| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366032 | khanhphucscratch | New Home (APIO18_new_home) | C++20 | 20 ms | 580 KiB |
#include<bits/stdc++.h>
using namespace std;
const int oo = 1e9;
int x[10005], type[10005], l[10005], r[10005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, m, q; cin>>n>>m>>q;
for(int i = 1; i <= n; i++) cin>>x[i]>>type[i]>>l[i]>>r[i];
for(int test = 0; test < q; test++){
int p, t; cin>>p>>t;
int ans = -oo;
for(int i = 1; i <= m; i++){
int cur = oo;
for(int j = 1; j <= n; j++) if(type[j] == i && l[j] <= t && r[j] >= t){
cur = min(cur, abs(p - x[j]));
}
ans = max(ans, cur);
}
if(ans < oo) cout<<ans<<'\n';
else cout<<-1<<'\n';
}
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
