#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
vector<pair<int,int>> Alice(){
int n=41;
long long x=setN(n);
vector<pair<int,int>> res;
for(int i=1;i<n;i++)res.emplace_back(x%i+1,i+1);
return res;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
using i128 = __int128_t;
long long Bob(vector<pair<int,int>> e){
const i128 LIM=1e18;
auto extgcd=[&](i128 a,i128 b){
i128 u=1,v=0,q;
while(b){
q=a/b;
a-=q*b,u-=q*v;
swap(a,b),swap(u,v);
}
return make_tuple(a,u,v);
};
i128 a=0,m=0;
for(auto [u,v]:e){
if(m>LIM)break;
u--,v--;
if(u>v)swap(u,v);
if(m==0){
a=u,m=v;
continue;
}
auto [g,x,y]=extgcd(m,v);
a=a+x*(u-a)/g%(v/g)*m;
m=m/g*v;
a%=m;
if(a<0)a+=m;
}
return a;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
784 KB |
Correct. |
2 |
Correct |
0 ms |
784 KB |
Correct. |
3 |
Correct |
0 ms |
776 KB |
Correct. |
4 |
Correct |
0 ms |
784 KB |
Correct. |
5 |
Correct |
0 ms |
784 KB |
Correct. |
6 |
Correct |
0 ms |
776 KB |
Correct. |
7 |
Correct |
0 ms |
788 KB |
Correct. |
8 |
Correct |
0 ms |
784 KB |
Correct. |
9 |
Correct |
1 ms |
784 KB |
Correct. |
10 |
Correct |
0 ms |
776 KB |
Correct. |
11 |
Correct |
0 ms |
776 KB |
Correct. |
12 |
Correct |
0 ms |
776 KB |
Correct. |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
784 KB |
Correct. |
2 |
Correct |
0 ms |
784 KB |
Correct. |
3 |
Correct |
0 ms |
776 KB |
Correct. |
4 |
Correct |
0 ms |
784 KB |
Correct. |
5 |
Correct |
0 ms |
784 KB |
Correct. |
6 |
Correct |
0 ms |
776 KB |
Correct. |
7 |
Correct |
0 ms |
788 KB |
Correct. |
8 |
Correct |
0 ms |
784 KB |
Correct. |
9 |
Correct |
1 ms |
784 KB |
Correct. |
10 |
Correct |
0 ms |
776 KB |
Correct. |
11 |
Correct |
0 ms |
776 KB |
Correct. |
12 |
Correct |
0 ms |
776 KB |
Correct. |
13 |
Correct |
0 ms |
776 KB |
Correct. |
14 |
Correct |
0 ms |
776 KB |
Correct. |
15 |
Correct |
1 ms |
776 KB |
Correct. |
16 |
Correct |
0 ms |
776 KB |
Correct. |
17 |
Correct |
0 ms |
776 KB |
Correct. |
18 |
Correct |
0 ms |
784 KB |
Correct. |
19 |
Correct |
1 ms |
784 KB |
Correct. |
20 |
Correct |
0 ms |
776 KB |
Correct. |
21 |
Correct |
0 ms |
776 KB |
Correct. |
22 |
Correct |
0 ms |
784 KB |
Correct. |
23 |
Correct |
0 ms |
784 KB |
Correct. |
24 |
Incorrect |
1 ms |
776 KB |
Incorrect answer. |
25 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
784 KB |
Correct. |
2 |
Correct |
0 ms |
784 KB |
Correct. |
3 |
Correct |
0 ms |
776 KB |
Correct. |
4 |
Correct |
0 ms |
784 KB |
Correct. |
5 |
Correct |
0 ms |
784 KB |
Correct. |
6 |
Correct |
0 ms |
776 KB |
Correct. |
7 |
Correct |
0 ms |
788 KB |
Correct. |
8 |
Correct |
0 ms |
784 KB |
Correct. |
9 |
Correct |
1 ms |
784 KB |
Correct. |
10 |
Correct |
0 ms |
776 KB |
Correct. |
11 |
Correct |
0 ms |
776 KB |
Correct. |
12 |
Correct |
0 ms |
776 KB |
Correct. |
13 |
Correct |
0 ms |
776 KB |
Correct. |
14 |
Correct |
0 ms |
776 KB |
Correct. |
15 |
Correct |
1 ms |
776 KB |
Correct. |
16 |
Correct |
0 ms |
776 KB |
Correct. |
17 |
Correct |
0 ms |
776 KB |
Correct. |
18 |
Correct |
0 ms |
784 KB |
Correct. |
19 |
Correct |
1 ms |
784 KB |
Correct. |
20 |
Correct |
0 ms |
776 KB |
Correct. |
21 |
Correct |
0 ms |
776 KB |
Correct. |
22 |
Correct |
0 ms |
784 KB |
Correct. |
23 |
Correct |
0 ms |
784 KB |
Correct. |
24 |
Incorrect |
1 ms |
776 KB |
Incorrect answer. |
25 |
Halted |
0 ms |
0 KB |
- |