(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 #1105620

#TimeUsernameProblemLanguageResultExecution timeMemory
1105620GabrielTraffic (IOI10_traffic)C++17
0 / 100
1 ms4432 KiB
#include "traffic.h" #include "bits/stdc++.h" using namespace std; int LocateCentre(int N, int pp[], int S[], int D[]) { long long n = N; vector<long long> a(n), b(n); for(long long i = 0; i < n; i++){ a[i] = (long long)pp[i]; if(i > 0) a[i] += a[i - 1]; } for(long long i = n - 1; i > -1; i--){ b[i] = (long long)pp[i]; if(i < (n - 1)) b[i] += b[i + 1]; } long long r = 2222222222222222; for(long long i = 0; i < n; i++){ long long p = 0; if(i > 0) p += a[i - 1]; if(i < (n - 1)) p += b[i + 1]; r = min(r, p); } return (int)r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...