#include "Alice.h"
#include <vector>
using namespace std;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
const int N = 5000;
vpi Alice() {
long long x = setN(N);
vpi ij;
for (int j = 1; j < N; j++) {
int i = x % j;
ij.push_back(make_pair(i + 1, j + 1));
}
return ij;
}
#include "Bob.h"
#include <vector>
using namespace std;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
long long Bob(vpi ij) {
const long long M = 1000000000000000000;
int m = ij.size();
long long md = 1, x = 0;
for (int h = 0; h < m && md <= M; h++) {
int i = ij[h].first - 1, j = ij[h].second - 1;
while (x % j != i)
x += md;
int k = 1;
while (md * k <= M && md * k % j != 0)
k++;
md *= k;
}
return x;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
820 KB |
Correct. |
2 |
Correct |
2 ms |
820 KB |
Correct. |
3 |
Correct |
1 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
1 ms |
816 KB |
Correct. |
6 |
Correct |
1 ms |
820 KB |
Correct. |
7 |
Correct |
2 ms |
828 KB |
Correct. |
8 |
Correct |
1 ms |
832 KB |
Correct. |
9 |
Correct |
1 ms |
832 KB |
Correct. |
10 |
Correct |
1 ms |
820 KB |
Correct. |
11 |
Correct |
2 ms |
832 KB |
Correct. |
12 |
Correct |
2 ms |
816 KB |
Correct. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
820 KB |
Correct. |
2 |
Correct |
2 ms |
820 KB |
Correct. |
3 |
Correct |
1 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
1 ms |
816 KB |
Correct. |
6 |
Correct |
1 ms |
820 KB |
Correct. |
7 |
Correct |
2 ms |
828 KB |
Correct. |
8 |
Correct |
1 ms |
832 KB |
Correct. |
9 |
Correct |
1 ms |
832 KB |
Correct. |
10 |
Correct |
1 ms |
820 KB |
Correct. |
11 |
Correct |
2 ms |
832 KB |
Correct. |
12 |
Correct |
2 ms |
816 KB |
Correct. |
13 |
Correct |
2 ms |
832 KB |
Correct. |
14 |
Correct |
2 ms |
816 KB |
Correct. |
15 |
Correct |
2 ms |
820 KB |
Correct. |
16 |
Correct |
1 ms |
828 KB |
Correct. |
17 |
Correct |
1 ms |
820 KB |
Correct. |
18 |
Correct |
1 ms |
820 KB |
Correct. |
19 |
Correct |
2 ms |
1072 KB |
Correct. |
20 |
Correct |
2 ms |
820 KB |
Correct. |
21 |
Correct |
2 ms |
820 KB |
Correct. |
22 |
Correct |
2 ms |
820 KB |
Correct. |
23 |
Correct |
1 ms |
828 KB |
Correct. |
24 |
Correct |
1 ms |
820 KB |
Correct. |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
820 KB |
Correct. |
2 |
Correct |
2 ms |
820 KB |
Correct. |
3 |
Correct |
1 ms |
820 KB |
Correct. |
4 |
Correct |
1 ms |
820 KB |
Correct. |
5 |
Correct |
1 ms |
816 KB |
Correct. |
6 |
Correct |
1 ms |
820 KB |
Correct. |
7 |
Correct |
2 ms |
828 KB |
Correct. |
8 |
Correct |
1 ms |
832 KB |
Correct. |
9 |
Correct |
1 ms |
832 KB |
Correct. |
10 |
Correct |
1 ms |
820 KB |
Correct. |
11 |
Correct |
2 ms |
832 KB |
Correct. |
12 |
Correct |
2 ms |
816 KB |
Correct. |
13 |
Correct |
2 ms |
832 KB |
Correct. |
14 |
Correct |
2 ms |
816 KB |
Correct. |
15 |
Correct |
2 ms |
820 KB |
Correct. |
16 |
Correct |
1 ms |
828 KB |
Correct. |
17 |
Correct |
1 ms |
820 KB |
Correct. |
18 |
Correct |
1 ms |
820 KB |
Correct. |
19 |
Correct |
2 ms |
1072 KB |
Correct. |
20 |
Correct |
2 ms |
820 KB |
Correct. |
21 |
Correct |
2 ms |
820 KB |
Correct. |
22 |
Correct |
2 ms |
820 KB |
Correct. |
23 |
Correct |
1 ms |
828 KB |
Correct. |
24 |
Correct |
1 ms |
820 KB |
Correct. |
25 |
Correct |
1 ms |
820 KB |
Correct. |
26 |
Correct |
1 ms |
832 KB |
Correct. |
27 |
Correct |
2 ms |
820 KB |
Correct. |
28 |
Correct |
2 ms |
820 KB |
Correct. |
29 |
Correct |
3 ms |
820 KB |
Correct. |
30 |
Correct |
1 ms |
828 KB |
Correct. |
31 |
Correct |
1 ms |
820 KB |
Correct. |
32 |
Correct |
2 ms |
820 KB |
Correct. |
33 |
Correct |
1 ms |
836 KB |
Correct. |
34 |
Correct |
1 ms |
820 KB |
Correct. |
35 |
Correct |
2 ms |
884 KB |
Correct. |
36 |
Correct |
2 ms |
836 KB |
Correct. |
37 |
Correct |
1 ms |
832 KB |
Correct. |
38 |
Correct |
1 ms |
820 KB |
Correct. |
39 |
Correct |
1 ms |
832 KB |
Correct. |
40 |
Correct |
2 ms |
820 KB |
Correct. |
41 |
Correct |
1 ms |
820 KB |
Correct. |
42 |
Correct |
2 ms |
820 KB |
Correct. |
43 |
Correct |
1 ms |
820 KB |
Correct. |
44 |
Correct |
1 ms |
832 KB |
Correct. |