結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー とりゐとりゐ
提出日時 2022-09-16 21:53:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 86,756 KB
実行使用メモリ 78,800 KB
最終ジャッジ日時 2023-08-23 15:00:32
合計ジャッジ時間 6,872 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,444 KB
testcase_01 AC 89 ms
71,592 KB
testcase_02 AC 89 ms
71,692 KB
testcase_03 AC 87 ms
71,588 KB
testcase_04 AC 86 ms
71,548 KB
testcase_05 AC 125 ms
78,472 KB
testcase_06 AC 133 ms
78,736 KB
testcase_07 AC 88 ms
71,412 KB
testcase_08 AC 118 ms
78,008 KB
testcase_09 AC 123 ms
78,384 KB
testcase_10 AC 160 ms
78,500 KB
testcase_11 AC 155 ms
78,800 KB
testcase_12 AC 91 ms
71,748 KB
testcase_13 AC 119 ms
77,440 KB
testcase_14 AC 148 ms
78,540 KB
testcase_15 AC 125 ms
77,300 KB
testcase_16 AC 124 ms
78,576 KB
testcase_17 AC 89 ms
71,608 KB
testcase_18 AC 103 ms
76,904 KB
testcase_19 AC 125 ms
78,588 KB
testcase_20 AC 117 ms
78,196 KB
testcase_21 AC 113 ms
77,892 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 AC 125 ms
78,100 KB
testcase_31 AC 115 ms
76,832 KB
testcase_32 AC 117 ms
77,136 KB
testcase_33 AC 119 ms
76,944 KB
testcase_34 AC 115 ms
77,176 KB
testcase_35 AC 127 ms
78,068 KB
testcase_36 AC 117 ms
77,340 KB
testcase_37 AC 122 ms
77,580 KB
testcase_38 AC 119 ms
77,016 KB
testcase_39 AC 124 ms
77,664 KB
testcase_40 AC 122 ms
77,584 KB
testcase_41 AC 122 ms
77,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


n=int(input())
s=input()

ans=[]
for x in range(3):
  y=(x+1)%3
  z=(x+2)%3
  cnt=[0]*3
  for i in range(3*n):
    if s[i]=='c' and i%3==x:
      cnt[0]+=1
    if s[i]=='o' and i%3==y:
      cnt[1]+=1
    if s[i]=='n' and i%3==z:
      cnt[2]+=1
  
  ans.append(min(cnt))

if sum(ans)==n:
  if max(ans)==n:
    print(n)
  else:
    print(n-1)
else:
  print(sum(ans))
0