結果

問題 No.2593 Reorder and Mod 120
ユーザー Nikkuniku029
提出日時 2023-12-29 15:37:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 413 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,516 KB
実行使用メモリ 77,376 KB
最終ジャッジ日時 2024-09-27 16:10:10
合計ジャッジ時間 2,734 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4 WA * 6 RE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N = int(input())
S = input()
ans = set()
C_S = Counter(S)
for i in range(min(1000, int(S) + 1)):
    isOK = True
    tmp = Counter(S)
    for t in list(str(i).zfill(min(3, N))):
        if t in tmp:
            tmp[t] -= 1
        else:
            isOK = False
    for v in tmp.values():
        if v < 0:
            isOK = False
    if isOK:
        ans.add(i)
print(len(ans))
0