본문 바로가기

algorithm

(54)
바킹독 (기초, 백준) 15552 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int f, s, n; cin >> n; for (int i = 0; i > f >> s; cout
바킹독 (기초, 백준) 10871 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int N, X; cin >> N >> X; for (int i = 0; i > tmp; if (tmp < X) cout
바킹독 (기초, 백준) 10869 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int a, b; cin >> a >> b; cout
바킹독 (기초, 백준) 10804 #include using namespace std; int arr[20] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ,16 ,17 ,18 ,19, 20}; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int f, s; for (int i = 0; i > f >> s; if (f > s) swap(f, s); else if (f == s) continue ; else { int dif = s - f + 1; for (int j = 0; j < dif/2; j++) { int tmp = arr[f - 1 + j]; arr[f - 1 + j] = arr[s - 1 - j];..
바킹독 (기초, 백준) 10171 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cout
바킹독 (기초, 백준) 10093 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); unsigned long long a, b, diff; cin >> a >> b; if (a > b) swap(a,b); if (a == b || b - a == 1) { cout
바킹독 (기초, 백준) 9498 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int a; cin >> a; if (a >= 90) cout = 80) cout = 70) cout = 60) cout
바킹독 (기초, 백준) 2754 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int tmp; cin >> tmp; if (tmp % 4 == 0 && ((tmp % 100 != 0) || (tmp % 400 == 0))) cout
바킹독 (기초, 백준) 2752 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int tmp; int arr[3]; for (int i = 0; i > tmp; arr[i] = tmp; } sort(arr, arr + 3); cout
바킹독 (기초, 백준) 2587 #include using namespace std; int num[9], result[7]; int main(void) { ios::sync_with_stdio(0); cin.tie(0); for(int i = 0; i > num[i]; for(int a = 0; a < 8; a++) { int total = 0; for(int b = a + 1; b < 9; b++) { total = 0; for(int c = 0, i = 0; c < 9; c++) if(c != a && c != b) result[i++] = num[c]; for(int i = 0; i < 7; i++) total += result[i]; if(total == 100) break; } if(total ==..