#include <bits/stdc++.h>
#define sz(x) int(x.size())
#define in(x) freopen(x, "r", stdin)
#define out(x) freopen(x, "w", stdout)
#define N 100500
#define oo ll(1e16)
#define ft first
#define sd second
#define pb push_back
#define ppb pop_back
#define el '\n'
#define elf endl
#define base ll(1e9 + 7)
using namespace std;
typedef long long ll;
typedef long double ld;
ll n, m, xlt[N], ylt[N], xrt[N], yrt[N], rs[N];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// in("input.txt");
cin >> n;
for (int i = 0; i < n; i++) {
ll a, b;
cin >> xlt[i] >> ylt[i] >> a >> b;
xrt[i] = xlt[i] + a;
yrt[i] = ylt[i] + b;
rs[i] = 1;
}
for (int i = 0; i < n; i++)
for (int j = i + 1; j < n; j++) {
ll mn1, mx1, mn2, mx2;
mn1 = min(xrt[i], xrt[j]);
mx1 = max(xlt[i], xlt[j]);
mn2 = min(yrt[i], yrt[j]);
mx2 = max(ylt[i], ylt[j]);
if (mn1 > mx1 && mn2 > mx2) {
rs[i] = 0;
break;
}
}
for (int i = 0; i < n; i++)
if (rs[i]) cout << "DA" << el;
else cout << "NE" << el;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
512 KB |
Output is correct |
2 |
Correct |
63 ms |
896 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
67 ms |
896 KB |
Output is correct |
2 |
Correct |
2523 ms |
3468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
59 ms |
1280 KB |
Output is correct |
2 |
Correct |
3969 ms |
3848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
196 ms |
1664 KB |
Output is correct |
2 |
Correct |
2793 ms |
3416 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1346 ms |
2452 KB |
Output is correct |
2 |
Correct |
3967 ms |
4088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
930 ms |
2424 KB |
Output is correct |
2 |
Correct |
3060 ms |
3960 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3239 ms |
2524 KB |
Output is correct |
2 |
Correct |
144 ms |
4316 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4094 ms |
3192 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4094 ms |
3448 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3831 ms |
4452 KB |
Output is correct |
2 |
Execution timed out |
4054 ms |
5368 KB |
Time limit exceeded |