본문 바로가기

분리집합6

AtCoder ABC 276 풀이 https://atcoder.jp/contests/abc276 AtCoder Beginner Contest 276 - AtCoder AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp D, F가 재밌었던 셋입니다. A. 알파벳 \(a\)가 등장하는 마지막 인덱스를 찾아주면 됩니다. #include using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0); string s; cin >> s; int ans = -1; for (int i = 0; i < s.si.. 2023. 3. 25.
AtCoder ABC 256 풀이 https://atcoder.jp/contests/abc256/tasks Tasks - Tokio Marine & Nichido Fire Insurance Programming Contest 2022(AtCoder Beginner Contest 256) AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp A. 2^n을 출력해줍니다. 1 n; cout n; for (int i = 1; i > a[i]; int p = 0; for (int i = 1; i > h3; cin >> w1 >> w2 >> w3; int ans = 0;.. 2022. 10. 22.
AtCoder ABC 238 D,E 재밌는 문제들입니다. D. https://atcoder.jp/contests/abc238/tasks/abc238_d D - AND and SUM AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp x & y = a , x+y=s인 (x,y)가 존재하는지 O(1)에 판정해봅시다. x & y = a이므로, x>=a, y>=a 입니다. x=x1+a, y=y1+a라고 두면, x1 & y1 = 0입니다. 이제 x1 & y1 = 0이고, x1+y1=s-2a인 x1,y1이 존재하는지 알아봅시다. x1과 y1을 이진법으로 썼을 때, a를 .. 2022. 10. 2.
AtCoder ABC 269 풀이 https://atcoder.jp/contests/abc269/tasks Tasks - UNICORN Programming Contest 2022(AtCoder Beginner Contest 269) AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online. atcoder.jp A. (a+b)*(c-d)와 문자열 하나를 출력해주면 됩니다. #include using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0); int a, b, c, d; cin >> a >> b >> c >> d;.. 2022. 9. 18.