/** MIT License Copyright (c) 2018 Vasilyev Daniil **/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#pragma GCC optimize("Ofast")
template<typename T> using v = vector<T>;
template<typename T, typename U> using hmap = __gnu_pbds::gp_hash_table<T, U>;
//#define int long long
typedef long double ld;
typedef string str;
typedef vector<int> vint;
#define rep(a, l, r) for(int a = (l); a < (r); a++)
#define pb push_back
#define fs first
#define sc second
#define sz(a) ((int) a.size())
const long long inf = 4611686018427387903; //2^62 - 1
#if 0 //FileIO
const string fileName = "";
ifstream fin ((fileName == "" ? "input.txt" : fileName + ".in" ));
ofstream fout((fileName == "" ? "output.txt" : fileName + ".out"));
#define get fin>>
#define put fout<<
#else
#define get cin>>
#define put cout<<
#endif
#define eol put endl
#define check(a) put #a << ": " << a << endl;
void read() {} template<typename Arg,typename... Args> void read (Arg& arg,Args&... args){get (arg) ;read(args...) ;}
void print(){} template<typename Arg,typename... Args> void print(Arg arg,Args... args){put (arg)<<" ";print(args...);}
void debug(){eol;} template<typename Arg,typename... Args> void debug(Arg arg,Args... args){put (arg)<<" ";debug(args...);}
int getInt(){int a; get a; return a;}
//code goes here
const long long N = 1e7 + 1;
const int LIM = 20;
int dp[N];
void run() {
int m, q;
read(m, q);
vint primes;
int p[m];
v<pair<int, int>> vals;
rep(i, 0, m) {
get p[i];
if (p[i] > LIM)
for (int j = 1; j * p[i] < N; j++)
vals.pb({j * p[i], i});
else
primes.pb(p[i]);
}
sort(vals.begin(), vals.end());
}
int32_t main() {srand(time(0)); ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); put fixed; put setprecision(15); run(); return 0;}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
21 ms |
4588 KB |
Output isn't correct |
2 |
Incorrect |
176 ms |
16972 KB |
Output isn't correct |
3 |
Incorrect |
45 ms |
16972 KB |
Output isn't correct |
4 |
Incorrect |
73 ms |
16972 KB |
Output isn't correct |
5 |
Incorrect |
125 ms |
17020 KB |
Output isn't correct |
6 |
Incorrect |
20 ms |
17020 KB |
Output isn't correct |
7 |
Incorrect |
45 ms |
17020 KB |
Output isn't correct |
8 |
Incorrect |
37 ms |
17020 KB |
Output isn't correct |
9 |
Incorrect |
95 ms |
17020 KB |
Output isn't correct |
10 |
Incorrect |
223 ms |
33552 KB |
Output isn't correct |
11 |
Incorrect |
252 ms |
33552 KB |
Output isn't correct |
12 |
Incorrect |
54 ms |
33552 KB |
Output isn't correct |
13 |
Execution timed out |
1089 ms |
131964 KB |
Time limit exceeded |
14 |
Execution timed out |
1074 ms |
132156 KB |
Time limit exceeded |
15 |
Incorrect |
221 ms |
132156 KB |
Output isn't correct |
16 |
Incorrect |
200 ms |
132156 KB |
Output isn't correct |
17 |
Incorrect |
291 ms |
132156 KB |
Output isn't correct |
18 |
Incorrect |
72 ms |
132156 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
200 ms |
132156 KB |
Output isn't correct |
2 |
Incorrect |
289 ms |
132156 KB |
Output isn't correct |
3 |
Execution timed out |
1087 ms |
132156 KB |
Time limit exceeded |
4 |
Incorrect |
402 ms |
132156 KB |
Output isn't correct |
5 |
Execution timed out |
1004 ms |
132156 KB |
Time limit exceeded |
6 |
Incorrect |
174 ms |
132156 KB |
Output isn't correct |
7 |
Incorrect |
195 ms |
132156 KB |
Output isn't correct |
8 |
Incorrect |
380 ms |
132156 KB |
Output isn't correct |
9 |
Execution timed out |
1082 ms |
132184 KB |
Time limit exceeded |
10 |
Execution timed out |
1089 ms |
132184 KB |
Time limit exceeded |
11 |
Execution timed out |
1093 ms |
132212 KB |
Time limit exceeded |
12 |
Incorrect |
537 ms |
132212 KB |
Output isn't correct |
13 |
Incorrect |
76 ms |
132212 KB |
Output isn't correct |
14 |
Incorrect |
402 ms |
132212 KB |
Output isn't correct |
15 |
Execution timed out |
1078 ms |
132212 KB |
Time limit exceeded |
16 |
Incorrect |
282 ms |
132212 KB |
Output isn't correct |
17 |
Execution timed out |
1077 ms |
132212 KB |
Time limit exceeded |
18 |
Execution timed out |
1088 ms |
132248 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1031 ms |
132248 KB |
Time limit exceeded |
2 |
Execution timed out |
1081 ms |
132248 KB |
Time limit exceeded |
3 |
Execution timed out |
1085 ms |
132248 KB |
Time limit exceeded |
4 |
Incorrect |
533 ms |
132248 KB |
Output isn't correct |
5 |
Incorrect |
315 ms |
132248 KB |
Output isn't correct |
6 |
Execution timed out |
1086 ms |
132248 KB |
Time limit exceeded |
7 |
Execution timed out |
1084 ms |
132340 KB |
Time limit exceeded |
8 |
Execution timed out |
1012 ms |
132340 KB |
Time limit exceeded |
9 |
Execution timed out |
1028 ms |
132340 KB |
Time limit exceeded |
10 |
Incorrect |
893 ms |
132340 KB |
Output isn't correct |
11 |
Incorrect |
699 ms |
132340 KB |
Output isn't correct |
12 |
Incorrect |
972 ms |
132340 KB |
Output isn't correct |
13 |
Execution timed out |
1084 ms |
132340 KB |
Time limit exceeded |
14 |
Incorrect |
372 ms |
132340 KB |
Output isn't correct |
15 |
Execution timed out |
1090 ms |
132340 KB |
Time limit exceeded |
16 |
Execution timed out |
1083 ms |
132340 KB |
Time limit exceeded |
17 |
Execution timed out |
1089 ms |
132340 KB |
Time limit exceeded |
18 |
Execution timed out |
1082 ms |
132340 KB |
Time limit exceeded |
19 |
Incorrect |
154 ms |
132340 KB |
Output isn't correct |
20 |
Execution timed out |
1087 ms |
132340 KB |
Time limit exceeded |
21 |
Incorrect |
547 ms |
132340 KB |
Output isn't correct |
22 |
Execution timed out |
1091 ms |
132340 KB |
Time limit exceeded |
23 |
Incorrect |
356 ms |
132340 KB |
Output isn't correct |
24 |
Incorrect |
155 ms |
132340 KB |
Output isn't correct |
25 |
Incorrect |
792 ms |
132340 KB |
Output isn't correct |
26 |
Incorrect |
534 ms |
132340 KB |
Output isn't correct |
27 |
Execution timed out |
1078 ms |
132340 KB |
Time limit exceeded |
28 |
Incorrect |
159 ms |
132340 KB |
Output isn't correct |
29 |
Execution timed out |
1074 ms |
132340 KB |
Time limit exceeded |
30 |
Execution timed out |
1084 ms |
132340 KB |
Time limit exceeded |
31 |
Incorrect |
292 ms |
132340 KB |
Output isn't correct |
32 |
Incorrect |
403 ms |
132340 KB |
Output isn't correct |
33 |
Incorrect |
63 ms |
132340 KB |
Output isn't correct |
34 |
Execution timed out |
1086 ms |
132340 KB |
Time limit exceeded |
35 |
Incorrect |
264 ms |
132340 KB |
Output isn't correct |
36 |
Execution timed out |
1083 ms |
132340 KB |
Time limit exceeded |
37 |
Incorrect |
312 ms |
132340 KB |
Output isn't correct |
38 |
Execution timed out |
1087 ms |
132340 KB |
Time limit exceeded |
39 |
Incorrect |
225 ms |
132340 KB |
Output isn't correct |
40 |
Incorrect |
838 ms |
132340 KB |
Output isn't correct |
41 |
Incorrect |
818 ms |
132340 KB |
Output isn't correct |
42 |
Execution timed out |
1075 ms |
132340 KB |
Time limit exceeded |