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=XlastAns, where denotes the bitwise XOR operation. Note that lastAns at any time is defined as the answer to the latest query. If the latest query was a Y, lastAns=1431655765. If the latest query was an N, lastAns=715827882. If no queries have occurred so far, lastAns=0.

Constraints

1Q,X105

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)

Copy
2
1
2

Sample Input (Encrypted)

Copy
2
1
1431655767

Sample Output

Copy
Y
Y

Comments


  • 0
    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)