結果
| 問題 | No.2073 Concon Substrings (Swap Version) |
| コンテスト | |
| ユーザー |
taiga0629kyopro
|
| 提出日時 | 2022-09-16 21:41:53 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 131 ms / 2,000 ms |
| + 786µs | |
| コード長 | 326 bytes |
| 記録 | |
| コンパイル時間 | 906 ms |
| コンパイル使用メモリ | 64,768 KB |
| 実行使用メモリ | 87,684 KB |
| 最終ジャッジ日時 | 2026-10-20 06:40:42 |
| 合計ジャッジ時間 | 5,974 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 38 |
ソースコード
n=int(input())
s=list(input())
from _collections import defaultdict
cnt=defaultdict(int)
for i in range(3*n):
cnt[i%3,s[i]]+=1
ans=0
nokori=3*n
for j in range(3):
res=min(cnt[j,"c"],cnt[(j+1)%3,"o"],cnt[(j+2)%3,"n"])
while nokori-3*res<0 and res>0:res-=1
ans+=res
nokori-=3*res
nokori-=1
print(ans)
taiga0629kyopro