結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー flygonflygon
提出日時 2022-09-16 22:36:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 78,056 KB
最終ジャッジ日時 2023-08-23 16:11:30
合計ジャッジ時間 5,508 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,260 KB
testcase_01 AC 72 ms
71,412 KB
testcase_02 AC 71 ms
71,384 KB
testcase_03 AC 72 ms
71,116 KB
testcase_04 AC 73 ms
71,116 KB
testcase_05 AC 94 ms
77,596 KB
testcase_06 AC 98 ms
77,696 KB
testcase_07 AC 72 ms
71,368 KB
testcase_08 AC 87 ms
77,444 KB
testcase_09 AC 90 ms
77,364 KB
testcase_10 AC 102 ms
77,440 KB
testcase_11 AC 103 ms
77,692 KB
testcase_12 AC 69 ms
70,976 KB
testcase_13 AC 82 ms
75,776 KB
testcase_14 AC 102 ms
77,556 KB
testcase_15 AC 86 ms
76,832 KB
testcase_16 AC 92 ms
77,700 KB
testcase_17 AC 71 ms
71,176 KB
testcase_18 AC 79 ms
75,748 KB
testcase_19 AC 94 ms
77,552 KB
testcase_20 AC 90 ms
76,872 KB
testcase_21 AC 88 ms
77,360 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 #

n = int(input())
s = input()
pos = [[0]*3 for i in range(3)]
for i,c in enumerate(s):
  if c == "c":
    pos[0][i%3] += 1
  elif c == "o":
    pos[1][i%3] += 1
  elif c == "n":
    pos[2][i%3] += 1

now = 0
ans = 0
for i in range(3):
  cc,oo,nn = pos[0][(0+i)%3], pos[1][(1+i)%3], pos[2][(2+i)%3]
  mn = min(cc,oo,nn)
  ans += mn

print(ans)
0