제출 #463499

#제출 시각아이디문제언어결과실행 시간메모리
463499KhizriTraffic (IOI10_traffic)C++17
0 / 100
1 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; int 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]; } int ans=2000000000; for(int i=0;i<n;i++){ int x=0; if(i-1>=0){ x=a[i-1]; //cout<<a[i-1]<<' '; } if(i+1<n){ x=max(x,b[i+1]); //cout<<b[i+1]<<' '; } //cout<<endl; //cout<<x<<' '; ans=min(ans,x); } 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...