結果

問題 No.2562 数字探しゲーム(緑以下コンver.)
ユーザー Mikan04yMikan04y
提出日時 2023-12-02 20:40:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 2,071 ms
コンパイル使用メモリ 200,888 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 20:40:35
合計ジャッジ時間 3,199 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 34 ms
6,676 KB
testcase_05 AC 35 ms
6,676 KB
testcase_06 AC 33 ms
6,676 KB
testcase_07 AC 34 ms
6,676 KB
testcase_08 AC 34 ms
6,676 KB
testcase_09 AC 35 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int T;
    cin >> T;
    for (int t = 0; t < T; t++)
    {
        int M;
        cin >> M;
        int d[10];
        d[0] = 0;
        for (int i = 1; i < 10; i++)
            cin >> d[i];

        long long X = 0;
        for (int i = 1; i < 10; i++)
        {
            for (int j = 0; j < d[i]; j++)
            {
                X *= 10;
                X += i;
            }
        }
        X *= 1'000'000'000;
        if (X % M != 0)
        {
            X += M;
            X -= X % M;
        }
        cout << X << endl;
    }
}
0