Submission #312141

#TimeUsernameProblemLanguageResultExecution timeMemory
312141AmineTrabelsiTraffic (IOI10_traffic)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; using ll = long long; #define pb push_back #define mp make_pair #define f first #define s second #define sz(x) ((int)x.size()) #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() // Hi ll LocateCentre(int n,vector<int> p,vector<int> ff,vector<int> d){ // assuming all the cities are in straight line // s[i] = i , d[i] = i+1; vector<ll> sum(n+1,0); for(int i=0;i<n;i++){ sum[i+1] = sum[i]+p[i]; } ll res = 1e18; for(int i=1;i<n;i++){ res = min(res,max(sum[i],sum[n]-sum[i+1])); } return res; // 1 2 3 // 0 1 3 6 } /* int main(){ vector<int> p = {10,10,10,20,20}; vector<int> s = {0,1,2,3}; vector<int> d = {1,2,3,4}; cout<<LocateCentre(5,p,s,d)<<'\n'; return 0; }*/

Compilation message (stderr)

/tmp/ccqdfSMC.o: In function `main':
grader.cpp:(.text.startup+0xad): undefined reference to `LocateCentre(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status