結果
| 問題 | No.2073 Concon Substrings (Swap Version) | 
| コンテスト | |
| ユーザー |  timi | 
| 提出日時 | 2022-09-17 01:53:23 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 91 ms / 2,000 ms | 
| コード長 | 350 bytes | 
| コンパイル時間 | 988 ms | 
| コンパイル使用メモリ | 82,216 KB | 
| 実行使用メモリ | 76,800 KB | 
| 最終ジャッジ日時 | 2024-12-22 00:04:45 | 
| 合計ジャッジ時間 | 4,385 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 37 | 
ソースコード
N=int(input())
S=input()
D={}
D['c']=[0,0,0]
D['o']=[0,0,0]
D['n']=[0,0,0]
for i in range(3*N):
  s=S[i]
  if s not in D:
    D[s]=[0]*3
  D[s][i%3]+=1
a=min(D['c'][0],D['o'][1],D['n'][2])
b=min(D['c'][1],D['o'][2],D['n'][0])
c=min(D['c'][2],D['o'][0],D['n'][1])
d=a+b+c
if N!=d:
  print(d)
else:
  if S=='con'*N:
    print(d)
  else:
    print(d-1)
            
            
            
        