結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー takumi152takumi152
提出日時 2023-12-02 14:58:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 885 bytes
コンパイル時間 890 ms
コンパイル使用メモリ 88,480 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 14:59:01
合計ジャッジ時間 3,055 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

typedef long long int ll;
typedef pair<int, int> Pii;

const ll mod = 998244353;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int t;
  cin >> t;
  vector<ll> m(t);
  vector<vector<ll>> d(t, vector<ll>(9));
  for (int i = 0; i < t; i++) {
    cin >> m[i];
    for (auto &dn: d[i]) cin >> dn;
  }

  vector<ll> ans(t);
  for (int i = 0; i < t; i++) {
    ll mult_1e9 = 0;
    for (int j = 0; j < 9; j++) {
      for (int k = 0; k < d[i][j]; k++) {
        mult_1e9 = mult_1e9 * 10 + (j + 1);
      }
    }
    ll ans_hi = mult_1e9 * 1000000000LL;
    ll ans_lo = (m[i] - ans_hi % m[i]) % 1000000000LL;
    ans.push_back(ans_hi + ans_lo);
  }

  for (auto &x: ans) cout << x << endl;

  return 0;
}
0