(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #477283

#TimeUsernameProblemLanguageResultExecution timeMemory
477283TsiannisTraffic (IOI10_traffic)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define INF 100000000000 typedef long long ll; int main() { ll N; cin>>N; ll sum=0; ll P[N],D[N],S[N],pre[N]; for (int i=0;i<N;i++) { cin>>P[i]; sum+=P[i]; pre[i]=sum; } for (int i=0;i<N-1;i++) { cin>>S[i]>>D[i]; } ll mn=INF; ll index; ll d=sum/2; for (int i=0;i<N;i++) { ll d=(sum-P[i])/2; if (abs(pre[i]-d-P[i])<mn) { mn=abs(pre[i]-d-P[i]); index=i; } } cout<<index<<endl; return 0; }

Compilation message (stderr)

traffic.cpp: In function 'int main()':
traffic.cpp:23:8: warning: unused variable 'd' [-Wunused-variable]
   23 |     ll d=sum/2;
      |        ^
/usr/bin/ld: /tmp/cc2fI1o3.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccyyNwt4.o:traffic.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc2fI1o3.o: in function `main':
grader.cpp:(.text.startup+0xe1): undefined reference to `LocateCentre(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status