제출 #463493

#제출 시각아이디문제언어결과실행 시간메모리
463493KhizriTraffic (IOI10_traffic)C++17
0 / 100
0 ms332 KiB
#include "traffic.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define F first #define S second #define INF 1e18 #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define pii pair<int,int> #define pll pair<ll,ll> #define OK cout<<"Ok"<<endl; #define MOD (ll)(1e9+7) #define endl "\n" const int mxn=1e6+5; ll a[mxn],b[mxn]; int LocateCentre(int n, int arr[], int S[], int D[]) { a[0]=arr[0]; for(int i=1;i<n;i++){ a[i]=a[i-1]+arr[i]; } b[n-1]=arr[n-1]; for(int i=n-2;i>=0;i--){ b[i]=b[i+1]+arr[i]; } ll ans=min(b[1],a[n-1]); for(int i=1;i<n-1;i++){ ans=min(ans,max(a[i-1],b[i+1])); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...