Submission #1532155
Source Code Expand
#include <bits/stdc++.h> using namespace std; int main(void) { int N,M; cin >> N >> M; int a; int b; bool s[N+100] = {false}; bool t[N+100] = {false}; for( int i = 0; i < M; i++){ cin >> a >> b; if( a == 1 ) s[b] = true; if( b == N ) t[a] = true; } for( int i = 0; i < M; i++){ if( s[i] == true && t[i] == true ){ printf("POSSIBLE"); return 0; } } printf("IMPOSSIBLE"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Cat Snuke and a Voyage |
User | toame |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 532 Byte |
Status | RE |
Exec Time | 242 ms |
Memory | 640 KB |
Judge Result
Set Name | Sample | All | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||||
Status |
|
|
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 | WA | 1 ms | 256 KB |
example1 | AC | 1 ms | 256 KB |
example2 | AC | 1 ms | 384 KB |
example3 | AC | 1 ms | 256 KB |
last0 | AC | 151 ms | 640 KB |
last1 | AC | 149 ms | 640 KB |
many0 | AC | 137 ms | 640 KB |
many1 | AC | 134 ms | 640 KB |
rand0 | AC | 98 ms | 640 KB |
rand1 | RE | 242 ms | 640 KB |
rand2 | AC | 86 ms | 640 KB |