Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- #include <queue>
- #include <vector>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- vector<int> a;
- for(int i=0;i<n;i++)
- {
- int x;
- cin>>x;
- a.push_back(x);
- }
- int z=0,m=0;
- for(int i=0;z<n and i < n; i++)
- {
- z+=a[i] + 1;
- m++;
- }
- cout << m << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment