結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
コンテスト
ユーザー 👑 Kazun
提出日時 2026-02-01 23:30:14
言語 PyPy3
(7.3.17)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 486 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 367 ms
コンパイル使用メモリ 82,388 KB
実行使用メモリ 77,792 KB
最終ジャッジ日時 2026-02-01 23:30:17
合計ジャッジ時間 2,619 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def solve():
    M = int(input())
    d = [0] + list(map(int, input().split()))

    if all(d[i] == 0 for i in range(10)):
        return M

    a = 0
    for k in range(1, 10):
        for _ in range(d[k]):
            a = 10 * a + k

    b = (-a * pow(10, 9)) % M
    return a * pow(10, 9) + b

#==================================================
import sys
input = sys.stdin.readline
write = sys.stdout.write

T = int(input())
write("\n".join(map(str, [solve() for _ in range(T)])))
0