結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー kemuniku
提出日時 2023-12-02 14:55:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 198 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 81,980 KB
実行使用メモリ 78,436 KB
最終ジャッジ日時 2024-11-19 21:28:48
合計ジャッジ時間 2,106 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    M = int(input())
    d = [0]+list(map(int,input().split()))
    tmp = []
    for i in range(1,10):
        for j in range(d[i]):
            tmp.append(str(i))
    if tmp == []:
        x = M
    else:
        x = int("".join(tmp))*(10**9)
    if M != 10**9:
        x += M-x%M
    assert x % M == 0
    assert 1 <= x <= 10**18
    print(x)
0