Submission #1462064


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

int main()
{
  int N, M;
  cin >> N >> M;
  int latte[200000] = {}, malta[200000] = {};
  for(int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    if(a == 0) latte[b] = true;
    if(b == N - 1) malta[a] = true;
  }
  for(int i = 0; i < N; i++) {
    if(latte[i] && malta[i]) {
      cout << "POSSIBLE" << endl;
      return (0);
    }
  }
  cout << "IMPOSSIBLE" << endl;
}

Submission Info

Submission Time
Task C - Cat Snuke and a Voyage
User ei13333
Language C++14 (GCC 5.4.1)
Score 300
Code Size 466 Byte
Status AC
Exec Time 152 ms
Memory 1792 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 11
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 2 ms 1792 KB
example1 AC 2 ms 1792 KB
example2 AC 2 ms 1792 KB
example3 AC 2 ms 1792 KB
last0 AC 152 ms 1792 KB
last1 AC 149 ms 1792 KB
many0 AC 140 ms 1792 KB
many1 AC 138 ms 1792 KB
rand0 AC 99 ms 1792 KB
rand1 AC 147 ms 1792 KB
rand2 AC 88 ms 1792 KB