結果
問題 | No.2562 数字探しゲーム(緑以下コンver.) |
ユーザー |
![]() |
提出日時 | 2023-12-20 13:38:26 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 540 bytes |
コンパイル時間 | 647 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 26,880 KB |
最終ジャッジ日時 | 2024-11-19 21:41:11 |
合計ジャッジ時間 | 29,299 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 TLE * 9 |
ソースコード
n = int(input()) from collections import Counter def check_ans(ans, d) -> bool: c = Counter(str(ans)) for i, count in enumerate(d, 1): if c[str(i)] < count: return False return True for _ in range(n): M = int(input()) d = list(map(int, input().split())) ans = "" for i, count in enumerate(d, 1): ans += str(i) * count while len(ans) < 17: # 17桁にする ans += "9" ans = int(ans) remainder = ans % M ans -= remainder while check_ans(ans, d) == False: ans -= M if ans < 0: assert False print(ans)