International Dates
Time limit1sMemory limit1024 MB
Given a date written as AA/BB/CCCC, decide whether it must be US format (MM/DD), must be European format (DD/MM), or could be either.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
You read many documents from the United States, Europe, and other countries. Their date formats are not consistent. The US writes dates as MM/DD/YYYY, while Europe writes them as DD/MM/YYYY. In other words, the US puts the month before the day, and Europe puts the day first. Given a date, determine whether it is definitely in the US format, definitely in the European format, or could be either. (There are more date formats, but since the year always comes last in this case, only these 2 formats need to be considered.)
Input
The input is a single string of 3 integers separated by forward slashes, in the form , where and . The given string is guaranteed to be a valid date in at least one of the two formats. Assume all 12 months have exactly 31 days, so months with 30 days and February need not be considered.
Output
Print US if the date does not follow the European format, or EU if the date does not follow the US format. If there is no way to know for sure which format the date follows, print either.