結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー titiatitia
提出日時 2022-09-19 06:01:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 10,760 KB
実行使用メモリ 9,516 KB
最終ジャッジ日時 2023-08-23 18:47:42
合計ジャッジ時間 6,672 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,804 KB
testcase_01 AC 16 ms
7,776 KB
testcase_02 AC 16 ms
7,892 KB
testcase_03 AC 17 ms
7,832 KB
testcase_04 AC 16 ms
7,816 KB
testcase_05 AC 200 ms
9,476 KB
testcase_06 AC 192 ms
9,348 KB
testcase_07 AC 15 ms
7,756 KB
testcase_08 AC 127 ms
8,924 KB
testcase_09 AC 156 ms
9,076 KB
testcase_10 AC 242 ms
9,516 KB
testcase_11 AC 234 ms
9,400 KB
testcase_12 AC 16 ms
7,892 KB
testcase_13 AC 37 ms
8,244 KB
testcase_14 AC 207 ms
9,088 KB
testcase_15 AC 82 ms
8,576 KB
testcase_16 AC 258 ms
9,348 KB
testcase_17 AC 15 ms
7,784 KB
testcase_18 AC 39 ms
8,240 KB
testcase_19 AC 250 ms
9,364 KB
testcase_20 AC 191 ms
8,960 KB
testcase_21 AC 162 ms
8,820 KB
testcase_22 AC 253 ms
9,460 KB
testcase_23 AC 15 ms
7,804 KB
testcase_24 AC 20 ms
7,920 KB
testcase_25 AC 169 ms
9,008 KB
testcase_26 AC 256 ms
9,400 KB
testcase_27 AC 15 ms
7,860 KB
testcase_28 AC 213 ms
9,156 KB
testcase_29 AC 80 ms
8,540 KB
testcase_30 AC 174 ms
8,896 KB
testcase_31 AC 92 ms
8,456 KB
testcase_32 AC 48 ms
8,364 KB
testcase_33 AC 60 ms
8,324 KB
testcase_34 AC 52 ms
8,332 KB
testcase_35 AC 139 ms
8,928 KB
testcase_36 AC 63 ms
8,396 KB
testcase_37 AC 133 ms
8,812 KB
testcase_38 AC 53 ms
8,388 KB
testcase_39 AC 148 ms
8,936 KB
testcase_40 AC 132 ms
8,788 KB
testcase_41 AC 149 ms
8,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

LEN=int(input())
S=input()

C=[0]*3
O=[0]*3
N=[0]*3

for i in range(LEN*3):
    if S[i]=="c":
        C[i%3]+=1
    if S[i]=="o":
        O[i%3]+=1
    if S[i]=="n":
        N[i%3]+=1

ANS=0

ANS+=min(C[0],O[1],N[2])
ANS+=min(C[1],O[2],N[0])
ANS+=min(C[2],O[0],N[1])

if ANS==LEN:
    if min(C[0],O[1],N[2])==ANS:
        print(ANS)
    else:
        print(ANS-1)
else:
    print(ANS)
0