| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 981473 | dimashhh | 새 집 (APIO18_new_home) | C++17 | 5078 ms | 24152 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 5, MOD = 998244353;
int n,q,k;
vector<array<int,4>> a(N);
void test(){
cin >> n >> k >> q;
for(int i = 1;i <= n;i++){
cin >> a[i][0] >> a[i][1] >> a[i][2] >> a[i][3];
}
for(int i = 1;i <= q;i++){
int y,l;
cin >> l >> y;
int res = 0;
for(int j = 1;j <= k;j++){
int mn = 1e9;
for(int x = 1;x <= n;x++){
if(a[x][1] == j && a[x][2] <= y && a[x][3] >= y){
mn = min(mn,abs(a[x][0] - l));
}
}
if(mn == 1e9){
res=-1;
break;
}
res = max(res,mn);
}
cout << res << '\n';
}
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int T = 1;
// cin >> T;
while (T--){
test();
}
}| # | 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... | ||||
