Submission #365940

# Submission time Handle Problem Language Result Execution time Memory
365940 2021-02-12T14:48:56 Z Ahmadsm2005 Trampoline (info1cup20_trampoline) C++14
11 / 100
2000 ms 4612 KB
#include <bits/stdc++.h>
//#define endl '\n'
#define modulo 998244353
#define int long long
#define PI acos(-1)
#pragma GCC optimize("-Ofast")
#pragma GCC optimize("trapv")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
#define sinDegrees(x) sin((x) * PI / 180.0)
#define cosDegrees(x) cos((x) * PI / 180.0)
#define tanDegrees(x) tan((x) * PI / 180.0)
#define atanDegrees(x) atan(x)* 180.0 / PI
#define asinDegrees(x) asin(x)* 180.0 / PI
#define EPS 0.000000001
using namespace std;
int power(int x,int y,int m)
{
int temp;
if(y == 0)
return 1;
temp = (power(x, y/2,m))%m;
if (y%2 == 0)
return ((temp%m)*temp);
else
return ((x*temp%m)*temp%m)%m;
}
int inv(int x,int m=modulo)
{
return (power(x,m-2,m))%m;
}
///IOI 2021 isA
int R,C,N,T,X,Y,X2,Y2;
vector<pair<int,int>>lolz;
int32_t main()
{
//freopen("output.txt","w",stdout);
//freopen("sorting.in","r",stdin);
cin.tie(0),iostream::sync_with_stdio(0);
cin>>R>>C>>N;
for(int i=0;i<N;i++){
cin>>Y>>X;
lolz.push_back({Y,X});
}
sort(lolz.begin(),lolz.end());
cin>>T;
while(T--){
cin>>Y>>X>>Y2>>X2;
int LAST=0,LASTX=X,FFF=0;
for(int i=Y;i<Y2;i++){
int L=LAST,R=N-1,mid,BEST=INT_MAX;
while(L<=R){
mid=(L+R)/2;
if(lolz[mid].first<i)
L=mid+1;
else if(lolz[mid].first>i)
R=mid-1;
else if(lolz[mid].second<LASTX)
L=mid+1;
else
R=mid-1,BEST=min(BEST,lolz[mid].second),FFF=max(FFF,mid);
}
LASTX=BEST,LAST=FFF;
}
//cout<<LASTX<<endl;
if(LASTX<=X2){
cout<<"YES"<<endl;
}
else
cout<<"NO"<<endl;
a:;
}
return 0;
}

Compilation message

trampoline.cpp: In function 'int32_t main()':
trampoline.cpp:73:1: warning: label 'a' defined but not used [-Wunused-label]
   73 | a:;
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 748 KB expected NO, found YES [27th token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 853 ms 4580 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 879 ms 4580 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 435 ms 4580 KB 4000 token(s): yes count is 4000, no count is 0
4 Incorrect 977 ms 4580 KB expected NO, found YES [1000th token]
# Verdict Execution time Memory Grader output
1 Correct 710 ms 4580 KB 200000 token(s): yes count is 110486, no count is 89514
2 Correct 704 ms 4580 KB 200000 token(s): yes count is 114664, no count is 85336
3 Correct 721 ms 4580 KB 200000 token(s): yes count is 86232, no count is 113768
4 Correct 735 ms 4612 KB 200000 token(s): yes count is 94603, no count is 105397
5 Correct 743 ms 4580 KB 200000 token(s): yes count is 94148, no count is 105852
6 Correct 832 ms 4580 KB 200000 token(s): yes count is 97163, no count is 102837
# Verdict Execution time Memory Grader output
1 Execution timed out 2082 ms 620 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2082 ms 4580 KB Time limit exceeded
2 Halted 0 ms 0 KB -