結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー H20H20
提出日時 2022-09-16 23:01:11
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 249 ms
使用メモリ 111,248 KB
最終ジャッジ日時 2023-01-11 08:19:14
合計ジャッジ時間 7,481 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 94 ms
76,180 KB
testcase_01 AC 93 ms
76,024 KB
testcase_02 AC 93 ms
75,928 KB
testcase_03 AC 95 ms
76,088 KB
testcase_04 AC 93 ms
76,028 KB
testcase_05 AC 160 ms
111,060 KB
testcase_06 AC 163 ms
111,124 KB
testcase_07 AC 93 ms
75,836 KB
testcase_08 AC 140 ms
99,484 KB
testcase_09 AC 152 ms
104,412 KB
testcase_10 AC 160 ms
111,004 KB
testcase_11 AC 162 ms
111,004 KB
testcase_12 AC 91 ms
75,988 KB
testcase_13 AC 102 ms
82,524 KB
testcase_14 AC 151 ms
106,588 KB
testcase_15 AC 112 ms
84,492 KB
testcase_16 AC 157 ms
111,248 KB
testcase_17 AC 93 ms
75,980 KB
testcase_18 AC 103 ms
82,540 KB
testcase_19 AC 156 ms
109,632 KB
testcase_20 AC 141 ms
102,256 KB
testcase_21 AC 138 ms
98,764 KB
testcase_22 AC 160 ms
111,048 KB
testcase_23 AC 92 ms
75,840 KB
testcase_24 AC 99 ms
81,772 KB
testcase_25 AC 136 ms
100,416 KB
testcase_26 AC 159 ms
110,896 KB
testcase_27 AC 93 ms
75,984 KB
testcase_28 AC 148 ms
105,588 KB
testcase_29 AC 112 ms
84,360 KB
testcase_30 AC 144 ms
101,056 KB
testcase_31 AC 116 ms
84,848 KB
testcase_32 AC 108 ms
82,740 KB
testcase_33 AC 109 ms
83,284 KB
testcase_34 AC 109 ms
83,120 KB
testcase_35 AC 135 ms
96,424 KB
testcase_36 AC 110 ms
83,440 KB
testcase_37 AC 133 ms
95,564 KB
testcase_38 AC 109 ms
83,160 KB
testcase_39 AC 136 ms
98,084 KB
testcase_40 AC 132 ms
95,968 KB
testcase_41 AC 136 ms
97,692 KB
権限があれば一括ダウンロードができます

ソースコード

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,v1+v2,v2+v3,v3+v1,min(v1+v2+v3,N-1)))
0