#include "Alice.h"
#include <utility>
#include <vector>
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 <utility>
#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;
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;
}
Compilation message
Alice.cpp:5:9: error: 'pair' does not name a type
5 | typedef pair<int, int> pi;
| ^~~~
Alice.cpp:6:9: error: 'vector' does not name a type
6 | typedef vector<pi> vpi;
| ^~~~~~
Alice.cpp:10:1: error: 'vpi' does not name a type
10 | vpi Alice() {
| ^~~
Bob.cpp: In function 'long long int Bob(vpi)':
Bob.cpp:14:20: warning: 'm' is used uninitialized in this function [-Wuninitialized]
14 | for (int h = 0; h < m && md <= M; h++) {
| ~~^~~