Submission #1462380


Source Code Expand

Copy
#include <vector> 
#include <list> 
#include <map> 
#include <set> 
#include <deque> 
#include <queue> 
#include <stack> 
#include <bitset> 
#include <algorithm> 
#include <functional> 
#include <numeric> 
#include <utility> 
#include <sstream> 
#include <iostream> 
#include <iomanip> 
#include <cstdio> 
#include <cmath> 
#include <cstdlib> 
#include <cctype> 
#include <string> 
#include <cstring> 
#include <ctime> 

using namespace std;

#define _int64 long long

int can1[210000];
int can2[210000];

int main()
{
  int i,j,n,m,x,y;
  scanf("%d%d",&n,&m);
  memset(can1,0,sizeof(can1));
  memset(can2,0,sizeof(can2));
  for (i=0;i<m;i++)
  {
    scanf("%d%d",&x,&y);
    if (x==1) can1[y]=1;
    if (y==n) can2[x]=1;
  }
  for (i=2;i<n;i++)
    if ((can1[i]==1)&&(can2[i]==1))
    {
      printf("POSSIBLE\n");
      return 0;
    }
  printf("IMPOSSIBLE\n");
  return 0;
}

Submission Info

Submission Time
Task C - Cat Snuke and a Voyage
User liympanda
Language C++14 (GCC 5.4.1)
Score 300
Code Size 927 Byte
Status AC
Exec Time 37 ms
Memory 1920 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:34:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d",&n,&m);
                      ^
./Main.cpp:39:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&x,&y);
                        ^

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 1920 KB
example1 AC 2 ms 1920 KB
example2 AC 2 ms 1920 KB
example3 AC 2 ms 1920 KB
last0 AC 35 ms 1920 KB
last1 AC 35 ms 1920 KB
many0 AC 37 ms 1920 KB
many1 AC 35 ms 1920 KB
rand0 AC 23 ms 1920 KB
rand1 AC 35 ms 1920 KB
rand2 AC 21 ms 1920 KB