#DSU0000089. Giữ bí mật kết quả xét nghiệm (Anonymity Is Important)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Giữ bí mật kết quả xét nghiệm (Anonymity Is Important)
Anonymity Is Important
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
There are people numbered through . Every person is either sick or healthy, but their statuses are initially unknown.
Process operations in order:
0 l r x: publish a statement about positions through . If , everyone in the interval is healthy. If , at least one person in the interval is sick.1 j: ask whether the status of person is uniquely determined by all statements published so far.
All published statements are true and mutually consistent: at least one assignment of statuses always satisfies them. Statements are never withdrawn. Each query must consider all assignments consistent with the available information, not an arbitrary assignment.
Input
The first line contains . Each of the next lines is either 0 l r x or 1 j.
Output
For each 1 j query, print NO if definitely healthy, YES if definitely sick, or N/A otherwise.
Subtasks
- Subtask 1 (20 points): , , , , , ; mọi thông báo nhất quán.
- Subtask 2 (30 points): , , , , , ; mọi thông báo nhất quán.
- Subtask 3 (50 points): , , , , ; mọi thông báo nhất quán.
Example
Input
6 9
0 4 5 0
1 5
1 6
0 4 6 1
1 6
0 2 5 1
0 2 2 0
1 3
1 2
Output
NO
N/A
YES
YES
NO
Explanation
The first statement makes person definitely healthy, while person is unknown. After the interval is announced to contain a sick person, person must be sick.