結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー prd_xxx
提出日時 2023-12-02 14:57:10
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 372 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 77,672 KB
最終ジャッジ日時 2024-11-19 21:28:56
合計ジャッジ時間 2,217 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(M,D):
    ans = 0
    for i,d in enumerate(D,1):
        while d:
            ans += i
            ans *= 10
            d -= 1
    ans *= 10**8
    add = (M - ans%M) % M
    ans += add
    assert ans % M == 0
    assert ans <= 10**18
    print(ans)

T = int(input())
for _ in range(T):
    M = int(input())
    D = list(map(int,input().split()))
    solve(M,D)
0