목록전체 글 (251)
정화 코딩

https://www.acmicpc.net/problem/25046 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector> s(n, vector(n)); for (int i = 0; i > s[i][j]; } } int bm; // rows seleted by minwoo int maxi = 1 > 1; } // if jongjin select this col -> jongjin's score = on ..

https://www.acmicpc.net/problem/3541 #include #include using namespace std;int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y);}int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; int mina = INT_MAX; while (m--) { int u, d; cin >> u >> d; int gcdt = gcd(u, d); // lcm = u * d / gcd ..

https://www.acmicpc.net/problem/17433 #include #include using namespace std;int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y);}int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t, n; cin >> t; while (t--) { cin >> n; vector num(n); vector dif(n - 1); bool inf = true; for (int i = 0; i > num[i]; ..

https://www.acmicpc.net/problem/1684 #include #include #include using namespace std;int gcd(int x, int y) { if (y == 0) return x; return gcd(y, x % y);}int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; vector num(n); vector dif(n - 1); for (int i = 0; i > num[i]; if (i == 0) continue; dif[i - 1] = abs(num[i] - num[i -..

https://www.acmicpc.net/problem/29727 #include using namespace std;long long comb(int n, int r) { if (r > n) return 0; long long ans = 1; for (int i = n; i > n - r; i--) { ans *= i; } for (int i = r; i > 0; i--) { ans /= i; } return ans;}int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, xa, ya, xb, yb; cin >> n >> xa >> y..

https://www.acmicpc.net/problem/30645 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int r, c, n; cin >> r >> c >> n; vector d(n); for (int i = 0; i > d[i]; } sort(d.begin(), d.end()); vector maxh(c, 0); int idx = 0; int ans = 0; for (int i = 0; i = n) break; maxh[j] = d[idx++]; ..

https://www.acmicpc.net/problem/1821 #include #include using namespace std;vector fact;vector ans;vector mul;vector chk;int n, f;bool fin = false;void dfs(int idx, int res) { if (fin || res > f) { return; } if (idx == n) { if (res == f) { for (int x: ans) { cout > n >> f; fact = vector(n, 1); ans = vector(n); mul = vector(n); chk = vec..
task.json{ "version": "2.0.0", "runner": "terminal", "type": "shell", "echoCommand": true, "presentation": { "reveal": "always" }, "tasks": [ { "label": "save and compile for C++", "command": "g++", "args": [ "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}" ], ..