Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main() {
- int k,n,m,x,y,p,q;
- cin>>n;
- cin>>m;
- cin>>x;
- for(int i=1;i<=n-1;i++){
- cin>>y;
- }
- cin>>p;
- k=1;
- if(p>y){
- cout<<"imposibil";
- return 0;
- }
- while(cin>>q){
- k++;
- if(p<x && y<q){
- cout<<k;
- return 0;
- }
- p=q;
- }
- cout<<"imposibil";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement