| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1364820 | mayac | Guessing Game (EGOI23_guessinggame) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll a=67,b=123,c=50001;
ll n;
ll cur=1;
ll rand1(ll t){
cur=((a*cur+b)*t)%c;
return cur;
}
vector<ll> x(1e5);
void alice(){
int t=0;
cout<<c<<endl;
for(int i=0;i<n-1;i++){
cin>>t;
x[t]=rand1(t);
cout<<x[t]<<endl;
}
}
void bob(){
int t,s1=0,s2=0;
for(int i=0;i<n;i++){
cin>>t;
if(t!=x[i]){
s1=i;
}
}
cout<<s1<<" "<<s2<<endl;
}
int main(){
ll p;
cin>>p>>n;
for(int i=0;i<n;i++){
x[i]=rand1();
}
if(p==1){
alice();
}else{
bob();
}
return 0;
}