Submission #918762

# Submission time Handle Problem Language Result Execution time Memory
918762 2024-01-30T11:46:57 Z Aiperiii Horses (IOI15_horses) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
const int mod=1e9+7;
vector <int> x,y;
int init(int N, int X[], int Y[]) {
   x.pb(0);y.pb(0);
   for(int i=0;i<N;i++){
      x.pb(X[i]);
      y.pb(Y[i]);
   }
   int d=1;
   int mx=0;
   int n=x.size()-1;
   for(int i=1;i<=n;i++){
      d*=x[i];
      d%=mod;
      mx=max(mx,(d*y[i])%mod);
   }
   return mx%mod;
}
int updateX(int pos,int val){
   pos++;
   x[pos]=val;
   int d=1;
   int mx=0;
   int n=x.size()-1;
   for(int i=1;i<=n;i++){
      d*=x[i];
      d%=mod;
      mx=max(mx,(d*y[i])%mod);
   }
   return mx%mod;
}
int updateY(int pos,int val){
   pos++;
   y[pos]=val;
   int d=1;
   int mx=0;
   int n=y.size()-1;
   for(int i=1;i<=n;i++){
      d*=x[i];
      d%=mod;
      mx=max(mx,(d*y[i])%mod);
   }
   return mx%mod;
}

Compilation message

/usr/bin/ld: /tmp/cchdWYu5.o: in function `main':
grader.c:(.text.startup+0xaa): undefined reference to `init(int, int*, int*)'
/usr/bin/ld: grader.c:(.text.startup+0x113): undefined reference to `updateX(int, int)'
/usr/bin/ld: grader.c:(.text.startup+0x16d): undefined reference to `updateY(int, int)'
collect2: error: ld returned 1 exit status