Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n, m, x, last, it;
- int schod[1000000], ludz[1000000];
- int main(){
- ios_base::sync_with_stdio(0);
- cin >> n >> m;
- last=0;
- for (int i=0; i<n; i++){
- cin >> x;
- schod[i]=max(x,last);
- last=max(x,last);
- }
- for (int j=0; j<m; j++){
- cin >> ludz[j];
- }
- it=m-1;
- for (int i=0; i<m; i++){
- x=schod[i];
- while (x>schod[it]){
- it--;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement