[Solution] 2+ doors Codeforces Solution|Solution Codeforces
D. 2+ doors
time limit per test
1.5 secondsmemory limit per test
256 megabytesinput
standard inputoutput
standard outputThe Narrator has an integer array of length , but he will only tell you the size and statements, each of them being three integers , which means that , where denotes the bitwise OR operation.
Find the lexicographically smallest array that satisfies all the statements.
An array is lexicographically smaller than an array of the same length if and only if the following holds:
- in the first position where and differ, the array has a smaller element than the corresponding element in .
Input
In the first line you are given with two integers and (, ).
👇👇👇👇👇
In the next lines you are given with three integers , , and (, ) — the statements.
It is guaranteed that all statements hold for at least one array.
Output
On a single line print integers () — array .
No comments:
Post a Comment