RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00503

Sunčanje

Unrated 레이팅 미적용
난이도
4s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

4 \(s / 256\) \(MB / 130\) points

Little Slavko dreamed of an unusual dream. One sunny morning, \(N\) white rectangles climbed one by

one on the rectangular roof of Slavko's house. They were preparing for an exotic trip to Hawaii -

sunbathing. Each rectangle chose a place on the roof and lay in such a way that its sides were

parallel to the edges of the roof. It is possible that some rectangles overlapped parts of other

rectangles that have previously lain down on Slavko's roof. For each rectangle its length \(A\) {i}{ }, height \(B\) _{i}

and distances from the left and bottom edges of the roof, \(X\) {i}{ } and \(Y\) {i}{ }, respectively, are known.

After sunset, rectangles climbed down the roof and went to sleep dreaming of beautiful Hawaii

beaches and their bodies tanned to yellow due to the sun exposure. However, the next morning they

spotted a problem! Only parts of rectangles that had been directly exposed to the sun became yellow.

In other words, if parts of a rectangle were covered by some other rectangle, then those parts didn't

change colour from white to yellow.

Sadly, rectangles that did not change the colour entirely were forced to cancel the trip.

Write a program that will determine for each rectangle if it is going to Hawaii or not.

제약

In test cases worth 10% of total points, it will hold that \(N\) ≤ 10 000.

4 \(s / 256\) \(MB / 130\) points

입력 형식

The first line contains a positive integer \(N\) (1 ≤ \(N\) ≤ 100 000), number of rectangles.
Each of the next \(N\) lines contains four integers \(X\) {i}{ }, \(Y\) {i} (0 ≤ \(X\) { }, \(Y\) ≤10 {9}{ }), \(A\) {i} and \(B\) (1 ≤ \(A\) {i}{ }, \(B\) _{i} ≤10 {9}{ }),

describing rectangles in the order they were climbing and lying down on the roof. \(X\) _{i} represents

distance from the left edge of the roof, \(Y\) {i} the distance from the bottom edge of the roof, \(A\) the length

and \(B\) {i}{ } the height of the i {th}{ } rectangle.

출력 형식

You have to print \(N\) lines. In i {th}{ } line print “DA” (Croatian for yes, without quotation marks) if i ^{th}
rectangle will go to Hawaii, otherwise print “NE” (Croatian for no).

예제 1
입력
5
1 1 4 2
6 1 1 1
2 2 2 3
3 4 3 2
4 0 1 2

3
3 3 1 1
2 2 3 3
1 1 5 5
출력
output
NE
DA
NE
DA
DA

NE
NE
DA
설명

Clarification of the first sample:
The first and the third rectangle are not entirely exposed to the sun, meaning they won’t change colour entirely
and won’t go to Hawaii. Other rectangles are exposed to the sun entirely.

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2018/2019 Contest 2

평가 및 의견

Sunčanje

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Sunčanje

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8