April Fools' Day Contest 1 P8 - NP-Hard

View as PDF

Submit solution


Points: 0
Time limit: 1.0s
Memory limit: 1G

Author:
Problem type

Given Q queries of an integer X, output Y if it should be and N if it should be.

Note that this problem will be online enforced, meaning that input will be given in an encrypted format. To encrypt the data, the value X in queries will be given as X' = X \oplus \text{lastAns}, where \oplus denotes the bitwise XOR operation. Note that \text{lastAns} at any time is defined as the answer to the latest query. If the latest query was a Y, \text{lastAns} = 1431655765. If the latest query was an N, \text{lastAns} = 715827882. If no queries have occurred so far, \text{lastAns} = 0.

Constraints

1 \le Q, X \le 10^5

Input Specification

The first line will contain Q, the number of queries.

The following Q lines will contain X'.

Output Specification

Output Q answers for each of the queries.

Sample Input (Unencrypted)

2
1
2

Sample Input (Encrypted)

2
1
1431655767

Sample Output

Y
Y

Comments


  • 1
    panzer_shrek  commented on Aug. 16, 2022, 9:18 p.m. edited

    First Java AC

    RNGesus must be on my side today

    (Only took 93 tries, def didn't take me 1 week to solve this mhm)