結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー とりゐとりゐ
提出日時 2022-09-16 21:51:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 79,040 KB
最終ジャッジ日時 2023-08-23 14:57:12
合計ジャッジ時間 7,119 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,584 KB
testcase_01 AC 93 ms
71,736 KB
testcase_02 AC 92 ms
71,704 KB
testcase_03 AC 90 ms
71,456 KB
testcase_04 AC 91 ms
71,504 KB
testcase_05 AC 129 ms
78,936 KB
testcase_06 AC 132 ms
78,940 KB
testcase_07 AC 91 ms
71,624 KB
testcase_08 AC 121 ms
77,944 KB
testcase_09 AC 127 ms
78,212 KB
testcase_10 AC 162 ms
78,784 KB
testcase_11 AC 156 ms
78,852 KB
testcase_12 AC 90 ms
71,600 KB
testcase_13 AC 121 ms
77,136 KB
testcase_14 AC 149 ms
78,452 KB
testcase_15 AC 129 ms
77,192 KB
testcase_16 AC 128 ms
78,812 KB
testcase_17 AC 91 ms
71,724 KB
testcase_18 AC 106 ms
77,016 KB
testcase_19 AC 127 ms
78,868 KB
testcase_20 AC 120 ms
78,284 KB
testcase_21 AC 118 ms
78,232 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 #

from collections import defaultdict


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

ans=0
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+=min(cnt)

print(ans)
0