結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー けんぴんけんぴん
提出日時 2023-10-31 23:31:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 77,332 KB
最終ジャッジ日時 2023-10-31 23:31:17
合計ジャッジ時間 2,381 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,568 KB
testcase_01 AC 37 ms
53,568 KB
testcase_02 AC 37 ms
53,568 KB
testcase_03 AC 36 ms
53,568 KB
testcase_04 AC 178 ms
77,332 KB
testcase_05 AC 160 ms
76,604 KB
testcase_06 AC 155 ms
76,604 KB
testcase_07 AC 155 ms
76,604 KB
testcase_08 AC 156 ms
76,596 KB
testcase_09 AC 190 ms
76,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
assert 1 <= T <= 10**4
for _ in range(T):
    M = int(input())
    D = list(map(int, input().split()))
    assert 1 <= M <= 10**9
    for d in D:
        assert 0 <= d
    assert sum(D) <= 9
    ans_st = ""
    for i,d in enumerate(D, 1):
        ans_st += str(i)*d
    ans_st += "0"*(18-sum(D))
    assert 1 <= M * (-(-int(ans_st)//M)) <= 10**18
    print(M * (-(-int(ans_st)//M)))
0