結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,124 KB
testcase_01 AC 72 ms
71,148 KB
testcase_02 AC 71 ms
71,000 KB
testcase_03 AC 72 ms
70,976 KB
testcase_04 AC 72 ms
70,972 KB
testcase_05 AC 124 ms
104,748 KB
testcase_06 AC 127 ms
104,964 KB
testcase_07 AC 71 ms
71,180 KB
testcase_08 AC 105 ms
94,440 KB
testcase_09 AC 114 ms
98,312 KB
testcase_10 AC 134 ms
105,112 KB
testcase_11 AC 132 ms
105,120 KB
testcase_12 AC 72 ms
71,128 KB
testcase_13 AC 83 ms
76,824 KB
testcase_14 AC 125 ms
99,476 KB
testcase_15 AC 97 ms
84,424 KB
testcase_16 AC 123 ms
105,092 KB
testcase_17 AC 73 ms
71,088 KB
testcase_18 AC 80 ms
76,916 KB
testcase_19 AC 121 ms
103,824 KB
testcase_20 AC 113 ms
94,452 KB
testcase_21 AC 106 ms
93,804 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()
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 -= min(3 * tmp + 1, 0)
print(ans)
0