結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー Jikky1618
提出日時 2025-09-03 08:28:34
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 647 bytes
コンパイル時間 3,361 ms
コンパイル使用メモリ 279,564 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-03 08:28:39
合計ジャッジ時間 4,223 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...)
#endif

void solve() {
    ll M;
    vector<int> d(9);
    cin >> M;
    for (int i = 0; i < 9; i++) cin >> d[i];
    string tmp = "";
    for (int i = 0; i < 9; i++) tmp += string(d[i], i + '1');
    tmp += string(9, '0');
    debug(tmp);
    ll ans = stoll(tmp);
    ans += (ans % M ? M - (ans % M) : 0);
    cout << ans << '\n';
    assert(ans % M == 0);
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int T;
    cin >> T;
    while (T--) solve();
}
0