-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEquator.cpp
More file actions
32 lines (32 loc) · 873 Bytes
/
Equator.cpp
File metadata and controls
32 lines (32 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define sf(a) scanf("%d",&a)
#define pf(a) printf("%d\n",a)
#define mem(a,b) memset(a,b,sizeof(a))
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define F first
#define S second
#define Check cout<< "Done in " << clock() / CLOCKS_PER_SEC <<" sec"<< endl;
#define FastRead ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
int main()
{
int n;
cin >> n;
int sum=0,a[n+2],s2=0;
for(int i=0;i<n;i++)
cin >> a[i] , sum += a[i];
int x = ceil(sum/2.0);
for(int i=0;i<n;i++)
{
s2 += a[i];
if(s2 >= x)
{
cout << i+1 << endl;
return 0;
}
}
}