結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー googol_S0googol_S0
提出日時 2022-09-16 21:28:47
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 246 ms
使用メモリ 128,132 KB
最終ジャッジ日時 2023-01-11 05:59:52
合計ジャッジ時間 6,927 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 75 ms
75,532 KB
testcase_01 AC 75 ms
75,700 KB
testcase_02 AC 76 ms
75,492 KB
testcase_03 AC 76 ms
75,736 KB
testcase_04 AC 74 ms
75,776 KB
testcase_05 AC 115 ms
86,180 KB
testcase_06 AC 113 ms
86,548 KB
testcase_07 AC 74 ms
75,680 KB
testcase_08 AC 104 ms
84,140 KB
testcase_09 AC 108 ms
85,200 KB
testcase_10 AC 150 ms
117,644 KB
testcase_11 AC 150 ms
118,088 KB
testcase_12 AC 75 ms
75,576 KB
testcase_13 AC 91 ms
83,164 KB
testcase_14 AC 142 ms
113,472 KB
testcase_15 AC 104 ms
91,496 KB
testcase_16 AC 148 ms
128,012 KB
testcase_17 AC 75 ms
75,840 KB
testcase_18 AC 92 ms
84,656 KB
testcase_19 AC 147 ms
127,464 KB
testcase_20 AC 132 ms
117,164 KB
testcase_21 AC 125 ms
109,852 KB
testcase_22 AC 152 ms
127,728 KB
testcase_23 AC 74 ms
75,676 KB
testcase_24 AC 86 ms
80,924 KB
testcase_25 AC 131 ms
113,164 KB
testcase_26 AC 149 ms
128,132 KB
testcase_27 AC 73 ms
75,740 KB
testcase_28 AC 138 ms
121,960 KB
testcase_29 AC 103 ms
92,892 KB
testcase_30 AC 128 ms
113,316 KB
testcase_31 AC 105 ms
96,108 KB
testcase_32 AC 94 ms
87,228 KB
testcase_33 AC 98 ms
89,140 KB
testcase_34 AC 96 ms
88,216 KB
testcase_35 AC 119 ms
106,344 KB
testcase_36 AC 98 ms
90,312 KB
testcase_37 AC 116 ms
103,632 KB
testcase_38 AC 96 ms
87,900 KB
testcase_39 AC 120 ms
109,404 KB
testcase_40 AC 117 ms
103,868 KB
testcase_41 AC 120 ms
106,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())*3
S=input()
C=[[0,0,0],[0,0,0],[0,0,0]]
T='con'
for i in range(N):
  for j in range(3):
    if T[j]==S[i]:
      C[(i-j)%3][j]+=1
D=[min(C[i]) for i in range(3)]
v=0
x=[]
for i in range(3):
  for j in range(D[i]*3):
    x.append(i)
  x.append(-1)
x=x[:N]
P=[0]*3
for i in range(min(N,len(x))):
  if x[i]>=0:
    P[x[i]]+=1
print(P[0]//3+P[1]//3+P[2]//3)
0