Submission #365814

#TimeUsernameProblemLanguageResultExecution timeMemory
365814aihayTrampoline (info1cup20_trampoline)C++14
0 / 100
2156 ms911276 KiB
#pragma GCC optimize ("O3") #pragma GCC optimize ("unroll-loops") #pragma GCC optimize("-Ofast") #include <bits/stdc++.h> using namespace std; typedef int in; #define f first #define s second #define pb push_back #define pp push #define ceil(x) NEVER USE CEIL #define sqrt(x) (int)(sqrt(x)) map<pair<int,int>,bool> gr; bool fun(int x,int y,int x2,int y2){ if(x==x2&&y<=y2){ return 1; } if(x>x2||y>y2){ return 0; } if(gr[{x,y}]){ return max(fun(x+1,y,x2,y2),fun(x,y+1,x2,y2)); } return fun(x,y+1,x2,y2); } in main() { ios_base::sync_with_stdio(0); int tc=1; //cin>>tc; while(tc--) { int r,c,n,q; cin>>r>>c>>n; while(n--){ int x,y; cin>>x>>y; gr[{x,y}]=1; } cin>>q; while(q--){ int x,y,x2,y2; cin>>x>>y>>x2>>y2; cout<<(fun(x,y,x2,y2)?"Yes\n":"No\n"); } } return 0; }
#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...