답안 #229013

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
229013 2020-05-03T09:00:44 Z kartel Sunčanje (COCI18_suncanje) C++14
117 / 130
4000 ms 5468 KB
#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[n] = 1;

    for (i = 1; i <= n; i++)
      for (j = i + 1; j <= n; j++)
    {
        if (min(xr[i], xr[j]) > max(xl[i], xl[j]) &&
            min(yr[i], yr[j]) > max(yl[i], yl[j])) {ans[i] = 0;break;}
        ans[i] = 1;
    }

    for (i = 1; i <= n; i++) cout << (ans[i] ? "DA" : "NE") << el;
}



# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 640 KB Output is correct
2 Correct 36 ms 768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 44 ms 888 KB Output is correct
2 Correct 1212 ms 3016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 44 ms 1144 KB Output is correct
2 Correct 1892 ms 3552 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 119 ms 1272 KB Output is correct
2 Correct 1342 ms 2980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 696 ms 1984 KB Output is correct
2 Correct 1937 ms 3764 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 501 ms 2016 KB Output is correct
2 Correct 1512 ms 3844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1565 ms 2044 KB Output is correct
2 Correct 106 ms 3964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3273 ms 2528 KB Output is correct
2 Correct 269 ms 3448 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2093 ms 2776 KB Output is correct
2 Correct 3159 ms 4732 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2201 ms 3356 KB Output is correct
2 Execution timed out 4062 ms 5468 KB Time limit exceeded