結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー H20
提出日時 2022-09-16 22:56:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,588 KB
実行使用メモリ 104,836 KB
最終ジャッジ日時 2024-12-21 22:19:20
合計ジャッジ時間 4,704 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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
v1 = min(C[0]['c'],C[1]['o'],C[2]['n'])
v2 = min(N-1,min(C[0]['o'],C[1]['n'],C[2]['c']))
v3 = min(N-1,min(C[0]['n'],C[1]['c'],C[2]['o']))
print(max(v1,v2,v3,min(v1+v2,N-1),min(v2+v3,N-1),min(v3+v1,N-1),min(v1+v2+v3,N-2)))
0