일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 북리뷰
- 컴공
- 브루트포스
- 코딩
- 문제풀이
- 너비우선탐색
- vector
- 백준
- Computer science
- Operating System
- coding
- cs
- 코테
- OS
- Stack
- bfs
- 구현
- 컴공과
- c++
- 그래프
- DP
- 개발
- 스택
- 오에스
- 정석
- 오퍼레이팅시스템
- 컴퓨터공학과
- 자료구조
- 알고리즘
- 정석학술정보관
- Today
- Total
목록알고리즘 (210)
Little Jay
이 문제가 뭐라고 5번이나 시도했는지 모르겠다..... #include #include #include using namespace std; int main() { int participant; cin >> participant; vector sum; for (int i = 0; i > a >> b >> c; if (a == b && b == c) { sum.push_back(10000 + (a * 1000)); } else if (a == b) { sum.push_back(1000 + (a * 100)); } else if (a == c) { sum.push_back(1000 + (a * 100)); } else if (b == c..
#include #include using namespace std; int main() { string input; cin >> input; while (input != "0") { if (input == "0") { break; } int size = 2; size += input.length() - 1; for (int i = 0; i < input.length(); i++) { if (input[i] == '0') { size += 4; } else if (input[i] == '1') { size += 2; } else { size += 3; } } cout input; } return 0; }
#include using namespace std; int main() { const int DIVISOR = 42; int arr[42]{ 0 }; int count = 0; int a; for (int i = 0; i > a; arr[a % 42]++; } for (int i : arr) { if (i > 0) { count++; } } cout
#include #include using namespace std; int main() { int input, a; cin >> input; int count = 0; vector compVec; vector numbers; for (int i = 0; i > a; numbers.push_back(i + 1); compVec.push_back(a); if (numbers[i] != compVec[i]) { count++; } } compVec.clear(); numbers.clear(); cout
#include using namespace std; int main() { int arr[9][9]; int max = 0, row = 0, col = 0; for (int i = 0; i > arr[i][k]; if (arr[i][k] > max) { max = arr[i][k]; row = i; col = k; } } } cout
약간은 짜증났던 문제? 당연히 A,B의 승리만 계산하면 되는건줄 알았는데 비겨도 A,B의 승리는 존재하고, 전부다 비길 때를 고려해야하는? 그래서 3번 틀림...... #include using namespace std; int main() { int arr1[10]; int arr2[10]; int aPoint = 0, bPoint = 0; char win = 'D'; for (int i = 0; i > arr1[i]; } for (int i = 0; i > arr2[i]; } for (int i = 0; i arr2[i]) { aPoint += 3; win = 'A'; } else if (..
#include #include #include using namespace std; int main() { int input; int sum = 0, average = 0; vector arr; for (int i = 0; i > input; sum += input; arr.push_back(input); } average = sum / 5; sort(arr.begin(), arr.end()); cout
#include #include #include using namespace std; int main() { int input; cin >> input; vector numVec; int a; for (int i = 0; i > a; numVec.push_back(a); } sort(numVec.begin(), numVec.end()); for (int i = 0; i < numVec.size(); i++) { cout
#include using namespace std; int main() { int input; int sum = 0, max = 0, temp = 0; int arr[1000]{ 0, }; for (int i = 0; i > input; sum += input; arr[input]++; if (arr[input] > temp) { max = input; temp = arr[input]; } } int average = sum / 10; cout
n번째 피보나치에서 90까지 와버리면 숫자가 기하급수적으로 커져버리기 때문에 자료형을 long long으로 바꿔주었다. int 자료형은 어느정도 표현 가능한 범위가 long long보다는 제한적이기 때문 #include using namespace std; int main() { long long first = 0; long long second = 1; long long input; cin >> input; for (int i = 1; i < input; i++) { long long third = first + second; first = second; second = third; } cout