結果

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

ソースコード

diff #

# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
import os
import sys

# from bisect import *
# from collections import *
# from datetime import *
# from decimal import *  # PyPyだと遅い
# from heapq import *
from itertools import *

# from math import gcd, lcm
# from random import *
# from string import *

# import numpy as np
# from atcoder.dsu import *
# from atcoder.segtree import *
# from more_itertools import *
# from sortedcontainers import *

# sys.setrecursionlimit(10**7)  # PyPyは呪文を付ける
# sys.set_int_max_str_digits(0)
INF = 1 << 61
MOD = 998244353
# MOD = 10**9 + 7
IS_ATCODER = os.getenv("ATCODER", 0)

File = sys.stdin


def input():
    return File.readline().replace("\n", "")


# ///////////////////////////////////////////////////////////////////////////


for _ in range(int(input())):
    M = int(input())
    d = list(map(int, input().split()))
    l = []
    for i, j in enumerate(d, 1):
        if j:
            l.append(str(i) * j)
    n = int("".join(l) + "0" * (9 + (9 - sum(d))))
    n += M - (n % M)
    print(n)
    # print(n % M)
0