結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー ああいいああいい
提出日時 2022-09-17 21:59:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 77,476 KB
最終ジャッジ日時 2023-08-23 17:54:54
合計ジャッジ時間 5,608 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,216 KB
testcase_01 AC 74 ms
71,164 KB
testcase_02 AC 74 ms
71,160 KB
testcase_03 AC 74 ms
70,980 KB
testcase_04 AC 73 ms
71,220 KB
testcase_05 AC 90 ms
77,344 KB
testcase_06 AC 95 ms
77,260 KB
testcase_07 AC 74 ms
71,048 KB
testcase_08 AC 88 ms
76,612 KB
testcase_09 AC 88 ms
76,772 KB
testcase_10 AC 98 ms
77,264 KB
testcase_11 AC 99 ms
77,204 KB
testcase_12 AC 72 ms
71,132 KB
testcase_13 AC 82 ms
75,748 KB
testcase_14 AC 98 ms
77,280 KB
testcase_15 AC 87 ms
76,108 KB
testcase_16 AC 90 ms
77,476 KB
testcase_17 AC 72 ms
70,768 KB
testcase_18 AC 82 ms
75,800 KB
testcase_19 AC 89 ms
77,208 KB
testcase_20 AC 87 ms
76,772 KB
testcase_21 AC 87 ms
76,552 KB
testcase_22 AC 91 ms
77,380 KB
testcase_23 AC 72 ms
70,724 KB
testcase_24 AC 81 ms
75,912 KB
testcase_25 AC 87 ms
76,788 KB
testcase_26 AC 89 ms
77,256 KB
testcase_27 AC 75 ms
71,088 KB
testcase_28 AC 88 ms
76,960 KB
testcase_29 AC 83 ms
76,012 KB
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())
NN = N * 3
S = input()

dat = [[0] * 3 for _ in range(3)]
for i in range(NN):
    j = i % 3
    if S[i] == "c":
        dat[j][0] += 1
    elif S[i] == "o":
        dat[j][1] += 1
    elif S[i] == "n":
        dat[j][2] += 1
ans = 0
"""
for i in range(3):
    ans += min(dat[i][0],dat[(i+1)%3][1],dat[(i+2)%3][2])
"""
ans += min(dat[0][0],dat[1][1],dat[2][2])
t = min(dat[1][0],dat[2][1],dat[0][2])
if t == N:
    t -= 1
ans += t
t = min(dat[2][0],dat[0][1],dat[1][2])
if t == N:
    t -= 1
ans += t
print(ans)
0