Submission #64586


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
const int MOD = 998244353;
int main(){
int n;
long long k;
cin >> n >> k;
vector<long long> a(n);
for(int i = 0; i < n; ++i){
cin >> a[i];
}
int cnt = count_if(a.begin(), a.end(), [&](long long x){ return (gcd(k, x) == 1); });
int res = 1;
for(int i = 0; i < cnt; ++i){
(res <<= 1) %= MOD;
}
cout << res - 1 << '\n';
return (0);
}

ステータス

項目 データ
問題 1409 - Prime Combination
ユーザー名 ei1903
投稿日時 2020-11-04 18:00:36
言語 C++17
状態 Accepted
得点 300
ソースコード長 534 Byte
最大実行時間 191 ms
最大メモリ使用量 2256 KB

セット

セット 得点 Cases
1 ALL 300 / 300 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.txt AC 138 ms 1756 KB
1
in02.txt AC 162 ms 1852 KB
1
in03.txt AC 125 ms 1440 KB
1
in04.txt AC 72 ms 1008 KB
1
in05.txt AC 61 ms 952 KB
1
in06.txt AC 179 ms 2060 KB
1
in07.txt AC 178 ms 2004 KB
1
in08.txt AC 186 ms 2076 KB
1
in09.txt AC 174 ms 2152 KB
1
in10.txt AC 181 ms 2096 KB
1
in11.txt AC 179 ms 2168 KB
1
in12.txt AC 191 ms 2108 KB
1
in13.txt AC 128 ms 2056 KB
1
in14.txt AC 129 ms 2256 KB
1
in15.txt AC 171 ms 2200 KB
1
in16.txt AC 147 ms 2016 KB
1
in17.txt AC 99 ms 2084 KB
1
in18.txt AC 99 ms 2156 KB
1
in19.txt AC 109 ms 2100 KB
1
in20.txt AC 19 ms 508 KB
1
in21.txt AC 22 ms 480 KB
1
in22.txt AC 24 ms 576 KB
1
in23.txt AC 124 ms 2208 KB
1
in24.txt AC 129 ms 2148 KB
1
in25.txt AC 44 ms 2216 KB
1
in26.txt AC 102 ms 2164 KB
1
in27.txt AC 41 ms 2240 KB
1
in28.txt AC 84 ms 2180 KB
1
in29.txt AC 18 ms 584 KB
1
in30.txt AC 24 ms 684 KB
1
sample01.txt AC 22 ms 648 KB
1
sample02.txt AC 21 ms 620 KB
1