제출 #683126

#제출 시각아이디문제언어결과실행 시간메모리
683126mseebacherTraffic (IOI10_traffic)C++17
0 / 100
1 ms2644 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; #define MAXI (int)1e5 #define pb(x) push_back(x) vector<int> ad[MAXI]; vector<bool> vis(MAXI,0); void dfs(int x){ if(vis[x]) return; vis[x] = 1; for(auto s:ad[x]){ dfs(s); } } int LocateCentre(int n,int p[],int s[],int d[]){ ll left = 0; ll right = 0; ll maxi = 1e18; for(int i = 0;i<n;i++){ right += p[i]; } int node = 0; for(int i = 1;i<n;i++){ left += p[i-1]; right -= p[i]; if(maxi > max(right,left)){ maxi = max(right,left); node = i; } } return node; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...