結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー rafi2
提出日時 2023-03-15 17:50:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,004 KB
実行使用メモリ 77,424 KB
最終ジャッジ日時 2024-09-18 08:49:46
合計ジャッジ時間 3,807 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 4
other AC * 8 WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
from collections import defaultdict
d0 = defaultdict(int)
d1 = defaultdict(int)
d2 = defaultdict(int)

for i in range(n):
    d0[s[3*i]] += 1
    d1[s[3*i+1]] += 1
    d2[s[3*i+2]] += 1

ans = 0

l = ["c","o","n"]
ans1 = min(d0["c"],d1["o"],d2["n"])
ans2 = min(d0["n"],d1["c"],d2["o"])
ans3 = min(d0["o"],d1["n"],d2["c"])
if ans1 == n or ans2 == n or ans3 == n:
    print(n)
    exit()

if ans == n:
    print(ans-1)
    exit()
print(ans)

0