DMOPC '14 Contest 6 P1 - Finding Bessarion

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 128M

Author:
Problem type

Bessarion Station is perhaps the TTC's most unique subway station as the mystery behind it has attracted countless urban explorers. In fact, it's the only station that has a 5-star review on Google and a "documentary" that uncovers its secrets.

Many of them have suggested places of where the station might be, and have sent you various lists of stations. Knowing that it is next to both Leslie and Bayview stations, output Y if the list is valid or N if it is not.

Input Specification

The first line contains N (1 \le N \le 10), the number of stations.
The next N lines contain the name of the station.

Output Specification

Output Y if the list is valid or N if it is not.

Sample Input 1

5
Sheppard-Yonge
Bayview
Bessarion
Leslie
Don Mills

Sample Output 1

Y

Sample Input 2

4
Leslie
Queen's Park
Bessarion
Bayview

Sample Output 2

N

Comments


  • 1
    p1geon  commented on Oct. 22, 2019, 11:38 p.m. edit 2

    final edit: i've been banned from the problem


    • 0
      c  commented on Oct. 23, 2019, 2:14 a.m.

      RIP


      • -5
        CheezWhiz  commented on Oct. 23, 2019, 3:45 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


  • -3
    pro  commented on Sept. 30, 2017, 2:07 p.m.

    The review is actually 4.4 stars.


  • -2
    SoundwaveSuperior  commented on Nov. 21, 2015, 5:51 p.m.

    Can a station name be repeated?