結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー googol_S0googol_S0
提出日時 2022-09-16 21:28:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 123,836 KB
最終ジャッジ日時 2023-08-23 14:26:46
合計ジャッジ時間 6,455 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,464 KB
testcase_01 AC 70 ms
71,424 KB
testcase_02 AC 70 ms
71,292 KB
testcase_03 AC 69 ms
71,344 KB
testcase_04 AC 69 ms
71,212 KB
testcase_05 AC 111 ms
82,228 KB
testcase_06 AC 112 ms
82,372 KB
testcase_07 AC 70 ms
71,376 KB
testcase_08 AC 98 ms
80,064 KB
testcase_09 AC 104 ms
80,812 KB
testcase_10 AC 145 ms
113,740 KB
testcase_11 AC 147 ms
113,692 KB
testcase_12 AC 70 ms
71,300 KB
testcase_13 AC 84 ms
79,204 KB
testcase_14 AC 139 ms
109,360 KB
testcase_15 AC 100 ms
87,252 KB
testcase_16 AC 143 ms
123,836 KB
testcase_17 AC 72 ms
71,108 KB
testcase_18 AC 86 ms
80,424 KB
testcase_19 AC 141 ms
123,308 KB
testcase_20 AC 130 ms
113,064 KB
testcase_21 AC 122 ms
105,572 KB
testcase_22 AC 149 ms
123,760 KB
testcase_23 AC 71 ms
71,388 KB
testcase_24 AC 83 ms
76,860 KB
testcase_25 AC 129 ms
108,900 KB
testcase_26 AC 144 ms
123,736 KB
testcase_27 AC 71 ms
71,324 KB
testcase_28 AC 136 ms
117,844 KB
testcase_29 AC 97 ms
88,980 KB
testcase_30 AC 124 ms
109,272 KB
testcase_31 AC 102 ms
92,332 KB
testcase_32 AC 90 ms
83,268 KB
testcase_33 AC 94 ms
85,136 KB
testcase_34 AC 93 ms
84,120 KB
testcase_35 AC 117 ms
102,280 KB
testcase_36 AC 96 ms
86,124 KB
testcase_37 AC 113 ms
99,488 KB
testcase_38 AC 93 ms
84,120 KB
testcase_39 AC 119 ms
105,272 KB
testcase_40 AC 114 ms
99,504 KB
testcase_41 AC 116 ms
102,652 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