일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- 스택
- 구현
- 개발
- 정석학술정보관
- 오에스
- 문제풀이
- 컴퓨터공학과
- cs
- DP
- 코테
- 그래프
- bfs
- Stack
- 오퍼레이팅시스템
- 너비우선탐색
- 자료구조
- vector
- coding
- 정석
- Computer science
- 컴공과
- 알고리즘
- c++
- 컴공
- 백준
- Operating System
- 브루트포스
- 북리뷰
- 코딩
- OS
- Today
- Total
목록백준 (160)
Little Jay
to_string 메소드를 생각하면 쉽게 풀 수 있었다. #include #include using namespace std; int main() { long a, b, c; cin >> a >> b >> c; long sum = a * b * c; string num; num = to_string(sum); int len = num.length(); int numArr[10]{ 0 }; for (int i = 0; i < len; i++) { switch (num[i]) { case '0': numArr[0]++; break; case '1': numArr[1]++; break; case '2': numArr[2]++; break; case '3': numArr[3]++; break; case '4':..
단순히 sort 만 쓰면 당연하게도 틀리는 문 이 문제때문에 처음으로 stable_sort 를 써보았다. stable_sort가 정리되어있는 www.cplusplus.com/reference/algorithm/stable_sort/ stable_sort - C++ Reference function template std::stable_sort template void stable_sort ( RandomAccessIterator first, RandomAccessIterator last ); template void stable_sort ( RandomAccessIterator first, RandomAccessIterator last, Compare comp ); Sort elements preserv..
#include using namespace std; int main() { int testCase, height, width, number; cin >> testCase; for (int i = 0; i > height >> width >> number; int y, x; y = number % height; x = number / height; if (y > 0) { x++; } else { y = height; } cout
#include #include using namespace std; int main() { int x, y, w, h; cin >> x >> y >> w >> h; int newWidth = w - x; int newHeight = h - y; int arr[4]; arr[0] = x; arr[1] = y; arr[2] = newWidth; arr[3] = newHeight; int min = 1000; for (int i = 0; i < 4; i++) { if (arr[i] < min) { min = arr[i]; } } cout
#include #include #include using namespace std; int main() { ios::sync_with_stdio(false); int testCase, a; cin >> testCase; vector list; for (int i = 0; i > a; list.push_back(a); } sort(list.begin(), list.end()); for (int i = 0; i < testCase; i++) { cout
벡터로 풀기 #include #include #include using namespace std; int main() { int testCase; cin >> testCase; vector arr; int input; for (int i = 0; i > input; arr.push_back(input); } sort(arr.begin(), arr.end()); cout a; int N = 7; for (int i = 0; i > ary[k]; } sort(ary, ary + 10); cout
간단한 입출력 문제 문제가 번역이 안되어 있어서 좀 그랬을 뿐! #include using namespace std; int main() { int num; cin >> num; int count = 0; if (num
백준 문제풀이를 통해 이런것도 있나 싶다 역시 불교국가..... #include #include #include #include using namespace std; int main() { int a; cin >> a; cout
string에서 length메소드 생각하 #include #include using namespace std; int main() { string input; cin >> input; int len = input.length(); cout
vector 기능 중 pair을 처음 써본 문제 pair만 제대로 이해했다면 조금은 쉬운 예제 #include #include #include #include #include using namespace std; int main() { vector inputList; const int INPUT_NUM = 8; int inputNumber; for (int i = 0; i > inputNumber; inputList.push_back(make_pair(inputNumber, i + 1)); } sort(inputList.begin(), inputList.end(), greater()); int sum = 0; vector index; for (int i = 0..