提出 #67785688


ソースコード 拡げる

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

#include "atcoder/all"
using namespace atcoder;

using Z = modint998244353;

int main() {
    int n, V = 0;
    cin >> n;
    vector<int> a(n);
    for (auto &x : a) cin >> x, V = max(V, x + 1);
    vector<vector<int>> dS(V);
    for (int i = 1; i < V; i++)
        for (int j = i; j < V; j += i) dS[j].push_back(i);
    vector<Z> f(V);
    for (int i = 1; i < V; i++) {
        f[i] = (Z(10).pow(i) - 1) / 9;
        for (int d : dS[i])
            if (d != i) f[i] /= f[d];
    }
    Z ans = 1;
    vector<bool> vis(V);
    for (int i : a) {
        for (int d : dS[i])
            if (!vis[d]) vis[d] = 1, ans *= f[d];
        cout << ans.val() << endl;
    }
}

提出情報

提出日時
問題 C - Repunits
ユーザ lhx1048576
言語 C++ 20 (gcc 12.2)
得点 900
コード長 740 Byte
結果 AC
実行時間 600 ms
メモリ 26260 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 900 / 900
結果
AC × 3
AC × 30
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_n_small_00.txt, 01_n_small_01.txt, 01_n_small_02.txt, 01_n_small_03.txt, 01_n_small_04.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 03_hcn_00.txt, 03_hcn_01.txt, 03_hcn_02.txt, 03_hcn_03.txt, 03_hcn_04.txt, 04_max_00.txt, 05_min_00.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3468 KiB
00_sample_01.txt AC 326 ms 25276 KiB
00_sample_02.txt AC 307 ms 24308 KiB
01_n_small_00.txt AC 331 ms 25272 KiB
01_n_small_01.txt AC 328 ms 25276 KiB
01_n_small_02.txt AC 328 ms 25396 KiB
01_n_small_03.txt AC 325 ms 25320 KiB
01_n_small_04.txt AC 327 ms 25344 KiB
02_random_00.txt AC 504 ms 25888 KiB
02_random_01.txt AC 573 ms 26160 KiB
02_random_02.txt AC 493 ms 25856 KiB
02_random_03.txt AC 581 ms 26108 KiB
02_random_04.txt AC 571 ms 26156 KiB
02_random_05.txt AC 579 ms 26260 KiB
02_random_06.txt AC 557 ms 26056 KiB
02_random_07.txt AC 581 ms 26120 KiB
02_random_08.txt AC 480 ms 25932 KiB
02_random_09.txt AC 571 ms 26068 KiB
02_random_10.txt AC 568 ms 26192 KiB
02_random_11.txt AC 574 ms 26100 KiB
02_random_12.txt AC 570 ms 26120 KiB
02_random_13.txt AC 569 ms 26060 KiB
02_random_14.txt AC 569 ms 26112 KiB
03_hcn_00.txt AC 600 ms 26104 KiB
03_hcn_01.txt AC 600 ms 26168 KiB
03_hcn_02.txt AC 599 ms 26260 KiB
03_hcn_03.txt AC 588 ms 26164 KiB
03_hcn_04.txt AC 588 ms 26060 KiB
04_max_00.txt AC 562 ms 26100 KiB
05_min_00.txt AC 1 ms 3504 KiB