結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー ニックネーム
提出日時 2022-09-16 22:03:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 246 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 12,032 KB
最終ジャッジ日時 2024-12-21 20:20:29
合計ジャッジ時間 3,184 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 31 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

m = int(input())
s = input()
c = [s[i::3].count("c") for i in range(3)]
o = [s[i::3].count("o") for i in range(3)]
n = [s[i::3].count("n") for i in range(3)]
ans = 0
for i in range(3): ans += min(c[i], o[(i+1)%3], n[(i+2)%3])
print(min(ans, m-1))
0