結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー GOTKAKO
提出日時 2024-11-29 22:34:44
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 462 bytes
コンパイル時間 2,064 ms
コンパイル使用メモリ 194,736 KB
最終ジャッジ日時 2025-02-26 09:23:38
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int test; cin >> test;
    while(test--){
        long long M; cin >> M;

        string s = "";
        for(int i=1; i<=9; i++){
            int d; cin >> d;
            while(d--) s += '0'+i;
        }
		if(s == "") s = "0";
        long long D = stoll(s);
        D *= 1e9;
        D += (M-D%M)%M;
        cout << D << endl;   
    }
}
0