結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー ytftytft
提出日時 2022-09-22 20:55:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 77,856 KB
最終ジャッジ日時 2023-08-23 20:39:09
合計ジャッジ時間 6,155 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,108 KB
testcase_01 AC 72 ms
71,356 KB
testcase_02 AC 73 ms
71,272 KB
testcase_03 AC 72 ms
71,480 KB
testcase_04 AC 73 ms
71,288 KB
testcase_05 AC 86 ms
77,592 KB
testcase_06 AC 88 ms
77,856 KB
testcase_07 AC 74 ms
71,140 KB
testcase_08 AC 86 ms
76,944 KB
testcase_09 AC 88 ms
77,236 KB
testcase_10 AC 97 ms
77,600 KB
testcase_11 AC 92 ms
77,776 KB
testcase_12 AC 75 ms
71,364 KB
testcase_13 AC 82 ms
76,052 KB
testcase_14 AC 90 ms
77,352 KB
testcase_15 AC 86 ms
76,472 KB
testcase_16 AC 85 ms
77,368 KB
testcase_17 AC 73 ms
71,296 KB
testcase_18 AC 76 ms
75,820 KB
testcase_19 AC 84 ms
77,260 KB
testcase_20 AC 82 ms
76,896 KB
testcase_21 AC 80 ms
77,008 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