submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s700155969 | p03647 | Java | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
ArrayList<Integer>[] adj = new ArrayList[n];
for(int i=0;i<n;i++) adj[i] = new ArrayList<Integer>();
for(int i=0;i<m;i++) {
int a = sc.nextInt() - 1;
int b = sc.nextInt() - 1;
adj[a].add(b);
adj[b].add(a);
}
Queue<Integer> q = new LinkedList<Integer>();
q.add(1);
int cnt = 0;
boolean[] vis = new boolean[n];
bfs:
while(!q.isEmpty()) {
int cur = q.poll();
for(int next : adj[cur]) {
if(next == n - 1) {
break bfs;
}
if(!vis[next]) {
cnt++;
}
}
}
System.out.println(cnt == 2 ? "POSSIBLE" : "IMPOSSIBLE");
}
} | Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
|
s234736245 | p03647 | Java | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
ArrayList<Integer>[] adj = new ArrayList[n];
for(int i=0;i<n;i++) adj[i] = new ArrayList<Integer>();
for(int i=0;i<m;i++) {
int a = sc.nextInt() - 1;
int b = sc.nextInt() - 1;
adj[a].add(b);
adj[b].add(a);
}
Queue<Integer> q = new LinkedList<Integer>();
q.add(1);
int cnt = 0;
boolean[] vis = new boolean[n];
bfs:
while(!q.isEmpty()) {
int cur = q.poll();
for(int next : adj[cur]) {
if(next == n - 1) {
break bfs;
}
if(!vis[next]) {
cnt++;
}
}
}
System.out.println(cnt == 2 ? "POSSIBLE" : "IMPOSSIBLE");
}
}
| Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
|
s766991711 | p03647 | Java | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
ArrayList<Integer>[] adj = new ArrayList[n];
for(int i=0;i<n;i++) adj[i] = new ArrayList<Integer>();
for(int i=0;i<m;i++) {
int a = sc.nextInt() - 1;
int b = sc.nextInt() - 1;
adj[a].add(b);
adj[b].add(a);
}
Queue<Integer> q = new LinkedList<>();
q.add(1);
int cnt = 0;
boolean[] vis = new boolean[n];
bfs:
while(!q.isEmpty()) {
int cur = q.poll();
for(int next : adj[cur]) {
if(next == n - 1) {
break bfs;
}
if(!vis[next]) {
cnt++;
}
}
}
System.out.println(cnt == 2 ? "POSSIBLE" : "IMPOSSIBLE");
}
} | Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
|
s870959987 | p03647 | C++ | #include <iostream>
using namespace std;
int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
int main()
{
cin >> n >> m;
for(int t = 0; t < n; t++)
{
q[t] = 0;
p[t] = 0;
}
for(int i = 0; i < m; i++)
{
cin >> k >> l;
if(k == 1) q[l + 1] = 1;
else if(l == 1) q[k + 1] = 1;
if(l == n) p[k + 1] = 1;
else if(k == n) p[l + 1] = 1;
}
for(int j = 0; j < n ; j++)
{
if(q[j + 1] == 1 && p[j + 1] == 1)
{
cnt++;
break;
}
}
if(cnt > 0) cout << "POSSIBLE" << endl;
else cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc:3:51: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
3 | int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
| ^~~
a.cc:3:51: error: could not convert '2.0e+5' from 'double' to 'long unsigned int'
3 | int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
| ^~~
| |
| double
a.cc:3:51: error: size of array 'q' has non-integral type 'double'
a.cc:3:59: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
3 | int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
| ^~~
a.cc:3:59: error: could not convert '2.0e+5' from 'double' to 'long unsigned int'
3 | int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
| ^~~
| |
| double
a.cc:3:59: error: size of array 'p' has non-integral type 'double'
|
s258077446 | p03647 | C++ | #include <iostream>
using namespace std;
int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
int main()
{
cin >> n >> m;
for(int t = 0; t < n; t++)
{
q[t] = 0;
p[t] = 0;
}
for(int i = 0; i < m; i++)
{
cin >> k >> l;
if(k == 1) q[l + 1] = 1;
else if(l == 1) q[k + 1] = 1;
if(l == n) p[k + 1] = 1;
else if(k == n) p[l + 1] = 1;
}
for(int j = 0; j < n ; j++)
{
if(q[j + 1] == 1 && p[j + 1] == 1)
{
cnt++;
break;
}
}
if(cnt > 0) cout << "POSSIBLE" << endl;
else cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc:3:51: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
3 | int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
| ^~~
a.cc:3:51: error: could not convert '2.0e+5' from 'double' to 'long unsigned int'
3 | int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
| ^~~
| |
| double
a.cc:3:51: error: size of array 'q' has non-integral type 'double'
a.cc:3:59: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
3 | int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
| ^~~
a.cc:3:59: error: could not convert '2.0e+5' from 'double' to 'long unsigned int'
3 | int n, m, cnt = 0, a[101010], b[101010], k, l, q[2e5], p[2e5];
| ^~~
| |
| double
a.cc:3:59: error: size of array 'p' has non-integral type 'double'
|
s153067179 | p03647 | C++ | Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates that is defined as the maximal number of non-overlapping substrings equal to p that can be found in s'. He wants to make this number as big as possible.
More formally, let's define as maximum value of over all s' that can be obtained by removing exactly x characters from s. Dreamoon wants to know for all x from 0 to |s| where |s| denotes the length of string s. | a.cc:1:112: warning: multi-character literal with 135 characters exceeds 'int' size of 4 bytes
1 | Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates that is defined as the maximal number of non-overlapping substrings equal to p that can be found in s'. He wants to make this number as big as possible.
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:3:19: warning: multi-character literal with 41 characters exceeds 'int' size of 4 bytes
3 | More formally, let's define as maximum value of over all s' that can be obtained by removing exactly x characters from s. Dreamoon wants to know for all x from 0 to |s| where |s| denotes the length of string s.
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'Dreamoon' does not name a type
1 | Dreamoon has a string s and a pattern string p. He first removes exactly x characters from s obtaining string s' as a result. Then he calculates that is defined as the maximal number of non-overlapping substrings equal to p that can be found in s'. He wants to make this number as big as possible.
| ^~~~~~~~
|
s318987190 | p03647 | C++ | vious12345…Next
Username
Prob
Result
Time
(ms) Mem
(MB) Lang
Submit Time
saleh_p
A
Submit Failed
C++
8 hr ago
saleh_p
B
Submit Failed
C++
8 hr ago
erfan_tamimi
C
Submit Failed
C++
9 hr ago
aryanv
D
Submit Failed
Bash (GNU bash v4.3.11)
9 hr ago
aryanv
C
Submit Failed
Bash (GNU bash v4.3.11)
9 hr ago
aryanv
A
Submit Failed
Bash (GNU bash v4.3.11)
9 hr ago
mahdivp
D
Submit Failed
C++
9 hr ago
amir_mrd
C
Submit Failed
C++
9 hr ago
mostafarastegar
A
Submit Failed
C++
9 hr ago
saleh_p
D
Submit Failed
C
9 hr ago
ameernsrr
E
Compilation error
C++
9 hr ago
aarr
D
Submit Failed
C++
9 hr ago
ameernsrr
A
Submit Failed
C++
9 hr ago
alirezakermani
A
Submit Failed
C++
9 hr ago
dorpoush
A
Submit Failed
C++
9 hr ago
mostafarastegar
B
Submit Failed
C++
9 hr ago
alirezakermani
E
Compilation error
C++
9 hr ago
alirezakermani
D
Submit Failed
C++
9 hr ago
alirezakermani
C
Submit Failed
C++
9 hr ago
alirezakermani
B
Submit Failed
C++
9 hr ago
All Copyright Reserved ©2018 Xu Han
Server Time: 2019-02-12 19:38:27 UTC+3.5
#18205592 | saleh_p's solution for [AtCoder-2660] [Problem A]
Status
Submit Failed
Length
597
Lang
C++14 (GCC 5.3.0)
Submitted
2019-02-12 11:13:18
Shared
Select Code
#include <bits/stdc++.h>
using namespace std;
typedef pair <int, int> pii;
const int maxn = 200002;
int n,m,k,l,p;
vector <int> g[maxn];
void input();
bool solve();
int main(){
input();
if (solve()){
cout<<"POSSIBLE";
}
else{
cout<<"IMPOSSIBLE";
}
return 0;
}
void input(){
cin >> n >> m;
for (int i=0;i<m;i++){
cin>>k>>l;
g[k].push_back(l);
g[l].push_back(k);
}
sort(g[1].begin(),g[1].end());
sort(g[n].begin(),g[n].end());
}
bool solve(){
for (int i=0;i<g[1].size();i++){
while (g[n][p]<g[1][i]){
p++;
}
if (g[n][p]==g[1][i]){
return 1;
}
}
return 0;
} | a.cc:1:1: error: extended character … is not valid in an identifier
1 | vious12345…Next
| ^
a.cc:27:18: error: too many decimal points in number
27 | Bash (GNU bash v4.3.11)
| ^~~~~
a.cc:32:18: error: too many decimal points in number
32 | Bash (GNU bash v4.3.11)
| ^~~~~
a.cc:37:18: error: too many decimal points in number
37 | Bash (GNU bash v4.3.11)
| ^~~~~
a.cc:110:24: error: extended character © is not valid in an identifier
110 | All Copyright Reserved ©2018 Xu Han
| ^
a.cc:113:11: error: "|" is not a valid filename
113 | #18205592 | saleh_p's solution for [AtCoder-2660] [Problem A]
| ^
a.cc:113:20: warning: missing terminating ' character
113 | #18205592 | saleh_p's solution for [AtCoder-2660] [Problem A]
| ^
a.cc:119:12: error: too many decimal points in number
119 | C++14 (GCC 5.3.0)
| ^~~~~
a.cc:1:1: error: 'vious12345\U00002026Next' does not name a type
1 | vious12345…Next
| ^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:125:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/cstddef:50,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
443 | typedef decltype(nullptr) nullptr_t;
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
443 | typedef decltype(nullptr) nullptr_t;
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59,
from /usr/include/c++/14/bits/stl_algo.h:69,
from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/inclu |
s176970189 | p03647 | C++ | #define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1
//{
#include<bits/stdc++.h>
using namespace std;
#define hi cout<<"hi"<<endl;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define fi first
#define se second
#define mp make_pair
#define rev reverse
#define dans dump(ans)
#define MOD 1000000007
#define amp(v,n) (v).count(n)?v[n]++:v[n]=1;
//{
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cerr<<endl;}
template<class...A> inline void debug_rest() {cerr<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cerr<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cerr<<first,debug_rest(rest...);}
//}
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
template<int m>class mint{private:int i;public:mint() : i(0){}mint(int i): i((i%m+m)%m){}mint operator+(const mint& o){return o.i+i;}mint operator*(const mint& o){return o.i*i;}mint operator-(){return -i;}operator int() {return i;}};
int n,m,a,b;
set<int> l,r;
main(){
cin>>n>>m;
rep(i,m){
cin>>a>>b;
if(a==1)l.insert(b);
if(b==n)r.insert(a);
}
for(auto x:b){
if(r.count(x)){
dump("POSSIBLE");
return 0;
}
}
dump("IMPOSSIBLE");
}
| a.cc:9:9: warning: "INT_MAX" redefined
9 | #define INT_MAX LLONG_MAX
| ^~~~~~~
In file included from /usr/include/c++/14/climits:42,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:38,
from a.cc:5:
/usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:120:9: note: this is the location of the previous definition
120 | #define INT_MAX __INT_MAX__
| ^~~~~~~
a.cc:47:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
47 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:54:16: error: 'begin' was not declared in this scope
54 | for(auto x:b){
| ^
a.cc:54:16: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1238:5: note: 'std::begin'
1238 | begin(const valarray<_Tp>& __va) noexcept
| ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note: 'std::filesystem::__cxx11::begin'
608 | begin(recursive_directory_iterator __iter) noexcept
| ^~~~~
a.cc:54:16: error: 'end' was not declared in this scope
54 | for(auto x:b){
| ^
a.cc:54:16: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note: 'std::end'
1265 | end(const valarray<_Tp>& __va) noexcept
| ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note: 'std::filesystem::__cxx11::end'
613 | end(recursive_directory_iterator) noexcept
| ^~~
|
s003769379 | p03647 | C++ | #include<bits/stdc++.h>
using namespace std;
int N, M;
vector<vector<int>> connect;
vector<bool> vsited;
bool DFS(int curr, num) {
if (curr == N) return true;
if (num >= 3) return false;
for (int n : connect[curr]) {
if (visited[n]) continue;
if (DFS(n, num + 1)) {
return true;
}
return false;
}
}
int main() {
cin >> N >> M;
connect = vector<vector<int>>(N + 1, vector<int>);
visited = vector<bool>(N + 1, false);
for (int i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
connect[a].push_back(b);
cinnect[b].push_back(a);
}
if (dfs(1, 1)) cout << "POSSIBLE" << endl;
else cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc:6:20: error: 'num' has not been declared
6 | bool DFS(int curr, num) {
| ^~~
a.cc: In function 'bool DFS(int, int)':
a.cc:8:13: error: 'num' was not declared in this scope; did you mean 'enum'?
8 | if (num >= 3) return false;
| ^~~
| enum
a.cc:10:21: error: 'visited' was not declared in this scope; did you mean 'vsited'?
10 | if (visited[n]) continue;
| ^~~~~~~
| vsited
a.cc:11:28: error: 'num' was not declared in this scope; did you mean 'enum'?
11 | if (DFS(n, num + 1)) {
| ^~~
| enum
a.cc: In function 'int main()':
a.cc:20:38: error: expected primary-expression before '(' token
20 | connect = vector<vector<int>>(N + 1, vector<int>);
| ^
a.cc:20:57: error: expected primary-expression before ')' token
20 | connect = vector<vector<int>>(N + 1, vector<int>);
| ^
a.cc:21:9: error: 'visited' was not declared in this scope; did you mean 'vsited'?
21 | visited = vector<bool>(N + 1, false);
| ^~~~~~~
| vsited
a.cc:26:17: error: 'cinnect' was not declared in this scope; did you mean 'connect'?
26 | cinnect[b].push_back(a);
| ^~~~~~~
| connect
a.cc:28:13: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
28 | if (dfs(1, 1)) cout << "POSSIBLE" << endl;
| ^~~
| ffs
a.cc: In function 'bool DFS(int, int)':
a.cc:16:1: warning: control reaches end of non-void function [-Wreturn-type]
16 | }
| ^
|
s778909637 | p03647 | C++ | #include <iostream>
using namespace std;
int ans[200000];
int main(){
int n,m;
cin >> n >> m;
memset(ans,0,sizeof(ans));
int is1,is2;
for(int i = 0;i < m;i++){
cin >> is1 >> is2;
if(is1==1) ans[is2]++;
else if(is2==1) ans[is1]++;
else if(is1==n) ans[is2]++;
else if(is2==n) ans[is1]++;
}
for(int i = 1;i < n;i++){
if(ans[i]==2){
cout << "POSSIBLE";
return 0;
}
}
cout << "IMPOSSIBLE";
}
| a.cc: In function 'int main()':
a.cc:9:5: error: 'memset' was not declared in this scope
9 | memset(ans,0,sizeof(ans));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s136641755 | p03647 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[200001][200001];
int p,q;
bool check = false;
void dfs(int now,int depth){
if(now==p){
check = true;
return;
}
if(depth==2||check)return;
for(int i=1;i<=p;++i){
if(a[now][i]==1)dfs(i,depth+1);
}
return;
}
int main(){
cin >> p >> q;
int x,y;
for(int i=0;i<q;++i){
cin >> x >> y;
a[x][y] = 1;
a[y][x] = 1;
}
for(int i=1;i<=p;i++){
for(int j=1;j<=p;j++){
cout << a[i][j] << " ";
}
cout << endl;
}
dfs(1,0);
if(check)cout << "POSSIBLE" << endl;
else cout << "IMPOSSIBLE" << endl;
return 0;
} | /tmp/ccbwthqI.o: in function `dfs(int, int)':
a.cc:(.text+0x10): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccbwthqI.o
a.cc:(.text+0x1b): relocation truncated to fit: R_X86_64_PC32 against symbol `check' defined in .bss section in /tmp/ccbwthqI.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `check' defined in .bss section in /tmp/ccbwthqI.o
a.cc:(.text+0x80): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccbwthqI.o
/tmp/ccbwthqI.o: in function `main':
a.cc:(.text+0x99): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccbwthqI.o
a.cc:(.text+0xb5): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccbwthqI.o
a.cc:(.text+0x154): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccbwthqI.o
a.cc:(.text+0x1c9): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccbwthqI.o
a.cc:(.text+0x1f1): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccbwthqI.o
a.cc:(.text+0x210): relocation truncated to fit: R_X86_64_PC32 against symbol `check' defined in .bss section in /tmp/ccbwthqI.o
collect2: error: ld returned 1 exit status
|
s268869093 | p03647 | C++ | #include <iostream>
int main(){
int n,m;
bool b1[n+10];
bool b2[n+10];
cin >> n >> m;
for(int i=0; i<m; i++){
int a,b;
cin >> a >> b;
if(a>b) swap(a,b);
if(a==1) b1[b]=true;
if(b==n) b2[a]=true;
}
for(int i=1; i<=m; i++){
if(b1[i]==true && b2[i]==true){
cout << "POSSIBLE" << endl;
}
return 0;
}
cout << "IMPOSSIBLE" << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: 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:10:13: error: 'swap' was not declared in this scope
10 | if(a>b) swap(a,b);
| ^~~~
a.cc:10:13: note: suggested alternatives:
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68,
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:
/usr/include/c++/14/tuple:2823:5: note: 'std::swap'
2823 | swap(tuple<_Elements...>&, tuple<_Elements...>&) = delete;
| ^~~~
In file included from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/bits/move.h:226:5: note: 'std::swap'
226 | swap(_Tp& __a, _Tp& __b)
| ^~~~
/usr/include/c++/14/bits/move.h:226:5: note: 'std::swap'
/usr/include/c++/14/bits/exception_ptr.h:229:5: note: 'std::__exception_ptr::swap'
229 | swap(exception_ptr& __lhs, exception_ptr& __rhs)
| ^~~~
a.cc:16:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout << "POSSIBLE" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:16:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
16 | cout << "POSSIBLE" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:20:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
20 | cout << "IMPOSSIBLE" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:20:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
20 | cout << "IMPOSSIBLE" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s667628304 | p03647 | C++ | #include <iostream>
int main(){
int n,m;
bool b1[n+10] ={false};
bool b2[n+10] ={false};
cin >> n >> m;
for(int i=0; i<m; i++){
int a,b;
cin >> a >> b;
if(a>b) swap(a,b);
if(a==1) b1[b]=true;
if(b==n) b2[a]=true;
}
for(int i=1; i<=m; i++){
if(b1[i]==true && b2[i]==true){
cout << "POSSIBLE" << endl;
}
return 0;
}
cout << "IMPOSSIBLE" << endl;
} | a.cc: In function 'int main()':
a.cc:4:18: error: '\U0000ff5bfalse' was not declared in this scope
4 | bool b1[n+10] ={false};
| ^~~~~~~
a.cc: At global scope:
a.cc:5:11: error: 'n' was not declared in this scope
5 | bool b2[n+10] ={false};
| ^
a.cc:5:18: error: '\U0000ff5bfalse' was not declared in this scope
5 | bool b2[n+10] ={false};
| ^~~~~~~
a.cc:5:25: error: expected declaration before '}' token
5 | bool b2[n+10] ={false};
| ^
a.cc:6:3: error: 'cin' does not name a type
6 | cin >> n >> m;
| ^~~
a.cc:7:3: error: expected unqualified-id before 'for'
7 | for(int i=0; i<m; i++){
| ^~~
a.cc:7:16: error: 'i' does not name a type
7 | for(int i=0; i<m; i++){
| ^
a.cc:7:21: error: 'i' does not name a type
7 | for(int i=0; i<m; i++){
| ^
a.cc:14:3: error: expected unqualified-id before 'for'
14 | for(int i=1; i<=m; i++){
| ^~~
a.cc:14:16: error: 'i' does not name a type
14 | for(int i=1; i<=m; i++){
| ^
a.cc:14:22: error: 'i' does not name a type
14 | for(int i=1; i<=m; i++){
| ^
a.cc:20:3: error: 'cout' does not name a type
20 | cout << "IMPOSSIBLE" << endl;
| ^~~~
a.cc:21:1: error: expected declaration before '}' token
21 | }
| ^
|
s243085745 | p03647 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] s = new int[2*M];
int[] ps = new int[2*M];
int counter = 0;
for(int i = 0;i < 2*M;i++){
s[i] = sc.nextInt();
}
for(int i = 0;i < 2*M -1;i += 2){
if(s[i] == 1){
ps[counter] = s[i];
ps[counter+1] = s[i+1];
counter += 2;
}
}
int ncounter = 0;
for(int i = 1;i < 2*M;i += 2){
if(s[i] == N){
ps[counter+2 + ncounter] = s[i-1];
ps[counter+3 + ncounter] = s[i];
ncounter += 2;
}
}
boolean possible = false;
out:
for(int i = 0;i < counter+1;i += 2){
for(int j = counter+3;j < counter + ncounter +2;j += 2){
if(ps[i] = ps[j]){
possible = true;
break out;
}
}
}
System.out.println(possible ? "POSSIBLE":"IMPOSSIBLE");
}}
| Main.java:32: error: incompatible types: int cannot be converted to boolean
if(ps[i] = ps[j]){
^
1 error
|
s775154766 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
out<<'('<<P.F<<','<<P.S<<')';
return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;
/*
ll mypow(ll a,ll b){
ll res=1LL;
while(b){
if(b&1) res=res*a%MOD;
else a=a*a%MOD;
b>>=1;
}
return res;
}
*/
set<int> st;
vector<int> v;
int main()
{
//IOS;
int n,m;
cin>>n>>m;
while(m--){
int u,v;
cin>>u>>v;
if(u==1) st.insert(v);
if(v==n) v.pb(u);
}
for(int a:v){
if(st.count(a)){
cout<<"POSSIBLE";
return 0;
}
}
cout<<"IMPOSSIBLE";
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:12: error: request for member 'push_back' in 'v', which is of non-class type 'int'
12 | #define pb push_back
| ^~~~~~~~~
a.cc:62:28: note: in expansion of macro 'pb'
62 | if(v==n) v.pb(u);
| ^~
|
s235655793 | p03647 | C | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, m, d[200000];
vector<int> g[200000];
cin >> n >> m;
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
a--, b--;
g[a].push_back(b);
}
queue<int> q;
for (int i = 0; i < n; i++)
d[i] = 3;
d[0] = 0;
q.push(0);
while (!q.empty()) {
int p = q.front(); q.pop();
for (int i = 0; i < g[p].size(); i++) {
if (d[g[p][i]] == 3) {
d[g[p][i]] = d[p] + 1;
q.push(g[p][i]);
}
}
}
cout << (d[n - 1] == 2 ? "POSSIBLE" : "IMPOSSIBLE") << endl;
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s261779887 | p03647 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <math.h>
#include <iomanip>
using namespace std;
typedef long long int ll;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll n, m, pair<ll, ll>p[200020];
cin >> n >> m;
for (int i = 0; i < m; i++)cin >> p[i].first >> p[i].second;
sort(p, p + n);
bool s[200020] = {}, ans = 0;
for (int i = 0; i < m; i++) {
if (p[i].first == 1)s[p[i].second] = 1;
if (s[p[i].first] && p[i].second == n) {
ans = 1;
break;
}
}
if (ans)cout << "POSSIBLE" << endl;
else cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:30: error: invalid declarator before 'p'
12 | ll n, m, pair<ll, ll>p[200020];
| ^
a.cc:14:43: error: 'p' was not declared in this scope
14 | for (int i = 0; i < m; i++)cin >> p[i].first >> p[i].second;
| ^
a.cc:15:14: error: 'p' was not declared in this scope
15 | sort(p, p + n);
| ^
|
s977922305 | p03647 | C++ | use std::io;
use std::cmp;
use std::mem;
fn read_line() -> String{
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
s
}
fn read_ints() -> Vec<i64>{
let s = read_line();
let split:Vec<&str> = s.trim().split(" ").collect();
split.iter().map(|&x| x.to_string().parse().unwrap()).collect()
}
fn main(){
let temp = read_ints();
let n = temp[0];
let m = temp[1];
let mut v = Vec::new();
for _i in 0..m{
let temp = read_ints();
let a = temp[0];
let b = temp[1];
if a == 1 || a == n {
match v.iter().find(|&&x| x==b){
Some(_) => {println!("POSSIBLE");return;},
None => {v.push(b);}
}
}else if b == 1 || b == n {
match v.iter().find(|&&x| x==a){
Some(_) => {println!("POSSIBLE");return;},
None => {v.push(a);}
}
}
}
println!("IMPOSSIBLE");
}
| a.cc:23:15: error: too many decimal points in number
23 | for _i in 0..m{
| ^~~~
a.cc:1:1: error: 'use' does not name a type
1 | use std::io;
| ^~~
a.cc:2:1: error: 'use' does not name a type
2 | use std::cmp;
| ^~~
a.cc:3:1: error: 'use' does not name a type
3 | use std::mem;
| ^~~
a.cc:5:1: error: 'fn' does not name a type
5 | fn read_line() -> String{
| ^~
a.cc:11:1: error: 'fn' does not name a type
11 | fn read_ints() -> Vec<i64>{
| ^~
a.cc:17:1: error: 'fn' does not name a type
17 | fn main(){
| ^~
|
s835391608 | p03647 | C++ | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
HashMap<Integer, List<Integer>> hmap = new HashMap<>();
for (Integer i=0; i<m; i++) {
int a = sc.nextInt();
int b = sc.nextInt();
List<Integer> listA = hmap.get(a);
if (listA != null) {
listA.add(b);
} else {
listA = new ArrayList<>();
listA.add(b);
}
hmap.put(a, listA);
List<Integer> listB = hmap.get(b);
if (listB != null) {
listB.add(a);
} else {
listB = new ArrayList<>();
listB.add(a);
}
hmap.put(b, listB);
}
List<Integer> list1 = hmap.get(1);
List<Integer> listn = hmap.get(n);
for (Integer med : list1) {
if (listn.contains(med)) {
System.out.println("POSSIBLE");
return;
}
}
System.out.println("IMPOSSIBLE");
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.util.ArrayList;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.HashMap;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.List;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.util.Scanner;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
6 | public class Main {
| ^~~~~~
|
s477708034 | p03647 | C++ | clude <cstdio>
#include <set>
#include <algorithm>
int main() {
int N, M;
scanf("%d %d", &N, &M);
std::set<int> set;
for (int i=0; i<M; ++i) {
int a, b;
scanf("%d %d", &a, &b);
if (a != 1 && b != N) continue;
int c=(a==1? b:a);
if (set.count(c))
return !printf("POSSIBLE\n");
set.insert(c);
}
printf("IMPOSSIBLE\n");
return 0;
}
| a.cc:1:1: error: 'clude' does not name a type
1 | clude <cstdio>
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/bits/stl_tree.h:63,
from /usr/include/c++/14/set:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __s |
s586666742 | p03647 | C++ | #include <iostream>
#include <algorithm>
#include <array>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>
#define INT_MAX 2000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define int_64 _int64
#define int_32 _int32
#define int_16 _int16
#define int_8 _int8
using namespace std;
int i, j, k;
int main() {
int n, m;
int a[200000], b[200000];
cin >> n >> m;
rep(i, 0, m)
cin >> a[i] >> b[i];
int_8 c[2][200001] = {};
rep(i, 0, m) {
if (a[i] == 1)
c[1][b[i]] = 1;
else if (a[i] == n)
c[0][b[i]] = 1;
if (b[i] == 1)
c[1][a[i]] = 1;
else if (b[i] == n)
c[0][a[i]] = 1;
}
int flag=0;
rep(i, 0, n) {
if ((c[0][i] & c[1][i]) == 1) {
flag = 1;
}
}
if (flag==1)
cout << "POSSIBLE" << endl;
else
cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:15: error: '_int8' was not declared in this scope
18 | #define int_8 _int8
| ^~~~~
a.cc:30:9: note: in expansion of macro 'int_8'
30 | int_8 c[2][200001] = {};
| ^~~~~
a.cc:33:25: error: 'c' was not declared in this scope
33 | c[1][b[i]] = 1;
| ^
a.cc:35:25: error: 'c' was not declared in this scope
35 | c[0][b[i]] = 1;
| ^
a.cc:37:25: error: 'c' was not declared in this scope
37 | c[1][a[i]] = 1;
| ^
a.cc:39:25: error: 'c' was not declared in this scope
39 | c[0][a[i]] = 1;
| ^
a.cc:43:22: error: 'c' was not declared in this scope
43 | if ((c[0][i] & c[1][i]) == 1) {
| ^
|
s320434837 | p03647 | C++ | #include <iostream>
#include <algorithm>
#include <array>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>
#define INT_MAX 2000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define int64 _int64
#define int32 _int32
#define int16 _int16
#define int8 _int8
using namespace std;
int i, j, k;
int main() {
int n, m;
int a[200000], b[200000];
cin >> n >> m;
rep(i, 0, m)
cin >> a[i] >> b[i];
int8 c[2][200001] = {};
rep(i, 0, m) {
if (a[i] == 1)
c[1][b[i]] = 1;
else if (a[i] == n)
c[0][b[i]] = 1;
if (b[i] == 1)
c[1][a[i]] = 1;
else if (b[i] == n)
c[0][a[i]] = 1;
}
int flag=0;
rep(i, 0, n) {
if ((c[0][i] & c[1][i]) == 1) {
flag = 1;
}
}
if (flag==1)
cout << "POSSIBLE" << endl;
else
cout << "IMPOSSIBLE" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:14: error: '_int8' was not declared in this scope; did you mean 'int8'?
18 | #define int8 _int8
| ^~~~~
a.cc:30:9: note: in expansion of macro 'int8'
30 | int8 c[2][200001] = {};
| ^~~~
a.cc:33:25: error: 'c' was not declared in this scope
33 | c[1][b[i]] = 1;
| ^
a.cc:35:25: error: 'c' was not declared in this scope
35 | c[0][b[i]] = 1;
| ^
a.cc:37:25: error: 'c' was not declared in this scope
37 | c[1][a[i]] = 1;
| ^
a.cc:39:25: error: 'c' was not declared in this scope
39 | c[0][a[i]] = 1;
| ^
a.cc:43:22: error: 'c' was not declared in this scope
43 | if ((c[0][i] & c[1][i]) == 1) {
| ^
|
s330708346 | p03647 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
vector<vector<bool>> edges(n, vector<bool>(n, false));
for(int i=0;i<m;i++){
int a, b;
cin >> a >> b;
a--, b--;
edges[a][b] = edge[b][a] = true;
}
bool flag = false;
for(int i=1;i<n-1;i++){
if(edges[0][i] && edges[i][n-1])
flag = true;
}
cout << (flag?"POSSIBLE":"IMPOSSIBLE") << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:23: error: 'edge' was not declared in this scope; did you mean 'edges'?
15 | edges[a][b] = edge[b][a] = true;
| ^~~~
| edges
|
s930446339 | p03647 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n, m;
cin >> n >> m;
vector<vector<bool>> edges(n, vector<int>(n, false));
for(int i=0;i<m;i++){
int a, b;
cin >> a >> b;
a--, b--;
edges[a][b] = edge[b][a] = true;
}
bool flag = false;
for(int i=1;i<n-1;i++){
if(edges[0][i] && edges[i][n-1])
flag = true;
}
cout << (flag?"POSSIBLE":"IMPOSSIBLE") << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:56: error: no matching function for call to 'std::vector<std::vector<bool> >::vector(int&, std::vector<int>)'
9 | vector<vector<bool>> edges(n, vector<int>(n, false));
| ^
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >]'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed:
a.cc:9:56: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<int>')
9 | vector<vector<bool>> edges(n, vector<int>(n, false));
| ^
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >; allocator_type = std::allocator<std::vector<bool> >]'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<std::vector<bool> >'
678 | vector(initializer_list<value_type> __l,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<bool> >]'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<std::vector<bool> >&&'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >; allocator_type = std::allocator<std::vector<bool> >; std::false_type = std::false_type]'
640 | vector(vector&& __rv, const allocator_type& __m, false_type)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >; allocator_type = std::allocator<std::vector<bool> >; std::true_type = std::true_type]'
635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<bool> >]'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<bool> >&'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >]'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >]'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >; size_type = long unsigned int; value_type = std::vector<bool>; allocator_type = std::allocator<std::vector<bool> >]'
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:47: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<bool> >::value_type&' {aka 'const std::vector<bool>&'}
569 | vector(size_type __n, const value_type& __value,
| ~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<bool> >]'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<bool> >::allocator_type&' {aka 'const std::allocator<std::vector<bool> >&'}
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >; allocator_type = std::allocator<std::vector<bool> >]'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::vector<bool>; _Alloc = std::allocator<std::vector<bool> >]'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided
a.cc:15:23: error: 'edge' was not declared in this scope; did you mean 'edges'?
15 | edges[a][b] = edge[b][a] = true;
| ^~~~
| edges
|
s798874059 | p03647 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int N,M,a,b;
vector <int> u,v;
cin>>N>>M;
for(int i=0;i<M;i++){
cin>>a>>b;
if(a==1){
u.push_back(b);
}
if(b==N){
v.push_back(a);
}
int i=0,j=0;
sort(u.begin(),u.end());
sort(v.begin(),v.end());
for(i;i<u.size();i++){
if(u[i]==u[i+1]){
continue;
}
for(j;j<v.size() && v[j]<=u[i] ;j++){
if(u[i]==v[j]){
cout<<"POSSIBLE"<<endl;
return 0;
}
}
}
}
cout<<"IMPOSSIBLE"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:9: error: redeclaration of 'int i'
19 | int i=0,j=0;
| ^
a.cc:11:11: note: 'int i' previously declared here
11 | for(int i=0;i<M;i++){
| ^
|
s322321844 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m,s[200001],g[200001],i,ans=0,x,y;
for(i=0;i<200001;i++){
s[i] = 0;
g[i] = 0;
}
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d",&x,&y);
if(x==1){
s[y] ++;
}
if(y==n){
g[x] ++;
}
}
for(i=1;i<n;i++){
if((s[i]==1) && (g[i]==1){
ans = 1;
break;
}
}
if(ans == 1){
printf("POSSIBLE\n");
} else {
printf("IMPOSSIBLE\n");
}
} | a.cc: In function 'int main()':
a.cc:21:34: error: expected ')' before '{' token
21 | if((s[i]==1) && (g[i]==1){
| ~ ^
| )
a.cc:25:5: error: expected primary-expression before '}' token
25 | }
| ^
|
s304170002 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m,s[200001],g[200001],i,ans=0,x,y;
for(i=0;i<200001;i++){
s[i] = 0;
g[i] = 0;
}
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d",&x,&y);
if(x==1){
s[y] ++;
}
if(y==n){
g[x] ++;
}
}
for(i=1;i<n;i++){
if((s[i]==1) && (g[i]==1){
ans = 1;1
break;
}
}
if(ans == 1){
printf("POSSIBLE\n");
} else {
printf("IMPOSSIBLE\n");
}
} | a.cc: In function 'int main()':
a.cc:21:34: error: expected ')' before '{' token
21 | if((s[i]==1) && (g[i]==1){
| ~ ^
| )
a.cc:25:5: error: expected primary-expression before '}' token
25 | }
| ^
|
s275477501 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m,s[200001],g[200001],i,ans=0,x,y;
for(i=0;i<200001;i++){
s[i] = 0;
g[i] = 0;
}
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d",&x,&y);
if(x==1){
s[y] ++;
}
if(y==n){
g[x] ++;
}
}
for(i=1;i<n;i++){
if(s[i]==1 && g[i]==1){
ans = 1;1
break;
}
}
if(ans == 1){
printf("POSSIBLE\n");
} else {
printf("IMPOSSIBLE\n");
}
} | a.cc: In function 'int main()':
a.cc:22:22: error: expected ';' before 'break'
22 | ans = 1;1
| ^
| ;
23 | break;
| ~~~~~
|
s229149865 | p03647 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int N, M;
cin>>N>>M;
bool suc=false;
bool st[200010]={0}, gl[200010]={0};
for(int i=0;i<M;i++){
int a, b;
cin>>a>>b;
if(a==1)
st[b]=true;
else if(b==N)
gl[a]=true;
}
for(int i=2;i<=200000&&!suc;i++){
if(st[i]&&gl[i])
suc=true;
}
if(suc)
cout<<"POSSIBLE"<<endl;
else
cout<<"IMPOSSIBLE"<<endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin>>N>>M;
| ^~~
a.cc:23:17: error: 'cout' was not declared in this scope
23 | cout<<"POSSIBLE"<<endl;
| ^~~~
a.cc:23:35: error: 'endl' was not declared in this scope
23 | cout<<"POSSIBLE"<<endl;
| ^~~~
a.cc:25:17: error: 'cout' was not declared in this scope
25 | cout<<"IMPOSSIBLE"<<endl;
| ^~~~
a.cc:25:37: error: 'endl' was not declared in this scope
25 | cout<<"IMPOSSIBLE"<<endl;
| ^~~~
|
s237977678 | p03647 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
using namespace std;
int n,m,i,j,ans,hu;
vector<int> bi[200005];
bool vis[200005];
int main()
{
cin>>n;
for (i=1;i<=n;i++)
{
cin>>x;
bi[x].push_back(i);
}
for (i=1;i<=n;i++)
{
if (!vis[i])
{
dfs(i);
}
}
if (!hu)
{
cout<<"POSSIBLE";
return 0;
}
| a.cc:8:1: error: 'vector' does not name a type
8 | vector<int> bi[200005];
| ^~~~~~
a.cc: In function 'int main()':
a.cc:15:22: error: 'x' was not declared in this scope
15 | cin>>x;
| ^
a.cc:16:17: error: 'bi' was not declared in this scope; did you mean 'i'?
16 | bi[x].push_back(i);
| ^~
| i
a.cc:22:26: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
22 | dfs(i);
| ^~~
| ffs
a.cc:29:10: error: expected '}' at end of input
29 | }
| ^
a.cc:11:1: note: to match this '{'
11 | {
| ^
|
s365031407 | p03647 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<int> v1, v2;
v1.reserve(m);
v2.reserve(m);
int a, b;
for(auto i = 0; i < m; ++i) {
cin >> a >> b;
if(a == 1) {
v1.pushback(b);
}
if(b == n) {
v2.reserve(a);
}
}
for(auto x : v1) {
for(auto y : v2) {
if(x == y) {
cout << "POSSIBLE" << endl;
return 0;
}
}
}
cout << "INPOSSIBLE" << endl;
}
| a.cc: In function 'int main()':
a.cc:19:28: error: 'class std::vector<int>' has no member named 'pushback'; did you mean 'push_back'?
19 | v1.pushback(b);
| ^~~~~~~~
| push_back
|
s924613651 | p03647 | C++ | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
TaskC solver = new TaskC();
solver.solve(1, in, out);
out.close();
}
static class TaskC {
public void solve(int testNumber, InputReader in, PrintWriter out) {
int n = in.nextInt();
int m = in.nextInt();
boolean[] connectedToSource = new boolean[n];
boolean[] connectedToDest = new boolean[n];
while (m-- > 0) {
int x = in.nextInt() - 1;
int y = in.nextInt() - 1;
if (x == 0) {
connectedToSource[y] = true;
} else if (x == n - 1) {
connectedToDest[y] = true;
} else if (y == 0) {
connectedToSource[x] = true;
} else if (y == n - 1) {
connectedToDest[x] = true;
}
}
for (int i = 0; i < n; ++i) {
if (connectedToDest[i] && connectedToSource[i]) {
out.println("POSSIBLE");
return;
}
}
out.println("IMPOSSIBLE");
}
}
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
public InputReader(InputStream stream) {
this.stream = stream;
}
public int read() {
if (numChars == -1)
throw new UnknownError();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new UnknownError();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt() {
return Integer.parseInt(next());
}
public String next() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuffer res = new StringBuffer();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
private boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.io.OutputStream;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.io.InputStream;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.io.PrintWriter;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import java.io.IOException;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import java.io.InputStream;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:12:1: error: expected unqualified-id before 'public'
12 | public class Main {
| ^~~~~~
|
s013443707 | p03647 | C++ | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
long long f(vector<long long> a){
int idx = max_element(a.begin(),a.end()) - a.begin();
if( a[idx] < a.size() ) return 0;
a[idx] -= a.size();
a[idx^1] += 1;
return 1 + f(a);
}
int main(){
long long N;
cin >> N;
vector<long long> a(50,49 + N / 50);
for(int i = 0 ; i < N % 50 ; i++){
sort(a.begin(),a.end());
a[0] += 50;
for(int j = 1 ; j < 50 ; j++)
a[j] -= 1;
}
cout << 50 << endl;
for(int i = 0 ; i < 50 ; i++) cout << a[i] << (i + 1 == "\n" : " ");
// 4 4 4 4 | 4
// 5 5 5 0 | 3
// 1 6 6 1 | 2
// 2 2 7 2 | 1
// 3 3 3 3 | 0
// 3 3 3 3
} | a.cc: In function 'int main()':
a.cc:27:62: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
27 | for(int i = 0 ; i < 50 ; i++) cout << a[i] << (i + 1 == "\n" : " ");
| ~~~~~~^~~~~~~
a.cc:27:69: error: expected ')' before ':' token
27 | for(int i = 0 ; i < 50 ; i++) cout << a[i] << (i + 1 == "\n" : " ");
| ~ ^~
| )
|
s483317721 | p03647 | C++ | #include <iostream>
#include <map>
#include <vector>
using namespace std;
long long f(vector<long long> a){
int idx = max_element(a.begin(),a.end()) - a.begin();
if( a[idx] < a.size() ) return 0;
a[idx] -= a.size();
a[idx^1] += 1;
return 1 + f(a);
}
int main(){
long long N;
cin >> N;
vector<long long> a(50,49 + N / 50);
for(int i = 0 ; i < N % 50 ; i++){
sort(a.begin(),a.end());
a[0] += 50;
for(int j = 1 ; j < 50 ; j++)
a[j] -= 1;
}
cout << 50 << endl;
for(int i = 0 ; i < 50 ; i++) cout << a[i] << " ";
// 4 4 4 4 | 4
// 5 5 5 0 | 3
// 1 6 6 1 | 2
// 2 2 7 2 | 1
// 3 3 3 3 | 0
// 3 3 3 3
} | a.cc: In function 'long long int f(std::vector<long long int>)':
a.cc:8:19: error: 'max_element' was not declared in this scope
8 | int idx = max_element(a.begin(),a.end()) - a.begin();
| ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:20:17: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(a.begin(),a.end());
| ^~~~
| short
|
s908530466 | p03647 | C++ | #include <algorithm>
using namespace std;
bool can[3][200000];
int n, m;
int v[200000];
int to[200000];
int main() {
ios_base::sync_with_stdio(0);
cin >> n >> m;
for (int i = 0; i < m; i++) {
cin >> v[i] >> to[i];
v[i]--;
to[i]--;
}
for (int i = 0; i < n; i++) {
can[0][i] = can[1][i] = can[2][i] = 0;
}
can[0][0] = 1;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < m; j++) {
if (can[i][v[j]]) {
can[i + 1][to[j]] = 1;
}
if (can[i][to[j]]) {
can[i + 1][v[j]] = 1;
}
}
}
if (can[2][n - 1]) {
cout << "POSSIBLE";
} else {
cout << "IMPOSSIBLE";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:9: error: 'ios_base' has not been declared
10 | ios_base::sync_with_stdio(0);
| ^~~~~~~~
a.cc:11:9: error: 'cin' was not declared in this scope
11 | cin >> n >> m;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <algorithm>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:34:17: error: 'cout' was not declared in this scope
34 | cout << "POSSIBLE";
| ^~~~
a.cc:34:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:36:17: error: 'cout' was not declared in this scope
36 | cout << "IMPOSSIBLE";
| ^~~~
a.cc:36:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s517422166 | p03647 | C++ | #include <algorithm>
using namespace std;
bool can[200000];
int n, m;
int v[200000];
int to[200000];
int main() {
ios_base::sync_with_stdio(0);
cin >> n >> m;
for (int i = 0; i < m; i++) {
cin >> v[i] >> to[i];
v[i]--;
to[i]--;
}
for (int i = 0; i < n; i++) {
can[i] = 0;
}
can[0] = 1;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < m; j++) {
if (can[v[j]]) {
can[to[j]] = 1;
}
if (can[to[j]]) {
can[v[j]] = 1;
}
}
}
if (can[n - 1]) {
cout << "POSSIBLE";
} else {
cout << "IMPOSSIBLE";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:9: error: 'ios_base' has not been declared
10 | ios_base::sync_with_stdio(0);
| ^~~~~~~~
a.cc:11:9: error: 'cin' was not declared in this scope
11 | cin >> n >> m;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <algorithm>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:33:17: error: 'cout' was not declared in this scope
33 | cout << "POSSIBLE";
| ^~~~
a.cc:33:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:17: error: 'cout' was not declared in this scope
35 | cout << "IMPOSSIBLE";
| ^~~~
a.cc:35:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s761426351 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
vector<int> next;
vector<int> bef;
longlong n,m;
cin>>n>>m;
for (int i; i<m;i++){
int a,b;
cin>>a>>b;
if (a==1) next.push_back(b);
if (b==n) bef.push_back(a);
}
int l1,l2;
int ans=0;
l1=next.size();
l2=bef.size();
for (int i;i<l1;i++){
for (int j;j<l2;j++){
if (next[i]==bef[j]){
ans=1; break;
}
}
}
if (ans==0) printf ("IMPOSSIBLE");
if (ans==1) printf ("POSSIBLE");
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'longlong' was not declared in this scope
6 | longlong n,m;
| ^~~~~~~~
a.cc:7:8: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | cin>>n>>m;
| ^
| yn
a.cc:7:11: error: 'm' was not declared in this scope; did you mean 'tm'?
7 | cin>>n>>m;
| ^
| tm
|
s722541745 | p03647 | C++ | #inlcude <bits/stdc++.h>
using namespace std;
#define _int64 long long
_int64 a[60];
int main()
{
_int64 i,j,n,tmp,ans,b1;
scanf("%lld",&n);
for (i=0;i<n;i++)
scanf("%lld",&a[i]);
ans=0;
b1=1;
while (b1==1)
{
b1=0;
for (i=0;i<n;i++)
if (a[i]>=n)
{
b1=1;
tmp=a[i]/n;
a[i]%=n;
ans+=tmp;
for (j=0;j<n;j++)
if (i!=j) a[j]+=tmp;
}
}
printf("%lld\n",ans);
return 0;
} | a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <bits/stdc++.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:11:3: error: 'scanf' was not declared in this scope
11 | scanf("%lld",&n);
| ^~~~~
a.cc:30:3: error: 'printf' was not declared in this scope
30 | printf("%lld\n",ans);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | #inlcude <bits/stdc++.h>
|
s090392616 | p03647 | C++ | #include<bits/stdc++.h>
using namespace std;
int cnt;
vector<int>v[200010];
void dfs(int s,int d)
{
if(s==d) return;
for(int i=0;i<v[s].size();i++)
{
cnt++;
dfs(v[s][i],d);
}
}
int main()
{
int n,m;
cin>>n>>m;
for(int i=0;i<m;i++)
{
int a,b;
cin>>a>>b;
v[a].push_back(b);
}
dfs(1,n);
if(cnt>2) cout<<IMPOSSIBLE<<endl;
else cout<<POSSIBLE<<endl;
}
| a.cc: In function 'int main()':
a.cc:25:21: error: 'IMPOSSIBLE' was not declared in this scope
25 | if(cnt>2) cout<<IMPOSSIBLE<<endl;
| ^~~~~~~~~~
a.cc:26:16: error: 'POSSIBLE' was not declared in this scope
26 | else cout<<POSSIBLE<<endl;
| ^~~~~~~~
|
s523674176 | p03647 | C++ | if __name__ == '__main__':
N, M = list(map(int, input().split()))
a = []
b = []
for i in range(M):
tmp_a, tmp_b = list(map(int, input().split()))
a.append(tmp_a)
b.append(tmp_b)
c = set([b[i] for i in range(0, M) if a[i] == 1])
for i in range(0, M):
if a[i] in c and b[i] == N:
print("POSSIBLE")
break
else:
print("IMPOSSIBLE")
| a.cc:1:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
1 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before 'if'
1 | if __name__ == '__main__':
| ^~
|
s363174984 | p03647 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool contains(vector<int> &adj,M){
if(find(adj.begin(),adj.end(),M)!=adj.end()) return true;
else return false;
}
int main(){
int N,M;
int a,b;
cin>>N>>M;
vector<vector<int> >adj(N+1,);
while(cin>>a>>b){
adj[a].push_back(b);
}
if(contains(adj[1],M)) {
cout<<"possibel"<<endl;
return 0;
}else{
for(int c: adj[1]){
if(contains(c,M)) {
cout<<"possible"<<endl;
return 0;
}else{
cout<<"impossible"<<endl;
return 0;
}
}
}
return 0;
} | a.cc:5:32: error: 'M' has not been declared
5 | bool contains(vector<int> &adj,M){
| ^
a.cc: In function 'bool contains(std::vector<int>&, int)':
a.cc:6:33: error: 'M' was not declared in this scope
6 | if(find(adj.begin(),adj.end(),M)!=adj.end()) return true;
| ^
a.cc: In function 'int main()':
a.cc:14:31: error: expected primary-expression before ')' token
14 | vector<vector<int> >adj(N+1,);
| ^
a.cc:23:19: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'int'
23 | if(contains(c,M)) {
| ^
a.cc:5:28: note: in passing argument 1 of 'bool contains(std::vector<int>&, int)'
5 | bool contains(vector<int> &adj,M){
| ~~~~~~~~~~~~~^~~
a.cc: In function 'bool contains(std::vector<int>&, int)':
a.cc:8:1: warning: control reaches end of non-void function [-Wreturn-type]
8 | }
| ^
|
s767761062 | p03647 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int N,M;
int a,b;
cin>>N>>M;
vector<vector<int> >adj(N+1,);
while(cin>>a>>b){
adj[a].push_back(b);
}
if(contains(adj[1],M)) {
cout<<"possibel"<<endl;
return 0;
}else{
for(int c: adj[1]){
if(contains(c,M)) {
cout<<"possible"<<endl;
return 0;
}else{
cout<<"impossible"<<endl;
return 0;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:31: error: expected primary-expression before ')' token
9 | vector<vector<int> >adj(N+1,);
| ^
a.cc:13:6: error: 'contains' was not declared in this scope
13 | if(contains(adj[1],M)) {
| ^~~~~~~~
|
s343435018 | p03647 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int N,M;
int a,b;
cin>>N>>M;
vector<vector<int> >adj(N+1,{});
while(cin>>a>>b){
adj[a].push_back(b);
}
if(contains(adj[1],M)) {
cout<<"possibel"<<endl;
return 0;
}else{
for(int c: adj[1]){
if(contains(c,M)) {
cout<<"possible"<<endl;
return 0;
}else{
cout<<"impossible"<<endl;
return 0;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:33: error: call of overloaded 'vector(int, <brace-enclosed initializer list>)' is ambiguous
9 | vector<vector<int> >adj(N+1,{});
| ^
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; size_type = long unsigned int; value_type = std::vector<int>; allocator_type = std::allocator<std::vector<int> >]'
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<int> >]'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
a.cc:13:6: error: 'contains' was not declared in this scope
13 | if(contains(adj[1],M)) {
| ^~~~~~~~
|
s428436438 | p03647 | C++ | #include<stdio.h>
int main()
{
long long a,k;
scanf_s("%lld", &k);
printf("%lld\n", k);
for (long long i = 0; i < k; i++) {
printf("%lld ", k);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
6 | scanf_s("%lld", &k);
| ^~~~~~~
| scanf
|
s764414585 | p03647 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
public class A {
public static void main(String[] args) {
InputReader in = new InputReader();
PrintWriter out = new PrintWriter(System.out);
int n = in.nextInt();
int m = in.nextInt();
ArrayList<Integer>[] a = new ArrayList[n];
for (int i = 0; i < n; i++) {
a[i] = new ArrayList();
}
for (int i = 0; i < m; i++) {
int u = in.nextInt() - 1;
int v = in.nextInt() - 1;
a[u].add(v);
a[v].add(u);
}
boolean ok = false;
for (int i = 0; i < a[0].size(); i++) {
int j = a[0].get(i);
for (int k = 0; k < a[j].size(); k++) {
if (a[j].get(k) == n - 1) ok = true;
}
}
out.println(ok ? "POSSIBLE" : "IMPOSSIBLE");
out.close();
}
static class InputReader {
BufferedReader br;
StringTokenizer st;
public InputReader()
{
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next()
{
while (st == null || !st.hasMoreElements())
{
try
{
st = new StringTokenizer(br.readLine());
}
catch (IOException e)
{
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt()
{
return Integer.parseInt(next());
}
long nextLong()
{
return Long.parseLong(next());
}
double nextDouble()
{
return Double.parseDouble(next());
}
String nextLine()
{
String str = "";
try
{
str = br.readLine();
}
catch (IOException e)
{
e.printStackTrace();
}
return str;
}
}
}
| Main.java:9: error: class A is public, should be declared in a file named A.java
public class A {
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s669692799 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int adake[N + 5], adadari[N + 5];
int main(){
scanf("%d%d", &n, &m);
for(int i = 0;i < m; ++i){
int a, b;
scanf("%d%d", &a, &b);
int low = min(a, b);
int hi = max(a, b);
if(lo == 1){
adake[hi] = 1;
}
else if(hi == n){
adadari[lo] = 1;
}
}
for(int i = 2;i <= n-1; ++i){
if(adake[i] && adadari[i]){
puts("POSSIBLE");
return 0;
}
}
puts("IMPOSSIBLE");
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:24: error: 'n' was not declared in this scope
6 | scanf("%d%d", &n, &m);
| ^
a.cc:6:28: error: 'm' was not declared in this scope; did you mean 'tm'?
6 | scanf("%d%d", &n, &m);
| ^
| tm
a.cc:12:20: error: 'lo' was not declared in this scope; did you mean 'low'?
12 | if(lo == 1){
| ^~
| low
|
s873550242 | p03647 | C++ | #include <iostream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
#include <cstdio>
#include <time.h>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <math.h>
//#include <bits/stdc++.h>
#define ll long long
#define int64 long long
#define mem(x,y) memset(x,y,sizeof(x))
#define ull unsigned long long
#define pb push_back
#define INF 0x3f3f3f3f
#define lson l, mid, rt<<1
#define rson mid+1, r, rt<<1|1
#define pi 3.141592653589793238462
using namespace std;
const int maxn = 2e5 + 5;
const int maxm = 3e5 + 5;
const int mod = 1e9 + 7;
const int seed = 10007;
const double eps = 1e-5;
vector<int> g[maxn];
int main() {
scanf("%d%d",&n,&m);
int u,v;
for(int i=0;i<n;i++){
scanf("%d%d",&u,&v);
g[u].pb(v);
g[v].pb(u);
}
for(int i=0;i<g[1].size();i++){
int v=g[1][i];
for(int j=0;j<g[v].size();j++){
if(g[v][j]==n){
printf("POSSIBLE\n");
return 0;
}
}
}
printf("IMPOSSIBLE\n");
return 0;
}
| a.cc: In function 'int main()':
a.cc:34:19: error: 'n' was not declared in this scope; did you mean 'yn'?
34 | scanf("%d%d",&n,&m);
| ^
| yn
a.cc:34:22: error: 'm' was not declared in this scope; did you mean 'tm'?
34 | scanf("%d%d",&n,&m);
| ^
| tm
|
s290260634 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
#define fo(i,s,t) for(int i = s; i <= t; ++ i)
#define fd(i,s,t) for(int i = s; i >= t; -- i)
typedef long long ll;
#define pb push_back
const int maxn = 200050;
const int inf = 1<<30;
int n, in[maxn], to[maxn];
bool v[maxn];
set<int> s[maxn];
vector<int> loop, candidate;
void go(int x)
{
v[x] = true;
fo(i,0,inf) if(s[x].find(i)==s[x].end()){s[to[x]].insert(i); break;}
if(!(-- in[to[x]])) go(to[x]);
}
int main()
{
scanf("%d",&n);
fo(i,1,n) {int x; scanf("%d",&to[i]); in[to[i]] ++;}
fo(i,1,n) if(!in[i] && !v[i]) go(i);
fo(i,1,n) if(!v[i])
{
int now = i;
while(1)
{
loop.pb(now);
now = to[now];
if(now == i) break;
}
break;
}
for(int i = 0; candidate.size()<2; ++ i)
if(s[loop[0]].find(i)==s[loop[0]].end())
candidate.pb(i);
i
fo(i,0,1)
{
in[0] = candidate[i];
fo(j,1,loop.size()-1)
{
fo(k,0,inf)
if(in[j-1]!=k&&s[loop[j]].find(k)==s[loop[j]].end())
{
in[j] = k;
break;
}
}
if(in[loop.size()-1]!=in[0]) return 0*printf("POSSIBLE\n");
}
printf("IMPOSSIBLE\n");
return 0;
}
| a.cc: In function 'int main()':
a.cc:42:9: error: 'i' was not declared in this scope
42 | i
| ^
|
s050576995 | p03647 | C++ | include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll k ;
cin >> k ;
if( k==0 )
{
cout << 4 << endl;
cout << 3 << " " << 3 << " " << 3 << " " << 3 << endl; return 0;
}
cout << 10000000 << endl;
for( ll i =0 ; i<10000000-1; i++ )
{
cout << i-1 << " " ;
}
cout << 10000000 << endl;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'ios_base' has not been declared
8 | ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
| ^~~~~~~~
a.cc:8:35: error: 'cin' was not declared in this scope
8 | ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
| ^~~
a.cc:8:47: error: 'cout' was not declared in this scope
8 | ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
| ^~~~
a.cc:13:23: error: 'endl' was not declared in this scope
13 | cout << 4 << endl;
| ^~~~
a.cc:16:27: error: 'endl' was not declared in this scope
16 | cout << 10000000 << endl;
| ^~~~
|
s461454305 | p03647 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,m,y,x;
vector<int>v[200001];
bool used[200001];
void dfs(int to,int depth){
if(depth==2)return;
rep(i,v[to].size()){
int x=v[to][i];
if(!used[x]){
used[x]=1;
dfs(x,d+1);
}
}
}
main(){
cin>>n>>m;
rep(i,m){
cin>>x>>y;
v[x].push_back(y);
v[y].push_back(x);
}
dfs(1,0);
if(used[n])cout<<"POSSIBLE"<<endl;
else cout<<"IMPOSSIBLE"<<endl;
} | a.cc: In function 'void dfs(int, int)':
a.cc:13:13: error: 'd' was not declared in this scope
13 | dfs(x,d+1);
| ^
a.cc: At global scope:
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
17 | main(){
| ^~~~
|
s042845072 | p03647 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,m,y,x;
vector<int>v[200001];
bool used[200001];
void dfs(int to,int depth){
if(depth==2)return;
rep(i,v[to].size()){
int x=v[to][i];
if(!b[x]){
b[x]=1;
dfs(x,d+1);
}
}
}
main(){
cin>>n>>m;
rep(i,m){
cin>>x>>y;
v[x].push_back(y);
v[y].push_back(x);
}
dfs(1,0);
if(used[n])cout<<"POSSIBLE"<<endl;
else cout<<"IMPOSSIBLE"<<endl;
} | a.cc: In function 'void dfs(int, int)':
a.cc:11:9: error: 'b' was not declared in this scope
11 | if(!b[x]){
| ^
a.cc:13:13: error: 'd' was not declared in this scope
13 | dfs(x,d+1);
| ^
a.cc: At global scope:
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
17 | main(){
| ^~~~
|
s405678253 | p03647 | C++ | #include <cstdio>
#include <cstring>
#define MAXN 200000
#define T 500
int is[2][MAXN];
int main(){
int n,m,a,b,temp;
scanf("%d %d",&n,&m);
while(m--){
scanf("%d %d",&a,&b);
if(a==1||a==n||b==1||b==n){
if(b==1||b==n){
temp=b;
b=a;
a=temp;
}
if(a==1)
is[0][b]=1;
else if(a==n) is[1][b]=1;
}
}
for(int i=0;i<MAXN;i++){
if(is[0][i]==1){
printf("POSSIBLE\n");
return 0;
| a.cc: In function 'int main()':
a.cc:26:22: error: expected '}' at end of input
26 | return 0;
| ^
a.cc:24:24: note: to match this '{'
24 | if(is[0][i]==1){
| ^
a.cc:26:22: error: expected '}' at end of input
26 | return 0;
| ^
a.cc:23:28: note: to match this '{'
23 | for(int i=0;i<MAXN;i++){
| ^
a.cc:26:22: error: expected '}' at end of input
26 | return 0;
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s996203482 | p03647 | C++ |
#define PROB ChangingChange
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, l, r) for (int i = l; i<r;i++)
#define all(b) b.begin() , b.end()
#define mp(a, b) make_pair(a,b)
#define pb(a) push_back(a)
#define vi vector<int>
#define vd vector<double>
#define vs vector<string>
#define vii vector<pair<int,int>>
#define vvi vector<vector<int>>
#define ii pair<int,int>
#define turnOff(k, i) (k&(~(1<<(i-1))))
#define isOn(k, i) (k&&(1<<i-1)?true:false)
#define pll pair<long long int , long long int>
#define ull unsigned long long int
#define ll long long int
#define add(a, b) ((a+b)%MOD)
#define sub(a, b) ((a-b+MOD)%MOD)
#define mul(a, b) ((a*b)%MOD)
#ifdef DEBUG
#define MAXN 105
#else
#define MAXN 5000020
#endif
#define MAXLG 20
#define endl '\n'
#define PI 3.141592653589793238
#define MOD (1000000007)
#define INF (2000000000)
#define EPS (0.00000001)
#define treap treapNode*
int gcd(int a, int b) {
while (a != 0) {
int c = a;
a = b % a;
b = c;
}
return b;
}
vi adj[3000];
vi getAllDivisors(int num) {
vector<int> divs;
int square_root = (int) sqrt(num) + 1;
for (int i = 1; i < square_root; i++) {
if (num % i == 0) {
if (i * i != num) {
divs.pb(i);
}
divs.pb(num / i);
}
}
return divs;
}
class PROB {
public:
};
ll mod_pow(long x, int y) {
// exponentiation by squaring
ll r = 1;
while (y > 0) {
if (y % 2 == 1) {
r = (r * x) % MOD;
}
x = (x * x) % MOD;
y /= 2;
}
return r;
}
int dp[2][1001][51][51];
int main() {
PROB temp;
ios_base::sync_with_stdio(false);
cin.tie(0);
#ifdef DEBUG
freopen("input", "r", stdin);
#end
cout<<2<<endl<<0<<" " <<" "<<0;
return 0;
} | a.cc:90: error: unterminated #ifdef
90 | #ifdef DEBUG
a.cc: In function 'int main()':
a.cc:88:16: error: expected '}' at end of input
88 | cin.tie(0);
| ^
a.cc:85:12: note: to match this '{'
85 | int main() {
| ^
|
s153978072 | p03647 | C++ | //( ͡° ͜ʖ ͡°) °º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤º°` looking at my code...
//#define ONLINE_JUDGE //in case i forget to uncomment this, sometimes the grader defines the macro ^.^
#ifdef ONLINE_JUDGE
#include <bits/stdc++.h>
#else
#include "stdc++.h"
#endif
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define INF (int)1e9
#define int long long
using namespace std;
signed main() {
#ifndef ONLINE_JUDGE
freopen("/Users/kdkdk/Desktop/input.txt", "r", stdin);
//freopen("/Users/kdkdk/Desktop/output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<pair<int,int> > bridges (n);
for(int i = 0; i < m; ++i) cin >> bridges[i].first >> bridges[i].second;
unordered_map<int, bool> possible;
for(int i = 0; i < m; ++i) if(bridges[i].second == n) possible[bridges[i].first] = true;
bool totPossible = false;
for(int i = 0; i < m && !totPossible; ++i) if(bridges[i].first == 1) if(possible.count(bridges[i].second) > 0 && possible[bridges[i].second]) totPossible = true;
cout << (totPossible ? "POSSIBLE" : "IMPOSSIBLE") << endl;
return 0;
}
| a.cc:7:10: fatal error: stdc++.h: No such file or directory
7 | #include "stdc++.h"
| ^~~~~~~~~~
compilation terminated.
|
s189463842 | p03647 | C++ | #include <vector>
#include <iostream>
using namespace std;
int main(void)
{
int n, m;
cin >> n >> m;
vector<int> a(m);
vector<int> b(m);
int a1s = 0, a2s = 0;
vector<int> a1(m), a2(m);
vector<int> b1(m), b2(m);
for (int i = 0; i < m; i++) {
cin >> a[i] >> b[i];
if (a[i] == 1) {
a1[a1s] = a[i];
b1[b1s] = b[i];
a1s++;
} else {
a2[a2s] = a[i];
b2[b2s] = b[i];
a2s++;
}
}
bool ans = false;
for (int i = 0; i < a1s; i++) {
if (a1[i] == 1) {
int tmp = b1[i];
for (int j = 0; j < a2s; j++) {
if (a2[j] == tmp){
if (b2[j] == n) {
ans = true;
break;
}
}
}
if (ans) break;
}
}
if (ans) {
cout << "POSSIBLE" << endl;
} else {
cout << "IMPOSSIBLE" << endl;
}
} | a.cc: In function 'int main()':
a.cc:21:20: error: 'b1s' was not declared in this scope; did you mean 'b1'?
21 | b1[b1s] = b[i];
| ^~~
| b1
a.cc:25:20: error: 'b2s' was not declared in this scope; did you mean 'b2'?
25 | b2[b2s] = b[i];
| ^~~
| b2
|
s413598798 | p03647 | C++ | #include <stdio.h>
using namespace std;
int n,m,a[200005],b[200005];
bool f[200005];
int main(){
scanf("%d %d",&n,&m);
for(int i=0;i<m;i++){
scanf("%d %d",a+i,b+i);
a[i]--;b[i]--;
if(b[i]==n-1)f[a]=true;
}
for(int i=0;i<n;i++)if(a[i]==0 && f[b[i]]){
printf("POSSIBLE\n");
return 0;
}
printf("IMPOSSIBLE\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:12:15: error: invalid types 'bool [200005][int [200005]]' for array subscript
12 | if(b[i]==n-1)f[a]=true;
| ^
|
s070338453 | p03647 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#define INF (0x3f3f3f3f)
using namespace std;
const int N = 200005;
template <class T> inline void read() {
int flag = 1; x = 0;
register char ch = getchar();
while(ch < '0' || ch > '9') { if(ch == '-') flag = -1; ch = getchar(); }
while(ch >= '0' && ch <= '9') { x = (x<<1)+(x<<3)+ch-'0'; ch = getchar(); }
t *= flag;
}
int n, m, dis[N], que[N << 1], head[N], top = 0;
struct Node
{
int y, nxt;
} e[N << 1];
inline void Adde( int x, int y )
{
e[++top].y = y, e[top].nxt = head[x], head[x] = top;
e[++top].y = x, e[top].nxt = head[y], head[y] = top;
}
int BFS()
{
memset(dis, INF, sizeof(dis));
int h, t, u, v;
h = t = 0;
dis[1] = 0;
que[++t] = 1;
while(h < t)
{
u = que[++h];
for(int i = head[u]; i; i = e[i].nxt)
{
v = e[i].y;
if(dis[v] != INF) continue;
dis[v] = dis[u] + 1;
que[++t] = v;
}
}
return dis[n];
}
int main()
{
int u, v;
read(n), read(m);
for(int i = 1; i <= m; i++)
read(u), read(v), Adde(u, v);
if(BFS() > 2) printf( "IMPOSSIBLE\n" );
else printf( "POSSIBLE\n" );
return 0;
}
| a.cc: In function 'void read()':
a.cc:11:23: error: 'x' was not declared in this scope
11 | int flag = 1; x = 0;
| ^
a.cc:12:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
12 | register char ch = getchar();
| ^~
a.cc:15:9: error: 't' was not declared in this scope
15 | t *= flag;
| ^
a.cc: In function 'int main()':
a.cc:54:13: error: no matching function for call to 'read(int&)'
54 | read(n), read(m);
| ~~~~^~~
a.cc:10:32: note: candidate: 'template<class T> void read()'
10 | template <class T> inline void read() {
| ^~~~
a.cc:10:32: note: candidate expects 0 arguments, 1 provided
a.cc:54:22: error: no matching function for call to 'read(int&)'
54 | read(n), read(m);
| ~~~~^~~
a.cc:10:32: note: candidate: 'template<class T> void read()'
10 | template <class T> inline void read() {
| ^~~~
a.cc:10:32: note: candidate expects 0 arguments, 1 provided
a.cc:56:21: error: no matching function for call to 'read(int&)'
56 | read(u), read(v), Adde(u, v);
| ~~~~^~~
a.cc:10:32: note: candidate: 'template<class T> void read()'
10 | template <class T> inline void read() {
| ^~~~
a.cc:10:32: note: candidate expects 0 arguments, 1 provided
a.cc:56:30: error: no matching function for call to 'read(int&)'
56 | read(u), read(v), Adde(u, v);
| ~~~~^~~
a.cc:10:32: note: candidate: 'template<class T> void read()'
10 | template <class T> inline void read() {
| ^~~~
a.cc:10:32: note: candidate expects 0 arguments, 1 provided
|
s841716794 | p03647 | C++ | #include <iostream>
#include <stdio.h>
using namespace std;
int n,m,a[200005],b[200005];
bool f[200005];
int main(){
scanf("%d %d",&n,&m);
for(int i=0;i<m;i++){
int b;
scanf("%d %d",a+i,b+i);
a[i]--;b[i]--;
if(b[i]==n-1)f[a]=true;
}
for(int i=0;i<n;i++)if(a[i]==0 && f[b[i]]){
printf("POSSIBLE\n");
return 0;
}
printf("IMPOSSIBLE\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:13:9: error: invalid types 'int[int]' for array subscript
13 | a[i]--;b[i]--;
| ^
a.cc:14:5: error: invalid types 'int[int]' for array subscript
14 | if(b[i]==n-1)f[a]=true;
| ^
a.cc:14:15: error: invalid types 'bool [200005][int [200005]]' for array subscript
14 | if(b[i]==n-1)f[a]=true;
| ^
|
s907531646 | p03647 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#define MOD 1000000007
#define ll long long
using namespace std;
ll N,M;
vector<ll> a;
vector<ll> b;
ll db[200001]={0};
int main(){
ll ina,inb;
cin.tie(0);
ios::sync_with_stdio(false);
cin >> N >> M;
a.push_back(0);
b.push_back(0);
for(ll 0 = 1;i<M;i++){
cin >> ina>> inb;
a.push_back(ina);
b.push_back(inb);
if(ina == 1)db[inb]=1;
}
for(ll i = 1;i<=M;i++){
if(db[a[i]]){
if(b[i]==N){cout << "POSSIBLE" << endl;
return 0;
}
}
}
cout << "IMPOSSIBLE" << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:29:10: error: expected unqualified-id before numeric constant
29 | for(ll 0 = 1;i<M;i++){
| ^
a.cc:29:10: error: expected ';' before numeric constant
a.cc:29:10: error: lvalue required as left operand of assignment
a.cc:29:16: error: 'i' was not declared in this scope
29 | for(ll 0 = 1;i<M;i++){
| ^
a.cc:29:19: error: expected ')' before ';' token
29 | for(ll 0 = 1;i<M;i++){
| ~ ^
| )
a.cc:29:20: error: 'i' was not declared in this scope
29 | for(ll 0 = 1;i<M;i++){
| ^
|
s968961988 | p03647 | C++ | #include <vector>
#include <iostream>
using namaspase std;
int main(void)
{
int n, m;
cin >> n >> m;
vector<int> a(m);
vector<int> b(m);
for (int i = 0; i < m; i++) {
cin >> a[i] >> b[i];
}
bool ans = false;
for (int i = 0; i < m; i++) {
if (a[i] == 1) {
int tmp = b[i];
for (int j = 0; j < m; j++) {
if (a[j] == tmp){
if (b[j] == n) {
ans = true;
break;
}
}
}
if (ans) break;
}
}
if (ans) {
cout << "POSSIBLE" << endl;
} else {
cout << "IMPOSSIBLE" << endl;
}
} | a.cc:4:7: error: expected nested-name-specifier before 'namaspase'
4 | using namaspase std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> n >> m;
| ^~~
| std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:11:5: error: 'vector' was not declared in this scope
11 | vector<int> a(m);
| ^~~~~~
a.cc:11:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
from a.cc:1:
/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:11:12: error: expected primary-expression before 'int'
11 | vector<int> a(m);
| ^~~
a.cc:12:12: error: expected primary-expression before 'int'
12 | vector<int> b(m);
| ^~~
a.cc:15:16: error: 'a' was not declared in this scope
15 | cin >> a[i] >> b[i];
| ^
a.cc:15:24: error: 'b' was not declared in this scope
15 | cin >> a[i] >> b[i];
| ^
a.cc:20:13: error: 'a' was not declared in this scope
20 | if (a[i] == 1) {
| ^
a.cc:21:27: error: 'b' was not declared in this scope
21 | int tmp = b[i];
| ^
a.cc:35:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
35 | cout << "POSSIBLE" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:35:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
35 | cout << "POSSIBLE" << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:37:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
37 | cout << "IMPOSSIBLE" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:37:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
37 | cout << "IMPOSSIBLE" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s532268105 | p03647 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
ArrayList[] list = new ArrayList[N];
for(int i = 0; i < N; i++) {
list[i] = new ArrayList<Integer>();
}
for(int i = 0; i < M; i++) {
int a = sc.nextInt() - 1;
int b = sc.nextInt() - 1;
list[a].add(b);
list[b].add(a);
}
ArrayList<Integer> list0 = list[0];
String ans = "IMPOSSIBLE";
for(int i = 0; i < list0.size(); i++) {
int v = list[list0.get(i)];
if(list[v].contains(N - 1)) {
ans = "POSSIBLE";
break;
}
}
System.out.println(ans);
}
} | Main.java:21: error: incompatible types: ArrayList cannot be converted to int
int v = list[list0.get(i)];
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s169719584 | p03647 | C++ | #include<cstdio>
#include<algorithm>
#include<set>
using namespace std;
int e,v[400010],first[200010],next[400010];
void AddEdge(int U,int V){
v[++e]=V;
next[e]=first[U];
first[U]=e;
}
typedef pair<int,int> Point;
set<Point>S;
int n,m;
int main(){
int x,y;
scanf("%d%d",&n,&m);
for(int i=1;i<=m;++i){
scanf("%d%d",&x,&y);
AddEdge(x,y);
AddEdge(y,x);
S.insert(make_pair(x,y));
S.insert(make_pair(y,x));
}
for(int i=first[1];i;i=next[i]){
if(S.find(make_pair(v[i],n))!=S.end()){
puts("POSSIBLE");
return 0;
}
}
puts("IMPOSSIBLE");
return 0;
} | a.cc: In function 'void AddEdge(int, int)':
a.cc:8:9: error: reference to 'next' is ambiguous
8 | next[e]=first[U];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/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:5:31: note: 'int next [400010]'
5 | int e,v[400010],first[200010],next[400010];
| ^~~~
a.cc: In function 'int main()':
a.cc:24:32: error: reference to 'next' is ambiguous
24 | for(int i=first[1];i;i=next[i]){
| ^~~~
/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:5:31: note: 'int next [400010]'
5 | int e,v[400010],first[200010],next[400010];
| ^~~~
|
s490335985 | p03647 | C++ | 5 5
1 3
4 5
2 3
2 4
1 4
| a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5 5
| ^
|
s610955981 | p03647 | C++ | import java.util.Scanner;
public class Main {
private final static String YES = "POSSIBLE";
private final static String NO = "IMPOSSIBLE";
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt(), m = scanner.nextInt();
boolean[] from = new boolean[n + 1];
boolean[] to = new boolean[n + 1];
for (int i = 1; i <= m; i++) {
int a = scanner.nextInt(), b = scanner.nextInt();
if (a == 1)
from[b] = true;
if (b == n)
to[a] = true;
}
for (int i = 2; i < n; i++) if (from[i] && to[i]) {
System.out.println(YES);
return;
}
System.out.println(NO);
}
}
| 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 {
| ^~~~~~
|
s962148993 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
vector<int> g[200001];
int main() {
int n, m;
cin >> n >> m;
for(int i=0; i<m; ++i) {
int a, b;
cin >> a >> b;
g[a].push_back(b);
}
int ans = false;
for(int i=0; i<g[1].size(); ++i) {
int t = g[1][i];
if(find(g[t].begin(), g[t].end(), n)!=g[t].end()) {
ans = true;
break;
}
}
if(ans) cout << "POSSIBLE" << endl;
else cout << "IMPOSSIBLE" << endl;
return 0;
}
| cc1plus: error: '::main' must return 'int'
|
s115442005 | p03647 | C++ | #include <iostream>
#include <set>
using namespace std;
set<int> G[200005];
int dist[200005];
int N,M;
int main()
{
cin>>N>>M;
for(int i=1;i<=M;i++)
{
int x,y;
cin>>x>>y;
G[x].push_back(y);
G[y].push_back(x);
}
for(int i=1;i<=N;i++)
{
if(G[1].find(i)!=G[1].end()&&G[N].find(i)!=G[N].end())
{
cout<<"POSSIBLE";return 0;
}
}
cout<<"IMPOSSIBLE";
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:14: error: 'class std::set<int>' has no member named 'push_back'
14 | G[x].push_back(y);
| ^~~~~~~~~
a.cc:15:14: error: 'class std::set<int>' has no member named 'push_back'
15 | G[y].push_back(x);
| ^~~~~~~~~
|
s814721726 | p03647 | C++ | #define fi first
#define se second
#define mk make_pair
using namespace std;
int n,m,y,x;
vector<int>v[200001];
bool b[200001];
void dfs(int p,int d){
if(d==2)return;
r(i,v[p].size()){
if(!b[v[p][i]]){
b[v[p][i]]=1;
dfs(v[p][i],d+1);
}
}
}
main(){
cin>>n>>m;
r(i,m){
cin>>x>>y;
v[x].push_back(y);
v[y].push_back(x);
}
dfs(1,0);
if(b[n])cout<<"POSSIBLE"<<endl;
else cout<<"IMPOSSIBLE"<<endl;
} | a.cc:6:1: error: 'vector' does not name a type
6 | vector<int>v[200001];
| ^~~~~~
a.cc: In function 'void dfs(int, int)':
a.cc:10:5: error: 'i' was not declared in this scope
10 | r(i,v[p].size()){
| ^
a.cc:10:7: error: 'v' was not declared in this scope
10 | r(i,v[p].size()){
| ^
a.cc:10:3: error: 'r' was not declared in this scope
10 | r(i,v[p].size()){
| ^
a.cc: At global scope:
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
17 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:18:3: error: 'cin' was not declared in this scope
18 | cin>>n>>m;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #define fi first
a.cc:19:5: error: 'i' was not declared in this scope
19 | r(i,m){
| ^
a.cc:19:3: error: 'r' was not declared in this scope
19 | r(i,m){
| ^
a.cc:25:11: error: 'cout' was not declared in this scope
25 | if(b[n])cout<<"POSSIBLE"<<endl;
| ^~~~
a.cc:25:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:29: error: 'endl' was not declared in this scope
25 | if(b[n])cout<<"POSSIBLE"<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #define fi first
a.cc:26:8: error: 'cout' was not declared in this scope
26 | else cout<<"IMPOSSIBLE"<<endl;
| ^~~~
a.cc:26:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:28: error: 'endl' was not declared in this scope
26 | else cout<<"IMPOSSIBLE"<<endl;
| ^~~~
a.cc:26:28: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s884724643 | p03647 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> ii;
typedef vector< ii > vii;
typedef vector<int> vi;
typedef vector< vi > vvi;
#define mm 100005
#define nn 1005
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (int)(a.size())
#define all(a) a.begin(),a.end()
#define forn(i, n) for(int i = 0; i < int(n); ++i)
#define rep(i, a, b) for(int i = int(a); i <= int(b); ++i)
#define cases int t; cin>>t; while(t--)
#define check(a,n) forn(iiii,int(n)) cout<<ll(a[iiii])<<" "; cout<<endl
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
vi g[2*mm];
int main()
{
fast_io;
int n,m;
cin>>n>>m;
forn(i,m)
cin>>v>>u,g[v].pb(u),g[u].pb(v);
for(auto i:g[1])
{
for(auto j:g[j])
if(j==n)
return cout<<"POSSIBLE",0;
}
cout<<"IMPOSSIBLE";
return 0;
}
| a.cc: In function 'int main()':
a.cc:34:14: error: 'v' was not declared in this scope
34 | cin>>v>>u,g[v].pb(u),g[u].pb(v);
| ^
a.cc:34:17: error: 'u' was not declared in this scope
34 | cin>>v>>u,g[v].pb(u),g[u].pb(v);
| ^
a.cc:37:22: error: 'j' was not declared in this scope
37 | for(auto j:g[j])
| ^
|
s783666901 | p03647 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
for(int i=0; i<m; ++i) {
int a, b;
cin >> a >> b;
g[a].push_back(b);
}
int ans = false;
for(int i=0; i<g[1].size(); ++i) {
int t = g[1][i];
if(find(g[t].begin(), g[t].end(), n)!=g[t].end()) {
ans = true;
break;
}
}
if(ans) cout << "POSSIBLE" << endl;
else cout << "IMPOSSIBLE" << endl;
return 0;
}
}
}
}
| a.cc: In function 'int main()':
a.cc:11:42: error: 'g' was not declared in this scope
11 | g[a].push_back(b);
| ^
a.cc:15:37: error: 'g' was not declared in this scope
15 | for(int i=0; i<g[1].size(); ++i) {
| ^
a.cc: At global scope:
a.cc:26:22: error: expected declaration before '}' token
26 | }
| ^
a.cc:27:14: error: expected declaration before '}' token
27 | }
| ^
a.cc:28:1: error: expected declaration before '}' token
28 | }
| ^
|
s578132768 | p03647 | Java | import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class Voyage79C {
public static void main(String[] args) throws IOException {
FastScanner in = new FastScanner();
int n = in.nextInt();
int m = in.nextInt();
//0 to n-1
ArrayList<ArrayList<Integer>> graph = new ArrayList<>();
for (int i = 0; i < n; i++) {
graph.add(new ArrayList<>());
}
for (int i = 0; i < m; i++) {
int a = in.nextInt() - 1;
int b = in.nextInt() - 1;
graph.get(a).add(b);
graph.get(b).add(a);
}
for (int i = 0; i < graph.get(0).size(); i++) {
for (int j = 0; j < graph.get(graph.get(0).get(i)).size(); j++) {
if (graph.get(graph.get(0).get(i)).get(j) == n-1) {
System.out.println("POSSIBLE");
return;
}
}
}
System.out.println("IMPOSSIBLE");
}
public static class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner(String s) {
try {
br = new BufferedReader(new FileReader(s));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public FastScanner() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String nextToken() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return st.nextToken();
}
String nextLine() {
st = null;
try {
return br.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
int nextInt() {
return Integer.parseInt(nextToken());
}
long nextLong() {
return Long.parseLong(nextToken());
}
double nextDouble() {
return Double.parseDouble(nextToken());
}
}
}
| Main.java:5: error: class Voyage79C is public, should be declared in a file named Voyage79C.java
public class Voyage79C {
^
1 error
|
s285164911 | p03647 | Java | package main;
import util.FastScanner;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class TaskC {
public void solve(int testNumber, FastScanner in, PrintWriter out) {
int n = in.nextInt();
int m = in.nextInt();
List<Integer>[] adj = new List[n];
for (int i = 0; i < n; i++) {
adj[i] = new ArrayList<>();
}
for (int i = 0; i < m; i++) {
int a = in.nextInt() - 1;
int b = in.nextInt() - 1;
adj[a].add(b);
adj[b].add(a);
}
int[] d = bfs(0, adj);
out.println(d[n - 1] <= 2 ? "POSSIBLE" : "IMPOSSIBLE");
}
private int[] bfs(int s, List<Integer>[] adj) {
int n = adj.length;
int[] q = new int[n];
int[] d = new int[n];
Arrays.fill(d, n);
d[s] = 0;
q[0] = s;
int qt = 0;
int qh = 1;
while (qt < qh) {
int i = q[qt++];
for (int j : adj[i]) {
if (d[j] > 1 + d[i]) {
d[j] = 1 + d[i];
q[qh++] = j;
}
}
}
return d;
}
}
| Main.java:10: error: class TaskC is public, should be declared in a file named TaskC.java
public class TaskC {
^
Main.java:3: error: package util does not exist
import util.FastScanner;
^
Main.java:11: error: cannot find symbol
public void solve(int testNumber, FastScanner in, PrintWriter out) {
^
symbol: class FastScanner
location: class TaskC
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
|
s416440108 | p03648 | C++ | v#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vc = vector<char>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;
ll mod = 1000000007;
int main(){
ll K; cin >> K;
ll m = K % 100;
ll n = K/100;
ll p = 99 + n;
p -= m;
cout << 100 << endl;
for(int i=0; i<99; i++){
cout << p << " ";
}
cout << p+m+100*m;
} | a.cc:1:2: error: stray '#' in program
1 | v#include <bits/stdc++.h>
| ^
a.cc:1:1: error: 'v' does not name a type
1 | v#include <bits/stdc++.h>
| ^
In file included from /usr/include/math.h:275,
from /usr/include/c++/14/cmath:47,
from /usr/include/c++/14/math.h:36,
from a.cc:3:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gn |
s273833373 | p03648 | C++ | #include<iostream>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<time.h>
#define debug(a) cout << "*" << a << "*" << endl
#define ls (k << 1)
#define rs ((k << 1) | 1)
#define mid ((l + r) >> 1)
using namespace std;
typedef long long ll;
ll a[55], m, n;
inline ll get(ll a)
{
if (a < 50)
return 0;
return (a - 49) * 50;
}
ll low(ll l, ll r, ll k)
{
while (l < r)
{
ll m = l + r >> 1;
if (get(m) >= k) r = m;
else l = m + 1;
}
return l;
}
int main()
{
while (~scanf("%lld", &m))
{
//m = low(1, m, m);
memset(a, 0, sizeof(a));
printf("50\n");
n = m % 50;
m /= 50;
for (int i = 0; i < n; i++) a[i] = 50;
if (m)
for (int i = 0; i < 50; i++) a[i] += (49 - n + m);
for (int i = 0; i < 50; i++) printf("%lld%c", a[i], i == 49 ? '\n' : ' ');
} | a.cc: In function 'int main()':
a.cc:46:10: error: expected '}' at end of input
46 | }
| ^
a.cc:34:1: note: to match this '{'
34 | {
| ^
|
s774023051 | p03648 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll K; cin >> K;
int N = 50;
cout << N << '\n';
for (int i = 0; i < N; i++) {
cour << (N+1) * (K / N + (i < K % N)) + (N-1) - K << " \n"[i+1==N];
}
} | a.cc: In function 'int main()':
a.cc:11:5: error: 'cour' was not declared in this scope
11 | cour << (N+1) * (K / N + (i < K % N)) + (N-1) - K << " \n"[i+1==N];
| ^~~~
|
s581515061 | p03648 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long k = sc.nextLong();
System.out.println(50);
long p = k/50;
long q = k%50;
for(int i=0;i<q;i++)System.out.print((49-(q-1)+p+50)+" ");
for(int i=q;i<50;i++)System.out.print((49-q+p)+" ");
}
} | Main.java:10: error: incompatible types: possible lossy conversion from long to int
for(int i=q;i<50;i++)System.out.print((49-q+p)+" ");
^
1 error
|
s724654600 | p03648 | C++ | #include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
LL x[50];
int main() {
LL K;
scanf("%lld", &K);
printf("%d\n", 50);
LL rd = K / 50;
for (int i = 0; i < 50; i++)
x[i] = N - 1 + rd;
rd %= 50;
for (int i = 0; i < rd; i++) {
int idx;
for (idx = 0; i < 50; i++)
if (x[i] <= x[idx]) idx = i;
for (int i = 0; i < 50; i++) {
if (i == idx) x[i] += 50;
else x[i]--;
}
}
for (int i = 0; i < 50; i++)
printf("%lld", x[i]);
puts("");
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:16: error: 'N' was not declared in this scope
28 | x[i] = N - 1 + rd;
| ^
|
s422491499 | p03648 | C++ | #include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
int main() {
LL K;
scanf("%lld", &K);
printf("%d\n", 2);
LL rd = K / 2;
LL x1 = (rd + 1), x2 = (rd + 1);
if (K % 2) {
x1 += 2;
x2--;
}
if (x1 > (LL)1e16 + 100) asset(false);
printf("%lld %lld\n", x1, x2);
return 0;
}
| a.cc: In function 'int main()':
a.cc:31:30: error: 'asset' was not declared in this scope; did you mean 'assert'?
31 | if (x1 > (LL)1e16 + 100) asset(false);
| ^~~~~
| assert
|
s462413043 | p03648 | C++ | #include"stdafx.h"
#include<iostream>
using namespace std;
int main() {
long long K;
long long p;
int q;
const int cntC = 50;
long long C[cntC];
cin >> K;
p = (int)(K / cntC);
q = K - (p * cntC);
for (int i = 0; i < q; i++) {
C[i] = p + cntC - i;
}
for (int i = q; i < cntC; i++) {
C[i] = p + cntC - i - 1;
}
cout << C[0];
for (int i = 1; i < cntC; i++) {
cout << " " << C[i];
}
cin >> K;
return 0;
}
| a.cc:1:9: fatal error: stdafx.h: No such file or directory
1 | #include"stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s057933020 | p03648 | C++ | #include<iostream>
using namespace std;
int main(){
long long K;
long long p;
int q;
int cntC = 50;
long long C[cntC];
cin >> K;
p = (int)(K / cntC);
q = K - (p * cntC);
for(int i = 0; i < q; i++){
C[i] = p + cntC;
}
for(int i = q; i < cntC; i++){
C[i] = p + cntC - i;
}
cout << C[0];
for(int i = 1; i < cntC; i++){
cout << " " & C[i];
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:23:17: error: no match for 'operator&' (operand types are 'std::basic_ostream<char>' and 'long long int')
23 | cout << " " & C[i];
| ~~~~~~~~~~~ ^ ~~~~
| | |
| | long long int
| std::basic_ostream<char>
a.cc:23:17: note: candidate: 'operator&(int, long long int)' (built-in)
23 | cout << " " & C[i];
| ~~~~~~~~~~~~^~~~~~
a.cc:23:17: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68,
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/cstddef:141:3: note: candidate: 'constexpr std::byte std::operator&(byte, byte)'
141 | operator&(byte __l, byte __r) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:141:18: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::byte'
141 | operator&(byte __l, byte __r) noexcept
| ~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:84:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator&(_Ios_Fmtflags, _Ios_Fmtflags)'
84 | operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:84:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags'
84 | operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:134:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator&(_Ios_Openmode, _Ios_Openmode)'
134 | operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:134:27: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode'
134 | operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:181:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator&(_Ios_Iostate, _Ios_Iostate)'
181 | operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
| ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:181:26: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate'
181 | operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
| ~~~~~~~~~~~~~^~~
|
s290834222 | p03648 | C++ | #include <iostream>
#include<iomanip>
#include <set>
#include <vector>
#include <map>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <queue>
#include <stack>
using namespace std;
const int NN=5e6+10;
int n;
int a[100][100];
int main()
{
scanf("%d",&n);
for(int i=1;i<=50;i++){
a[i][1]=50;
}
for(int i=1;i<=50;i++){
for(int j=2;j<=50;j++){
if(j>i){
a[i][j]=a[i][i]-2;
}
else{
a[i][j]=a[i][j-1]-1;
}
}
}
/*
for(int i=1;i<=50;i++){
for(int j=1;j<=50;j++){
printf("%d ",a[i][j]);
}
printf("\n");
}*/
printf("50\n");
int ans=n/50;
if(n==50) ans=0;
int ans2=n%50;
if(ans2==0) ans2=50;
printf("%d",a[ans2][1]+ans);
for(int i=2;i<=50;i++){
printf(" %d",a[ans2][i]+ans);
}
printf("\n");
| a.cc: In function 'int main()':
a.cc:53:18: error: expected '}' at end of input
53 | printf("\n");
| ^
a.cc:22:1: note: to match this '{'
22 | {
| ^
|
s602648073 | p03648 | C++ | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T, typename U> using P = pair<T, U>;
using ll = int64_t;
using PLL = P<ll, ll>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename Head, typename... Tail> const Head& var_min(const Head &head, const Tail&... tail) { return min(head, var_min(tail...)); }
template <typename Head, typename... Tail> const Head& var_max(const Head &head, const Tail&... tail) { return max(head, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
void init_io() {
cin.tie(0);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(30);
}
#define DEBUGGING
#ifdef DEBUGGING
#include "../debug.cpp"
#else
#define DEBUG(...) 0
#endif
int main() {
ll K;
cin >> K;
ll N = 50;
V<ll> ans(N);
iota(ALL(ans), 0ll);
ll times = K / N;
for(ll &e : ans) e += times;
ll rest = K - times * N;
for(ll loops = 0; loops < rest; loops++) {
ans[loops] += N;
for(ll i = 0; i < N; i++) if(i != loops) ans[i]--;
}
cout << ans.size() << endl;
for(ll e : ans) cout << e << ' ';
cout << endl;
}
| a.cc:28:10: fatal error: ../debug.cpp: No such file or directory
28 | #include "../debug.cpp"
| ^~~~~~~~~~~~~~
compilation terminated.
|
s964133155 | p03648 | C++ | #include <bits/stdc++.h>
using namespace std;
long long K, rec[60], ans[60];
const int N = 50;
int main() {
cin >> K;
int div = K / N, mo = K % N;
for (int i=0;i<N;i++)
rec[i] = div + (i < mo);
for (int i=0;i<N;i++) {
long long sum = 0;
for (int j=0;j<N;j++){
if(i != j)
sum += rec[j];}
ans[i] = N * (rec[i] + 1) - sum;
}
cout << N << endl;
for (int i=0;i<N;i++) cout << ans[i]<<" ";
return 0; | a.cc: In function 'int main()':
a.cc:19:14: error: expected '}' at end of input
19 | return 0;
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s568803261 | p03648 | C++ | For each i (1≤i≤N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i. | a.cc:1:13: error: extended character ≤ is not valid in an identifier
1 | For each i (1≤i≤N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.
| ^
a.cc:1:13: error: extended character ≤ is not valid in an identifier
a.cc:1:1: error: 'For' does not name a type
1 | For each i (1≤i≤N), the squares painted in Color i are 4-connected. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.
| ^~~
|
s529062372 | p03648 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int;
int K, rec[60], ans[60];
const int N = 50;
int_32 main() {
cin >> K;
if (K == 0) {
cout << 2 << endl;
cout << 1 << " " << 1;
exit(0);
}
int div = K / N, mo = K % N;
iota(ans, ans + N, 0);
for (int i=0;i<N;i++)
ans[i] += div;
if (mo == 0)
for (int i = 0; i < N; i++)
ans[i] += (K - 1) / 50;
else {
for (int i=0;i< mo;i++) {
ans[i] += 50;
for (int j=0;j<N;j++)
if(i != j)
ans[j]--;
}
}
cout << N << endl;
for (int i=0;i<N;i++) cout << ans[i]<<" ";
return 0;
} | a.cc:3:19: error: declaration does not declare anything [-fpermissive]
3 | typedef long long int;
| ^~~
a.cc:6:1: error: 'int_32' does not name a type
6 | int_32 main() {
| ^~~~~~
|
s913131617 | p03648 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int;
int K, rec[60], ans[60];
const int N = 50;
int_32 main() {
cin >> K;
if (K == 0) {
cout << 2 << endl;
cout << 1 << " " << 1;
exit(0);
}
int div = K / N, mo = K % N;
iota(ans, ans + N, 0);
for (int i=0;i<N;i++)
ans[i] += div;
if (mo == 0)
for (int i = 0; i < N; i++)
ans[i] += (K - 1) / 50;
else {
for (int i=0;i< mo;i++) {
ans[i] += 50;
for (int j=0;j<N;j++)
if(i != j)
ans[j]--;
}
}
cout << N << endl;
for (int i=0;i<N;i++) cout << ans[i]<<" ";
return 0;
} | a.cc:3:19: error: declaration does not declare anything [-fpermissive]
3 | typedef long long int;
| ^~~
a.cc:6:1: error: 'int_32' does not name a type
6 | int_32 main() {
| ^~~~~~
|
s006741336 | p03648 | C++ | #include <iostream>
using namespace std;
int K, rec[60], ans[60];
const int N = 50;
int main() {
cin >> K;
if (K == 0) {
cout << 2 << endl;
cout << 1 << " " << 1;
exit(0);
}
int div = K / N, mo = K % N;
iota(ans, ans + N, 0);
for (int i=0;i<N;i++)
ans[i] = div;
if (mo == 0)
for (int i = 0; i < N; i++)
ans[i] += (K - 1) / 50;
else {
for (int i=0;i< mo;i++) {
ans[i] += 50;
for (int j=0;j<N;j++)
if(i != j)
ans[j]--;
}
}
cout << N << endl;
for (int i=0;i<N;i++) cout << ans[i]<<" ";
return 0;
} | a.cc: In function 'int main()':
a.cc:13:9: error: 'iota' was not declared in this scope
13 | iota(ans, ans + N, 0);
| ^~~~
|
s564977396 | p03648 | C++ | #include <iostream>
using namespace std;
int K, rec[60], ans[60];
const int N = 50;
int main() {
cin >> K;
if (k == 0) {
cout << 2 << endl;
cout << 1 << " " << 1;
exit(0);
}
int div = K / N, mo = K % N;
for (int i=0;i<N;i++)
ans[i] = div + (i);
if (mo == 0)
for (int i = 0; i < N; i++)
ans[i]++;
else {
for (int i=0;i< mo;i++) {
ans[i] += 50;
for (int j=0;j<N;j++)
if(i != j)
ans[j]--;
}
}
cout << N << endl;
for (int i=0;i<N;i++) cout << ans[i]<<" ";
return 0;
} | a.cc: In function 'int main()':
a.cc:7:13: error: 'k' was not declared in this scope
7 | if (k == 0) {
| ^
|
s433240939 | p03648 | C++ | #include <iostream>
using namespace std;
int K, rec[60], ans[60];
const int N = 50;
int main() {
cin >> K;
if (k == 0) {
cout << 2 << endl;
cout << 1 << " " << 1;
exit(0);
}
int div = K / N, mo = K % N;
for (int i=0;i<N;i++)
ans[i] = div + (i + 1);
if (mo == 0)
for (int i = 0; i < N; i++)
ans[i]++;
else {
for (int i=0;i< mo;i++) {
ans[i] += 50;
for (int j=0;j<N;j++)
if(i != j)
ans[j]--;
}
}
cout << N << endl;
for (int i=0;i<N;i++) cout << ans[i]<<" ";
return 0;
} | a.cc: In function 'int main()':
a.cc:7:13: error: 'k' was not declared in this scope
7 | if (k == 0) {
| ^
|
s911154373 | p03648 | C++ | #include <iostream>
using namespace std;
int K, rec[60], ans[60];
const int N = 50;
int main() {
cin >> K;
if (k == 0) {
cout << 2 << endl;
cout << 1 << " " << 1;
exit(0);
}
int div = K / N, mo = K % N;
for (int i=0;i<N;i++)
ans[i] = div + (i + 1);
if (mo == 0)
for (int i = 0; i < N; i++)
ans[i]++;
else {
for (int i=0;i< mo;i++) {
ans[i] += 50;
for (int j=0;j<N;j++)
if(i != j)
ans[j]--;
}
}
cout << N << endl;
for (int i=0;i<N;i++) cout << ans[i]<<" ";
return 0;
} | a.cc: In function 'int main()':
a.cc:7:13: error: 'k' was not declared in this scope
7 | if (k == 0) {
| ^
|
s557893818 | p03648 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define substr(s,f,t) (s.substr(f-1,t-f+1))
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{ll x,y,t;};
struct Edge{ll to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
const ll Inf = llINF;const int MAX_V=201010;vector<ll>d;
Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
void add_edge(ll from,ll to,ll cost){E[from].pb({to,cost});}
};
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll k;
cin>>k;
if(k<=(ll)2*(1e16)){
cout<<2<<endl;
if(k%2){
cout<<k/2+2<<" "<<k/2<<endl;
}else{
cout<<k/2+1<<" "<<k/2<<endl;
}
}else{
ll num=k/((ll)(1e16));
if(k%((ll)(1e16))){
num++;
}
cout<<num<<endl;
ll cnt=k;
ll numm=num-cnt%num;
vi ans;
for(int i=0;i<numm;i++){
ans.pb(n-1+cnt/num);
}
for(int i=numm;i<num;i++){
ans.pb(n-1+cnt/num-(numm));
}
for(int i=0;i<ans.size();i++)
cout<<ans[i]<<" ";
cout<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:47:14: error: 'n' was not declared in this scope
47 | ans.pb(n-1+cnt/num);
| ^
a.cc:50:14: error: 'n' was not declared in this scope
50 | ans.pb(n-1+cnt/num-(numm));
| ^
|
s264916830 | p03648 | C++ | x | a.cc:1:1: error: 'x' does not name a type
1 | x
| ^
|
s832351775 | p03648 | C++ | #include "bits/stdc++.h"
#define esc(ret) cout << ret << endl,quick_exit(0)
#define fcout(d) cout << fixed << setprecision(d)
#define repU(i,s,t) for(int i = (int)(s); i <= (int)(t); ++i)
#define repD(i,t,s) for(int i = (int)(t); i >= (int)(s); --i)
#define rep(i,n) repU(i,0,n - 1)
#define rep1(i,n) repU(i,1,n)
#define all(v) begin(v),end(v)
#define vct vector
#define prique priority_queue
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define qceil(n,d) ((n) > 0 ? ((n) - 1) / (d) + 1 : (n) / (d))
#define parity(a,b) (a & 1 == b & 1)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;
const pii dir[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int inf32 = (1 << 30) - 1;
const ll inf64 = (1LL << 62) - 1;
const int mod = 1e9 + 7;
ll K;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
cin >> K;
ll q = K / 50,r = K % 50;
ll a = q + 49;
for(int i = 0; i < r; ++i){
cout << a + 51 - r << ' ';
el
}
for(int i = r; i < 50; ++i){
cout << a - r << ' ';
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:46:17: error: 'el' was not declared in this scope; did you mean 'll'?
46 | el
| ^~
| ll
|
s541934248 | p03648 | C++ | #include<bits/stdc++.h>
using namespace std;
//出力
void Yes(){ cout << "Yes" << endl; }
void yes(){ cout << "yes" << endl; }
void No(){ cout << "No" << endl; }
void no(){ cout << "no" << endl; }
void Possible(){ cout << "Possible" << endl; }
void possible(){ cout << "possible" << endl; }
void Imossible(){ cout << "Impossible" << endl; }
void imossible(){ cout << "impossible" << endl; }
//マクロ
#define INF 10010010010010010
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define sort(a) sort(a.begin(), a.end())
#define reverse(a) reverse(a.begin(), a.end())
#define MOD 1000000007
int main(){
long long k; cin >> k;
cout << 2 << endl;
if(k % 2 = 0){
cout << (k / 2) + 1 << " " << (k / 2) + 1 << endl;
}else{
cout << (k / 2) + 2 << " " << (k / 2) << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:27:10: error: lvalue required as left operand of assignment
27 | if(k % 2 = 0){
| ~~^~~
|
s878723874 | p03648 | C++ | #include<bits/stdc++.h>
using namespace std;
//出力
void Yes(){ cout << "Yes" << endl; }
void yes(){ cout << "yes" << endl; }
void No(){ cout << "No" << endl; }
void no(){ cout << "no" << endl; }
void Possible(){ cout << "Possible" << endl; }
void possible(){ cout << "possible" << endl; }
void Imossible(){ cout << "Impossible" << endl; }
void imossible(){ cout << "impossible" << endl; }
//マクロ
#define INF 10010010010010010
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define sort(a) sort(a.begin(), a.end())
#define reverse(a) reverse(a.begin(), a.end())
#define MOD 1000000007
int main(){
int k; cin >> k;
cout << 2 << endl;
if(k % 2 = 0){
cout << (k / 2) + 1 << " " << (k / 2) + 1 << endl;
}else{
cout << (k / 2) + 2 << " " << (k / 2) << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:27:10: error: lvalue required as left operand of assignment
27 | if(k % 2 = 0){
| ~~^~~
|
s095063764 | p03648 | C++ | #include<bits/stdc++.h>
using namespace std;
//出力
void Yes(){ cout << "Yes" << endl; }
void yes(){ cout << "yes" << endl; }
void No(){ cout << "No" << endl; }
void no(){ cout << "no" << endl; }
void Possible(){ cout << "Possible" << endl; }
void possible(){ cout << "possible" << endl; }
void Imossible(){ cout << "Impossible" << endl; }
void imossible(){ cout << "impossible" << endl; }
//マクロ
#define INF 10010010010010010
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define sort(a) sort(a.begin(), a.end())
#define reverse(a) reverse(a.begin(), a.end())
#define MOD 1000000007
int main(){
int k; cin >> k;
cout << 2 << endl;
if(k % 2 = 0){
cout << (k / 2) + 1 << " " << (k / 2) + 1 << endl;
}else{
cout << (k / 2) + 2 << " " << (k / 2) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:27:10: error: lvalue required as left operand of assignment
27 | if(k % 2 = 0){
| ~~^~~
a.cc:33:2: error: expected '}' at end of input
33 | }
| ^
a.cc:22:11: note: to match this '{'
22 | int main(){
| ^
|
s362539662 | p03648 | C++ | // D.
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
int main(int argc, char *argv[]) {
const LL n = 16;
LL k;
cin >> k;
LL a[n];
fill(a, a + 16, k / 16 + 15);
for (LL i = 0; i < k % 16; ++i) {
int t = i % 16;
for (int j = 0; j < 16; ++j) {
if (t == j) {
a[j] += 16;
} else {
a[j] -= 1;
}
}
}
cout << n << endl;
for (int i = 0; i < n; ++i) {
if (i) {
cout << " ";
}
cout << a[i];
}
cout << endl;
| a.cc: In function 'int main(int, char**)':
a.cc:35:22: error: expected '}' at end of input
35 | cout << endl;
| ^
a.cc:10:34: note: to match this '{'
10 | int main(int argc, char *argv[]) {
| ^
|
s707171656 | p03648 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
int main(){
ll K; cin >> K;
cout << 1 << endl;
cout << K << end;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:11: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
7 | cout << K << end;
| ~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nullptr_t'
306 | |
s140095723 | p03648 | C++ | #include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<string.h>
#include<list>
#include<limits>
#include<bitset>
#include<ctype.h>
#include<set>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000000;
int main() {
ll k;]
cin>>k;
ll n=30;
cout<<n<<endl;
ll a[31];
for(ll i=0;i<n;i++){
a[i]=n-1+k/n;
}
for(ll i=0;i<k%n;i++){
for(ll j=0;j<n;j++){
if(i==j){
a[j]+=n;
}else{
a[j]--;
}
}
}
for(int i=0;i<n;i++){
cout<<a[i];
if(i==n-1){
cout<<endl;
}else{
cout<<" ";
}
}
getchar();
getchar();
}
| a.cc: In function 'int main()':
a.cc:22:10: error: expected primary-expression before ']' token
22 | ll k;]
| ^
|
s959816831 | p03648 | C++ | #include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<string.h>
#include<list>
#include<limits>
#include<bitset>
#include<ctype.h>
#include<set>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000000;
int main() {
ll k;
cin>>k;
ll n=30;
ll a[31];
for(ll i=0;i<n;i++){
a[i]=i+k/n;
}
for(ll i=0;i<=k%n;i++){
if(i==k%n){
a[i]+=n;
}else{
a[i]-=1;
}
}
for(int i=0;i<n;i++){
cout<<a[i];
if(i==n-1){
cout<<endl;
}else{
cout<<" ";
}
}
getchar();
getchar();
}
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<string.h>
#include<list>
#include<limits>
#include<bitset>
#include<ctype.h>
#include<set>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000000;
int main() {
ll k;
cin>>k;
ll n=30;
ll a[31];
for(ll i=0;i<n;i++){
a[i]=i+k/n;
}
for(ll i=0;i<=k%n;i++){
if(i==k%n){
a[i]+=n;
}else{
a[i]-=1;
}
}
for(int i=0;i<n;i++){
cout<<a[i];
if(i==n-1){
cout<<endl;
}else{
cout<<" ";
}
}
getchar();
getchar();
}
| a.cc:67:10: error: redefinition of 'const ll MOD'
67 | const ll MOD=1000000007;
| ^~~
a.cc:19:10: note: 'const ll MOD' previously defined here
19 | const ll MOD=1000000007;
| ^~~
a.cc:68:10: error: redefinition of 'const ll INF'
68 | const ll INF=1000000000;
| ^~~
a.cc:20:10: note: 'const ll INF' previously defined here
20 | const ll INF=1000000000;
| ^~~
a.cc:69:5: error: redefinition of 'int main()'
69 | int main() {
| ^~~~
a.cc:21:5: note: 'int main()' previously defined here
21 | int main() {
| ^~~~
|
s170410512 | p03648 | C++ | #include <bits/stdc++.h>
using namespace std;
int cnt[26];
int main()
{
long long k;
cin>>k;
long long mxk=10000000000000000;
pr[0]=49;
vector<long long> pr(50,0);
for(int i=0;i<50;i++){
pr[i]+=min(mxk,k);
k-=min(mxk,k);
}
for(int i=0;i<50;i++){
cout<<pr[i]<<" \n"[i==49];
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:5: error: 'pr' was not declared in this scope
10 | pr[0]=49;
| ^~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.