Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<iterator>
  3. #include<vector>
  4. #include<iterator>
  5. using namespace std;
  6.  
  7. int main(){
  8.     int test,camp,night,x;
  9.     int avg;
  10.     vector<int> a;
  11.     vector<int> sum;
  12.     vector<int>::iterator it;
  13.     int res[300];
  14.     cin>>test;
  15.  
  16.    for(int i=0;i<test;i++){
  17.         sum[0]=0;
  18.     cin>>camp;
  19.  
  20.     cin>>night;
  21.     for(int j=1;j<=camp;j++){
  22.         cin>>x;
  23.         a.push_back(x);
  24.         sum[j]=sum[j-1]+x;
  25.     }
  26.     avg=sum[camp]/camp;
  27.     x=avg;
  28.     for(int z=0;z<camp;z++){
  29.         //need help
  30.       it=lower_bound(sum.begin(),sum.end(),x);
  31.     cout<<"iterator"<<&it<<endl;
  32.     }
  33.  
  34.    }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement