Submission #1532099


Source Code Expand

N,M = map(int,input().split(' '))

a = []
b = []
c = 0

for i in range(M):
    x,y = map(int,input().split(' '))
    if x == 1:
        a.append(y)
    elif y == N:
        b.append(x)

for i in a:
    if i in b:
        print("POSSIBLE")
        c = 1

if c == 0:
    print("IMPOSSIBLE")

Submission Info

Submission Time
Task C - Cat Snuke and a Voyage
User tokuzenw
Language Python (3.4.3)
Score 0
Code Size 309 Byte
Status TLE
Exec Time 2104 ms
Memory 10976 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 4
AC × 9
TLE × 2
Set Name Test Cases
Sample example0, example1, example2, example3
All example0, example1, example2, example3, last0, last1, many0, many1, rand0, rand1, rand2
Case Name Status Exec Time Memory
example0 AC 17 ms 2940 KB
example1 AC 17 ms 3060 KB
example2 AC 17 ms 3060 KB
example3 AC 17 ms 3060 KB
last0 AC 557 ms 3060 KB
last1 AC 538 ms 3060 KB
many0 TLE 2104 ms 10976 KB
many1 TLE 2104 ms 10964 KB
rand0 AC 349 ms 3060 KB
rand1 AC 508 ms 3060 KB
rand2 AC 305 ms 3060 KB