Submission #3775365


Source Code Expand

N,M=map(int,input().split())
x=[]
y=[]
for i in range(M):
    a,b=map(int,input().split())
    if a==1:
        x.append(b)
    if b==N:
        y.append(a)
x.sort()
y.sort()
for i in x:
    if i in y:
        print("POSSIBLE")
        break
else:
    print("IMPOSSIBLE")

Submission Info

Submission Time
Task C - Cat Snuke and a Voyage
User moro
Language PyPy3 (2.4.0)
Score 0
Code Size 287 Byte
Status TLE
Exec Time 2109 ms
Memory 59352 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 168 ms 38256 KB
example1 AC 169 ms 38256 KB
example2 AC 168 ms 38256 KB
example3 AC 170 ms 38256 KB
last0 AC 840 ms 44632 KB
last1 AC 828 ms 44120 KB
many0 TLE 2108 ms 59352 KB
many1 TLE 2109 ms 59352 KB
rand0 AC 630 ms 43608 KB
rand1 AC 815 ms 43992 KB
rand2 AC 602 ms 43608 KB