Submission #693336

# Submission time Handle Problem Language Result Execution time Memory
693336 2023-02-02T21:03:11 Z Ahmed_Solyman Trampoline (info1cup20_trampoline) C++14
0 / 100
2000 ms 92024 KB
#include <bits/stdc++.h>
#include <ext/rope>
 
using namespace std;
using namespace __gnu_cxx;
#pragma GCC optimize("-Ofast")
#pragma GCC optimize("-O1")
//-------------------------------------------------------------//
typedef long long ll;
typedef unsigned long long ull;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define lb lower_bound
#define ub upper_bound
#define endl '\n'
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define sum_to(n) (n*(n+1))/2
#define pb push_back
#define pf push_front
#define sz size()
#define fil(arr,x) memset(arr,x,sizeof(arr))
const ll mod=1e9+7;
int dx[8]={0,1,0,-1,1,1,-1,-1};
int dy[8]={1,0,-1,0,1,-1,-1,1};
//-------------------------------------------------------------//
ll lcm(ll a,ll b)
{
    return (max(a,b)/__gcd(a,b))*min(a,b);
}
void person_bool(bool x)
{
    cout<<(x?"YES":"NO")<<endl;
}
int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    fast
    int r,c,n;
    cin>>r>>c>>n;
    vector<vector<int>>arr(r+1);
    for(int i=0;i<n;i++){
    	int x,y;
    	cin>>x>>y;
    	arr[x].pb(y);
    }
    for(int i=1;i<=r;i++){
    	sort(all(arr[i]));
    }
    int q;cin>>q;
    while(q--){
    	int x,y,a,b;
    	cin>>x>>y>>a>>b;
    	if(a<x ||  b<y || a-x>n){
    		cout<<"No"<<endl;
    	}
    	else{
    		if(a-x==1){
    			while(1)cout<<"f";
    		}
    		int p=y;
    		bool valid=1;
    		for(int i=x;i<a;i++){
    			int j=lb(all(arr[i]),p)-arr[i].begin();
    			if(j==arr[i].sz){
    				valid=0;
    				break;
    			}
    			else{
    				p=arr[i][j];
    			}
    		}
    		cout<<(valid?"Yes":"No")<<endl;
    	}
    }
    return 0;
}

Compilation message

trampoline.cpp: In function 'int main()':
trampoline.cpp:66:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   66 |        if(j==arr[i].sz){
      |            ^
# Verdict Execution time Memory Grader output
1 Execution timed out 2073 ms 87304 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2094 ms 92024 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 596 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 596 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 596 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -