목록백준 (51)
안선생의 개발 블로그

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 #include #include #include #include using namespace std; vector v; int g[30][30] = {}; int aaa = 0; int n; bool dfs(int x,int y) { if (x = n || y = n) return false; if (g[x][y]) { aaa++; g[x][y] = 0; dfs(x - 1, y..

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 31 32 33 34 35 36 37 #include #include #include #include using namespace std; bool v[101] ={}; vector g[101] ={}; int aaa = 0; int dfs(int x) { aaa++; v[x] = true; for (int i = 0; i > n >> m; for (int i = 0; i > a>>b; g[a].push_back(b); g[b].push_back(a); } cout

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 31 32 33 34 35 36 37 38 #include #include #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n; cin >> n; vector a(n); for (int i = 0; i > a[i].first >> a[i].second; } int rank = 1; for (int i = 0; i

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 31 32 33 34 35 36 37 38 39 #include #include #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n; cin >> n; priority_queue a; //내림차순 정렬 방법 while (n--) { int input; cin >> input; if (input == 0) { if (!a.empty()) { cout

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 31 32 33 34 35 36 37 38 #include #include #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n; cin >> n; priority_queue a; while (n--) { int input; cin >> input; if (input == 0) { if (!a.empty()) { cout

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 31 32 33 #include #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n; cin >> n; queue a; for (int i = 1; i 1) { a.pop(); a.push(a.front()); a.pop(); } cout

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 31 32 33 34 35 36 #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); string s1, s2; cin >> s1 >> s2; int sum = 0; for (int i = 0; i

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 31 32 33 34 35 36 37 38 39 40 #include #include #include #include #include using namespace std; void push(vector& a) { for (int i = 0; i > a[i]; } } int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n; cin >> n; vector a(n), b(n); push(a); push(b); sort(a.begin(), a.end()); sort(b.begin(), b.en..

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 #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); long s =0; long n; cin >> n; int i = 1; while (1) { s += i++; if (s > n) { i--; break; } } cout

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 31 32 #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int l, p, v; int day = 0; int result = 0; int i = 1; while (1) { cin >> l >> p >> v; if (l == 0 && p == 0 && v == 0) break; result = v % p; //휴가 요일에서 캠핑 가능 요일의 나머지는 마지막날 캠핑 가능 요..