#include <vector>
#include "Alice.h"
#include<bits/stdc++.h>
using namespace std;
const int N = 5000;
// 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 setN(int N);
std::vector<std::pair<int,int>> Alice(){
long long x = setN(N);
vector<pair<int , int>> G;
for(int i = 2;i <= N; ++ i){
G.push_back({x % (i - 1) + 1 , i});
}
return G;
}
#include <vector>
#include "Bob.h"
#include<bits/stdc++.h>
#define fi first
#define se second
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().
long long Bob(std::vector<std::pair<int,int>> V){
long long ans = 0;
__int128 lc = 1;
for(auto to : V){
int m = to.se , r = to.fi;
while(ans % m != r) ans += lc;
lc *= (m / __gcd(__int128(m) , lc));
if(lc > 1e18) break;
}
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... |