Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int n, m, x, last, it;
  4. int schod[1000000], ludz[1000000];
  5. int main(){
  6. ios_base::sync_with_stdio(0);
  7. cin >> n >> m;
  8. last=0;
  9. for (int i=0; i<n; i++){
  10. cin >> x;
  11. schod[i]=max(x,last);
  12. last=max(x,last);
  13. }
  14. for (int j=0; j<m; j++){
  15. cin >> ludz[j];
  16. }
  17. it=m-1;
  18. for (int i=0; i<m; i++){
  19. x=schod[i];
  20. while (x>schod[it]){
  21. it--;
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement