結果

問題 No.2593 Reorder and Mod 120
コンテスト
ユーザー Kude
提出日時 2023-12-21 06:59:00
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 301 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 145 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 77,312 KB
最終ジャッジ日時 2026-04-14 06:34:20
合計ジャッジ時間 2,125 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
d = [0] * 10
for c in input():
    d[ord(c)-48] += 1
t = min(n, 3)
ans = [False] * 8
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 % 8] = True
    for c in map(int, str(x)):
        d[c] += 1
print(sum(ans))
0