結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー nikoshonikosho
提出日時 2023-12-02 17:04:32
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 577 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 82,312 KB
最終ジャッジ日時 2023-12-02 17:04:37
合計ジャッジ時間 4,175 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

t = int(input())

for i in range(t):
    m = int(input())
    d = list(map(int,input().split()))
    val = 1
    sum_d = sum(d)
    if sum_d>(int(m/10)+1):
        val= int(((10**sum_d)-1)/m)-1
        #print("-> {} <-".format(val))

    while val<=10**18:
        d_check = [d[k] for k in range(9)]
        ch = str(val*m)
        for k in range(len(ch)):
            if d_check[int(ch[k])-1]>0:
                d_check[int(ch[k])-1]-=1
        if sum(d_check)==0:
            #print("==>> {} <<==".format(int(ch)))
            print(int(ch))
            break
        val+=1
0