結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,028 KB
testcase_01 AC 69 ms
71,084 KB
testcase_02 AC 70 ms
71,156 KB
testcase_03 AC 70 ms
70,888 KB
testcase_04 AC 70 ms
71,028 KB
testcase_05 AC 87 ms
77,408 KB
testcase_06 AC 90 ms
77,212 KB
testcase_07 AC 70 ms
71,056 KB
testcase_08 AC 85 ms
76,508 KB
testcase_09 AC 81 ms
76,948 KB
testcase_10 AC 93 ms
77,316 KB
testcase_11 AC 95 ms
77,272 KB
testcase_12 AC 68 ms
71,076 KB
testcase_13 AC 80 ms
75,844 KB
testcase_14 AC 94 ms
77,100 KB
testcase_15 AC 81 ms
76,284 KB
testcase_16 AC 85 ms
77,512 KB
testcase_17 AC 71 ms
71,212 KB
testcase_18 AC 77 ms
75,956 KB
testcase_19 AC 86 ms
77,204 KB
testcase_20 AC 84 ms
76,920 KB
testcase_21 AC 81 ms
76,800 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())
N *= 3
S = input()

dat = [[0] * 3 for _ in range(3)]
for i in range(N):
    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])
print(ans)
0