結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー H20
提出日時 2022-09-16 22:52:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 104,804 KB
最終ジャッジ日時 2024-12-21 22:13:29
合計ジャッジ時間 4,286 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 25 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N = int(input())
S = list(input())
C = [collections.Counter() for _ in range(3)]
for i,c in enumerate(S):
    C[i%3][c]+=1
print(min(C[0]['c'],C[1]['o'],C[2]['n'])+min(N-1,min(C[0]['o'],C[1]['n'],C[2]['c']))+min(N-1,min(C[0]['n'],C[1]['c'],C[2]['o'])))
0