結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー とろちゃとろちゃ
提出日時 2023-12-02 15:32:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,539 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,864 KB
最終ジャッジ日時 2023-12-02 15:32:22
合計ジャッジ時間 2,720 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

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()))
    # M = randint(1, 10**9)
    # M = 1000000000
    # t = 9
    # d = []
    # for _ in range(9):
    #     r = randint(0, t)
    #     t -= r
    #     d.append(r)
    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)) % M
    # print(n)
    # print(M, d, n)
    # if n % M != 0 or n > 10**18:
    #     print(M, d, n)
    #     print("False1")
    #     exit()
    # s = str(n)
    # for i, j in enumerate(d, 1):
    #     if s.count(str(i)) < j:
    #         print(M, d, n)
    #         print("False2")
    #         exit()
0