#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define in(x) freopen(x, "r", stdin)
#define out(x) freopen(x, "w", stdout)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")
#define F first
#define S second
#define pb push_back
#define N +100500
#define M ll(1e9 + 7)
#define sz(x) (int)x.size()
#define re return
#define oo ll(1e18)
#define el '\n'
using namespace std;
//using namespace __gnu_pbds;
//typedef tree <int, null_type, less_equal <int> , rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
int xr[N], xl[N], yl[N], yr[N], lx, ly, i, j, n, ans[N];
int main()
{
srand(time(0));
ios_base::sync_with_stdio(0);
iostream::sync_with_stdio(0);
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
// in("input.txt");
// out("output.txt");
cin >> n;
for (i = 1; i <= n; i++)
{
cin >> xl[i] >> yl[i] >> lx >> ly;
xr[i] = xl[i] + lx;
yr[i] = yl[i] + ly;
ans[i] = 1;
}
for (i = 1; i <= n; i++)
for (j = i + 1; j <= n; j++)
{
if (xr[i] >= xl[j] && xr[i] <= xr[j] && yr[i] <= yr[j] && yr[i] >= yr[j]) ans[i] = 0;
if (xr[i] >= xl[j] && xr[i] <= xr[j] && yl[i] <= yr[j] && yl[i] >= yr[j]) ans[i] = 0;
if (xl[i] >= xl[j] && xl[i] <= xr[j] && yr[i] <= yr[j] && yr[i] >= yr[j]) ans[i] = 0;
if (xl[i] >= xl[j] && xl[i] <= xr[j] && yl[i] <= yr[j] && yl[i] >= yr[j]) ans[i] = 0;
if (yr[i] >= yl[j] && yr[i] <= yr[j] && xr[i] <= yr[j] && xr[i] >= yr[j]) ans[i] = 0;
if (yr[i] >= yl[j] && yr[i] <= yr[j] && xl[i] <= yr[j] && xl[i] >= yr[j]) ans[i] = 0;
if (yl[i] >= yl[j] && yl[i] <= yr[j] && xr[i] <= yr[j] && xr[i] >= yr[j]) ans[i] = 0;
if (yl[i] >= yl[j] && yl[i] <= yr[j] && xl[i] <= yr[j] && xl[i] >= yr[j]) ans[i] = 0;
}
for (i = 1; i <= n; i++) cout << (ans[i] ? "DA" : "NE") << el;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
123 ms |
496 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
744 ms |
652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2531 ms |
960 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4067 ms |
1408 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4054 ms |
2176 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4073 ms |
2304 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4075 ms |
2296 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4064 ms |
3448 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4070 ms |
3704 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4058 ms |
4860 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |