結果

問題 No.2073 Concon Substrings (Swap Version)
ユーザー rafi2rafi2
提出日時 2023-03-15 17:49:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 419 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,596 KB
実行使用メモリ 76,812 KB
最終ジャッジ日時 2023-10-18 12:28:58
合計ジャッジ時間 4,445 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 89 ms
76,808 KB
testcase_17 AC 41 ms
53,444 KB
testcase_18 AC 51 ms
66,088 KB
testcase_19 AC 88 ms
76,756 KB
testcase_20 AC 79 ms
76,160 KB
testcase_21 AC 75 ms
76,296 KB
testcase_22 AC 89 ms
76,808 KB
testcase_23 AC 41 ms
53,444 KB
testcase_24 AC 48 ms
61,988 KB
testcase_25 AC 76 ms
76,384 KB
testcase_26 AC 89 ms
76,804 KB
testcase_27 AC 41 ms
53,560 KB
testcase_28 AC 82 ms
76,356 KB
testcase_29 AC 59 ms
73,800 KB
testcase_30 AC 77 ms
76,412 KB
testcase_31 AC 65 ms
75,876 KB
testcase_32 AC 53 ms
68,132 KB
testcase_33 AC 55 ms
70,180 KB
testcase_34 AC 54 ms
70,180 KB
testcase_35 AC 74 ms
76,140 KB
testcase_36 AC 56 ms
72,228 KB
testcase_37 AC 71 ms
76,092 KB
testcase_38 AC 54 ms
70,180 KB
testcase_39 AC 74 ms
76,236 KB
testcase_40 AC 71 ms
76,104 KB
testcase_41 AC 72 ms
76,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
from collections import defaultdict
d0 = defaultdict(int)
d1 = defaultdict(int)
d2 = defaultdict(int)

for i in range(n):
    d0[s[3*i]] += 1
    d1[s[3*i+1]] += 1
    d2[s[3*i+2]] += 1

ans = 0

l = ["c","o","n"]
ans += min(d0["c"],d1["o"],d2["n"])
if ans == n:
    print(n)
    exit()
ans += min(d0["n"],d1["c"],d2["o"])
ans += min(d0["o"],d1["n"],d2["c"])
if ans == n:
    print(ans-1)

0