結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー 👑 p-adicp-adic
提出日時 2023-05-29 16:32:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 742 ms / 2,000 ms
コード長 152 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 9,444 KB
最終ジャッジ日時 2023-08-27 23:44:35
合計ジャッジ時間 14,923 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,844 KB
testcase_01 AC 14 ms
7,820 KB
testcase_02 AC 14 ms
7,816 KB
testcase_03 AC 14 ms
7,784 KB
testcase_04 AC 14 ms
7,812 KB
testcase_05 AC 742 ms
9,380 KB
testcase_06 AC 715 ms
9,316 KB
testcase_07 AC 14 ms
7,824 KB
testcase_08 AC 450 ms
8,896 KB
testcase_09 AC 517 ms
8,808 KB
testcase_10 AC 709 ms
9,372 KB
testcase_11 AC 713 ms
9,388 KB
testcase_12 AC 15 ms
7,736 KB
testcase_13 AC 76 ms
8,284 KB
testcase_14 AC 609 ms
9,104 KB
testcase_15 AC 221 ms
8,496 KB
testcase_16 AC 649 ms
9,444 KB
testcase_17 AC 15 ms
7,816 KB
testcase_18 AC 80 ms
8,328 KB
testcase_19 AC 690 ms
9,304 KB
testcase_20 AC 509 ms
9,044 KB
testcase_21 AC 430 ms
8,948 KB
testcase_22 AC 704 ms
9,344 KB
testcase_23 AC 15 ms
7,856 KB
testcase_24 AC 26 ms
7,868 KB
testcase_25 AC 441 ms
9,012 KB
testcase_26 AC 678 ms
9,328 KB
testcase_27 AC 15 ms
7,804 KB
testcase_28 AC 571 ms
9,048 KB
testcase_29 AC 191 ms
8,388 KB
testcase_30 AC 477 ms
8,876 KB
testcase_31 AC 239 ms
8,396 KB
testcase_32 AC 109 ms
8,232 KB
testcase_33 AC 134 ms
8,220 KB
testcase_34 AC 125 ms
8,240 KB
testcase_35 AC 367 ms
8,888 KB
testcase_36 AC 158 ms
8,320 KB
testcase_37 AC 332 ms
8,852 KB
testcase_38 AC 124 ms
8,172 KB
testcase_39 AC 376 ms
8,520 KB
testcase_40 AC 353 ms
8,752 KB
testcase_41 AC 401 ms
8,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I,R=input,range
N=int(I())*3
S=I()
a=0
s="con"
for d in R(3):
	c=[0]*3
	for i in R(N):c[i%3]+=S[i]==s[(i+d)%3]
	a+=min(c+[max(0,(N-a*3-d)//3)])
print(a)
0