結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー lloyzlloyz
提出日時 2023-08-02 00:31:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 104,888 KB
最終ジャッジ日時 2024-04-20 01:17:33
合計ジャッジ時間 5,433 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,248 KB
testcase_01 AC 39 ms
53,504 KB
testcase_02 AC 46 ms
53,760 KB
testcase_03 AC 51 ms
53,248 KB
testcase_04 AC 39 ms
54,016 KB
testcase_05 AC 131 ms
104,576 KB
testcase_06 AC 110 ms
104,748 KB
testcase_07 AC 38 ms
53,888 KB
testcase_08 AC 90 ms
94,080 KB
testcase_09 AC 102 ms
98,268 KB
testcase_10 AC 111 ms
104,888 KB
testcase_11 AC 127 ms
104,804 KB
testcase_12 AC 51 ms
53,888 KB
testcase_13 AC 51 ms
65,664 KB
testcase_14 AC 115 ms
100,624 KB
testcase_15 AC 69 ms
83,840 KB
testcase_16 AC 111 ms
104,612 KB
testcase_17 AC 40 ms
53,504 KB
testcase_18 AC 52 ms
65,664 KB
testcase_19 AC 108 ms
103,796 KB
testcase_20 AC 93 ms
93,940 KB
testcase_21 AC 109 ms
93,312 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 #

from collections import defaultdict

n = int(input())
S = list(input())

C = [defaultdict(int) for _ in range(3)]
for i in range(3 * n):
    C[i % 3][S[i]] += 1
ans = 0
for i in range(3):
    ans += min(C[i % 3]['c'], C[(i + 1) % 3]['o'], C[(i + 2) % 3]['n'])
print(ans)
0