結果

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

ソースコード

diff #

n = int(input())
s = input()
pos = [[0]*3 for i in range(3)]
for i,c in enumerate(s):
  if c == "c":
    pos[0][i%3] += 1
  elif c == "o":
    pos[1][i%3] += 1
  elif c == "n":
    pos[2][i%3] += 1

now = 0
ans = 0
for i in range(3):
  cc,oo,nn = pos[0][(0+i)%3], pos[1][(1+i)%3], pos[2][(2+i)%3]
  mn = min(cc,oo,nn)
  ans += mn

print(ans)
0