結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー titiatitia
提出日時 2022-09-19 06:00:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 9,468 KB
最終ジャッジ日時 2023-08-23 18:47:34
合計ジャッジ時間 6,856 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 251 ms
9,372 KB
testcase_17 AC 15 ms
7,904 KB
testcase_18 AC 39 ms
8,216 KB
testcase_19 AC 248 ms
9,296 KB
testcase_20 AC 193 ms
8,924 KB
testcase_21 AC 158 ms
8,808 KB
testcase_22 AC 257 ms
9,300 KB
testcase_23 AC 15 ms
7,760 KB
testcase_24 AC 20 ms
7,808 KB
testcase_25 AC 170 ms
8,932 KB
testcase_26 AC 259 ms
9,468 KB
testcase_27 AC 15 ms
7,844 KB
testcase_28 AC 218 ms
9,176 KB
testcase_29 AC 82 ms
8,516 KB
testcase_30 AC 173 ms
8,880 KB
testcase_31 AC 92 ms
8,544 KB
testcase_32 AC 48 ms
8,428 KB
testcase_33 AC 59 ms
8,300 KB
testcase_34 AC 53 ms
8,252 KB
testcase_35 AC 139 ms
8,776 KB
testcase_36 AC 64 ms
8,376 KB
testcase_37 AC 128 ms
8,756 KB
testcase_38 AC 54 ms
8,404 KB
testcase_39 AC 149 ms
8,860 KB
testcase_40 AC 132 ms
8,800 KB
testcase_41 AC 150 ms
8,804 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)
0