#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
std::vector<std::pair<int,int>> Alice(){
int n = 5000;
long long x = setN(n);
vector<pair<int, int>> v;
for (int i = 1; i < n; i++) {
v.push_back({i + 1, (x % i) + 1});
}
return v;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
using ll = long long;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
long long Bob(std::vector<std::pair<int,int>> V) {
ll ans = 0;
ll ansmod = 1;
for (auto &i : V) {
i.first--;
i.second--;
if (i.first > i.second) swap(i.first, i.second);
cout << i.first << " " << i.second << " " << endl;
while (ans % i.second != i.first) ans += ansmod;
ansmod *= i.second / __gcd((ll)i.second, ansmod);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |