結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー 👑 H20H20
提出日時 2022-09-16 22:58:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 86,720 KB
実行使用メモリ 106,860 KB
最終ジャッジ日時 2023-08-23 16:28:40
合計ジャッジ時間 7,130 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,396 KB
testcase_01 AC 93 ms
71,548 KB
testcase_02 AC 90 ms
71,216 KB
testcase_03 AC 87 ms
71,628 KB
testcase_04 AC 85 ms
71,700 KB
testcase_05 AC 157 ms
106,592 KB
testcase_06 AC 157 ms
106,792 KB
testcase_07 AC 85 ms
71,216 KB
testcase_08 AC 129 ms
95,400 KB
testcase_09 AC 142 ms
99,964 KB
testcase_10 AC 151 ms
106,748 KB
testcase_11 AC 151 ms
106,812 KB
testcase_12 AC 84 ms
71,484 KB
testcase_13 AC 94 ms
78,764 KB
testcase_14 AC 147 ms
102,552 KB
testcase_15 AC 103 ms
80,084 KB
testcase_16 AC 152 ms
106,676 KB
testcase_17 AC 85 ms
71,704 KB
testcase_18 AC 94 ms
78,336 KB
testcase_19 AC 147 ms
105,500 KB
testcase_20 AC 136 ms
97,756 KB
testcase_21 AC 128 ms
94,392 KB
testcase_22 AC 151 ms
106,436 KB
testcase_23 AC 85 ms
71,640 KB
testcase_24 AC 93 ms
77,560 KB
testcase_25 AC 132 ms
95,932 KB
testcase_26 AC 151 ms
106,860 KB
testcase_27 AC 86 ms
71,380 KB
testcase_28 AC 143 ms
101,068 KB
testcase_29 AC 104 ms
80,096 KB
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 #

import collections
N = int(input())
S = list(input())
C = [collections.Counter() for _ in range(3)]
for i,c in enumerate(S):
    C[i%3][c]+=1
v1 = min(C[0]['c'],C[1]['o'],C[2]['n'])
v2 = min(N-1,min(C[0]['o'],C[1]['n'],C[2]['c']))
v3 = min(N-1,min(C[0]['n'],C[1]['c'],C[2]['o']))
print(max(v1,v2,v3,min(v1+v2,N-2),min(v2+v3,N-2),min(v3+v1,N-2),min(v1+v2+v3,N-3)))
0