結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー 👑 KazunKazun
提出日時 2022-09-16 22:33:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 340 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 78,480 KB
最終ジャッジ日時 2023-08-23 16:09:46
合計ジャッジ時間 6,473 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
71,520 KB
testcase_01 AC 88 ms
71,632 KB
testcase_02 AC 86 ms
71,492 KB
testcase_03 AC 87 ms
71,620 KB
testcase_04 AC 85 ms
71,524 KB
testcase_05 AC 134 ms
78,332 KB
testcase_06 AC 130 ms
78,280 KB
testcase_07 AC 87 ms
71,640 KB
testcase_08 AC 117 ms
77,716 KB
testcase_09 AC 120 ms
77,928 KB
testcase_10 AC 127 ms
78,300 KB
testcase_11 AC 126 ms
78,196 KB
testcase_12 AC 91 ms
71,640 KB
testcase_13 AC 93 ms
76,888 KB
testcase_14 AC 120 ms
77,916 KB
testcase_15 AC 103 ms
76,972 KB
testcase_16 AC 128 ms
78,288 KB
testcase_17 AC 88 ms
71,464 KB
testcase_18 AC 96 ms
76,772 KB
testcase_19 AC 127 ms
78,200 KB
testcase_20 AC 117 ms
77,620 KB
testcase_21 AC 111 ms
77,704 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


def solve():
    N=int(input())
    S=input()

    A=[defaultdict(int), defaultdict(int), defaultdict(int)]

    for i in range(3*N):
        A[i%3][S[i]]+=1

    p,q,r="con"
    ans=0

    for _ in range(3):
        ans+=min(A[0][p],A[1][q],A[2][r])
        p,q,r=q,r,p
    return ans

print(solve())
0