結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー 21kazu1321kazu13
提出日時 2023-12-04 14:06:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 1,243 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 78,140 KB
最終ジャッジ日時 2023-12-04 14:06:28
合計ジャッジ時間 2,799 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
65,796 KB
testcase_01 AC 62 ms
65,796 KB
testcase_02 AC 60 ms
65,796 KB
testcase_03 AC 62 ms
65,796 KB
testcase_04 AC 137 ms
77,628 KB
testcase_05 AC 138 ms
77,632 KB
testcase_06 AC 141 ms
78,140 KB
testcase_07 AC 141 ms
78,140 KB
testcase_08 AC 138 ms
77,628 KB
testcase_09 AC 156 ms
77,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
from bisect import bisect_left, bisect_right, insort_left, insort_right  # type: ignore
from collections import Counter, defaultdict, deque  # type: ignore
from math import gcd, sqrt, ceil, factorial  # type: ignore
from heapq import heapify, heappop, heappush, heappushpop, heapreplace, merge  # type: ignore
from itertools import accumulate, combinations, permutations, product  # type: ignore
from string import ascii_lowercase, ascii_uppercase # type: ignore

def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode("utf-8").split()
def S(): return sys.stdin.buffer.readline().rstrip().decode("utf-8")
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def SRL(n): return [list(S()) for _ in range(n)]

def solve(m,l):
    tmp = []
    for idx,cnt in enumerate(l,start=1):
        tmp.append(str(idx)*cnt)
    cand = int(''.join(tmp))*(10**9)
    rem = (m-cand%m)%m
    return cand+rem

T = I()
for _ in range(T):
    m = I()
    d = LI()
    print(solve(m,d))
0