結果

問題 No.2593 Reorder and Mod 120
ユーザー KudeKude
提出日時 2023-12-21 07:00:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 481 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,168 KB
最終ジャッジ日時 2023-12-21 07:00:29
合計ジャッジ時間 3,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
64,452 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 49 ms
64,452 KB
testcase_03 AC 49 ms
64,452 KB
testcase_04 AC 51 ms
64,452 KB
testcase_05 AC 50 ms
64,452 KB
testcase_06 AC 49 ms
64,452 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 AC 38 ms
53,460 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 37 ms
53,460 KB
testcase_11 AC 52 ms
64,584 KB
testcase_12 AC 53 ms
66,656 KB
testcase_13 AC 59 ms
76,140 KB
testcase_14 AC 52 ms
68,672 KB
testcase_15 AC 54 ms
73,172 KB
testcase_16 AC 51 ms
66,656 KB
testcase_17 AC 51 ms
68,684 KB
testcase_18 AC 53 ms
68,704 KB
testcase_19 AC 61 ms
75,992 KB
testcase_20 AC 61 ms
76,168 KB
testcase_21 AC 60 ms
76,168 KB
testcase_22 AC 60 ms
76,168 KB
testcase_23 AC 60 ms
76,168 KB
testcase_24 AC 53 ms
64,964 KB
testcase_25 AC 53 ms
64,964 KB
testcase_26 AC 52 ms
64,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
d = [0] * 10
for c in input():
    d[ord(c)-48] += 1
t = min(n, 3)
ans = [False] * 40
for x in range(10 ** (t - 1), 10 ** t):
    for c in map(int, str(x)):
        d[c] -= 1
    if min(d) >= 0:
        ans[x % 40] = True
    for c in map(int, str(x)):
        d[c] += 1
print(sum(ans))
0