Submission #1364820

#TimeUsernameProblemLanguageResultExecution timeMemory
1364820mayacGuessing Game (EGOI23_guessinggame)C++20
Compilation error
0 ms0 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;
}

Compilation message (stderr)

guessinggame.cpp: In function 'int main()':
guessinggame.cpp:35:19: error: too few arguments to function 'll rand1(ll)'
   35 |         x[i]=rand1();
      |              ~~~~~^~
guessinggame.cpp:7:4: note: declared here
    7 | ll rand1(ll t){
      |    ^~~~~