結果

問題 No.2593 Reorder and Mod 120
ユーザー Nikkuniku029Nikkuniku029
提出日時 2023-12-29 15:42:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,332 KB
最終ジャッジ日時 2023-12-29 15:42:42
合計ジャッジ時間 3,220 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
66,652 KB
testcase_01 AC 61 ms
66,628 KB
testcase_02 AC 62 ms
68,596 KB
testcase_03 AC 64 ms
68,600 KB
testcase_04 AC 63 ms
68,596 KB
testcase_05 AC 59 ms
66,652 KB
testcase_06 AC 63 ms
68,596 KB
testcase_07 AC 63 ms
68,716 KB
testcase_08 AC 81 ms
68,596 KB
testcase_09 AC 57 ms
66,652 KB
testcase_10 AC 60 ms
66,628 KB
testcase_11 AC 61 ms
66,532 KB
testcase_12 AC 61 ms
68,596 KB
testcase_13 AC 77 ms
76,160 KB
testcase_14 AC 65 ms
72,692 KB
testcase_15 AC 77 ms
76,332 KB
testcase_16 AC 61 ms
68,596 KB
testcase_17 AC 64 ms
72,692 KB
testcase_18 AC 65 ms
70,628 KB
testcase_19 AC 76 ms
76,140 KB
testcase_20 AC 80 ms
76,188 KB
testcase_21 AC 77 ms
76,188 KB
testcase_22 AC 91 ms
76,188 KB
testcase_23 AC 79 ms
76,188 KB
testcase_24 AC 77 ms
76,316 KB
testcase_25 AC 76 ms
76,316 KB
testcase_26 AC 76 ms
76,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter, defaultdict

N = int(input())
S = input()
ans = set()
C_S = Counter(S)
for i in range(1000):
    isOK = True
    d = defaultdict(int)
    for t in list(str(i).zfill(min(3, N))):
        d[t] += 1
    for k, v in d.items():
        if C_S[k] < v:
            isOK = False
    if isOK:
        ans.add(i % 40)
print(len(ans))
0