Woburn Challenge 2017-18 Round 4 - Junior Division
Problem 1: Fight or Flight
On their way to meet up with the remaining members of the Avengers, Captain America and Thor have fallen into an ambush set up by the evil Thanos! They have suddenly found themselves face to face with the Black Order, a fearsome group of supervillains, each with their own dangerous powers. Thanos hopes to deal a crippling blow to the Avengers by taking out two of their members before the impending Infinity War has even begun!
Despite Captain America and Thor being skillful fighters in their own right, the fact that they're outnumbered poses a serious problem. With the Black Order bearing down on them, they have only moments to decide on their course of action – should they engage in combat despite the odds, or attempt to escape?
Captain America's opinion is represented by a string C, which is equal to either "Fight
" or "Run
". Similarly, Thor's opinion is represented by a string T, which is also equal to either "Fight
" or "Run
". If the two of them have the same opinion, then it's clear what they'll do! However, if their opinions differ, then their joint indecision may be their downfall…
Given the opinions of the two heroes, determine what their course of action will be – either "Fight
" or "Run
" if they agree, or "Undecided
" if they disagree.
Input Format
The first line of input consists of a single string, C.
The next line consists of a single string, T.
Output Format
Output a single string, either the heroes' course of action if they agree, or "Undecided
" if they disagree.
Sample Input 1
Run Run
Sample Output 1
Run
Sample Input 2
Fight Run
Sample Output 2
Undecided
Sample Explanations
In the first case, Captain America and Thor both agree to "Run
", while in the second case, their differing opinions result in their course of action being "Undecided
".
All Submissions
Best Solutions
Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Apr 20, 2018
Author: SourSpinach
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
It's quiet in here...