Submission #3154872


Source Code Expand

Copy
n = int(input())
w_list = []
for i in range(n):
    w_list.append(input())

list = []
result = 'Yes'
for i in range(n):
    if w_list[i] not in list:
        list.append(w_list[i])
    else:
        result = 'No'

for i in range(n-1):
    if w_list[i][-1] != w_list[i+1][0]:
        result = 'No'
        break
print(result)

Submission Info

Submission Time
Task B - Shiritori
User nemunemu1112
Language Python3 (3.4.3)
Score 200
Code Size 343 Byte
Status
Exec Time 17 ms
Memory 3060 KB

Test Cases

Set Name Score / Max Score Test Cases
All 200 / 200 max_1, max_2, max_3, max_4, min_1, no1_1, no1_2, no2_1, no2_2, random_1, random_2, sample_01, sample_02, sample_03, sample_04, yes_1, yes_2
Sample 0 / 0 sample_01, sample_02, sample_03, sample_04
Case Name Status Exec Time Memory
max_1 17 ms 2940 KB
max_2 17 ms 3060 KB
max_3 17 ms 2940 KB
max_4 17 ms 3060 KB
min_1 17 ms 3060 KB
no1_1 17 ms 3060 KB
no1_2 17 ms 3060 KB
no2_1 17 ms 2940 KB
no2_2 17 ms 3060 KB
random_1 17 ms 2940 KB
random_2 17 ms 2940 KB
sample_01 17 ms 2940 KB
sample_02 17 ms 3060 KB
sample_03 17 ms 3060 KB
sample_04 17 ms 3060 KB
yes_1 17 ms 3060 KB
yes_2 17 ms 3060 KB