結果
問題 | No.2562 数字探しゲーム(緑以下コンver.) |
ユーザー |
![]() |
提出日時 | 2024-12-12 01:53:57 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 538 bytes |
コンパイル時間 | 2,140 ms |
コンパイル使用メモリ | 200,940 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-12 01:54:00 |
合計ジャッジ時間 | 3,509 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>using namespace std;void fast_io() {ios::sync_with_stdio(false);std::cin.tie(nullptr);}void solve() {long long m;cin >> m;vector<int> d(10);long long num = 0;for (int i = 1; i <= 9; i++) {cin >> d[i];for (int j = 0; j < d[i]; j++) {num = num * 10 + i;}}if (num == 0) {cout << m << "\n";return;}num *= (long long)1e9;num += (m - num % m) % m;assert(num % m == 0);cout << num << "\n";}int main() {fast_io();int t;cin >> t;while (t--) {solve();}}