結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー ytftytft
提出日時 2022-09-22 20:55:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 62,848 KB
最終ジャッジ日時 2024-06-01 18:02:39
合計ジャッジ時間 3,870 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,224 KB
testcase_01 AC 40 ms
52,400 KB
testcase_02 AC 42 ms
52,068 KB
testcase_03 AC 40 ms
52,096 KB
testcase_04 AC 41 ms
52,224 KB
testcase_05 AC 55 ms
62,720 KB
testcase_06 AC 56 ms
62,464 KB
testcase_07 AC 39 ms
52,224 KB
testcase_08 AC 51 ms
60,800 KB
testcase_09 AC 55 ms
61,184 KB
testcase_10 AC 61 ms
62,848 KB
testcase_11 AC 60 ms
62,592 KB
testcase_12 AC 42 ms
52,224 KB
testcase_13 AC 47 ms
59,264 KB
testcase_14 AC 59 ms
62,208 KB
testcase_15 AC 53 ms
60,288 KB
testcase_16 AC 55 ms
62,336 KB
testcase_17 AC 41 ms
52,224 KB
testcase_18 AC 48 ms
58,624 KB
testcase_19 AC 54 ms
62,008 KB
testcase_20 AC 54 ms
61,312 KB
testcase_21 AC 53 ms
60,928 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
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 sys
input=lambda:sys.stdin.readline().rstrip()
N=int(input())
S=input()
targ='con'
mem=[[0 for i in range(3)] for j in range(3)]
for i in range(3*N):
	if S[i] in targ:
		mem[i%3][targ.find(S[i])]+=1
if mem[0][0]==mem[1][1]==mem[2][2]==N:
	print(N)
else:
	ans=0
	for i in range(3):
		temp=3*N
		for j in range(3):
			temp=min(mem[j][(i+j)%3],temp)
		ans+=temp
	print(ans)
0