結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー 👑 timitimi
提出日時 2022-09-17 01:53:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 76,852 KB
最終ジャッジ日時 2024-06-01 14:47:58
合計ジャッジ時間 4,097 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,956 KB
testcase_01 AC 38 ms
52,680 KB
testcase_02 AC 38 ms
52,648 KB
testcase_03 AC 38 ms
52,180 KB
testcase_04 AC 37 ms
53,060 KB
testcase_05 AC 83 ms
76,612 KB
testcase_06 AC 79 ms
76,688 KB
testcase_07 AC 38 ms
53,888 KB
testcase_08 AC 69 ms
76,108 KB
testcase_09 AC 76 ms
76,260 KB
testcase_10 AC 79 ms
76,416 KB
testcase_11 AC 80 ms
76,724 KB
testcase_12 AC 38 ms
53,276 KB
testcase_13 AC 45 ms
62,536 KB
testcase_14 AC 75 ms
76,160 KB
testcase_15 AC 53 ms
70,808 KB
testcase_16 AC 78 ms
76,668 KB
testcase_17 AC 38 ms
52,468 KB
testcase_18 AC 45 ms
62,756 KB
testcase_19 AC 78 ms
76,852 KB
testcase_20 AC 69 ms
76,552 KB
testcase_21 AC 66 ms
76,208 KB
testcase_22 AC 79 ms
76,636 KB
testcase_23 AC 39 ms
53,460 KB
testcase_24 AC 44 ms
60,196 KB
testcase_25 AC 66 ms
76,276 KB
testcase_26 AC 77 ms
76,428 KB
testcase_27 AC 39 ms
52,320 KB
testcase_28 AC 74 ms
76,556 KB
testcase_29 AC 51 ms
69,116 KB
testcase_30 AC 66 ms
76,488 KB
testcase_31 AC 52 ms
68,424 KB
testcase_32 AC 48 ms
63,728 KB
testcase_33 AC 49 ms
65,596 KB
testcase_34 AC 49 ms
65,696 KB
testcase_35 AC 65 ms
76,520 KB
testcase_36 AC 51 ms
67,328 KB
testcase_37 AC 63 ms
76,160 KB
testcase_38 AC 49 ms
64,832 KB
testcase_39 AC 64 ms
76,476 KB
testcase_40 AC 63 ms
76,360 KB
testcase_41 AC 66 ms
76,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=input()
D={}
D['c']=[0,0,0]
D['o']=[0,0,0]
D['n']=[0,0,0]
for i in range(3*N):
  s=S[i]
  if s not in D:
    D[s]=[0]*3
  D[s][i%3]+=1

a=min(D['c'][0],D['o'][1],D['n'][2])
b=min(D['c'][1],D['o'][2],D['n'][0])
c=min(D['c'][2],D['o'][0],D['n'][1])
d=a+b+c
if N!=d:
  print(d)
else:
  if S=='con'*N:
    print(d)
  else:
    print(d-1)
0