結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー ニックネームニックネーム
提出日時 2022-09-16 22:10:32
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 9,424 KB
最終ジャッジ日時 2023-08-23 15:46:58
合計ジャッジ時間 2,749 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,828 KB
testcase_01 AC 15 ms
7,884 KB
testcase_02 AC 15 ms
7,764 KB
testcase_03 AC 15 ms
7,924 KB
testcase_04 AC 15 ms
7,816 KB
testcase_05 AC 20 ms
9,308 KB
testcase_06 AC 19 ms
9,380 KB
testcase_07 AC 15 ms
7,768 KB
testcase_08 AC 18 ms
8,920 KB
testcase_09 AC 18 ms
9,076 KB
testcase_10 AC 24 ms
9,404 KB
testcase_11 AC 24 ms
9,300 KB
testcase_12 AC 14 ms
7,772 KB
testcase_13 AC 15 ms
8,224 KB
testcase_14 AC 24 ms
9,148 KB
testcase_15 AC 17 ms
8,396 KB
testcase_16 AC 19 ms
9,304 KB
testcase_17 AC 15 ms
7,784 KB
testcase_18 AC 15 ms
8,380 KB
testcase_19 AC 19 ms
9,424 KB
testcase_20 AC 18 ms
9,000 KB
testcase_21 AC 17 ms
8,844 KB
testcase_22 AC 19 ms
9,368 KB
testcase_23 AC 16 ms
7,832 KB
testcase_24 AC 15 ms
7,952 KB
testcase_25 AC 18 ms
8,932 KB
testcase_26 AC 19 ms
9,400 KB
testcase_27 AC 15 ms
7,964 KB
testcase_28 AC 18 ms
9,084 KB
testcase_29 AC 16 ms
8,472 KB
testcase_30 AC 18 ms
8,844 KB
testcase_31 AC 17 ms
8,636 KB
testcase_32 AC 15 ms
8,244 KB
testcase_33 AC 16 ms
8,296 KB
testcase_34 AC 16 ms
8,292 KB
testcase_35 AC 16 ms
8,836 KB
testcase_36 AC 16 ms
8,496 KB
testcase_37 AC 16 ms
8,784 KB
testcase_38 AC 15 ms
8,196 KB
testcase_39 AC 17 ms
8,796 KB
testcase_40 AC 16 ms
8,888 KB
testcase_41 AC 17 ms
8,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

m = int(input())
s = input()
c = [s[i::3].count("c") for i in range(3)]
o = [s[i::3].count("o") for i in range(3)]
n = [s[i::3].count("n") for i in range(3)]
ans = [min(c[i], o[(i+1)%3], n[(i+2)%3]) for i in range(3)]
print(min(sum(ans), m-1) if ans[1] or ans[2] else sum(ans))
0