結果
問題 |
No.2562 数字探しゲーム(緑以下コンver.)
|
ユーザー |
|
提出日時 | 2023-12-07 19:33:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 807 bytes |
コンパイル時間 | 1,701 ms |
コンパイル使用メモリ | 173,708 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-19 21:39:41 |
合計ジャッジ時間 | 2,721 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using T = tuple<ll, ll, ll>; // #include <atcoder/all> // using namespace atcoder; // using mint = modint1000000007; #define rep(i, n) for(ll i = 0; i < n; i++) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); ll t; cin >> t; while(t--) { ll m; cin >> m; vector<ll> d(9), ans; ll sum = 0; rep(i,9) { cin >> d[i]; rep(j,d[i]) ans.emplace_back(i+1); } sort(ans.begin(), ans.end()); ll cand = 0; rep(i,ans.size()) { cand *= 10; cand += ans[i]; } cand *= 1000000000; cand += (m-cand%m)%m; cout << cand << endl; } return 0; }