답안 #229998

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
229998 2020-05-07T15:25:51 Z Vimmer Sunčanje (COCI18_suncanje) C++14
0 / 130
489 ms 23548 KB
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("fast-math")
//#pragma GCC optimize("no-stack-protector")

#define F first
#define S second
#define sz(x) int(x.size())
#define pb push_back
#define N 100005
#define MOD ll(998244353)

using namespace std;

using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;

typedef short int si;

typedef tree <int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set lf, rg, up, dw;

int calcer(int x, int y, int xr, int yr)
{

}

void add(int x, int y, int xr, int yr)
{
    lf.insert(x);

    rg.insert(xr);

    up.insert(yr);

    dw.insert(y);
}

int calc(int x, int y, int xr, int yr)
{
    int kol = 0;

    kol += rg.order_of_key(x + 1);

    kol += up.order_of_key(y + 1);

    kol += sz(lf) - lf.order_of_key(xr);

    kol += sz(dw) - dw.order_of_key(yr);

    return kol;
}

int main()
{
   // freopen("input.txt", "r", stdin);// freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(0); istream::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n;

    cin >> n;

    int x[n], y[n], xr[n], yr[n];

    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i] >> xr[i] >> yr[i];

        xr[i] += x[i];

        yr[i] += y[i];
    }

    bool ans[n];

    for (int i = n - 1; i >= 0; i--)
    {
        int cx = x[i], cy = y[i], xc = xr[i], yc = yr[i];

        int kol = calc(cx, cy, xc, yc) - calcer(cx, cy, xc, yc);

        ans[i] = (kol == n - i - 1);

        add(cx, cy, xc, yc);
    }

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

Compilation message

suncanje.cpp: In function 'int calcer(int, int, int, int)':
suncanje.cpp:35:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 1408 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 34 ms 3328 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 72 ms 5752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 100 ms 7928 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 177 ms 12024 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 186 ms 12664 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 177 ms 12408 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 324 ms 17820 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 385 ms 19296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 489 ms 23548 KB Output isn't correct
2 Halted 0 ms 0 KB -