Submission #365889

# Submission time Handle Problem Language Result Execution time Memory
365889 2021-02-12T13:32:02 Z fadi57 Trampoline (info1cup20_trampoline) C++14
0 / 100
5 ms 492 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll mx=300;
const int mod= 1e9+7 ;
const ll inf=1e12+4;

//***while there is life there is hope


int r,c,n;

int main() {



	 //ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	 cin>>r>>c>>n;
	 int rr[n];
	 int cc[n];
	 vector<int>row[mx];
	 for(int i=0;i<n;i++){


        cin>>rr[i]>>cc[i];
        row[rr[i]].push_back(cc[i]);
	 }int t;
	 cin>>t;



while(t--){
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    int ans=0;
    if(x1<=x2&&y1<=y2){


        while(x1<x2){

            if(row[x1].empty()){break;}
            int nxt=lower_bound(row[x1].begin(),row[x1].end(),y1)-row[x1].begin();
            if(nxt==row[x1].size()){break;}
y1=row[x1][nxt];    x1++;
    //cout<<"test :"<<x1<<" "<<nxt<<endl;

        }

        if(x1==x2&&y1<=y2){ans=1;}




    }if(ans){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}




}
}










Compilation message

trampoline.cpp: In function 'int main()':
trampoline.cpp:45:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |             if(nxt==row[x1].size()){break;}
      |                ~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 492 KB expected YES, found NO [1st token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 7
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 7
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 7
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 7
2 Halted 0 ms 0 KB -