2021-11-27から1日間の記事一覧

【AtCoder参加記録】ABC229【AC2完】

B問題が解けずAC二完という結果になってしまいました。 atcoder.jp 制約が $$ 1\leqq A,B\leqq 10^{18} $$ となっており、1桁ごとに判定していくのは計算量が $$ O\left( 10^{18}\right) $$ となり間に合わないと勘違いしてしまいました。 桁の数をループさ…

AtCoder Beginner Contest 120 C - Unification【Python】

https://atcoder.jp/contests/abc120/tasks/abc120_c AtCoder ProblemsのRecommendationで Difficulty: 373、Solve Probability: 47%でした。 S = input() total = len(S) count0 = S.count('0') count1 = S.count('1') ans = total - (max(count0, count1) …