Canadian Computing Competition: 2014 Stage 1, Senior #3
In order to ensure peace and prosperity for future generations, the United Nations is creating the world's largest candy. The ingredients must be taken in railway cars from the top of a mountain and poured into Lake Geneva. The railway system goes steeply from the mountaintop down to the lake, with a T-shaped branch in the middle as shown below.
Right now, each of the
For example, if the cars were in the order
- Slide car 4 out to the branch
- Slide car 1 into the lake
- Slide car 3 out to the branch
- Slide car 2 into the lake
- Slide car 3 from the branch into the lake
- Slide car 4 from the branch into the lake
Input Specification
The first line will contain the number
Due to the official test data being weak, an additional test case worth 1 mark has been added that was constructed to break solutions that are incorrect but AC on the official test data. Data are provided by
.Output Specification
For each test, output one line which will contain either Y
(for "yum") if the recipe can be completed, and N
otherwise.
Sample Input
2
4
2
3
1
4
4
4
1
3
2
Output for Sample Input
Y
N
Comments
Since the original data were weak, an additional test case worth 1 point was added, and all submissions were rejudged. Data were provied by August_Chen08.
what the heck is "heavy gravity"💀
gravity++
I love this question sm
i saw this and almost jumped off a cliff cause i thought it was graph theory but turns out it wasnt so im happy now