結果
| 問題 | No.2562 数字探しゲーム(緑以下コンver.) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-12-02 16:38:16 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 862 bytes | 
| コンパイル時間 | 217 ms | 
| コンパイル使用メモリ | 82,828 KB | 
| 実行使用メモリ | 81,992 KB | 
| 最終ジャッジ日時 | 2024-11-19 21:34:03 | 
| 合計ジャッジ時間 | 2,484 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 WA * 1 | 
ソースコード
from collections import defaultdict, deque, Counter
import copy
from itertools import combinations, permutations, product, accumulate, groupby, chain
from heapq import heapify, heappop, heappush
import math
import bisect
from pprint import pprint
from random import randint
import sys
# sys.setrecursionlimit(700000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)
################################################
T = int(input())
for _ in range(T):
    M = int(input())
    D = list(map(int, input().split()))
    s = 0
    ans = 0
    cnt = 0
    for i, d in enumerate(D, 1):
        for j in range(d):
            s = (s*10 + i) % M
            ans = ans*10 + i
            cnt += 1
    s = s * 10**(18-cnt) % M
    ans *= 10**(18-cnt)
    ans += (-s)%M
    print(ans)
            
            
            
        