Submission #229056

# Submission time Handle Problem Language Result Execution time Memory
229056 2020-05-03T10:24:05 Z NONAME Sunčanje (COCI18_suncanje) C++17
0 / 130
86 ms 4472 KB
#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 mn, mx;

        mn = min(xrt[i], xrt[j]);
        mx = max(xlt[i], xlt[j]);
        if (mn > mx) {
            rs[i] = 0;
            break;
        }

        mn = min(yrt[i], yrt[j]);
        mx = max(ylt[i], ylt[j]);
        if (mn > mx) {
            rs[i] = 0;
            break;
        }
    }

    for (int i = 0; i < n; i++)
        if (rs[i]) cout << "DA" << el;
            else cout << "NE" << el;
}
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 896 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 1280 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 1792 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 2424 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 2492 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 52 ms 2400 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 86 ms 3476 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 3696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 4472 KB Output isn't correct
2 Halted 0 ms 0 KB -