結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー 👑 H20H20
提出日時 2022-09-16 22:56:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 107,104 KB
最終ジャッジ日時 2023-08-23 16:25:53
合計ジャッジ時間 7,131 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,536 KB
testcase_01 AC 90 ms
71,588 KB
testcase_02 AC 95 ms
71,796 KB
testcase_03 AC 92 ms
71,632 KB
testcase_04 AC 91 ms
71,540 KB
testcase_05 AC 179 ms
106,868 KB
testcase_06 AC 162 ms
106,688 KB
testcase_07 AC 88 ms
71,740 KB
testcase_08 AC 136 ms
95,408 KB
testcase_09 AC 151 ms
99,960 KB
testcase_10 AC 162 ms
107,104 KB
testcase_11 AC 163 ms
106,948 KB
testcase_12 AC 92 ms
71,536 KB
testcase_13 AC 102 ms
78,604 KB
testcase_14 AC 151 ms
102,412 KB
testcase_15 AC 110 ms
80,084 KB
testcase_16 AC 160 ms
106,892 KB
testcase_17 AC 90 ms
71,664 KB
testcase_18 AC 102 ms
78,868 KB
testcase_19 AC 158 ms
105,736 KB
testcase_20 AC 141 ms
98,004 KB
testcase_21 AC 133 ms
94,708 KB
testcase_22 AC 160 ms
107,012 KB
testcase_23 AC 91 ms
71,644 KB
testcase_24 AC 99 ms
77,552 KB
testcase_25 AC 137 ms
96,136 KB
testcase_26 AC 159 ms
106,740 KB
testcase_27 AC 88 ms
71,412 KB
testcase_28 AC 148 ms
101,396 KB
testcase_29 AC 107 ms
79,864 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-1),min(v2+v3,N-1),min(v3+v1,N-1),min(v1+v2+v3,N-2)))
0