結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー ntudantuda
提出日時 2022-09-18 19:23:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 105,608 KB
最終ジャッジ日時 2023-08-23 18:18:30
合計ジャッジ時間 6,246 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,312 KB
testcase_01 AC 68 ms
71,304 KB
testcase_02 AC 71 ms
71,332 KB
testcase_03 AC 71 ms
71,132 KB
testcase_04 AC 70 ms
71,368 KB
testcase_05 AC 120 ms
104,996 KB
testcase_06 AC 122 ms
105,464 KB
testcase_07 AC 71 ms
71,460 KB
testcase_08 AC 105 ms
94,512 KB
testcase_09 AC 108 ms
98,348 KB
testcase_10 AC 129 ms
105,240 KB
testcase_11 AC 131 ms
105,128 KB
testcase_12 AC 69 ms
70,980 KB
testcase_13 AC 83 ms
76,820 KB
testcase_14 AC 120 ms
99,128 KB
testcase_15 AC 96 ms
84,492 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 120 ms
105,340 KB
testcase_23 AC 68 ms
71,240 KB
testcase_24 AC 77 ms
76,108 KB
testcase_25 AC 104 ms
95,124 KB
testcase_26 AC 122 ms
105,192 KB
testcase_27 AC 68 ms
71,412 KB
testcase_28 AC 111 ms
98,680 KB
testcase_29 AC 82 ms
78,652 KB
testcase_30 AC 102 ms
95,660 KB
testcase_31 AC 83 ms
79,112 KB
testcase_32 AC 78 ms
77,016 KB
testcase_33 AC 82 ms
77,524 KB
testcase_34 AC 82 ms
77,236 KB
testcase_35 AC 100 ms
91,124 KB
testcase_36 AC 84 ms
77,728 KB
testcase_37 AC 100 ms
90,564 KB
testcase_38 AC 83 ms
77,284 KB
testcase_39 AC 104 ms
92,616 KB
testcase_40 AC 101 ms
90,692 KB
testcase_41 AC 102 ms
92,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
X = [[0] * 3 for _ in range(3)]
for i, c in enumerate(list(S)):
    if c == "c":
        X[i % 3][0] += 1
    if c == "o":
        X[(i - 1) % 3][1] += 1
    if c == "n":
        X[(i - 2) % 3][2] += 1
ans = 0
usable = 3 * N
for i in range(3):
    tmp = min(min(X[i]), usable // 3)
    ans += tmp
    usable -= 3 * tmp + 1
print(ans)
0