結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー ニックネームニックネーム
提出日時 2022-09-16 22:10:32
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 67 ms
使用メモリ 9,168 KB
最終ジャッジ日時 2023-01-11 07:16:27
合計ジャッジ時間 3,056 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 15 ms
7,780 KB
testcase_01 AC 16 ms
7,672 KB
testcase_02 AC 15 ms
7,696 KB
testcase_03 AC 15 ms
7,576 KB
testcase_04 AC 16 ms
7,572 KB
testcase_05 AC 22 ms
8,972 KB
testcase_06 AC 22 ms
9,084 KB
testcase_07 AC 15 ms
7,628 KB
testcase_08 AC 19 ms
8,468 KB
testcase_09 AC 20 ms
8,520 KB
testcase_10 AC 28 ms
9,024 KB
testcase_11 AC 27 ms
9,128 KB
testcase_12 AC 15 ms
7,736 KB
testcase_13 AC 16 ms
7,948 KB
testcase_14 AC 25 ms
8,740 KB
testcase_15 AC 18 ms
8,256 KB
testcase_16 AC 22 ms
9,168 KB
testcase_17 AC 15 ms
7,732 KB
testcase_18 AC 16 ms
7,908 KB
testcase_19 AC 21 ms
8,916 KB
testcase_20 AC 19 ms
8,704 KB
testcase_21 AC 19 ms
8,792 KB
testcase_22 AC 21 ms
9,048 KB
testcase_23 AC 15 ms
7,756 KB
testcase_24 AC 15 ms
7,732 KB
testcase_25 AC 19 ms
8,472 KB
testcase_26 AC 21 ms
9,044 KB
testcase_27 AC 15 ms
7,644 KB
testcase_28 AC 21 ms
8,768 KB
testcase_29 AC 17 ms
8,188 KB
testcase_30 AC 19 ms
8,408 KB
testcase_31 AC 17 ms
8,312 KB
testcase_32 AC 16 ms
7,944 KB
testcase_33 AC 17 ms
8,092 KB
testcase_34 AC 17 ms
8,000 KB
testcase_35 AC 19 ms
8,392 KB
testcase_36 AC 17 ms
7,964 KB
testcase_37 AC 18 ms
8,516 KB
testcase_38 AC 16 ms
7,932 KB
testcase_39 AC 18 ms
8,280 KB
testcase_40 AC 19 ms
8,508 KB
testcase_41 AC 18 ms
8,156 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