이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio();cin.tie();cout.tie();
#define en cout<<endl;
#define ops cout<<"ops"<<endl;
#define line cout<<"---------------------------"<<endl;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pllll;
typedef string str;
const ll DIM = 4e2 + 7;
const ll DIMM = 1e2 + 7;
const ll DDIM = 7;
const ll INF = 1e18 + 7;
const ll X = 1e5 + 7;
const ll BS = 2e5 + 7;
const ll AS = 26 + 7;
const ll MODULO = 1e9 + 7;
ll nt,n,m,k,q;
ll val,val1;
ll x,type,t1,t2;
ll ye;
struct z{
ll x,t1,t2;
};
vector<z> a[DIM];
ll cres,res;
int main()
{
fast;
//ll x1,y1,x2,y2;
cin>>n>>m>>k;
for(int i=1;i<=n;i++){
cin>>x>>type>>t1>>t2;
a[type].push_back({x,t1,t2});
}
for(int j=1;j<=k;j++){
cin>>x>>ye;
res=0;
for(int i=1;i<=m;i++){
cres=INF;
for(auto v:a[i]){
if(v.t1>ye || ye>v.t2)continue;
cres=min(cres,abs(x-v.x));
}
res=max(res,cres);
}
if(res==INF)cout<<-1<<endl;
else cout<<res<<endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |