목록백준 (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 #include #include #include #include #include #include using namespace std; bool cmp(const char& a,const char& b) { return a > b; } int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); string s; cin >> s; int sum = 0; bool check = 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 #include #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); string s; cin >> s; int zero = 0 , one = 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 41 42 43 44 45 #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; int a = 0; int result = 1000-n; a += result /500 ; result %= 500; a += result / 100; result %= 100; a += result ..

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 #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n; cin >> n; vector a; while (n--) { int b, e; cin >> b >> e; a.push_back(make_pair(e, b)); //끝난 시간 기준으로 넣어준다. } sort ( a.begin(), a.end());..

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 #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, b; for (int i = 0; i > input; a.push_back(input); } for (int i = 0; i > input; b.push_back(input); ..
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 #include #include #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); string s; cin >> s; string a; int sum = 0; bool check = 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 #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); while (n--) cin >> a[n]; sort(a.begin(), a.end()); int result = 0; 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 #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n, k; cin >> n >> k; vector a(n); while (1) { cin >> a[--n]; // 동전종류 입력 if (n == 0) break; } int result = 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 #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); stack st; string s; cin >> s; 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 #include #include #include #include using namespace std; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n; stack st; cin >> n; while (n--) { int a; cin>> a; st.push(a); } int count =1; int top = st.top(); while (!st.empty()) { if (top