Submission #1532715
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> ii; typedef vector<int> vi; typedef vector<long long> vll; typedef vector<pair<int,int> > vii; #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss second #define pq priority_queue #define sf(x) scanf("%d",&x) int inf = (1e9) + 7; int n,m; vi graph[200005]; int visited[200005]; void dfs(int start, int rem) { if(start == n-1){ printf("POSSIBLE\n"); exit(0); } if(rem == 0) return; for(auto u: graph[start]) { if(!visited[u]) dfs(u,rem-1); } visited[start] = 1; } int main(){ cin >> n >> m; int a,b; for (int i = 0; i < m; ++i) { sf(a); sf(b); a--; b--; graph[a].pb(b); graph[b].pb(a); } memset(visited,0,sizeof(visited)); dfs(0,2); printf("IMPOSSIBLE\n"); }
Submission Info
Submission Time | |
---|---|
Task | C - 4-adjacent |
User | gtaumaturgo |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 868 Byte |
Status | RE |
Exec Time | 103 ms |
Memory | 5760 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:44:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] sf(a); ^ ./Main.cpp:45:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] sf(b); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | WA | 3 ms | 5760 KB |
0_01.txt | WA | 3 ms | 5760 KB |
0_02.txt | WA | 3 ms | 5760 KB |
0_03.txt | WA | 3 ms | 5760 KB |
0_04.txt | WA | 3 ms | 5760 KB |
1_00.txt | RE | 96 ms | 4864 KB |
1_01.txt | RE | 97 ms | 4864 KB |
1_02.txt | RE | 96 ms | 4864 KB |
1_03.txt | RE | 103 ms | 4992 KB |
1_04.txt | RE | 98 ms | 4864 KB |
1_05.txt | RE | 97 ms | 4864 KB |
1_06.txt | RE | 99 ms | 4992 KB |
1_07.txt | RE | 100 ms | 4992 KB |
1_08.txt | RE | 99 ms | 4992 KB |
1_09.txt | RE | 96 ms | 4992 KB |
1_10.txt | RE | 97 ms | 4864 KB |
1_11.txt | RE | 99 ms | 4864 KB |
1_12.txt | RE | 97 ms | 4992 KB |
1_13.txt | RE | 97 ms | 4992 KB |