Submission #365872

#TimeUsernameProblemLanguageResultExecution timeMemory
365872BelalTrampoline (info1cup20_trampoline)C++14
0 / 100
2084 ms50724 KiB
#include <bits/stdc++.h> using namespace std; int r,c,n; map <int,vector<int> > arr1; map <int,vector<int> > arr2; bool fun(int a,int b,int x,int y){ if(a>x||b>y){return false;} if(a==x){return true;} int lim=y; for(int i=x-1;i>=a;i--){ if(arr1[i].size()==0){return false;} for(int j=0;j<arr1[i].size();j++){ if(arr1[i][j]<=lim){ if(arr1[i][j]>b){ if(i==a){return true;} lim==arr1[i][j]; break; } else{return false;} } } } } int main() { int a,b,x,y; cin>>r>>c>>n; for(int i=0;i<n;i++){ cin>>a>>b; arr1[a].push_back(b); arr2[b].push_back(a); } map<int,vector<int> > :: iterator it=arr1.begin(); for( ;it != arr1.end();it++){ sort(arr1[it->first].begin(),arr1[it->first].end(),greater<int>()); } int t; cin>>t; for(int i=0;i<t;i++){ cin>>a>>b>>x>>y; if(fun(a,b,x,y)){cout<<"Yes"<<endl;} else{cout<<"No"<<endl;} } return 0; }

Compilation message (stderr)

trampoline.cpp: In function 'bool fun(int, int, int, int)':
trampoline.cpp:13:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         for(int j=0;j<arr1[i].size();j++){
      |                     ~^~~~~~~~~~~~~~~
trampoline.cpp:17:24: warning: value computed is not used [-Wunused-value]
   17 |                     lim==arr1[i][j];
trampoline.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...