結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー srjywrdnprkt
提出日時 2023-12-07 14:26:53
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 491 bytes
コンパイル時間 1,831 ms
コンパイル使用メモリ 194,516 KB
最終ジャッジ日時 2025-02-18 08:57:34
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve(){
    ll M, d, K;
    const ll inf = 2e18;
    string S="";
    cin >> M;
    for (int i=1; i<=9; i++){
        cin >> d;
        S += string(d, char(i+'0'));
    }
    S += string(9, '0');
    K = stoll(S);
    cout << (K+M-1)/M*M << endl;
}

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

    int T;
    cin >> T;
    while(T){
        T--;
        solve();
    }

    return 0;
}
0