結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー 👑 tipstar0125tipstar0125
提出日時 2023-12-07 14:12:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 77,644 KB
最終ジャッジ日時 2023-12-07 14:12:17
合計ジャッジ時間 2,466 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,460 KB
testcase_01 AC 39 ms
53,460 KB
testcase_02 AC 37 ms
53,460 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 113 ms
76,016 KB
testcase_05 AC 158 ms
77,644 KB
testcase_06 AC 109 ms
76,032 KB
testcase_07 AC 111 ms
76,020 KB
testcase_08 AC 112 ms
76,032 KB
testcase_09 AC 144 ms
77,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())

for _ in range(T):
    M=int(input())
    d=list(map(int, input().split()))
    ans=0
    p=1
    for (i,di) in enumerate(d):
       for _ in range(di):
           ans+=p*(i+1)
           p*=10
    ans*=int(1e9)
    
    r=ans%M
    if r!=0:
        ans+=M-r
    print(ans)
0