結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー 👑 H20H20
提出日時 2022-09-16 23:01:11
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 106,840 KB
最終ジャッジ日時 2023-08-23 16:29:27
合計ジャッジ時間 7,262 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
71,468 KB
testcase_01 AC 85 ms
71,540 KB
testcase_02 AC 86 ms
71,504 KB
testcase_03 AC 88 ms
71,424 KB
testcase_04 AC 87 ms
71,188 KB
testcase_05 AC 162 ms
106,752 KB
testcase_06 AC 162 ms
106,764 KB
testcase_07 AC 88 ms
71,372 KB
testcase_08 AC 133 ms
95,072 KB
testcase_09 AC 147 ms
99,912 KB
testcase_10 AC 157 ms
106,840 KB
testcase_11 AC 157 ms
106,592 KB
testcase_12 AC 87 ms
71,532 KB
testcase_13 AC 99 ms
78,500 KB
testcase_14 AC 145 ms
102,336 KB
testcase_15 AC 106 ms
79,876 KB
testcase_16 AC 156 ms
106,636 KB
testcase_17 AC 86 ms
71,568 KB
testcase_18 AC 99 ms
78,452 KB
testcase_19 AC 152 ms
105,480 KB
testcase_20 AC 135 ms
98,056 KB
testcase_21 AC 125 ms
94,492 KB
testcase_22 AC 153 ms
106,440 KB
testcase_23 AC 84 ms
71,612 KB
testcase_24 AC 93 ms
77,492 KB
testcase_25 AC 131 ms
95,900 KB
testcase_26 AC 159 ms
106,648 KB
testcase_27 AC 86 ms
71,644 KB
testcase_28 AC 143 ms
101,096 KB
testcase_29 AC 104 ms
79,668 KB
testcase_30 AC 134 ms
96,800 KB
testcase_31 AC 107 ms
80,380 KB
testcase_32 AC 101 ms
78,952 KB
testcase_33 AC 104 ms
79,264 KB
testcase_34 AC 102 ms
78,924 KB
testcase_35 AC 131 ms
92,168 KB
testcase_36 AC 103 ms
79,184 KB
testcase_37 AC 123 ms
91,476 KB
testcase_38 AC 102 ms
79,080 KB
testcase_39 AC 131 ms
93,612 KB
testcase_40 AC 128 ms
91,424 KB
testcase_41 AC 130 ms
93,496 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