목록C++ (135)
정화 코딩

https://www.acmicpc.net/problem/16677 #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s; int n; cin >> s >> n; int sn = s.size(); double ans = 0; string anss = "No Jam"; while (n--) { string a; double g; cin >> a >> g; int an = a.size(); int cnt = 0; int idx1 = 0; ..

https://www.acmicpc.net/problem/1308 #include using namespace std;bool isleap(int n) { if (n % 4 == 0) { if (n % 100 == 0) { if (n % 400 == 0) return true; else return false; } return true; } return false;}int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, ..

https://www.acmicpc.net/problem/11048 #include #include #include using namespace std;int dx[3] = {1, 0, 1};int dy[3] = {0, 1, 1};vector> a;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; a = vector>(n, vector(m)); for (int i = 0; i > a[i][j]; } } queue> q; q.push({0, 0, a[0][0]}); int ans = 0; while (!q.empty..

https://www.acmicpc.net/problem/9048 #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int f, r, n; cin >> f >> r >> n; int ans = 2 * f + (r + 1); vector up(f + 1, 0); vector down(f + 1, r + 1); for (int i = 0; i > a >> b; if (b 처음에는 각 ..

https://www.acmicpc.net/problem/9935 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s, bomb; cin >> s >> bomb; stack stk; int n = bomb.size(); for (char c: s) { if (c == bomb[n - 1]) { for (int i = n - 2; i >= 0; i--) { if (stk.empty()) { for (int..

https://www.acmicpc.net/problem/5639 #include #include using namespace std;vector a;void post(int s, int e) { if (s >= e) return; int idx = e; for (int i = s + 1; i a[s]) { idx = i; break; } } post(s + 1, idx); post(idx, e); cout > x) { a.push_back(x); } int n = a.size(); post(0, n);} 이 문제는 트리 구조를 만들어서 뭔갈 한다기 보다는 어떻게 하면 전위 순회..

https://www.acmicpc.net/problem/16953 #include #include #include using namespace std;int INTMAX = 1000000000;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long a, b; cin >> a >> b; queue> q; q.emplace(a, 0); int ans = -1; while (!q.empty()) { long long x = q.front().first; int cnt = q.front().second; q.pop(); if (x..

https://www.acmicpc.net/problem/2206 #include #include #include using namespace std;int dx[] = {1, -1, 0, 0};int dy[] = {0, 0, 1, -1};int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; vector> g(n, vector(m)); vector> chk(n, vector(m, 0)); for (int i = 0; i > s; for (int j = 0; j > q; // {x index, y index, didBreak, coun..