結果
問題 |
No.2562 数字探しゲーム(緑以下コンver.)
|
ユーザー |
|
提出日時 | 2023-12-02 16:10:42 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 496 bytes |
コンパイル時間 | 422 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 633,104 KB |
最終ジャッジ日時 | 2024-11-19 21:32:57 |
合計ジャッジ時間 | 23,730 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 2 TLE * 6 MLE * 2 |
ソースコード
def solve(M, A): from itertools import permutations digit = [] for i in range(9): for _ in range(A[i]): digit.append(i + 1) P = list(permutations(digit)) for per in P: tmp = 0 for c in per: tmp *= 10 tmp += c if tmp % M == 0: return tmp ans = [] T = int(input()) for _ in range(T): M = int(input()) A = list(map(int, input().split())) ans.append(solve(M, A)) print(*ans, sep="\n")