This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
vector<pair<int,int>> Alice() {
int N = 5000;
long long X = setN(N);
vector<pair<int, int>> arbre;
for(int i = 2;i <= N;i++) {
arbre.push_back({1 + X % (i - 1), i});
}
return arbre;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
long long Bob(vector<pair<int, int>> aretes){
__int128 X = 0;
__int128 N = 1;
for(pair<int, int>& arete : aretes) {
__int128 modX = arete.first - 1, p = arete.second - 1;
while(X % p != modX) {
X += N;
}
N = (N * p) / __gcd(N, p);
if(N > 1e18) break;
}
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |