結果
問題 |
No.2562 数字探しゲーム(緑以下コンver.)
|
ユーザー |
![]() |
提出日時 | 2025-01-11 20:33:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 416 bytes |
コンパイル時間 | 2,304 ms |
コンパイル使用メモリ | 161,196 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-11 20:33:36 |
合計ジャッジ時間 | 3,139 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for( ll i = 0; i < n; i++ ) using ll = long long; int main() { int T; cin >> T; rep(i, T) { ll M; vector<int> vd(9); cin >> M; rep(j, 9) cin >> vd[j]; ll x = 0; rep(j, 9) { if(vd[j] == 0) continue; rep(k, vd[j]) x = x * 10 + j + 1; } if(x == 0) x = 1; x *= 1e9; ll r = x % M; if(r) x += M - r; cout << x << endl; } }