結果
問題 | No.2073 Concon Substrings (Swap Version) |
ユーザー |
|
提出日時 | 2023-03-15 17:49:26 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 419 bytes |
コンパイル時間 | 293 ms |
コンパイル使用メモリ | 82,456 KB |
実行使用メモリ | 77,456 KB |
最終ジャッジ日時 | 2024-09-18 08:49:42 |
合計ジャッジ時間 | 4,027 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 5 |
other | AC * 26 WA * 11 |
ソースコード
n = int(input())s = input()from collections import defaultdictd0 = defaultdict(int)d1 = defaultdict(int)d2 = defaultdict(int)for i in range(n):d0[s[3*i]] += 1d1[s[3*i+1]] += 1d2[s[3*i+2]] += 1ans = 0l = ["c","o","n"]ans += min(d0["c"],d1["o"],d2["n"])if ans == n:print(n)exit()ans += min(d0["n"],d1["c"],d2["o"])ans += min(d0["o"],d1["n"],d2["c"])if ans == n:print(ans-1)