목록PS (96)
정화 코딩
https://www.acmicpc.net/problem/1166 #include #include typedef long long ll;typedef long double ld;using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, l, w, h; cin >> n >> l >> w >> h; ld li = 0; ld ri = l + 1; for (int i = 0; i 실수 이분 탐색 문제는 처음 풀어봤다. (정답)우선, 오차는 10^(-9)까지 허용한다고 하니 cout li, ri, mi 전부 실수로 정의하되, 이분 탐색 계산할 때는 정수로 계산한..
https://www.acmicpc.net/problem/5430 #include #include #include using namespace std;int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int tn; cin >> tn; while(tn--) { string func; cin >> func; int n; cin >> n; string str; cin >> str; string tmp; deque deq; for (char c: str) { if (c =..
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++]; ..