Submission #3604780


Source Code Expand

local n = io.read("*n")
local tab = {}
for i = 1,n do
    table.insert(tab, io.read("*l"))
end

local firStr = tab[1]
local myMap = {[firStr] = 1}
local len = string.len(firStr)
local endStr = string.sub(firStr, len, len)
local strStr = ""
local result = true
for i = 2, n do
    strStr = string.sub(tab[i], 1, 1)
    if strStr == endStr then
        result = false
        print("No")
        break
    end
    if myMap[tab[i]] then
        result = false
        print("No")
        break
    end
    myMap[tab[i]] = 1
end

if result then
    print("Yes")
end

Submission Info

Submission Time
Task B - Shiritori
User vjudge4
Language Lua (5.3.2)
Score 0
Code Size 561 Byte
Status WA
Exec Time 8 ms
Memory 888 KB

Judge Result

Set Name All Sample
Score / Max Score 0 / 200 0 / 0
Status
AC × 8
WA × 9
AC × 3
WA × 1
Set Name Test Cases
All 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 sample_01, sample_02, sample_03, sample_04
Case Name Status Exec Time Memory
max_1 WA 8 ms 888 KB
max_2 AC 1 ms 256 KB
max_3 WA 1 ms 256 KB
max_4 AC 1 ms 256 KB
min_1 WA 1 ms 256 KB
no1_1 WA 1 ms 256 KB
no1_2 WA 1 ms 256 KB
no2_1 WA 1 ms 256 KB
no2_2 AC 1 ms 256 KB
random_1 WA 1 ms 256 KB
random_2 WA 1 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB
sample_04 WA 1 ms 256 KB
yes_1 AC 1 ms 256 KB
yes_2 AC 1 ms 256 KB