Submission #775607

# Submission time Handle Problem Language Result Execution time Memory
775607 2023-07-06T15:08:32 Z HD1 Trampoline (info1cup20_trampoline) C++14
62 / 100
2000 ms 10024 KB
//we are all lost trying to be someone.
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
#define sz(x) ll(x.size())
#define reve(x) reverse(x.begin(),x.end())
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii;
const ll MAX=3*(1e4+100);
const ll mod=1e9+7;
const ll inf=1e18+7;
map<ll,vector<ll>>A;
bool solve(){
	ll x1, y1, x2, y2;
	cin>>x1>>y1>>x2>>y2;
	if(x1>x2 || y1>y2) return false;
	if(x1==x2 && y1<=y2) return true;
	else{
		ll co=y1;
		for(ll i=x1; i<x2; i++){
			if(!A.count(i)) return false; 
			ll cov=*lower_bound(A[i].begin(),A[i].end(),co);
			if(cov>=co && cov<=y2){
				co=cov;
			}
			else{
				return false;
			}
		}
	}
	return true;
}
int main(){
	ll n, m, t;
	cin>>n>>m>>t;
	ll a, b;
	while(t--){
		cin>>a>>b;
		A[a].push_back(b);
	}
	for(auto it: A){
		sort(A[it.ff].begin(), A[it.ff].end());
	}
	ll x1, y1, x2, y2;
	cin>>t;
	while(t--){
		if(solve()) cout<<"Yes"<<'\n';
		else cout<<"No"<<'\n';
	}
	
}

Compilation message

trampoline.cpp: In function 'int main()':
trampoline.cpp:47:5: warning: unused variable 'x1' [-Wunused-variable]
   47 |  ll x1, y1, x2, y2;
      |     ^~
trampoline.cpp:47:9: warning: unused variable 'y1' [-Wunused-variable]
   47 |  ll x1, y1, x2, y2;
      |         ^~
trampoline.cpp:47:13: warning: unused variable 'x2' [-Wunused-variable]
   47 |  ll x1, y1, x2, y2;
      |             ^~
trampoline.cpp:47:17: warning: unused variable 'y2' [-Wunused-variable]
   47 |  ll x1, y1, x2, y2;
      |                 ^~
# Verdict Execution time Memory Grader output
1 Correct 4 ms 340 KB 200 token(s): yes count is 21, no count is 179
2 Correct 5 ms 468 KB 200 token(s): yes count is 70, no count is 130
3 Correct 3 ms 340 KB 197 token(s): yes count is 25, no count is 172
# Verdict Execution time Memory Grader output
1 Correct 117 ms 3308 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 117 ms 3376 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 229 ms 2508 KB 4000 token(s): yes count is 4000, no count is 0
4 Correct 389 ms 3428 KB 4000 token(s): yes count is 1991, no count is 2009
# Verdict Execution time Memory Grader output
1 Correct 580 ms 3644 KB 200000 token(s): yes count is 110486, no count is 89514
2 Correct 568 ms 3420 KB 200000 token(s): yes count is 114664, no count is 85336
3 Incorrect 578 ms 3172 KB expected NO, found YES [47th token]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 15 ms 340 KB 5000 token(s): yes count is 3238, no count is 1762
2 Correct 18 ms 412 KB 5000 token(s): yes count is 3837, no count is 1163
3 Correct 17 ms 864 KB 5000 token(s): yes count is 4104, no count is 896
4 Correct 15 ms 380 KB 5000 token(s): yes count is 3934, no count is 1066
5 Correct 302 ms 640 KB 5000 token(s): yes count is 3384, no count is 1616
6 Correct 15 ms 340 KB 5000 token(s): yes count is 3390, no count is 1610
# Verdict Execution time Memory Grader output
1 Execution timed out 2063 ms 10024 KB Time limit exceeded
2 Halted 0 ms 0 KB -