Submission #228961

# Submission time Handle Problem Language Result Execution time Memory
228961 2020-05-03T07:34:04 Z VEGAnn Sunčanje (COCI18_suncanje) C++14
0 / 130
230 ms 1512 KB
#include <bits/stdc++.h>
#define PB push_back
using namespace std;
typedef long long ll;
const int N = 10100;
const int PW = 22;
bool mrk[N];
int X1[N], Y1[N], x2[N], y2[N], n;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

    cin >> n;

    for (int i = 0; i < n; i++){
        int X, Y; cin >> X1[i] >> Y1[i] >> X >> Y;
        swap(X, Y);
        x2[i] = X1[i] + X;
        y2[i] = Y1[i] + Y;
    }

    for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++){
        int mn = max(X1[i], X1[j]);
        int mx = min(x2[i], x2[j]);
        if (mn >= mx) continue;

        mn = max(Y1[i], Y1[j]);
        mx = min(y2[i], y2[j]);
        if (mn >= mx) continue;

        mrk[i] = mrk[j] = 1;
    }

    for (int i = 0; i < n; i++)
        cout << (mrk[i] ? "NE\n" : "DA\n");

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 640 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 230 ms 1228 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1408 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1408 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1408 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1408 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1408 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1408 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 14 ms 1408 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 13 ms 1512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -