結果
問題 | No.2963 Mecha DESU |
ユーザー |
![]() |
提出日時 | 2024-11-16 16:17:12 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 664 bytes |
コンパイル時間 | 5,380 ms |
コンパイル使用メモリ | 309,424 KB |
実行使用メモリ | 22,912 KB |
最終ジャッジ日時 | 2024-11-16 16:19:03 |
合計ジャッジ時間 | 20,415 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 55 TLE * 2 |
ソースコード
#include <bits/stdc++.h>using namespace std;using namespace chrono;#if __has_include(<atcoder/all>)#include <atcoder/all>using namespace atcoder;#endifint main(){int64_t n, m, k;cin >> n >> m >> k;vector<int64_t> as(m);for (auto &&a : as){cin >> a;}vector<int64_t> cnt(1000001);for (auto &&a : as){for (int64_t i = a; i <= 1000000; i += a){cnt[i]++;}}using mint = modint998244353;mint ans = 0;for (int64_t i = 1; i <= n; i++){ans += 1 - (mint(m - cnt[i]) / m).pow(k);}cout << ans.val() << endl;return 0;}