結果
問題 |
No.2562 数字探しゲーム(緑以下コンver.)
|
ユーザー |
![]() |
提出日時 | 2023-12-03 23:18:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 635 bytes |
コンパイル時間 | 263 ms |
コンパイル使用メモリ | 41,472 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-19 21:38:31 |
合計ジャッジ時間 | 1,195 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 WA * 1 |
ソースコード
/* -*- coding: utf-8 -*- * * 2562.cc: No.2562 数字探しゲーム(緑以下コンver.) - yukicoder */ #include<cstdio> #include<algorithm> using namespace std; /* constant */ /* typedef */ typedef long long ll; /* global variables */ int ds[10]; /* subroutines */ /* main */ int main() { int tn; scanf("%d", &tn); while (tn--) { int m; scanf("%d", &m); ll x = 0; for (int i = 1; i <= 9; i++) { scanf("%d", ds + i); for (int j = 0; j < ds[i]; j++) x = x * 10 + i; } x *= 1000000000; int r = x % m; if (r > 0) x += m - r; printf("%lld\n", x); } return 0; }