結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー 👑 rin204rin204
提出日時 2022-09-16 21:30:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 77,928 KB
最終ジャッジ日時 2023-08-23 14:28:31
合計ジャッジ時間 5,611 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,312 KB
testcase_01 AC 72 ms
71,352 KB
testcase_02 AC 73 ms
71,308 KB
testcase_03 AC 72 ms
71,556 KB
testcase_04 AC 70 ms
71,360 KB
testcase_05 AC 93 ms
77,824 KB
testcase_06 AC 97 ms
77,768 KB
testcase_07 AC 73 ms
71,444 KB
testcase_08 AC 88 ms
77,396 KB
testcase_09 AC 90 ms
77,220 KB
testcase_10 AC 102 ms
77,764 KB
testcase_11 AC 104 ms
77,920 KB
testcase_12 AC 71 ms
71,312 KB
testcase_13 AC 84 ms
76,352 KB
testcase_14 AC 102 ms
77,312 KB
testcase_15 AC 88 ms
76,904 KB
testcase_16 AC 95 ms
77,804 KB
testcase_17 AC 72 ms
71,388 KB
testcase_18 AC 80 ms
76,104 KB
testcase_19 AC 95 ms
77,732 KB
testcase_20 AC 92 ms
77,424 KB
testcase_21 AC 90 ms
77,272 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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


ans = 0
for i in range(3):
    mi = 1 << 30
    for j in range(3):
        mi = min(mi, cnt[(i + j) % 3][j])
    ans += mi
print(ans)
0