結果
| 問題 | No.2562 数字探しゲーム(緑以下コンver.) |
| コンテスト | |
| ユーザー |
Yuto_kyopro0731
|
| 提出日時 | 2023-12-02 15:34:07 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 659 bytes |
| 記録 | |
| コンパイル時間 | 63 ms |
| コンパイル使用メモリ | 82,700 KB |
| 実行使用メモリ | 84,228 KB |
| 最終ジャッジ日時 | 2026-09-26 19:45:31 |
| 合計ジャッジ時間 | 9,131 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 3 TLE * 1 -- * 6 |
ソースコード
from itertools import permutations
def culc(M,d):
D = []
for i in range(9):
if d[i]!=0:
for _ in range(d[i]):
D.append(str(i+1))
for perm in permutations(D):
s = ''.join(item for item in perm)
X = int(s)
if X%M==0:
return X
elif M - ((X*10)%M) < 10:
return X*10 + M - ((X*10)%M)
T = int(input())
for i in range(T):
M = int(input())
d = list(map(int, input().split()))
ans = culc(M,d)
print(ans)
'''
for perm in permutations(D):
s = ''.join(perm)
X = int(s)
if X%M==0:
return X
'''
Yuto_kyopro0731