結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー roarisroaris
提出日時 2022-09-16 22:41:48
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 616 bytes
コンパイル時間 264 ms
使用メモリ 83,312 KB
最終ジャッジ日時 2023-01-11 07:59:33
合計ジャッジ時間 7,178 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 101 ms
76,056 KB
testcase_01 AC 98 ms
76,048 KB
testcase_02 AC 100 ms
75,904 KB
testcase_03 AC 101 ms
75,996 KB
testcase_04 AC 99 ms
76,036 KB
testcase_05 AC 119 ms
83,312 KB
testcase_06 AC 123 ms
82,940 KB
testcase_07 AC 98 ms
76,220 KB
testcase_08 AC 117 ms
82,228 KB
testcase_09 AC 117 ms
82,732 KB
testcase_10 AC 130 ms
82,792 KB
testcase_11 AC 130 ms
82,984 KB
testcase_12 AC 98 ms
75,984 KB
testcase_13 AC 115 ms
81,904 KB
testcase_14 AC 126 ms
82,612 KB
testcase_15 AC 116 ms
81,812 KB
testcase_16 AC 115 ms
82,760 KB
testcase_17 AC 99 ms
75,996 KB
testcase_18 AC 111 ms
81,304 KB
testcase_19 AC 118 ms
82,556 KB
testcase_20 AC 117 ms
82,316 KB
testcase_21 AC 115 ms
81,920 KB
testcase_22 AC 119 ms
82,628 KB
testcase_23 AC 98 ms
76,040 KB
testcase_24 AC 110 ms
81,068 KB
testcase_25 AC 118 ms
82,228 KB
testcase_26 AC 118 ms
83,132 KB
testcase_27 AC 99 ms
75,932 KB
testcase_28 AC 118 ms
82,704 KB
testcase_29 AC 112 ms
81,624 KB
testcase_30 AC 121 ms
82,396 KB
testcase_31 AC 117 ms
81,648 KB
testcase_32 AC 113 ms
81,408 KB
testcase_33 AC 115 ms
81,428 KB
testcase_34 AC 113 ms
81,424 KB
testcase_35 AC 118 ms
82,036 KB
testcase_36 AC 115 ms
81,440 KB
testcase_37 AC 117 ms
82,220 KB
testcase_38 AC 113 ms
81,424 KB
testcase_39 AC 119 ms
82,212 KB
testcase_40 AC 119 ms
81,988 KB
testcase_41 AC 119 ms
82,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N = int(input())
S = input()[:-1]
c = [0, 0, 0]
o = [0, 0, 0]
n = [0, 0, 0]

for i in range(3*N):
    if S[i]=='c':
        c[i%3] += 1
    elif S[i]=='o':
        o[i%3] += 1
    elif S[i]=='n':
        n[i%3] += 1

ans = 0
now = 0

for _ in range(min(c[0], o[1], n[2])):
    if now+3<=3*N:
        now += 3
        ans += 1
    
now += 1

for _ in range(min(c[1], o[2], n[0])):
    if now+3<=3*N:
        now += 3
        ans += 1
    
now += 1

for _ in range(min(c[2], o[0], n[1])):
    if now+3<=3*N:
        now += 3
        ans += 1

print(ans)
0