Submission #8450546


Source Code Expand

N = int(input())
W = [input() for _ in range(N)]

now_word = W[0]

memory = [W[0]]
for i in range(1, N):
    if i % 2 == 1:  # 分身のターン
        if now_word[-1] != W[i][0]:
            print("WIN")  # 本物の勝ち
            exit()
        else:
            if W[i] not in memory:
                memory.append(W[i])
                now_word = W[i]
            else:
                print("WIN")  # 本物の勝ち
                exit()
    else:  # 本物のターン
        if now_word[-1] != W[i][0]:
            print("LOSE")  # 本物の勝ち
            exit()
        else:
            if W[i] not in memory:
                memory.append(W[i])
                now_word = W[i]
            else:
                print("LOSE")  # 本物の勝ち
                exit()
print("DRAW")

Submission Info

Submission Time
Task B - あの日したしりとりの結果を僕達はまだ知らない。
User yoshinGO
Language Python (3.4.3)
Score 100
Code Size 834 Byte
Status AC
Exec Time 17 ms
Memory 3064 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 36
Set Name Test Cases
All 00_sample_01.txt, 00_sample_02.txt, 01_freeword_01.txt, 01_freeword_02.txt, 01_freeword_03.txt, 01_min.txt, 02_randomwords_00.txt, 02_randomwords_01.txt, 02_randomwords_02.txt, 02_randomwords_03.txt, 02_randomwords_04.txt, 02_randomwords_05.txt, 02_randomwords_06.txt, 02_randomwords_07.txt, 02_randomwords_08.txt, 02_randomwords_09.txt, 03_randomconnectwords_00.txt, 03_randomconnectwords_01.txt, 03_randomconnectwords_02.txt, 03_randomconnectwords_03.txt, 03_randomconnectwords_04.txt, 03_randomconnectwords_05.txt, 03_randomconnectwords_06.txt, 03_randomconnectwords_07.txt, 03_randomconnectwords_08.txt, 03_randomconnectwords_09.txt, 04_veryshort_00.txt, 04_veryshort_01.txt, 04_veryshort_02.txt, 04_veryshort_03.txt, 04_veryshort_04.txt, 04_veryshort_05.txt, 04_veryshort_06.txt, 04_veryshort_07.txt, 04_veryshort_08.txt, 04_veryshort_09.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 17 ms 3064 KB
00_sample_02.txt AC 17 ms 3064 KB
01_freeword_01.txt AC 17 ms 3064 KB
01_freeword_02.txt AC 17 ms 3064 KB
01_freeword_03.txt AC 17 ms 3064 KB
01_min.txt AC 17 ms 3064 KB
02_randomwords_00.txt AC 17 ms 3064 KB
02_randomwords_01.txt AC 17 ms 3064 KB
02_randomwords_02.txt AC 17 ms 3064 KB
02_randomwords_03.txt AC 17 ms 3064 KB
02_randomwords_04.txt AC 17 ms 3064 KB
02_randomwords_05.txt AC 17 ms 3064 KB
02_randomwords_06.txt AC 17 ms 3064 KB
02_randomwords_07.txt AC 17 ms 3064 KB
02_randomwords_08.txt AC 17 ms 3064 KB
02_randomwords_09.txt AC 17 ms 3064 KB
03_randomconnectwords_00.txt AC 17 ms 3064 KB
03_randomconnectwords_01.txt AC 17 ms 3064 KB
03_randomconnectwords_02.txt AC 17 ms 3064 KB
03_randomconnectwords_03.txt AC 17 ms 3064 KB
03_randomconnectwords_04.txt AC 17 ms 3064 KB
03_randomconnectwords_05.txt AC 17 ms 3064 KB
03_randomconnectwords_06.txt AC 17 ms 3064 KB
03_randomconnectwords_07.txt AC 17 ms 3064 KB
03_randomconnectwords_08.txt AC 17 ms 3064 KB
03_randomconnectwords_09.txt AC 17 ms 3064 KB
04_veryshort_00.txt AC 17 ms 3064 KB
04_veryshort_01.txt AC 17 ms 3064 KB
04_veryshort_02.txt AC 17 ms 3064 KB
04_veryshort_03.txt AC 17 ms 3064 KB
04_veryshort_04.txt AC 17 ms 3064 KB
04_veryshort_05.txt AC 17 ms 3064 KB
04_veryshort_06.txt AC 17 ms 3064 KB
04_veryshort_07.txt AC 17 ms 3064 KB
04_veryshort_08.txt AC 17 ms 3064 KB
04_veryshort_09.txt AC 17 ms 3064 KB