submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s510763122
p03645
C++
#include <bits/stdc++.h> using namespace std; vector<int>vecx; vector<int>vecy; int main(){ int n,m,a,b,x=0,y=0; cin>>n>>m; for(int i=0;i<m;i++){ cin>>a>>b; if(a==1){ vecx.push_back(b) x++; if(b==n){ vecy.push_back(a); y++; } } if(x==0||y==0){ cout<<"IMPOSSIBLE"<<endl; return 0; } sort(vecx.begin(),vecx.end()); sort(vecy.begin(),vecy.end()); x=0,y=0; while(x<=vecx.size()&&y<=vecy.size()){ if(vecx[x]==vecy[y]){ cout<<"POSSIBLE"<<endl; return 0; } if(vecx[x]<vecy[y])x++; else y++; } cout<<"IMPOSSIBLE"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:30: error: expected ';' before 'x' 11 | vecx.push_back(b) | ^ | ; 12 | x++; | ~ a.cc:35:2: error: expected '}' at end of input 35 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s489309615
p03645
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,m,a,b,x=0,y=0; cin>>n>>m; vector<int>vecx; vector<int>vecy; for(int i=0;i<m;i++){ cin>>a>>b; if(a==1)vecx.push_back(b); if(b==n)vecy.push_back(a); } sort(vecx.begin(),vecx.end()); sort(vecy.begin(),vecy.end()); while(max(x<=vecx.size(),0)&&y<=max(0,vecy.size())){ if(vecx[x]==vecy[y]){ cout<<"POSSIBLE"<<endl; return 0; } if(vecx[x]<vecy[y])x++; else y++; } cout<<"IMPOSSIBLE"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:15:14: error: no matching function for call to 'max(bool, int)' 15 | while(max(x<=vecx.size(),0)&&y<=max(0,vecy.size())){ | ~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:15:14: note: deduced conflicting types for parameter 'const _Tp' ('bool' and 'int') 15 | while(max(x<=vecx.size(),0)&&y<=max(0,vecy.size())){ | ~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:15:14: note: mismatched types 'std::initializer_list<_Tp>' and 'bool' 15 | while(max(x<=vecx.size(),0)&&y<=max(0,vecy.size())){ | ~~~^~~~~~~~~~~~~~~~~~ a.cc:15:40: error: no matching function for call to 'max(int, std::vector<int>::size_type)' 15 | while(max(x<=vecx.size(),0)&&y<=max(0,vecy.size())){ | ~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:15:40: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'std::vector<int>::size_type' {aka 'long unsigned int'}) 15 | while(max(x<=vecx.size(),0)&&y<=max(0,vecy.size())){ | ~~~^~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:15:40: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 15 | while(max(x<=vecx.size(),0)&&y<=max(0,vecy.size())){ | ~~~^~~~~~~~~~~~~~~
s431152378
p03645
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin >> N >> M; vector<bool> a(n),b(N); for(int i = 0;i < M;i++){ int x,y; cin >> x >> y; if(x == 1)a[y-1] = true; if(y == N)b[x-1] = false; } for(int i = 0;i < N;i++){ if(a[i]&&b[i]){ cout <<"POSSIBLE"<< endl; return 0; } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:20: error: 'n' was not declared in this scope 7 | vector<bool> a(n),b(N); | ^
s083539298
p03645
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; static const int MAX=200000; bool graph[MAX][MAX],visited[MAX],pos; int main(){ ll cunt,N,M,a,b; //N:島の個数,M:船の数 cin>>N>>M; for(int i=0;i<M;i++){ cin>>a>>b; a--;b--; graph[a][b]=graph[b][a]=true; } for(int v=1;v<N-1;v++){ if(graph[0][v]&&graph[v][N-1]) pos=true; break; } cout<<(pos?"POSSIBLE":"IMPOSSIBLE")<<"\n"; return 0; }
/tmp/cclSsX8r.o: in function `main': a.cc:(.text+0x141): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/cclSsX8r.o a.cc:(.text+0x14a): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/cclSsX8r.o collect2: error: ld returned 1 exit status
s839168455
p03645
C++
#include <bits/stdc++.h> #define INF (1<<30) #define INFLL (1ll<<60) using namespace std; map <int,int> mp; typedef pair<int, int> P; typedef long long ll; static const int MAX=200000; bool graph[MAX][MAX],visited[MAX],pos; int main(){ ll cunt,N,M,a,b; //N:島の個数,M:船の数 cin>>N>>M; for(int i=0;i<M;i++){ cin>>a>>b; a--;b--; graph[a][b]=graph[b][a]=true; } for(int v=1;v<N-1;v++){ if(graph[0][v]&&graph[v][N-1]) pos=true; break; } cout<<(pos?"POSSIBLE":"IMPOSSIBLE")<<"\n"; return 0; }
/tmp/ccdVHC2e.o: in function `main': a.cc:(.text+0x141): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/ccdVHC2e.o a.cc:(.text+0x14a): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/ccdVHC2e.o collect2: error: ld returned 1 exit status
s590742425
p03645
C++
#include <bits/stdc++.h> #define INF (1<<30) #define INFLL (1ll<<60) using namespace std; map <int,int> mp; typedef pair<int, int> P; typedef long long ll; static const int MAX=200000; ll cunt,N,M,a,b; //N:島の個数,M:船の数 bool graph[MAX][MAX],visited[MAX],pos; int main(){ cin>>N>>M; for(int i=0;i<M;i++){ cin>>a>>b; a--;b--; graph[a][b]=graph[b][a]=true; } for(int v=1;v<N-1;v++){ if(graph[0][v]&&graph[v][N-1]) pos=true; break; } cout<<(pos?"POSSIBLE":"IMPOSSIBLE")<<"\n"; return 0; }
/tmp/ccsqZ9dv.o: in function `main': a.cc:(.text+0x16e): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/ccsqZ9dv.o a.cc:(.text+0x177): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/ccsqZ9dv.o collect2: error: ld returned 1 exit status
s454983973
p03645
C++
#include <bits/stdc++.h> #define INF (1<<30) #define INFLL (1ll<<60) using namespace std; map <int,int> mp; typedef pair<int, int> P; typedef long long ll; static const int MAX=200000; int cunt,N,M,a,b; //N:島の個数,M:船の数 bool graph[MAX][MAX],visited[MAX],pos; int main(){ cin>>N>>M; for(int i=0;i<M;i++){ cin>>a>>b; a--;b--; graph[a][b]=graph[b][a]=true; } for(int v=1;v<N-1;v++){ if(graph[0][v]&&graph[v][N-1]) pos=true; break; } cout<<(pos?"POSSIBLE":"IMPOSSIBLE")<<"\n"; return 0; }
/tmp/cc1JqqPe.o: in function `main': a.cc:(.text+0x166): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/cc1JqqPe.o a.cc:(.text+0x16f): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/cc1JqqPe.o collect2: error: ld returned 1 exit status
s885329969
p03645
C++
#include <bits/stdc++.h> using namespace std; static const int MAX=200000; int cunt,N,M,a,b; //N:島の個数,M:船の数 bool graph[MAX][MAX],visited[MAX],pos; int main(){ cin>>N>>M; for(int i=0;i<M;i++){ cin>>a>>b; a--;b--; graph[a][b]=graph[b][a]=true; } for(int v=1;v<N-1;v++){ if(graph[0][v]&&graph[v][N-1]) pos=true; break; } cout<<(pos?"POSSIBLE":"IMPOSSIBLE")<<"\n"; return 0; }
/tmp/ccD5byR7.o: in function `main': a.cc:(.text+0x166): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/ccD5byR7.o a.cc:(.text+0x16f): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/ccD5byR7.o collect2: error: ld returned 1 exit status
s319753481
p03645
C++
#include <bits/stdc++.h> using namespace std; static const int MAX=200000; int cunt,N,M,a,b; //N:島の個数,M:船の数 bool graph[MAX][MAX],visited[MAX],pos; void dfs(int v){ visited[v]=true; for(int v2=0;v2<N;v2++){ if(!graph[v][v2]||visited[v2]||cunt>=2)continue; cunt++; cout<<v<<v2<<"\n"; if(v2==N-1)pos=true; dfs(v2); cunt--; } visited[v]=false; } int main(){ cin>>N>>M; for(int i=0;i<M;i++){ cin>>a>>b; a--;b--; graph[a][b]=graph[b][a]=true; } dfs(0); cout<<(pos?"POSSIBLE":"IMPOSSIBLE")<<"\n"; return 0; }
/tmp/ccz7xFQH.o: in function `dfs(int)': a.cc:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccz7xFQH.o a.cc:(.text+0x5c): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccz7xFQH.o a.cc:(.text+0xcf): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/ccz7xFQH.o a.cc:(.text+0x10b): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccz7xFQH.o /tmp/ccz7xFQH.o: in function `main': a.cc:(.text+0x231): relocation truncated to fit: R_X86_64_PC32 against symbol `pos' defined in .bss section in /tmp/ccz7xFQH.o collect2: error: ld returned 1 exit status
s040969119
p03645
C++
#include<iostream> #include<vector> #include<algorithm> struct root{ std::size_t one, other; root() :one{}, other{} {} friend std::istream& operator>> ( std::istream&is, root&p) { return is >> p.one >> p.other; } }; /* auto find = [&](auto x)->bool { auto it = std::find(std::begin(vc), std::end(vc), x); return it != std::end(vc); };*/ template<class T> bool find(const std::vector<T>&v,const T&val) { auto e_ = std::end(v); auto it = std::find(std::begin(v),e_,val); return e_ != it; } auto push = [&](bool b, auto x)->void { if (b) vc.emplace_back(x); }; int main() { std::size_t N, M;//target, size; std::cin >> N >> M; std::vector<root> vr; vr.resize(M); for (auto &e : vr) { std::cin >> e; } std::sort(std::begin(vr), std::end(vr), [](const auto &e,const auto &e1)->bool { return e.one < e1.one; }); std::vector<size_t> vc; vc.emplace_back(1); for (const auto&e : vr) { auto no_other = find(vc, e.one) && !find(vc, e.other);// auto no_one= !find(vc, e.one) && find(vc, e.other); if (no_one) { vc.emplace_back(e.one); } if (no_other) { vc.emplace_back(e.other); } } /* for (const auto&e : vc) { std::cout << e << "\n"; }*/ auto exist = find(vc,N); std::cout << (exist ? "POSSIBLE" : "IMPOSSIBLE") << "\n"; std::cin >> M; return 0; }
a.cc:30:14: error: non-local lambda expression cannot have a capture-default 30 | auto push = [&](bool b, auto x)->void { | ^ a.cc: In lambda function: a.cc:31:17: error: 'vc' was not declared in this scope 31 | if (b) vc.emplace_back(x); | ^~
s948620690
p03645
C++
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<stack> #include<map> #include<string> #include<algorithm> #include<cstdio> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define pb push_back #define P pair<int,int> #define ll __int64 //#define __int64 long long const ll M=1000000007; int n,m; vector<int>G[211111]; int main(){ cin>>n>>m; rep(i,m){ int a,b; cin>>a>>b; a--;b--; G[a].push_back(b); G[b].push_back(a); } rep(i,G[0].size()){ rep(j,G[G[0][i]].size()){ if(G[G[0][i]][j]==n-1){ cout<<"POSSIBLE"<<endl; return 0; } } } cout<<"IMPOSSIBLE"<<endl; return 0; }
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:18:7: note: in expansion of macro 'll' 18 | const ll M=1000000007; | ^~
s579799020
p03645
C++
#include<iostream> using namespace std; typedef long long ll; ll N, M; bool adj[200000][200000]; bool memo[200000]; const ll WHITE = 0; const ll BLACK = 1; bool DFS(int depth, ll pos){ memo[pos] = BLACK; if(depth==2){ if(pos==N-1) return true; else return false; }else{ bool flag; flag = false; for(ll i=0; i<N; i++){ if(adj[pos][i] && memo[i]==WHITE){ flag = DFS(depth+1, i); if(flag) return flag; } } return flag; } } int main(){ cin >> N >> M; ll a, b; for(ll i=0; i<N; i++){ memo[i] = WHITE; for(ll j=0; j<N; j++){ adj[i][j] = false; } } for(ll i=0; i<M; i++){ cin >> a >> b; a--; b--; adj[a][b] = true; adj[b][a] = true; } if(DFS(0, 0)){ cout << "POSSIBLE" << endl; }else{ cout << "IMPOSSIBLE" << endl; } }
/tmp/ccK0l9uv.o: in function `DFS(int, long long)': a.cc:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `memo' defined in .bss section in /tmp/ccK0l9uv.o a.cc:(.text+0x7f): relocation truncated to fit: R_X86_64_PC32 against symbol `memo' defined in .bss section in /tmp/ccK0l9uv.o /tmp/ccK0l9uv.o: in function `main': a.cc:(.text+0x113): relocation truncated to fit: R_X86_64_PC32 against symbol `memo' defined in .bss section in /tmp/ccK0l9uv.o collect2: error: ld returned 1 exit status
s173032779
p03645
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int many = 0; int check[] = new int[M]; int ab[][] = new int[2][M]; boolean ans = false; int k = 0; for (int i = 0; M > i; i++) { ab[0][i] = sc.nextInt(); ab[1][i] = sc.nextInt(); if (ab[0][i] == 1) { check[k] = ab[1][i]; many++; k++; } } lave: for (int j = 0; M > j; j++) { if (ab[1][j] == N) { for (int l = 0; many >= l; l++) { if (ab[0][j] == check[l]) { ans = true; break lave; } } } } if (ans == true) { System.out.println("POSSIBLE"); } else { System.out.println("IMPOSSIBLE"); } } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s043596752
p03645
C++
#include <iostream> #include <algorithm> #define r(i,n) for(int i=0; i<n; i++) using namespace std; int main(void){ int n, m; int a, b; bool a1[200010]; bool an[200010]; cin >> n >> m; r(i,m){ cin >> a >> b; if(a>b){ swap(a,b); } if(a==1){ a1[b]=true; } if(b==n){ an[a]=true; } } if(flag){ cout << "POSSIBLE" << endl; } r(i,n+1){ if(a1[i]==true && an[i]==true){ cout << "POSSIBLE" << endl; return 0; } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:6: error: 'flag' was not declared in this scope 23 | if(flag){ | ^~~~
s549828529
p03645
C++
#include <algorithm> #include <cmath> #include <iostream> #include <iomanip> #include <map> #include <string> #include <vector> #include <queue> #include <stack> #include <set> #include <list> #define INF 10000000000ll #define MOD 1000000007ll #define EPS 1e-10 #define REP(i,m) for(long long i=0; i<m; i++) #define FOR(i,n,m) for(long long i=n; i<m; i++) #define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; } #define ALL(v) v.begin(),v.end() #define pb push_back using namespace std; typedef long long int ll; typedef pair<ll, ll> P; typedef long double ld; using namespace std; int main(){ int n, m; cin >> n >> m; int first[n] = { }; int second[n] = { }; REP(i, m){ int a, b; cin >> a >> b; if(a == 1) first[b-1] = 1; if(b == n) second[a-1] = 1; } int ans = 0; REP(i, n){ if(first[i] == 1 && second[i] == 1) ans = 1 } if(ans) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:60: error: expected ';' before '}' token 39 | if(first[i] == 1 && second[i] == 1) ans = 1 | ^ | ; 40 | } | ~
s125327578
p03645
C++
#include <algorithm> #include <cmath> #include <iostream> #include <iomanip> #include <map> #include <string> #include <vector> #include <queue> #include <stack> #include <set> #include <list> #define INF 10000000000ll #define MOD 1000000007ll #define EPS 1e-10 #define REP(i,m) for(long long i=0; i<m; i++) #define FOR(i,n,m) for(long long i=n; i<m; i++) #define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; } #define ALL(v) v.begin(),v.end() #define pb push_back using namespace std; typedef long long int ll; typedef pair<ll, ll> P; typedef long double ld; using namespace std; int main(){ int n, m; cin >> n >> m; int first[n] = { }; int second[n] = { ); REP(i, m){ int a, b; cin >> a >> b; if(a) first[b-1] = 1; if(b == n) second[a-1] = 1; } int ans = 0; REP(i, n){ if(first[i] == 1 && second[i] == 1) ans = 1; } if(ans) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:30:27: error: expected primary-expression before ')' token 30 | int second[n] = { ); | ^ a.cc:30:27: error: expected '}' before ')' token 30 | int second[n] = { ); | ~ ^
s077767147
p03645
C++
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define repr(i,a,b) for(int i=(int)(a-1);i>=b;i--) #define rep(i,n) repl(i,0,n) #define each(itr,v) for(auto itr:v) #define pb(s) push_back(s) #define all(x) (x).begin(),(x).end() #define dbg(x) cout << #x" = " << x << endl #define maxch(x,y) x=max(x,y) #define minch(x,y) x=min(x,y) #define uni(x) x.erase(unique(all(x)),x.end()) #define exist(x,y) (find(all(x),y)!=x.end()) #define bcnt(x) bitset<32>(x).count() typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; #define INF INT_MAX/3 set<int> edge[2]; int main(){ cin.sync_with_stdio(false); int n, m; cin >> n >> m; rep(i, m) { int a, b; cin >> a >> b; if (a == 1) edge[0].insert(b); else if (b == 1) edge[0].insert(a); if (a == n) edge[1].insert(b); else if (b == n) edge[1].insert(a); } if (edge[0].count(n)) { cout << "POSSIBLE" << endl; } else { bool ok = false; each(i, edge[0]) { ok |= edge[1].count(i); if (ok) break; } if (ok) cout << "POSSIBLE" << endl; else cout <, "IMPOSSIBLE" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:49:20: error: expected primary-expression before ',' token 49 | else cout <, "IMPOSSIBLE" << endl; | ^ a.cc:49:35: error: invalid operands of types 'const char [11]' and '<unresolved overloaded function type>' to binary 'operator<<' 49 | else cout <, "IMPOSSIBLE" << endl; | ~~~~~~~~~~~~~^~~~~~~
s548474112
p03645
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll n, m; cin.tie(0); sync_with_stdio(false); cin >> n >> m; vector<vector<bool>> vv; vv = vector<vector<bool>>(m, vector<bool>(m, false)); for(ll i=0;i<n;i++){ ll a, b; cin >> a >> b; vv[a-1][b-1] = true; } if (m == 1){ cout << "IMPOSSIBLE" << endl; return 0; } for(ll i=1;i<n;i++){ if (vv[0][i] == true){ if (vv[i][n-1] == true){ cout << "POSSIBLE" << endl; return 0; } } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: 'sync_with_stdio' was not declared in this scope 8 | sync_with_stdio(false); | ^~~~~~~~~~~~~~~
s976011868
p03645
C++
#include <iostream> using namespace std; int main(){ int n,m,na,nb; cin >> n >> m; vector<bool> a(n,false),b(n,false); for(int i=0;i<m;i++){ cin >> na >> nb; if(na == 1) a[nb] = true; else if (nb == n) b[na] = true; } bool flag = false; for(int i=1;i<n;i++){ if(a[i] && b[i]){ flag = true; break; } } if(flag == true) cout << "POSSIBLE"; else cout << "IMPOSSIBLE"; return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'vector' was not declared in this scope 7 | vector<bool> a(n,false),b(n,false); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:7:16: error: expected primary-expression before 'bool' 7 | vector<bool> a(n,false),b(n,false); | ^~~~ a.cc:10:29: error: 'a' was not declared in this scope 10 | if(na == 1) a[nb] = true; | ^ a.cc:11:35: error: 'b' was not declared in this scope 11 | else if (nb == n) b[na] = true; | ^ a.cc:16:20: error: 'a' was not declared in this scope 16 | if(a[i] && b[i]){ | ^ a.cc:16:28: error: 'b' was not declared in this scope 16 | if(a[i] && b[i]){ | ^
s677558066
p03645
C++
#include <iostream> using namespace std; int main(){ int n,m; cin >> n >> m; int ab[m][2]; for(int i=0;i<m;i++) cin >> ab[i][0] >> ab[i][1]; bool flag = false; for(int i=0;i<m;i++){ if(ab[i][0] == 1){ for(int j=0;j<m;j++){ if(ab[j][0] == ab[i][1] && ab[j][1] == n){ flag = true; break; } } } }
a.cc: In function 'int main()': a.cc:20:10: error: expected '}' at end of input 20 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s136284750
p03645
C
#include <stdio.h> int main () { int a [ 200001 ] = { 0 }; int n ,m ,x ,y ,i ; scanf (“%d%d” ,&n ,&m ); int flag = 0 ; for (i = 1 ; i <= m ; i ++) { scanf (“%d%d” ,&x ,&y ); if(x == 1 && y != n ) { a [ y ] ++; } if(y == n && x != 1 ) { a [ x ] ++; } if (a [ x ] == 2 || a [ y ] == 2 ) { flag = 1 ; } } if (flag == 1 )printf (“POSSIBLE \ n” ); else printf (“IMPOSSIBLE \ n” ); return 0 ; }
main.c:2:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '\U0000ff08\U0000ff09' 2 | int main () | ^~~~ main.c:6:17: error: stray '\342' in program 6 | scanf <U+FF08><U+201C><U+FF05>d<U+FF05>d<U+201D> <U+FF0C><U+FF06>n <U+FF0C><U+FF06>m <U+FF09>; | ^~~~~~~~ main.c:6:24: error: stray '\342' in program 6 | scanf <U+FF08><U+201C><U+FF05>d<U+FF05>d<U+201D> <U+FF0C><U+FF06>n <U+FF0C><U+FF06>m <U+FF09>; | ^~~~~~~~ main.c:10:25: error: stray '\342' in program 10 | scanf <U+FF08><U+201C><U+FF05>d<U+FF05>d<U+201D> <U+FF0C><U+FF06>x <U+FF0C><U+FF06>y <U+FF09>; | ^~~~~~~~ main.c:10:32: error: stray '\342' in program 10 | scanf <U+FF08><U+201C><U+FF05>d<U+FF05>d<U+201D> <U+FF0C><U+FF06>x <U+FF0C><U+FF06>y <U+FF09>; | ^~~~~~~~ main.c:24:35: error: stray '\342' in program 24 | if <U+FF08>flag == 1 <U+FF09>printf <U+FF08><U+201C>POSSIBLE \ n<U+201D> <U+FF09>; | ^~~~~~~~ main.c:24:45: error: stray '\' in program 24 | if (flag == 1 )printf (“POSSIBLE \ n” ); | ^ main.c:24:48: error: stray '\342' in program 24 | if <U+FF08>flag == 1 <U+FF09>printf <U+FF08><U+201C>POSSIBLE \ n<U+201D> <U+FF09>; | ^~~~~~~~ main.c:25:23: error: stray '\342' in program 25 | else printf <U+FF08><U+201C>IMPOSSIBLE \ n<U+201D> <U+FF09>; | ^~~~~~~~ main.c:25:35: error: stray '\' in program 25 | else printf (“IMPOSSIBLE \ n” ); | ^ main.c:25:38: error: stray '\342' in program 25 | else printf <U+FF08><U+201C>IMPOSSIBLE \ n<U+201D> <U+FF09>; | ^~~~~~~~
s531872378
p03645
C
#include<iostream> #include<cstdlib> #include<cstdio> #include<algorithm> #include<string> #include<cmath> #include<cstring> using namespace std; int main() { int n,m,i,w=0,j,t,a[200002],b[200002]; cin>>n>>m; for(i=0;i<m;i++) { cin>>a[i]>>b[i]; } for(i=0;i<m;i++) { if(w==1)break; if(a[i]==1) t=b[i]; for(j=0;j<m;j++) { if(a[j]==t&&b[j]==n) { cout<<"POSSIBLE"<<endl; w=1; break; } } } if(w!=1) cout<<"IMPOSSIBLE"<<endl; return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s946339235
p03645
C++
#include<Stdio.h> int a[300000],b[300000]; int main() { int i,f,a1,b1,n,k; f=0; scanf("%d%d",&k,&n); for(i=1;i<=n;i++) { scanf("%d%d",&a1,&b1); if(a1==1) a[b1]=1; if(b1==k) b[a1]=1; } for(i=1;i<=n;i++) if(a[i]&&b[i]) f=1; if(f==1) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); }
a.cc:1:9: fatal error: Stdio.h: No such file or directory 1 | #include<Stdio.h> | ^~~~~~~~~ compilation terminated.
s254848551
p03645
C++
#include<Stdio.h> int a[300000],b[300000]; int main() { int i,f,a1,b1,n,k; f=0; scanf("%d%d",&k,&n); for(i=1;i<=n;i++) { scanf("%d%d",&a1,&b1); if(a1==1) a[b1]=1; if(b1==k) b[a1]=1; } for(i=1;i<=n;i++) if(a[i]&&b[i]) f=1; if(f==1) printf("POSSBLE\n"); else printf("IMPOSSBLE\n"); }
a.cc:1:9: fatal error: Stdio.h: No such file or directory 1 | #include<Stdio.h> | ^~~~~~~~~ compilation terminated.
s781876006
p03645
C
#include<Stdio.h> int a[300000],b[300000]; int main() { int i,f,a1,b1,n,k; f=0; scanf("%d%d",&k,&n); for(i=1;i<=n;i++) { scanf("%d%d",&a1,&b1); if(a1==1) a[b1]=1; if(b1==k) b[a1]=1; } for(i=1;i<=n;i++) if(a[i]&&b[i]) f=1; if(f==1) printf("POSSBLE\n"); else printf("IMPOSSBLE\n"); }
main.c:1:9: fatal error: Stdio.h: No such file or directory 1 | #include<Stdio.h> | ^~~~~~~~~ compilation terminated.
s311583910
p03645
C
#include<stdio.h> int main() { int n,m,vis[200001]; while(scanf("%d%d",&n,&m)!=EOF) { int u,v; bool flag=false; for(int i=1;i<=n;i++) vis[i]=false; for(int i=1;i<=m;i++) { scanf("%d%d",&u,&v); if(flag) continue; if(u==1) { if(vis[v]) { flag=true; } vis[v]=true; }else if(v==n) { if(vis[u]) { flag=true; } vis[u]=true; } } if(flag) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); break; } return 0; }
main.c: In function 'main': main.c:8:9: error: unknown type name 'bool' 8 | bool flag=false; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <stdbool.h> 2 | int main() main.c:8:19: error: 'false' undeclared (first use in this function) 8 | bool flag=false; | ^~~~~ main.c:8:19: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:8:19: note: each undeclared identifier is reported only once for each function it appears in main.c:19:26: error: 'true' undeclared (first use in this function) 19 | flag=true; | ^~~~ main.c:19:26: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
s925904934
p03645
C
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> int main() { int i,j,k,l,n,m,a[200005],b[200005]; scanf("%d%d",&n,&m); k=0; for(i=0;i<m;i++) { scanf("%d%d",&a[i],&b[i]); if(b[i]==n) k++; } if(k=0) printf("IMPOSSIBLE\n"); else { l=0; for(i=0;i<m;i++) { if(b[i]==n) b[i]=0; else continue; for(j=0;j<m;j++) { if(a[j]==1&&b[j]==a[i]) l++; } } if(l>0) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); } }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s548185725
p03645
C
#include<stdio.h> int main() { int n,m,a[200009],b[200009],i,j; scanf("%d%d",&n,&m); for(i=1;i<=m;i++) scanf("%d%d",&a[i],&b[i]); for(i=1;i<=m;i++) if(a[i]==1) { for(j=1;j<=m;j++) if((b[j]==n)&&b[i]==a[j]) { printf("POSSIBLE\n"); return 0; } else printf("IMPOSSIBLE\n"); } } }
main.c:22:1: error: expected identifier or '(' before '}' token 22 | } | ^
s602294141
p03645
C
#include<stdio.h> int main() { int N,M; int a,j,o,i,b; int c[200000]; int d[200000]; while(scanf("%d %d",&N,&M)!=EOF) { int k=0; int f=0; for(i=0;i<M;i++) { scanf("%d %d",&a,&b); if(a==1||b==N) { c[k]=a; d[k]=b; k++; } } if(k) { for(j=0;j<k;j++) { for(o=0;o<k;o++) { if(d[j]==c[o]) { f=true; } } } } if(f) { printf("POSSIBLE\n"); } else { printf("IMPOSSIBLE\n"); } } return 0; }
main.c: In function 'main': main.c:30:35: error: 'true' undeclared (first use in this function) 30 | f=true; | ^~~~ main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <stdbool.h> 2 | int main() main.c:30:35: note: each undeclared identifier is reported only once for each function it appears in 30 | f=true; | ^~~~
s035814063
p03645
C
#include<iostream> #include<cstdio> #include<vector> #include<map> #include<set> #include<queue> #include<cmath> #include<string> #include<cstring> #include<algorithm> using namespace std; typedef long long LL; const LL INF=1e18; const int MAXN=2e5+100; const double eps=1e-10; bool vis[MAXN]; int main() { long long int n,t,o; int a[100],b[100]; while(~scanf("%lld%lld",&n,&t)) { o=0; for(int i=0;i<t;i++) { scanf("%lld %lld",&a[i],&b[i]); } for(int i=0;i<t;i++) { if(b[i]==n) { for(int j=0;j<t;j++) { if(b[j]==a[i]&&a[j]==1) { o=1; } } } } if(o!=1) printf("IMPOSSIBLE\n"); else printf("POSSIBLE\n"); } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s462233281
p03645
C
#include<stdio.h> #include<string.h> typedef long long LL; const LL INF=1e18; const int MAXN=2e5+100; const double eps=1e-10; bool vis[MAXN]; int main() { long long int n,t,o; int a[100],b[100]; while(~scanf("%lld%lld",&n,&t)) { o=0; for(int i=0;i<t;i++) { scanf("%lld %lld",&a[i],&b[i]); } for(int i=0;i<t;i++) { if(b[i]==n) { for(int j=0;j<t;j++) { if(b[j]==a[i]&&a[j]==1) { o=1; } } } } if(o!=1) printf("IMPOSSIBLE\n"); else printf("POSSIBLE\n"); } return 0; }
main.c:7:1: error: unknown type name 'bool' 7 | bool vis[MAXN]; | ^~~~ main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 2 | #include<string.h> +++ |+#include <stdbool.h> 3 | typedef long long LL; main.c:7:6: error: variably modified 'vis' at file scope 7 | bool vis[MAXN]; | ^~~
s641690511
p03645
C
#include<stdio.h> int main() { int n,t,o; int a[100],b[100]; while(~scanf("%d%d",&n,&t)) { o=0; for(int i=0;i<t;i++) { scanf("%d %d",&a[i],&b[i]); } for(int i=0;i<t;i++) { if(b[i]==n) { for(int j=0;j<t;j++) { if(b[j]==a[i]&&a[j]==1) { o=1; } } } } if(o!=1) printf("IMPOSSIBLE\n"); else printf("POSSIBLE\n"); } return 0; }
main.c: In function 'main': main.c:31:8: error: invalid suffix ";" on integer constant 31 | return 0; | ^~~ main.c:31:11: error: expected ';' before '}' token 31 | return 0; | ^ | ; 32 | } | ~
s203080108
p03645
C++
#define Ll long long using namespace std; const int N=2e5+5; vector<int>h[N]; int n,m,x,y; void dfs(int x,int y){ if(y>2)return; if(x==n){cout<<"POSSIBLE";exit(0);} for(int k=0;k<h[x].size();k++) dfs(h[x][k],y+1); } int main() { scanf("%d%d",&n,&m); for(int i=1;i<=m;i++){ scanf("%d%d",&x,&y); h[x].push_back(y); } dfs(1,0); cout<<"IMPOSSIBLE"; }
a.cc:4:1: error: 'vector' does not name a type 4 | vector<int>h[N]; | ^~~~~~ a.cc: In function 'void dfs(int, int)': a.cc:8:18: error: 'cout' was not declared in this scope 8 | if(x==n){cout<<"POSSIBLE";exit(0);} | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #define Ll long long a.cc:8:35: error: 'exit' was not declared in this scope 8 | if(x==n){cout<<"POSSIBLE";exit(0);} | ^~~~ a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' +++ |+#include <cstdlib> 1 | #define Ll long long a.cc:9:23: error: 'h' was not declared in this scope 9 | for(int k=0;k<h[x].size();k++) | ^ a.cc: In function 'int main()': a.cc:14:9: error: 'scanf' was not declared in this scope 14 | scanf("%d%d",&n,&m); | ^~~~~ a.cc:17:17: error: 'h' was not declared in this scope 17 | h[x].push_back(y); | ^ a.cc:20:9: error: 'cout' was not declared in this scope 20 | cout<<"IMPOSSIBLE"; | ^~~~ a.cc:20:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s647202468
p03645
C++
def main() n, m = gets.chomp.split.map(&:to_i) from_1 = [] from_n = [] m.times do keiro = gets.chomp.split.map(&:to_i) from_1 << keiro.last if keiro.first == 1 from_n << keiro.first if keiro.last == n return puts "POSSIBLE" if (from_1 & from_n).first end puts "IMPOSSIBLE" end main()
a.cc:1:1: error: 'def' does not name a type 1 | def main() | ^~~
s067548255
p03645
C++
def main() n, m = gets.chomp.split.map(&:to_i) from_1 = [] from_n = [] m.times do keiro = gets.chomp.split.map(&:to_i) from_1 << keiro.last if keiro.first == 1 from_n << keiro.first if keiro.last == n return puts "POSSIBLE" if (from_1 & from_n).first end puts "IMPOSSIBLE" end main
a.cc:1:1: error: 'def' does not name a type 1 | def main() | ^~~
s079452450
p03645
C++
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, M; cin >> N >> M; int from[200000] = {}; int to[200000] = {}; int f, t; for (int i=0; i<M; i++) { cin >> f >> t; from[i] = f; to[i] = t; } queue<int> q; q.push(1); while (not q.empty()) { current = q.front(); q.pop(); for (int i=0; i<M; i++) { if (from[i] == current) { if (to[i] == N) { cout << "POSSIBLE" << endl; return 0; } else { q.push(to[i]); } } else if (to[i] == current) { // from < to q.push(from[i]); } } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:38:7: error: 'current' was not declared in this scope 38 | current = q.front(); | ^~~~~~~
s127061036
p03645
C++
#include <stdio.h> #include <vector> #include<iostream> #include<queue> using namespace std; int const N = 2 * 1e5 + 1; int n, m; bool vis[N]; int cost[N], parent[N]; queue<int> qu; vector<vector<int> > g; void BFS(int src) { memset(vis, false, sizeof vis); memset(cost, 0, sizeof cost); memset(parent, -1, sizeof parent); qu.push(src); vis[src] = true; while(!qu.empty()) { int fr = qu.front(); qu.pop(); for(int i = 0; i < (int)g[fr].size(); ++i) { int u = g[fr][i]; if(!vis[u]) { qu.push(u); vis[u] = true; cost[u] = cost[fr] + 1; parent[u] = fr; } } } } int main() { scanf("%d %d", &n, &m); g.resize(n); for(int i = 0, a, b ; i < m; ++i) { scanf("%d %d", &a, &b); a--; b--; g[a].push_back(b); } BFS (0); if ( cost[n - 1] <= 2 && parent[ n - 1] != -1 ) puts("POSSIBLE"); else puts("IMPOSSIBLE"); return 0; }
a.cc: In function 'void BFS(int)': a.cc:14:3: error: 'memset' was not declared in this scope 14 | memset(vis, false, sizeof vis); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<queue> +++ |+#include <cstring> 5 | using namespace std;
s053542096
p03645
C++
#include <iostream> #include <cstring> using namespace std; int u[200001],v[200001],vis[200001]; int first[200005],next[200005]; int main() { int n,m,k,kk,flag=0; cin>>n>>m; for(int i=1;i<=n;i++) first[i]=-1; for(int i=0;i<m;i++) { cin>>u[i]>>v[i]; next[i]=first[u[i]]; first[u[i]]=i; } k=first[1]; while(k!=-1) { kk=first[v[k]]; while(kk!=-1) { if(v[kk]==n)flag=1; kk=next[kk]; } k=next[k]; } if(flag)cout<<"POSSIBLE"; else cout<<"IMPOSSIBLE"; }
a.cc: In function 'int main()': a.cc:17:9: error: reference to 'next' is ambiguous 17 | next[i]=first[u[i]]; | ^~~~ In file included from /usr/include/c++/14/string:47, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:6:19: note: 'int next [200005]' 6 | int first[200005],next[200005]; | ^~~~ a.cc:27:16: error: reference to 'next' is ambiguous 27 | kk=next[kk]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:6:19: note: 'int next [200005]' 6 | int first[200005],next[200005]; | ^~~~ a.cc:29:11: error: reference to 'next' is ambiguous 29 | k=next[k]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:6:19: note: 'int next [200005]' 6 | int first[200005],next[200005]; | ^~~~
s402034776
p03645
C++
#include <bits/stdc++.h> using namespace std; list<int> li[200000]; int main() { int n,m,a,b; cin >> n >> m; for(int i=0;i<m;i++){ scanf(" %d %d",&a,&b); li[a-1].push_back(b-1); } list<int>::iterator itr; for(itr = li[0].begin();itr!=li[0].end();itr++){ a = *itr; list<int>::iterator itr2; for(itr2 = li[a].begin();itr2!=li[a].end();itr2++){ if(li[a][*itr2] == n-1){ cout << "POSSIBLE" << endl; return 0; } } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:21: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<int>' and 'int') 23 | if(li[a][*itr2] == n-1){ | ^
s093256305
p03645
C++
#include <bits/stdc++.h> using namespace std; list<int> li[200000]; int main() { int n,m,a,b; cin >> n >> m; for(int i=0;i<m;i++){ scanf(" %d %d",&a,&b); li[a-1].push_back(b-1); } list<int>::iterator itr; for(itr = li[0].begin();itr!=li[0].end();itr++){ a = *itr; list<int>::iterator itr2; for(itr2 = li[a].begin();itr2!=li[a].end();itr2++){ if(vec[a][*itr2] == n-1){ cout << "POSSIBLE" << endl; return 0; } } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:16: error: 'vec' was not declared in this scope 23 | if(vec[a][*itr2] == n-1){ | ^~~
s644027030
p03645
C
#include <stdio.h> int main(void) { int n, m; scanf("%d %d", &n, &m); int a[m], b[m]; int i; for(i=0,i<m;i++) scanf("%d %d", &a[i], &b[i]); int t; int u; int p == 0; for(t=0;t<n;t++){ if(a[t] == 1) u = b[t]; for(i=0;i<n;i++){ if (a[i] == u) if (b[i] ==n) p == 1; } } if(p) puts("POSSIBLE"); else puts("IMPOSSIBLE"); return 0; }
main.c: In function 'main': main.c:9:20: error: expected ';' before ')' token 9 | for(i=0,i<m;i++) | ^ | ; main.c:14:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token 14 | int p == 0; | ^~ main.c:14:11: error: expected expression before '==' token main.c:22:25: error: 'p' undeclared (first use in this function) 22 | p == 1; | ^ main.c:22:25: note: each undeclared identifier is reported only once for each function it appears in
s155001142
p03645
C++
#include<iostream> #include <set> using namespace std; int main() { int N; int M; cin >> N >> M; bool flag = false; set<int> orgList; set<int> destList; for (auto i = 0; i < M; ++i) { int a; int b; cin >> a >> b; if (a == 1) { orgList.insert(b); } if (b == N) { destList.insert(a); } } for (auto entry : orgList) { if (destList.count(entry.second) > 0) { flag = true; break; } } if (!flag) { cout << "IM"; } cout << "POSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:28:26: error: request for member 'second' in 'entry', which is of non-class type 'int' 28 | if (destList.count(entry.second) > 0) { | ^~~~~~
s423869810
p03645
Java
import java.util.*; public class Maini { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); boolean[] is1 = new boolean[N]; boolean[] isN = new boolean[N]; for(int i = 0; i < M; i++){ int a = sc.nextInt(); int b = sc.nextInt(); if(a == 1) is1[b] = true; if(b == 1) is1[a] = true; if(a == N) isN[b] = true; if(b == N) isN[a] = true; } int i; for(i = 2; i < N; i++){ if(is1[i]){ if(isN[i]){ System.out.println("POSSIBLE"); break; } } } if(i == N){ System.out.println("IMPOSSIBLE"); } } }
Main.java:2: error: class Maini is public, should be declared in a file named Maini.java public class Maini { ^ 1 error
s188281859
p03645
C++
#include<iostream> using namespace std; int main() { long long int n,m,i,j=0,k,l,p=0,q; cin>>n>>m; long long a[m],b[m],c[m],d[m]; for(i=0;i<m;i++) { cin>>a[i]>>b[i]; } for(i=0;i<m;i++) if(a[i]==1) { d[p]=i; p++; } for(i=0;i<m;i++) if(b[i]==n) { c[j]=i; j++; } if(j&&p) for(i=0;i<j;i++) { k=c[i]; if(a[k]==1) { cout<<"POSSIBLE"; return 0; } for(l=0;l<p;l++) { q=d[l] if(b[q]==a[k]) { cout<<"POSSIBLE"; return 0; } } } cout<<"IMPOSSIBLE"; return 0; }
a.cc: In function 'int main()': a.cc:35:7: error: expected ';' before 'if' 35 | q=d[l] | ^ | ; 36 | if(b[q]==a[k]) | ~~
s556605225
p03645
C
#include <stdio.h> int main(){ int n,m,a,b; scanf("%d%d",&n,&m); int boat[n+1] = {0}; for(int i=0; i<m; i++){ scanf("%d%d",&a,&b); if(a == 1){ if(boat[b]>0){ printf("POSSIBLE"); return 0; } boat[b]++; } if(b == n){ if(boat[a]>0){ printf("POSSIBLE"); return 0; } boat[a]++; } } printf("IMPOSSIBLE"); return 0; }
main.c: In function 'main': main.c:5:19: error: variable-sized object may not be initialized except with an empty initializer 5 | int boat[n+1] = {0}; | ^
s439026800
p03645
C++
#include <iostream> #include <vector> #include <array> #include <algorithm> #include <string> using namespace std; int main(void){ int in_roop; int target; array<array<int,2>,200000> ship{}; cin >> target >> in_roop; for(int i=0;i<in_roop;i++){ cin >> ship[i][0] >> ship[i][1]; } vector<int> pos_first; for(int i=0;i<in_roop;i++){ if(A[0]==1){ pos_first.push_back(A[1]); } else if(A[1] == 1){ pos_first.push_back(A[0]); } } bool judge = false; for(int i=0;i<in_roop;i++){ for(int J:pos_first){ if(A[0]==J || A[1] == J){ if(A[0]==target || A[1] ==target){ judge=true; break; } } } if(judge)break; } if(judge){ cout << "POSSIBLE" << endl; }else{ cout << "IMPOSSIBLE" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:12: error: 'A' was not declared in this scope 17 | if(A[0]==1){ | ^ a.cc:26:16: error: 'A' was not declared in this scope 26 | if(A[0]==J || A[1] == J){ | ^
s631886401
p03645
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); final int N = s.nextInt(); final int M = s.nextInt(); boolean[] hasRouteFrom1 = new boolean[N]; boolean[] hasRouteToN = new boolean[N]; for(int i = 0 ; i < M; i++) { int from = s.nextInt(); int to = s.nextInt(); if(from == 1) { hasRouteFrom1[to] = true; } if(to == N) { hasRouteToN[from] = true; } } boolean possible = false; for(int i = 0; i < N; i++) { if(hasRouteFrom1[i] && hasRouteToN[i]) { possible = true; } } if(possible) { System.out.println("POSSIBLE"); } else { System.out.println("IMPOSSIBLE"); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s162889646
p03645
C++
#include <iostream> #include <vector> using namespace std; int main void(){ int a,b; int M,N; cin>>N>>M; vector<int>a_list,b_list,transit; while(cin>>a>>b){ a_list.push_back(a); b_list.push_back(b); if(a == 1){ transit.push_back(b); } } for(int i = 0; i<a_list.size();i++){ for(int j= 0 ; j < transit.size(); j++){ if(a_list[i] == transit[j]){ if(b_list[i]== N){ cout<<"POSSIBLE"<<endl; } } cout<<"IMPOSSIBLE"<<endl; return 0; }
a.cc:4:10: error: expected initializer before 'void' 4 | int main void(){ | ^~~~
s826460881
p03645
C++
#include <iostream> #include <vector> using namespacestd ; int main ( ) { int n,m; cin >> n >> m; vector<bool> vis ( n+1, false ) ; bool ans = false ; f o r ( int i = 0 ; i < m; i++) { int a , b ; cin >> a >> b ; assert ( 1 <= a && a < b && b <= n ) ; if ( a == 1 ) { if ( vis [ b ] ) { ans = true ; } vis [ b ] = true ; } else if ( b == n ) { if ( vis [ a ] ) { ans = true ; } vis [ a ] = true ; } } if ( ! ans ) cout << ”IM ” ; cout << ”POSSIBLE” << e n dl ; return 0 ; }
a.cc:25:22: error: extended character ” is not valid in an identifier 25 | if ( ! ans ) cout << ”IM ” ; | ^ a.cc:25:26: error: extended character ” is not valid in an identifier 25 | if ( ! ans ) cout << ”IM ” ; | ^ a.cc:26:9: error: extended character ” is not valid in an identifier 26 | cout << ”POSSIBLE” << e n dl ; | ^ a.cc:26:9: error: extended character ” is not valid in an identifier a.cc:3:7: error: expected nested-name-specifier before 'namespacestd' 3 | using namespacestd ; | ^~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n >> m; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:7:1: error: 'vector' was not declared in this scope 7 | vector<bool> vis ( n+1, false ) ; | ^~~~~~ a.cc:7:1: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:7:8: error: expected primary-expression before 'bool' 7 | vector<bool> vis ( n+1, false ) ; | ^~~~ a.cc:9:1: error: 'f' was not declared in this scope 9 | f o r ( int i = 0 ; i < m; i++) { | ^ a.cc:9:21: error: 'i' was not declared in this scope 9 | f o r ( int i = 0 ; i < m; i++) { | ^ a.cc:25:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 25 | if ( ! ans ) cout << ”IM ” ; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:25:22: error: '\U0000201dIM' was not declared in this scope 25 | if ( ! ans ) cout << ”IM ” ; | ^~~ a.cc:26:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 26 | cout << ”POSSIBLE” << e n dl ; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:26:9: error: '\U0000201dPOSSIBLE\U0000201d' was not declared in this scope 26 | cout << ”POSSIBLE” << e n dl ; | ^~~~~~~~~~ a.cc:26:23: error: 'e' was not declared in this scope 26 | cout << ”POSSIBLE” << e n dl ; | ^
s967124855
p03645
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n,m; int a=0,b=0; int v[200001]; memset(v,0,sizeof(v)); bool ispos=false; cin>>n>>m; for(int i=0;i<m;i++){ cin >>a>>b; if(a==1){ v[b]++; if(v[b]==2){ispos=true;break;} } if(b==n){ v[a]++; if(v[a]==2){ispos=true;break;} } } if(ispos)cout<<"POSSIBLE"<<endl; else cout<<"IMPOSSIBLE"<<endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'memset' was not declared in this scope 11 | memset(v,0,sizeof(v)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 |
s509891392
p03645
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n,m; int a=0,b=0; bool s[200001],g[200001]; memset(s, false, sizeof(s)); memset(g, false, sizeof(g)); bool ispos=false; cin>>n>>m; for(int i=0;i<m;i++){ cin >>a>>b; if(a==1){ s[b]=true; } if(b==n){ g[a]=true; } } for (int i=0; i<n; i++) { if(s[i]&&g[i]){ ispos=true; } } if(ispos)cout<<"POSSIBLE"<<endl; else cout<<"IMPOSSIBLE"<<endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'memset' was not declared in this scope 11 | memset(s, false, sizeof(s)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 |
s172571815
p03645
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n,m; int a=0,b=0; bool s[200001],g[200001]; memset(s, false, sizeof(s)); memset(g, false, sizeof(g)); bool ispos=false; cin>>n>>m; for(int i=0;i<m;i++){ cin >>a>>b; if(a==1){ s[b]=true; } if(b==n){ g[a]=true; } } for (int i=0; i<n; i++) { if(s[i]&&g[i])cout<<"POSSIBLE"<<endl; ispos=true; } if(!ispos)cout<<"IMPOSSIBLE"<<endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'memset' was not declared in this scope 11 | memset(s, false, sizeof(s)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 |
s308084063
p03645
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int n,m; int a=0,b=0; bool s[200001],g[200001]; memset(s, false, sizeof(s)); memset(g, false, sizeof(g)); bool ispos=false; cin>>n>>m; for(int i=0;i<m;i++){ cin >>a>>b; if(a==1){ s[b]=true; } if(b==n){ g[a]=true; } } for (int i; i<n; i++) { if(s[i]&&g[i])cout<<"POSSIBLE"<<endl; ispos=true; } if(!ispos)cout<<"IMPOSSIBLE"<<endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'memset' was not declared in this scope 11 | memset(s, false, sizeof(s)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 |
s092672656
p03645
C++
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n >> m; if (m == 1) { cout << "IMPOSSIBLE" << endl; return 0; } vector<pair<int, int>> ls; ls.reserve(m); for(int i = 0; i < m; i++) { int a, b; cin >> a >> b; ls.emplace_back(a, b); } for(int i = 0; i < m; i++) { if(count(ls.begin(), ls.end(), pair<int, int>(1, i)) != 0 && count(ls.begin(), ls.end(), pair<int, int>(i, n)) != 0) { cout << "POSSIBLE" << endl; return 0; } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:29:20: error: 'count' was not declared in this scope 29 | if(count(ls.begin(), ls.end(), pair<int, int>(1, i)) != 0 && count(ls.begin(), ls.end(), pair<int, int>(i, n)) != 0) | ^~~~~
s656683439
p03645
C
#include <stdio.h> int main(void) { int n,m; int i; int flag = 0; int iki[200000]; int kaeri[200000]; scanf("%d %d",&n,&m); for(i=0;i<n;i++){ iki[i] = 0; kaeri[i] = 0; } for(i=0;i<m;i++){ scanf("%d %d",&a,&b); if(a==1) iki[b]=1; if(b==n) kaeri[a]=1; } for(i=0;i<m;i++){ if((iki[i] == 1)&&(kaeri[i] == 1)){ printf("POSSIBLE"); flag = 1; break; } } if(flag == 0){ printf("IMPOSSIBLE"); } return 0; }
main.c: In function 'main': main.c:18:32: error: 'a' undeclared (first use in this function) 18 | scanf("%d %d",&a,&b); | ^ main.c:18:32: note: each undeclared identifier is reported only once for each function it appears in main.c:18:35: error: 'b' undeclared (first use in this function) 18 | scanf("%d %d",&a,&b); | ^
s536857824
p03645
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> using namespace std; int main(){ long long int n,m,a,b,some,count=0,some1[200],some2[200; cin>>n>>m; for(int i=0;i<m;i++){ cin>>a>>b; if(a==1){ some1[b]=1; } else if(b==n){ some2[a]=1; } } for(int i=2;i<n;i++){ if(some1[i]==1 && some2[i]==1){ count++; } } printf("%s\n",(count>0)? "POSSIBLE":"IMPOSSIBLE"); return 0; }
a.cc: In function 'int main()': a.cc:7:64: error: expected ']' before ';' token 7 | long long int n,m,a,b,some,count=0,some1[200],some2[200; | ^ | ] a.cc:15:25: error: 'some2' was not declared in this scope; did you mean 'some1'? 15 | some2[a]=1; | ^~~~~ | some1 a.cc:19:35: error: 'some2' was not declared in this scope; did you mean 'some1'? 19 | if(some1[i]==1 && some2[i]==1){ | ^~~~~ | some1
s993189494
p03645
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,M;cin>>N>>M; vector<int> toM; vector<int> fromONE; for(int i=0;i<M;i++){ int a,b; cin>>a>>b; if(a==1&&b==N) continue; if(b==N){ toM.push_back(a); }if(a==1){ fromONE.push_back(b); } } sort(toM.begin(),toM.end(),greater<int>()); sort(fromONE.begin(),fromONE.end(),greater<int>()); //cout<<toM[0]<<" "<<fromONE[0]<<endl; bool flag=true; int i=0,j=0; while(i<toM.size()&&j<fromONE.size()){ if(toM[i]==fromONE[j]){ cout<<"POSSIBLE"<<endl; flag=false; break; } if(toM[i]>fromONE[j])j++; else i++; } if(flag==false)break; if(flag) cout<<"IMPOSSIBLE"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:32:18: error: break statement not within loop or switch 32 | if(flag==false)break; | ^~~~~
s284722313
p03645
C++
#include <cstdio> #include <iostream> #include <vector> #include <stdlib.h> using namespace std; struct node { int dis; int last; struct node *next; }; node ** T = (node **)malloc(200001*sizeof(node)); void insert(int index,int dis) { //新建一个node node *new_node = (node*)malloc(sizeof(node)); new_node->dis = dis; new_node->next = NULL; //将新建的node插入hash_code对应链表的最后 node* p = T[index]; if (p == NULL) { T[index] = new_node; return; } while (p->next != NULL) p = p->next; p->next = new_node; } int main(){ int M,N; cin >> M >> N; for(int i = 0; i < N; i++){ int a,b; cin >> a >> b; insert(a,b); insert(b,a); if(b == M) T[a]->last = 1; } node * tmp = (node*) malloc(sizeof(node)); tmp = T[1]; if(tmp == NULL) { cout << "IMPOSSIBLE" << endl; } else{ while(tmp != NULL){ /*node * tmp1 = (node*)malloc(sizeof(node)); tmp1 = T[tmp->dis]; if(tmp1 == NULL) { cout << "IMPOSSIBLE" << endl;*/ if(T[tmp->dis] == NULL) { cout << "IMPOSSIBLE" << endl; } } else{/* while(tmp1!=NULL){ if(tmp1->dis == M) { cout << "POSSIBLE" << endl; return 0; } else{ tmp1 = tmp1->next; } }*/ if(T[tmp-dis]->last == 1){ cout << "POSSIBLE" <<endl; return 0; } else{ tmp = tmp->next;} } } } free(tmp); cout << "IMPOSSIBLE" << endl; /* for(int i = 0; i < N; i++){ int a,b; cin >> a >> b; T[a][b] = T[b][a] = 1; } if(N == 1){ cout << "IMPOSSIBLE" <<endl; } else{ for(int i = 2; i <= M; i++){ if(T[1][i] == 1){ if(T[i][M] == 1) { cout << "POSSIBLE" << endl; return 0; } } } cout << "IMPOSSIBLE" << endl; }*/ }
a.cc: In function 'int main()': a.cc:67:25: error: 'else' without a previous 'if' 67 | else{/* | ^~~~ a.cc:79:43: error: 'dis' was not declared in this scope; did you mean 'div'? 79 | if(T[tmp-dis]->last == 1){ | ^~~ | div a.cc: At global scope: a.cc:88:13: error: expected constructor, destructor, or type conversion before '(' token 88 | free(tmp); | ^ a.cc:89:9: error: 'cout' does not name a type 89 | cout << "IMPOSSIBLE" << endl; | ^~~~ a.cc:116:1: error: expected declaration before '}' token 116 | } | ^
s991056983
p03645
C++
#i n cl u d e <i o s t re am> #i n cl u d e <v e c t o r> u si n g namespace s t d ; i n t main ( ) { i n t n , m; ci n >> n >> m; v e c t o r<bool> v i s ( n+1, f a l s e ) ; b o ol ans = f a l s e ; f o r ( i n t i = 0 ; i < m; i++) { i n t a , b ; ci n >> a >> b ; i f ( a == 1 ) { i f ( v i s [ b ] ) { ans = t r u e ; } v i s [ b ] = t r u e ; } e l s e i f ( b == n ) { i f ( v i s [ a ] ) { ans = t r u e ; } v i s [ a ] = t r u e ; } } i f ( ! ans ) c ou t << ”IM ” ; c ou t << ”POSSIBLE” << e n dl ; r e t u r n 0 ; }
a.cc:1:2: error: invalid preprocessing directive #i; did you mean #if? 1 | #i n cl u d e <i o s t re am> | ^ | if a.cc:2:2: error: invalid preprocessing directive #i; did you mean #if? 2 | #i n cl u d e <v e c t o r> | ^ | if a.cc:24:25: error: extended character ” is not valid in an identifier 24 | i f ( ! ans ) c ou t << ”IM ” ; | ^ a.cc:24:29: error: extended character ” is not valid in an identifier 24 | i f ( ! ans ) c ou t << ”IM ” ; | ^ a.cc:25:11: error: extended character ” is not valid in an identifier 25 | c ou t << ”POSSIBLE” << e n dl ; | ^ a.cc:25:11: error: extended character ” is not valid in an identifier a.cc:3:1: error: 'u' does not name a type 3 | u si n g namespace s t d ; | ^ a.cc:4:1: error: 'i' does not name a type 4 | i n t main ( ) { | ^
s406749021
p03645
C++
int n,m; scanf("%d %d",&n,&m); int a[m],b[m]; int temp = 0; for(int i = 0; i < m; i++){ scanf("%d %d",&a[i],&b[i]); } int ans = 0,cnt = 0; for(int i = 0; i < m; i++){ if(a[i] == 1 && b[i] == 2){ cnt++; temp = b[i]; } if(a[i] == temp + 1){ cnt++; temp = a[i]; } if(temp == n){ cnt++; ans = 1; } } if(ans == 1 && cnt <=2) cout << "POSSIBLE" << endl; else{ cout << "IMPOSSIBLE" << endl; }
a.cc:3:14: error: expected constructor, destructor, or type conversion before '(' token 3 | scanf("%d %d",&n,&m); | ^ a.cc:4:15: error: size of array 'a' is not an integral constant-expression 4 | int a[m],b[m]; | ^ a.cc:4:20: error: size of array 'b' is not an integral constant-expression 4 | int a[m],b[m]; | ^ a.cc:6:9: error: expected unqualified-id before 'for' 6 | for(int i = 0; i < m; i++){ | ^~~ a.cc:6:24: error: 'i' does not name a type 6 | for(int i = 0; i < m; i++){ | ^ a.cc:6:31: error: 'i' does not name a type 6 | for(int i = 0; i < m; i++){ | ^ a.cc:10:9: error: expected unqualified-id before 'for' 10 | for(int i = 0; i < m; i++){ | ^~~ a.cc:10:24: error: 'i' does not name a type 10 | for(int i = 0; i < m; i++){ | ^ a.cc:10:31: error: 'i' does not name a type 10 | for(int i = 0; i < m; i++){ | ^ a.cc:25:9: error: expected unqualified-id before 'if' 25 | if(ans == 1 && cnt <=2) cout << "POSSIBLE" << endl; | ^~ a.cc:26:9: error: expected unqualified-id before 'else' 26 | else{ | ^~~~
s038618400
p03645
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int target, num; String str = br.readLine(); StringTokenizer st = new StringTokenizer(str); target = Integer.parseInt(st.nextToken()); num =Integer.parseInt(st.nextToken()); boolean A[] = new boolean[200001]; boolean B[] = new boolean[200001]; Arrays.fill(A,false); Arrays.fill(B,false); for (int i = 0; i < num; i++) { int tmp1, tmp2; str = br.readLine(); st = new StringTokenizer(str); tmp1 = Integer.parseInt(st.nextToken()); tmp2 = Integer.parseInt(st.nextToken()); if (tmp1 == 1) { A[tmp2] = true; } else if (tmp2 == target) { B[tmp1] = true; } } for (int i = 0; i <= 200000; i++) { if (A[i] && B[i]) { System.out.println("POSSIBLE"); return 0; } } System.out.println("IMPOSSIBLE"); } }
Main.java:20: error: cannot find symbol Arrays.fill(A,false); ^ symbol: variable Arrays location: class Main Main.java:21: error: cannot find symbol Arrays.fill(B,false); ^ symbol: variable Arrays location: class Main Main.java:38: error: incompatible types: unexpected return value return 0; ^ 3 errors
s433855463
p03645
C++
#include <algorithm> #include <iostream> using namespace std; int main(){ long long int N,M,a[200000],b[200000],c=200001,d=200002; cin>>N>>M; for(int i=0;i<M;i++){ cin>>a[i]>>b[i]; } for(int i=0;i<M;i++){ if(a[i]==1){ c=b[i]; } for(int j=0;j<M;j++) if(b[j]==N){ d=a[j]; } if(c==d){ cout<<"POSSIBLE"<<endl; return 0; } } } cout<<"IMPOSSIBLE"<<endl; }
a.cc:25:1: error: 'cout' does not name a type 25 | cout<<"IMPOSSIBLE"<<endl; | ^~~~ a.cc:26:1: error: expected declaration before '}' token 26 | } | ^
s839444774
p03645
C++
include <iostream> using namespace std; int main(void){ int N,M,a[200000],b[200000],ke,ke2,flag=0,x=0; cin>>N>>M; for(int i=0;i<M;i++){ cin>>a[i]>>b[i]; if(b[i]==N)x=1; } if(x==0)cout<<"IMPOSSIBLE"<<endl; else{ for(int i=0;i<M;i++){ if(a[i]==1){ ke=b[i]; for(int j=0;j<M;j++){ if(a[j]==ke){ if(b[j]==N){ cout<<"POSSIBLE"<<endl; ke2=j; break; } if(b[j]!=N){ break; } } } } if(b[ke2]==N)break; if(i==M-1)cout<<"IMPOSSIBLE"<<endl; } } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope 5 | cin>>N>>M; | ^~~ a.cc:10:13: error: 'cout' was not declared in this scope 10 | if(x==0)cout<<"IMPOSSIBLE"<<endl; | ^~~~ a.cc:10:33: error: 'endl' was not declared in this scope 10 | if(x==0)cout<<"IMPOSSIBLE"<<endl; | ^~~~ a.cc:18:29: error: 'cout' was not declared in this scope 18 | cout<<"POSSIBLE"<<endl; | ^~~~ a.cc:18:47: error: 'endl' was not declared in this scope 18 | cout<<"POSSIBLE"<<endl; | ^~~~ a.cc:29:23: error: 'cout' was not declared in this scope 29 | if(i==M-1)cout<<"IMPOSSIBLE"<<endl; | ^~~~ a.cc:29:43: error: 'endl' was not declared in this scope 29 | if(i==M-1)cout<<"IMPOSSIBLE"<<endl; | ^~~~
s140254097
p03645
C++
#include <bits/stdc++.h> using namespace std; struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast; typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef queue<int> qi; typedef stack<int> si; typedef deque<int> dqi; #define reps(i, a, b) for (int i = a; i < b; ++i) #define rep(i, n) reps(i, 0, n) #define REPS(i, a, b) reps(i, a, b) #define REP(i, n) rep(i, n) #define deps(i, a, b) for (int i = a; i >= b; --i) #define dep(i, n) deps(i, n, 0) #define DEPS(i, a, b) deps(i, a, b) #define DEP(i, n) dep(i, n) #define pf push_front #define pb push_back #define mp make_pair #define fst first #define FST fst #define sec second #define SEC sec #define sz(obj) ((int)(obj).size()) #define all(v) (v).begin(), (v).end() #define ALL(v) all(v) const int INF = 999999999; const int MOD = 1e9 + 7; const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;} inline int in() {int x; std::cin >> x; return x;} template <typename T> void print(std::vector<T>& v, char c = ' ') { REP(i, v.size()) { if (i != 0) std::cout << c; std::cout << v[i]; } std::cout << endl; } template <typename T> void print(T x) { std::cout << x << '\n'; } bool s[200005], tn[200005]; signed main() { int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; if (a == 1) { s[b] = true; } if (b == n) { tn[a] == true; } } for (int i = 0; i <= n; i++) { if (s[i] and tn[i]) { printf("POSSIBLE\n"); return 0; } } printf("IMPOSSIBLE\n") return (0); }
a.cc: In function 'int main()': a.cc:71:25: error: expected ';' before 'return' 71 | printf("IMPOSSIBLE\n") | ^ | ; 72 | 73 | return (0); | ~~~~~~
s279483453
p03645
C++
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> a; vector<int> b; int n,m;cin >> n >> m; for(int i=0; i<m; i++){ int k1,k2;cin >> k1 >> k2; if(k1==n||k2==n){ a.push_back(n); b.push_back(k2-n:k2?k1); }else if(k1==1||k2==1){ a.push_back(1); b.push_back(k2-1:k2?k1); }else continue; } for(int i=2; i<m-1; i++){ bool s=0,e=0; for(int j=0; j<a.size(); j++){ if(i==b[j]){ if(a[j]==1)s=true; else e=true; } if(s&&e){ cout << "POSSIBLE\n"; return 0; } } } cout << "IMPOSSIBLE\n"; return 0; }
a.cc: In function 'int main()': a.cc:12:23: error: found ':' in nested-name-specifier, expected '::' 12 | b.push_back(k2-n:k2?k1); | ^ | :: a.cc:12:22: error: 'n' is not a class, namespace, or enumeration 12 | b.push_back(k2-n:k2?k1); | ^ a.cc:12:29: error: expected ':' before ')' token 12 | b.push_back(k2-n:k2?k1); | ^ | : a.cc:12:29: error: expected primary-expression before ')' token a.cc:15:23: error: expected ')' before ':' token 15 | b.push_back(k2-1:k2?k1); | ~ ^ | )
s621569535
p03645
Java
import java.util.*; import java.lang.*; class Main { public static void main(String []_){ Vector<int> bet = new Vector<int>(); int n, m; int i; int a, b; int len; Scanner input = new Scanner(System.in); n = input.nextInt(); m = input.nextInt(); for(i=0; i<m; i++){ a = input.nextInt(); b = input.nextInt(); if(a==1){ if(bet.indexOf(b)){ System.out.println("Possible"); System.exit(0); } bet.add(b); } if(b==n){ if(bet.indexOf(a)){ System.out.println("Possible"); System.exit(0); } bet.add(a); } } System.out.println("Inpossible"); return 0; } }
Main.java:5: error: as of release 9, '_' is a keyword, and may not be used as an identifier public static void main(String []_){ ^ 1 error
s838040065
p03645
C++
#include <cstdio> #include <iostream> #include <vector> #include <algorithm>s using namespace std; int i = 0, j = 0, ans = 0, tmp = 0,a,b; int main() { cin.tie(0); ios::sync_with_stdio(false); int n ,m; cin >> n >> m; ans = 0; vector<int> s; vector<int> g; int sc = 0, gc = 0; int i = 0, j = 0, ans = 0, tmp = 0; for (i; i < m; ++i) { cin >> a >> b; if (a == 1) { s.push_back(b); sc++; } else if (b == n) { g.push_back(a); gc++; } } sort(s.begin(), s.end()); sort(g.begin(), g.end()); i = 0; j = 0; while (1) { if (i > sc - 1 || j > gc - 1) { break; } if ( s[i] == g[j]) { ans = 1; break; } if (s[i] < g[j]) { i++; } else { j++; } } if (ans == 0) { printf("IMPOSSIBLE\n"); } else { printf("POSSIBLE\n"); } cin >> a; return 0; }
a.cc:4:10: fatal error: algorithm>: No such file or directory 4 | #include <algorithm>s | ^~~~~~~~~~~~ compilation terminated.
s583277533
p03645
C++
cout<<"POSSIBLE"<<endl;
a.cc:1:9: error: 'cout' does not name a type 1 | cout<<"POSSIBLE"<<endl; | ^~~~
s939205366
p03645
C++
#include <cstdio> #include <iostream> #define zz b[j].x1-b[j].x0+b[i].x1-b[i].x0+1==n&&b[j].x1=b[i].x0 const int maxn = 200005; using namespace std; struct point { int x0, x1; }a[maxn], b[maxn]; int main() { int n, m, j = 1, nn, k = 1; scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++){ scanf("%d%d", &a[i].x0, &a[i].x1); if (a[i].x0 == 1 || a[i].x1 == n) { b[j++] = a[i]; } } nn = j - 1; for (int j = 1; j <= nn / 2 + 1; j++) for (int i = 1; i <= nn; i++) { if (i != j && zz ) { printf("POSSIBLE"); return 0; } } printf("IMPOSSIBLE"); return 0; }
a.cc: In function 'int main()': a.cc:3:48: error: lvalue required as left operand of assignment 3 | #define zz b[j].x1-b[j].x0+b[i].x1-b[i].x0+1==n&&b[j].x1=b[i].x0 | ^ a.cc:22:27: note: in expansion of macro 'zz' 22 | if (i != j && zz ) { | ^~
s021385697
p03645
C++
#include<iostream> #include<vector> #include <algorithm> using namespace std; int main(){ int n,m; cin>>n>>m; vector<int> st,end; int a,b; for(int i=0;i<m;i++){ cin>>a>>b; if(a=1){ st.push_back(b); } if(b=n){ end.push_back(a); } } for(int x : st){ auto itr = find(end.begin(),end.end(),x); if(!itr==end.end()){ cout<<"POSSIBLE"<<endl; return 0; } } cout<<"IMPOSSIBLE"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:8: error: no match for 'operator!' (operand type is '__gnu_cxx::__normal_iterator<int*, std::vector<int> >') 22 | if(!itr==end.end()){ | ^~~~ a.cc:22:8: note: candidate: 'operator!(bool)' (built-in) a.cc:22:8: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'bool'
s117337403
p03645
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n,m; cin>>n>>m; vector<int> st,end; int a,b; for(int i=0;i<m;i++){ cin>>a>>b; if(a=1){ st.push_back(b); } if(b=n){ end.push_back(a); } } for(int x : st){ auto itr = find(end.begin(),end.end(),x); if(!itr==end.end()){ cout<<"POSSIBLE"<<endl; return 0; } } cout<<"IMPOSSIBLE"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:20:20: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 20 | auto itr = find(end.begin(),end.end(),x); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:20:20: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 20 | auto itr = find(end.begin(),end.end(),x); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
s089468847
p03645
C++
#include<cstdio> int a[10000]; int b[10000]; int main() { int n,m,A,B; int j,k,,i,x,y,temp; scanf("%d%d",&n,&m); { temp=0; j=0,k=0; for(i=0;i<m;i++) { scanf("%d%d",&A,&B); if(A==1) { a[j]=B; j++; } if(B==n) { b[k]=A; k++; } } for(x=0;x<j;x++) { for(y=0;y<k;y++) if(a[x]==b[y]) { temp=1; break; } } if(temp) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); } return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: expected unqualified-id before ',' token 7 | int j,k,,i,x,y,temp; | ^
s407427994
p03645
C++
#include <iostream> #include <cstdio> using namespace std; int a[200005],b[200005],c[200005]; int main() { int n,m,i,j,k,l; int flag=0; while(scanf("%d%d",&n,&m)!=EOF) { for(i=0;i<m;i++) { scanf("%d%d",&a[i],&b[i]);} for(i=0,j=0,k=0;i<m;i++) {if(a[i]==1&&a[i]!=n) { b[j++]=a[i]; } if(a[i]==n) { c[k++]=a[i]; } } sort(b,b+j); sort(c,c+k); for(i=0;i<j&&l<k;) { if(b[i]==c[l]){flag=1;break;} else if(b[i]>c[l])l++; else if(b[i]<c[l])i++; } if(flag)printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); } return 0; }
a.cc: In function 'int main()': a.cc:25:13: error: 'sort' was not declared in this scope; did you mean 'short'? 25 | sort(b,b+j); | ^~~~ | short
s936353691
p03645
C
#include<stdio.h> const int N=10000; int a[N][N]; int main() { int n,m,x; while(scanf("%d%d",&n,&m)!=EOF) { int flag=1; for(int i=0;i<m;i++) for(int j=0;j<2;j++) { scanf("%d",&a[i][j]); } for(int i=0;i<m;i++) { int x; if(a[i][0]==1) { x=a[i][1]; for(int j=0;j<m;j++) { if(a[j][0]==x&&a[j][1]==n) { printf("POSSIBLE\n"); flag=0; } } } } if(flag) { printf("IMPOSSIBLE\n"); } } }
main.c:4:5: error: variably modified 'a' at file scope 4 | int a[N][N]; | ^ main.c:4:5: error: variably modified 'a' at file scope
s102636570
p03645
C
#include<stdio.h> const int N=100; int a[N][N]; int main() { int n,m,x; while(scanf("%d%d",&n,&m)!=EOF) { int flag=1; for(int i=0;i<m;i++) for(int j=0;j<2;j++) { scanf("%d",&a[i][j]); } for(int i=0;i<m;i++) { int x; if(a[i][0]==1) { x=a[i][1]; for(int j=0;j<m;j++) { if(a[j][0]==x&&a[j][1]==n) { printf("POSSIBLE\n"); flag=0; } } } } if(flag) { printf("IMPOSSIBLE\n"); } } }
main.c:4:6: error: variably modified 'a' at file scope 4 | int a[N][N]; | ^ main.c:4:6: error: variably modified 'a' at file scope
s143921609
p03645
Java
import java.util.ArrayList; import java.util.IdentityHashMap; import java.util.Map; import java.util.Scanner; public class CopyOfMain { public static void main(String[] args) { Map<Integer ,Integer> map = new IdentityHashMap<Integer ,Integer>(); ArrayList<Integer> list = new ArrayList<Integer>(); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); sc.nextLine(); for (int i = 0; i < m; i++) { Integer a = new Integer(sc.nextInt()); Integer b = new Integer(sc.nextInt()); if (a == 1 || b == 1) { if (b < a) { map.put(b, a); list.add(b); } else { map.put(a, b); list.add(a); } } else if (a == n || b == n) { if (b > a) { map.put(b, a); list.add(b); } else { map.put(a, b); list.add(a); } } sc.nextLine(); } sc.close(); String result = "IMPOSSIBLE"; boolean stopFlag = false; for (Integer intI : list) { if (intI == 1) { int middle = map.get(intI); for (Integer intSubI : list) { if (intSubI == n) { // int end = map.get(intSubI); if (map.get(intSubI) == middle) { result = "POSSIBLE"; stopFlag = true; break; } } } } if (stopFlag) { break; } } System.out.println(result); } }
Main.java:6: error: class CopyOfMain is public, should be declared in a file named CopyOfMain.java public class CopyOfMain { ^ Main.java:17: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal Integer a = new Integer(sc.nextInt()); ^ Main.java:18: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal Integer b = new Integer(sc.nextInt()); ^ 1 error 2 warnings
s271424626
p03645
C++
#include <iostream> using namespace std; bool map[200001][200001]; int n,x,y,m,num=0; int main() { cin>>n>>m; for(int var1=1;var1<=m;var1++) { cin>>x>>y; map[x][y]=1; } for(int var1=1;var1<=n;var1++) { if(map[1][var1]==1&&map[var1][n]==1) { cout<<"POSSIBLE"; num++; break; } } if(num==0) cout<<"IMPOSSIBLE"; return 0; }
/tmp/ccAYnM1u.o: in function `main': a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x42): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x5e): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x6f): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x75): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x9b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0xc7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x10d): relocation truncated to fit: R_X86_64_PC32 against symbol `num' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x116): relocation truncated to fit: R_X86_64_PC32 against symbol `num' defined in .bss section in /tmp/ccAYnM1u.o a.cc:(.text+0x122): additional relocation overflows omitted from the output collect2: error: ld returned 1 exit status
s079062907
p03645
C++
#include <iostream> using namespace std; bool map[200001][200001]; int n,x,y,m,num=0; int main() { cin>>n>>m; for(int var1=1;var1<=m;var1++) { cin>>x>>y; map[x][y]=1; } for(int var1=1;var1<=n;var1++) { if(map[1][var1]==1&&map[var1][n]==1) { cout<<"POSSIBLE"; num++; break; } } if(num==0) cout<<"IMPOSSIBLE"; return 0; }
/tmp/ccqLGAX0.o: in function `main': a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x42): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x5e): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x6f): relocation truncated to fit: R_X86_64_PC32 against symbol `x' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x75): relocation truncated to fit: R_X86_64_PC32 against symbol `y' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x9b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0xc7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x10d): relocation truncated to fit: R_X86_64_PC32 against symbol `num' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x116): relocation truncated to fit: R_X86_64_PC32 against symbol `num' defined in .bss section in /tmp/ccqLGAX0.o a.cc:(.text+0x122): additional relocation overflows omitted from the output collect2: error: ld returned 1 exit status
s176220597
p03645
C++
#include<iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n; cin >> m; vector<int> a, b; for(int i = 0; i < m; i++) { int a_, b_; cin >> a_; cin >> b_; a.push_back(a_); b.push_back(b_); } if(m == 1) { cout << "IMPOSSIBLE" << endl; return 0; } auto it = a.begin(); const auto end = a.end(); for(it = find(it, end, 1); it != end; it = find(it, end, 1)) { size_t i = distance(a.begin(), it); for (int u = 0; u < m; u++) { if (b[i] == a[u] && b[u] == n) { cout << "POSSIBLE" << endl; return 0; } } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:31:22: error: no matching function for call to 'find(__gnu_cxx::__normal_iterator<int*, std::vector<int> >&, const __gnu_cxx::__normal_iterator<int*, std::vector<int> >&, int)' 31 | for(it = find(it, end, 1); it != end; it = find(it, end, 1)) | ~~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:31:22: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 31 | for(it = find(it, end, 1); it != end; it = find(it, end, 1)) | ~~~~^~~~~~~~~~~~ a.cc:31:56: error: no matching function for call to 'find(__gnu_cxx::__normal_iterator<int*, std::vector<int> >&, const __gnu_cxx::__normal_iterator<int*, std::vector<int> >&, int)' 31 | for(it = find(it, end, 1); it != end; it = find(it, end, 1)) | ~~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:31:56: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 31 | for(it = find(it, end, 1); it != end; it = find(it, end, 1)) | ~~~~^~~~~~~~~~~~
s278043033
p03645
C++
#include<iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n; cin >> m; vector<int> a, b; for(int i = 0; i < m; i++) { int a_, b_; cin >> a_; cin >> b_; a.push_back(a_); b.push_back(b_); } if(m == 1) { cout << "IMPOSSIBLE" << endl; return 0; } auto it = a.begin(), end = a.end(); for(it = find(it, end, 1); it != end; it = find(it, end, 1)) { size_t i = distance(a.begin(), it); for (int u = 0; u < m; u++) { if (b[i] == a[u] && b[u] == n) { cout << "POSSIBLE" << endl; return 0; } } } cout << "IMPOSSIBLE" << endl; return 0; }
a.cc: In function 'int main()': a.cc:30:22: error: no matching function for call to 'find(__gnu_cxx::__normal_iterator<int*, std::vector<int> >&, __gnu_cxx::__normal_iterator<int*, std::vector<int> >&, int)' 30 | for(it = find(it, end, 1); it != end; it = find(it, end, 1)) | ~~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:30:22: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 30 | for(it = find(it, end, 1); it != end; it = find(it, end, 1)) | ~~~~^~~~~~~~~~~~ a.cc:30:56: error: no matching function for call to 'find(__gnu_cxx::__normal_iterator<int*, std::vector<int> >&, __gnu_cxx::__normal_iterator<int*, std::vector<int> >&, int)' 30 | for(it = find(it, end, 1); it != end; it = find(it, end, 1)) | ~~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:30:56: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 30 | for(it = find(it, end, 1); it != end; it = find(it, end, 1)) | ~~~~^~~~~~~~~~~~
s725479014
p03645
C++
#include<iostream> #include<cstdio> using namespace std; int main(){ int n,m; cin>>n>>m; int bWhenA1[m],aWhenBn[m]; int j=0,k=0; for(int i=0;i<m;i++){ int a,b; scanf("%d %d",&a,&b); if(a[i]==1)bWhenA1[j++]=b; if(b[i]==n)aWhenBn[k++]=a; } for(int i=0;i<j;i++){ for(int l=0;l<k;l++){ if(bWhenA1[i]==aWhenBn[l]){ ans++; break; } } if(ans>0)break; } if(ans>0)cout<<"POSSIBLE"<<endl; else cout<<"IMPOSSIBLE"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:13: error: invalid types 'int[int]' for array subscript 13 | if(a[i]==1)bWhenA1[j++]=b; | ^ a.cc:14:13: error: invalid types 'int[int]' for array subscript 14 | if(b[i]==n)aWhenBn[k++]=a; | ^ a.cc:20:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 20 | ans++; | ^~~ | abs a.cc:24:12: error: 'ans' was not declared in this scope; did you mean 'abs'? 24 | if(ans>0)break; | ^~~ | abs a.cc:26:8: error: 'ans' was not declared in this scope; did you mean 'abs'? 26 | if(ans>0)cout<<"POSSIBLE"<<endl; | ^~~ | abs
s624571559
p03645
C
4 3 1 2 2 3 3 4
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 4 3 | ^
s841500959
p03645
C++
#include<iostream> #include<stdio.h> #include<algorithm> using namespace std; int main(){ unsigned l,p,*s,*g,t[2],i[3]={0,0,0}; bool f = false; scanf("%d%d",&l,&p); s = new unsigned[p]; g = new unsigned[p]; for(int j=0;j<p;j++){ scanf("%d%d",t,t+1); // cin >> t[0] >> t[1]; if(t[0]==1){ s[i[0]]=t[1];i[0]++; }else if(t[1]==l){ g[i[1]]=t[0];i[1]++; } } sort(s,s+i[0]); sort(g,g+i[1]); unsigned cnt = l - i[0]+i[1]; if(i[0]<i[1]) for(int j=0;j<i[0];j++){ for(int k=i[3];k<i[1];k++){ if(s[j]==g[k]){f=true;break;} else if(s[j]>g[k])i[3]++; } else for(int j=0;j<i[1];j++){ for(int k=i[3];k<i[0];k++){ if(g[j]==s[k]){f=true;break;} else if(g[j]>s[k])i[3]++; } cnt--; if(!cnt){f=true;break;} } if(!f) cout << "IM"; cout << "POSSIBLE"; return 0; }
a.cc: In function 'int main()': a.cc:32:1: error: 'else' without a previous 'if' 32 | else | ^~~~ a.cc:46:2: error: expected '}' at end of input 46 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s518314832
p03645
C++
#include <cstdio> #include <iostream> const int maxn = 200000 + 10; using namespace std; struct point { int x0, x1; }a[maxn], b[maxn]; int main() { int n, m, j = 1, nn; scanf("%d%d", &n, &m); for (int i = 1; i <= m; i++){ scanf("%d%d", &a[i].x0, &a[i].x1); if (a[i].x0 == 1 || a[i].x1 == n) { b[j++] = a[i]; } } nn = j - 1; for (int j = 1; j <= nn / 2; j++) { for (int i = 1; i <= nn; i++) { if (i != j && (b[j].x1 == b[i].x0 || b[j].x0 == b[i].x1){ printf("POSSIBLE\n"); return 0; } } } printf("IMPOSSIBLE\n"); return 0; }
a.cc: In function 'int main()': a.cc:21:69: error: expected ')' before '{' token 21 | if (i != j && (b[j].x1 == b[i].x0 || b[j].x0 == b[i].x1){ | ~ ^ | ) a.cc:25:9: error: expected primary-expression before '}' token 25 | } | ^
s296547713
p03645
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <map> using namespace std; int main(){ string s = "IMPOSSIBLE"; int n,m; int a = 0,b = 0,c = 0; vector<pair<int,int> >v; cin >> n >> m; for(int i = 0;i < m;i++){ cin >> a >> b; if(b == n)c++; v.push_back(make_pair(a,b)); } if(c != 0){ sort(v.begin(),v.end()); for(int i = 0;i < n;i++){ a = 0;b = 0; if(v[i].first == 1)a = v[i].second; else break; for(int j = i+1;j < n;j++){ if(v[j] == 1)continue; if(v[i].second != n){ b++; continue; }else if(a == v[j].first && v[j].second == n){ s = "POSSIBLE"; break; } } if(s == "POSSIBLE" || b == i+1)break; } } cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:26:17: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} and 'int') 26 | if(v[j] == 1)continue; In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::fpos<_StateT>' 26 | if(v[j] == 1)continue; | ^ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::allocator<_CharT>' 26 | if(v[j] == 1)continue; | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::reverse_iterator<_Iterator>' 26 | if(v[j] == 1)continue; | ^ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::reverse_iterator<_Iterator>' 26 | if(v[j] == 1)continue; | ^ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::move_iterator<_IteratorL>' 26 | if(v[j] == 1)continue; | ^ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::move_iterator<_IteratorL>' 26 | if(v[j] == 1)continue; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:26:20: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 26 | if(v[j] == 1)continue; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:26:20: note: 'std::pair<int, int>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 26 | if(v[j] == 1)continue; | ^ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:26:20: note: 'std::pair<int, int>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 26 | if(v[j] == 1)continue; | ^ /usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:26:20: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 26 | if(v[j] == 1)continue; | ^ /usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 26 | if(v[j] == 1)continue; | ^ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 26 | if(v[j] == 1)continue; | ^ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:26:20: note: mismatched types 'const _CharT*' and 'std::pair<int, int>' 26 | if(v[j] == 1)continue; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:26:20: note: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} is not derived from 'const std::tuple<_UTypes ...>' 26 | if(v[j] == 1)continue; | ^ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46: /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_itera
s741811630
p03645
C++
#include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const int maxn=200000+10; bool a[maxn][maxn],n,m; bool check() { for(long i=n-1;i>=1;i--) { if(a[n][i]==true) { if(a[i][1]==true) return true; } } return false; } int main() { cin>>n; cin>>m; //cout<<n<<m<<endl; long i; memset(a,0,sizeof(a)); for(i=0;i<m;i++) { long x,y; cin>>x; cin>>y; a[x][y]=true; a[y][x]=true; } if(check()) cout<<"POSSIBLE"<<endl; else cout<<"IMPOSSIBLE"<<endl; }
/tmp/cc2Ln0pN.o: in function `check()': a.cc:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2Ln0pN.o a.cc:(.text+0x1c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2Ln0pN.o /tmp/cc2Ln0pN.o: in function `main': a.cc:(.text+0x8b): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc2Ln0pN.o a.cc:(.text+0xa4): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc2Ln0pN.o a.cc:(.text+0x157): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc2Ln0pN.o collect2: error: ld returned 1 exit status
s049453732
p03645
C++
#include <iostream> #include <vector> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define llong long long #define pb(a) push_back(a) #define INF 999999999 using namespace std; typedef pair<int, int> P; typedef pair<llong, llong> LP; typedef pair<int, P> PP; typedef pair<llong, LP> LPP; int dy[]={0, 0, 1, -1}; int dx[]={1, -1, 0, 0}; vector< vector< int> > input(2000001); int N, M; int main(){ cin >> N >> M; REP(i, M){ int a, b; cin >> a >> b; input[a].pb(b); } int flag = 0; REP(i, 200001){ REP(j, input[i].size()){ if(count(input[input[1][i]].begin(), input[input[1][i]].end(), N) > 0){ flag = 1; } } } if(flag){ cout << "POSSIBLE" << endl; }else{ cout << "IMPOSSIBLE" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:35:16: error: 'count' was not declared in this scope 35 | if(count(input[input[1][i]].begin(), input[input[1][i]].end(), N) > 0){ | ^~~~~
s051575458
p03645
C++
#include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; const long maxn=200000+10; long a[maxn][maxn],n,m; int check() { for(long i=n-1;i>=1;i--) { if(a[n][i]==1) { if(a[i][1]==1) return 1; } } return 0; } int main() { cin>>n; cin>>m; //cout<<n<<m<<endl; long i; memset(a,0,sizeof(a)); for(i=0;i<m;i++) { long x,y; cin>>x; cin>>y; a[x][y]=1; a[y][x]=1; } if(check()) cout<<"POSSIBLE"<<endl; else cout<<"IMPOSSIBLE"<<endl; }
/tmp/ccxeOGQp.o: in function `check()': a.cc:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccxeOGQp.o a.cc:(.text+0x18): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccxeOGQp.o /tmp/ccxeOGQp.o: in function `main': a.cc:(.text+0x84): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccxeOGQp.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccxeOGQp.o a.cc:(.text+0x167): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccxeOGQp.o collect2: error: ld returned 1 exit status
s260750461
p03645
C++
#include "stdafx.h" #include <stdio.h> #include <string.h> #include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; int a, b; int rma = 0, rmb; bool flag = false; while (cin >> a >> b) { if (b == N) { rma = a; if (a == 1) { flag = true; break; } } else if (a == 1) { rmb = b; if (rma == rmb) { flag = true; break; } } } if (flag == true) { cout << "POSSIBLE"; } else { cout << "IMPOSSIBLE"; } return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s060335800
p03645
C++
#include<cstdio> int num[200000][2] int a[10]; int b[10]; int main() { int n,m; int j,k,x,y,temp; while(scanf("%d%d",&n,&m)!=EOF) { j=0,k=0; temp=0; for(int i=0;i<m;i++) { scanf("%d%d",&num[i][0],&num[i][1]); if(num[i][0]==1){ a[j]=num[i][1]; j++; } if(num[i][1]==n) { b[k]=num[i][0]; k++; } } for(x=0;x<j;x++) { for(y=0;y<k;y++) if(a[x]==b[y]) temp=1; } if(temp) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); } return 0; }
a.cc:3:1: error: expected initializer before 'int' 3 | int a[10]; | ^~~ a.cc: In function 'int main()': a.cc:15:31: error: 'num' was not declared in this scope; did you mean 'enum'? 15 | scanf("%d%d",&num[i][0],&num[i][1]); | ^~~ | enum a.cc:17:25: error: 'a' was not declared in this scope 17 | a[j]=num[i][1]; | ^ a.cc:29:20: error: 'a' was not declared in this scope 29 | if(a[x]==b[y]) temp=1; | ^
s616452823
p03645
C++
#include<iostream> #include<stdio.h> #include<vector> #include<cmath> using namespace std; int a[20010],b[20010],begin[10000]; int main() { int n,m,i,j,num,p,flag; while(cin>>n>>m){ j=0;flag=0; for(i=1;i<=m;i++){ cin>>a[i]>>b[i]; if(a[i]==1)begin[++j]=i; } for(i=1;i<=j;i++){ num=b[begin[j]]; for(p=1;p<=m;p++){ if(a[p]==num&&b[p]==n)flag=1; } if(flag){printf("POSSIBLE\n");break;} } if(flag==0)printf("IMPOSSIBLE\n"); } return 0; }
a.cc: In function 'int main()': a.cc:14:36: error: reference to 'begin' is ambiguous 14 | if(a[i]==1)begin[++j]=i; | ^~~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:114:37: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)' 114 | template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept; | ^~~~~ /usr/include/c++/14/bits/range_access.h:113:31: note: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)' 113 | template<typename _Tp> _Tp* begin(valarray<_Tp>&) noexcept; | ^~~~~ /usr/include/c++/14/bits/range_access.h:95:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])' 95 | begin(_Tp (&__arr)[_Nm]) noexcept | ^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)' 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:52:5: note: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ^~~~~ In file included from /usr/include/c++/14/bits/range_access.h:36: /usr/include/c++/14/initializer_list:88:5: note: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)' 88 | begin(initializer_list<_Tp> __ils) noexcept | ^~~~~ a.cc:6:23: note: 'int begin [10000]' 6 | int a[20010],b[20010],begin[10000]; | ^~~~~ a.cc:17:31: error: reference to 'begin' is ambiguous 17 | num=b[begin[j]]; | ^~~~~ /usr/include/c++/14/bits/range_access.h:114:37: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)' 114 | template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept; | ^~~~~ /usr/include/c++/14/bits/range_access.h:113:31: note: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)' 113 | template<typename _Tp> _Tp* begin(valarray<_Tp>&) noexcept; | ^~~~~ /usr/include/c++/14/bits/range_access.h:95:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])' 95 | begin(_Tp (&__arr)[_Nm]) noexcept | ^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)' 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:52:5: note: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/initializer_list:88:5: note: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)' 88 | begin(initializer_list<_Tp> __ils) noexcept | ^~~~~ a.cc:6:23: note: 'int begin [10000]' 6 | int a[20010],b[20010],begin[10000]; | ^~~~~
s031983364
p03645
C++
#include "stdafx.h" #include<iostream> #include<algorithm> #include<vector> using namespace std; #define REP(i, a, n) for(int i=a; i<n; i++) bool flag[200001]; int main() { int N, M; cin >> N >> M; vector<vector<int>> route(N); REP(i, 0, M) { int a, b; cin >> a >> b; a--; b--; route[a].push_back(b); route[b].push_back(a); } REP(i, 0, route[0].size()) { flag[route[0][i]] = true; } bool possible = false; REP(i, 0, route[N - 1].size()) { if (flag[route[N - 1][i]]) possible = true; } if (possible) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s463035626
p03645
C++
#include <cstdio> #include <algorithm> #include <queue> using namespace std; int dp[103]; const int INF = 0x3f3f3f3f; const int MAXN = 1000010; struct qnode{ int v; int c; qnode(int _v=0,int _c=0):v(_v),c(_c){} bool operator < (const qnode &r) const { return c > r.c; } }; struct Edge { int v,cost; Edge(int _v=0,int _cost=0):v(_v),cost(_cost){} }; vector<Edge>E[MAXN]; bool vis[MAXN]; int dist[MAXN]; void Dijkstra(int n,int start)//点的编号从1开始 { memset(vis,false,sizeof(vis)); for(int i = 1; i <= n; i++) dist[i] = INF; priority_queue <qnode> que; while(!que.empty()) que.pop(); dist[start] = 0; que.push(qnode(start,0)); qnode tmp; while(!que.empty()) { tmp = que.top(); que.pop(); int u = tmp.v; if(vis[u]) continue; vis[u] = true; for(int i = 0; i < E[u].size(); i++) { int v = E[tmp.v][i].v; int cost = E[u][i].cost; if(!vis[v]&&dist[v]>dist[u] + cost) { dist[v] = dist[u] + cost; que.push(qnode(v,dist[v])); } } } } void addedge(int u,int v,int w) { E[u].push_back(Edge(v,w)); } int main() { freopen("/Users/ecooodt/Desktop/c++ and acm/_集训/atcode/1/1.txt","r",stdin); int cnt = 0; int a,b; int n = 0; // for(int i = 0 ; i < ) while(~scanf("%d%d",&a,&b)) { addedge(a,b,1); cnt ++; n = max(b,n); } Dijkstra(n,1); // printf("%d\n",n); int t = dist[n]; if(t > 2) { printf("IMPOSSIBLE\n"); // printf("%d",t); } else { printf("POSSIBLE\n"); // printf("%d",t); } }
a.cc: In function 'void Dijkstra(int, int)': a.cc:29:5: error: 'memset' was not declared in this scope 29 | memset(vis,false,sizeof(vis)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <queue> +++ |+#include <cstring> 4 | using namespace std;
s882343548
p03645
C++
#include<stdio.h>   int main() { int N, M; int ship[200000][2];//ship[from][to] scanf("%d %d", &N, &M); int i, list[200000] = {}, j = 0; for ( i = 0; i < M; i++) { scanf("%d %d", &ship[i][0], &ship[i][1]); if (ship[i][0] == 1) { list[j] = ship[i][1]; j++; } }   for(i=0;i<M;i++) if (ship[i][1]==N) { for ( j = 0; list[j]; j++) { if (ship[i][0]==list[j]) { printf("POSSIBLE"); return 0; } } }   printf("IMPOSSIBLE"); return 0; }
a.cc:2:1: error: extended character   is not valid in an identifier 2 |   | ^ a.cc:18:1: error: extended character   is not valid in an identifier 18 |   | ^ a.cc:31:1: error: extended character   is not valid in an identifier 31 |   | ^ a.cc:2:1: error: '\U000000a0' does not name a type 2 |   | ^
s012600706
p03645
C++
#include<stdio.h>   int main() { int N, M; int ship[200000][2];//ship[from][to] scanf("%d %d", &N, &M); int i, list[200000] = {}, j = 0; for ( i = 0; i < M; i++) { scanf("%d %d", &ship[i][0], &ship[i][1]); if (ship[i][0] == 1) { list[j] = ship[i][1]; j++; } }   for(i=0;i<M;i++) if (ship[i][1]==N) { for ( j = 0; list[j]; j++) { if (ship[i][0]==list[j]) { printf("POSSIBLE"); return 0; } } }   printf("IMPOSSIBLE"); return 0; }
a.cc:2:1: error: extended character   is not valid in an identifier 2 |   | ^ a.cc:18:1: error: extended character   is not valid in an identifier 18 |   | ^ a.cc:31:1: error: extended character   is not valid in an identifier 31 |   | ^ a.cc:2:1: error: '\U000000a0' does not name a type 2 |   | ^
s554037607
p03645
C++
#include <iostream> #include <cstdio> using namespace std; int a[200005]; int b[200005]; int c[200005]; int main() { int m,n; while(~scanf("%d%d",&n,&m)) { memset(c,0,sizeof(c)); memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); for(int i=0;i<m;++i) { scanf("%d%d",&a[i],&b[i]); if(a[i] == 1) c[b[i]]++; if(a[i] == n) c[b[i]]++; if(b[i] == 1) c[a[i]]++; if(b[i] == n) c[a[i]]++; } int flag = 0; for(int i=0;i<n;++i) { if(c[i] >= 2) { flag = 1; break; } } if(flag) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); } }
a.cc: In function 'int main()': a.cc:12:17: error: 'memset' was not declared in this scope 12 | memset(c,0,sizeof(c)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | using namespace std;
s961928308
p03645
C++
#include<iostream> int N, M; int a[2000000], b[2000000]; int P[2000000], Q[2000000]; int count; int ans=0; int solve() { for (int i = 0; i < count; i++) { for (int j = 0; j < M; j++) { if (a[j] == P[i] && b[j] == N) { ans = 1; return 0; } } } } int main() { std::cin >> N >> M; for (int i = 0; i < M; i++) { std::cin >> a[i] >> b[i]; if (a[i] == 1) { P[count] = b[i]; count++; } solve(); if (ans == 1) { std::cout << "POSSIBLE" << "\n"; } else { std::cout << "IMPOSSIBLE" << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:34:2: error: expected '}' at end of input 34 | } | ^ a.cc:18:12: note: to match this '{' 18 | int main() { | ^ a.cc: In function 'int solve()': a.cc:17:1: warning: control reaches end of non-void function [-Wreturn-type] 17 | } | ^
s190871836
p03645
C++
#include <iostream> #include <cstdio> using namespace std; int a[200005]; int b[200005]; int c[200005]; int main() { int m,n; while(~scanf("%d%d",&n,&m)) { memset(c,0,sizeof(c)); memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); for(int i=0;i<m;++i) { scanf("%d%d",&a[i],&b[i]); if(a[i] == 1) c[b[i]]++; if(a[i] == n) c[b[i]]++; if(b[i] == 1) c[a[i]]++; if(b[i] == n) c[a[i]]++; } int flag = 0; for(int i=0;i<n;++i) { if(c[i] >= 2) { flag = 1; break; } } if(flag) printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); } }
a.cc: In function 'int main()': a.cc:12:17: error: 'memset' was not declared in this scope 12 | memset(c,0,sizeof(c)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | using namespace std;
s238251229
p03645
C
#include <stdio.h> int main(void){ int n,m; int a[200000]={0}; int b[200000]={0}; int c[200000]={0}; int i,j; int flag = 0; int cnt = 0; int cnt_b = 0; scanf("%d %d",&n,&m); for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<m;i++){ if(a[i] == 1){ c[cnt++] = i; } } for(i=0;i<m;i++){ if(b[i] == n){ d[cnt_b++] = i; } } for(i=0;i<cnt;i++){ for(j=0;j<cnt_b;j++){ if(c[i] == d[j]){ printf("POSSIBLE"); return 0; } } } if(flag == 0){ printf("IMPOSSIBLE"); } return 0; }
main.c: In function 'main': main.c:22:9: error: 'd' undeclared (first use in this function) 22 | d[cnt_b++] = i; | ^ main.c:22:9: note: each undeclared identifier is reported only once for each function it appears in
s655098418
p03645
C
#include <stdio.h> int main(void){ int n,m; int a[200000]={0}; int b[200000]={0}; int c[200000]={0}; int i,j; int flag = 0; scanf("%d %d",&n,&m); for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } int cnt = 0; for(i=0;i<m;i++){ if(a[i] == 1){ c[cnt++] = i; } } int cnt_b = 0; for(i=0;i<m;i++){ if(b[i] == n){ d[cnt_b++] = i; } } int cnt_b = 0; for(i=0;i<cnt;i++){ for(j=0;j<cnt_b;j++){ if(c[i] == d[j]){ printf("POSSIBLE"); return 0; } } } if(flag == 0){ printf("IMPOSSIBLE"); } return 0; }
main.c: In function 'main': main.c:22:9: error: 'd' undeclared (first use in this function) 22 | d[cnt_b++] = i; | ^ main.c:22:9: note: each undeclared identifier is reported only once for each function it appears in main.c:25:9: error: redefinition of 'cnt_b' 25 | int cnt_b = 0; | ^~~~~ main.c:19:9: note: previous definition of 'cnt_b' with type 'int' 19 | int cnt_b = 0; | ^~~~~