submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s302164374
p04033
C++
#include <iostream> using namespace std; int main() { int a,b; //Positive if((a > 0 && b > 0) || (a < 0 && b < 0) && ((b - a) % 2 == 0 )){ cout << "Positive"; } //Zero if((a > 0 && b < 0) || (a < 0 && b > 0) || (a == 0) || (b == 0)){ cout << "Zero"; } //Negative if(a < 0 && b < 0) && ((b - a) % 2 != 0 ){ cout << "Negative" } return 0; }
a.cc: In function 'int main()': a.cc:18:25: error: expected identifier before '(' token 18 | if(a < 0 && b < 0) && ((b - a) % 2 != 0 ){ | ^
s293931658
p04033
C++
#include <iostream> int main() { //Positive if((a > 0 && b > 0) || (a < 0 && b < 0) && ((b - a) % 2 == 0 )){ cout << "Positive"; } //Zero if((a > 0 && b < 0) || (a < 0 && b > 0) || (a == 0) || (b == 0)){ cout << "Zero"; } //Negative if(a < 0 && b < 0) && ((b - a) % 2 != 0 ){ cout << "Negative" } return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'a' was not declared in this scope 6 | if((a > 0 && b > 0) || (a < 0 && b < 0) && ((b - a) % 2 == 0 )){ | ^ a.cc:6:18: error: 'b' was not declared in this scope 6 | if((a > 0 && b > 0) || (a < 0 && b < 0) && ((b - a) % 2 == 0 )){ | ^ a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout << "Positive"; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:11:7: error: 'a' was not declared in this scope 11 | if((a > 0 && b < 0) || (a < 0 && b > 0) || (a == 0) || (b == 0)){ | ^ a.cc:11:16: error: 'b' was not declared in this scope 11 | if((a > 0 && b < 0) || (a < 0 && b > 0) || (a == 0) || (b == 0)){ | ^ a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 12 | cout << "Zero"; | ^~~~ | 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:6: error: 'a' was not declared in this scope 16 | if(a < 0 && b < 0) && ((b - a) % 2 != 0 ){ | ^ a.cc:16:15: error: 'b' was not declared in this scope 16 | if(a < 0 && b < 0) && ((b - a) % 2 != 0 ){ | ^ a.cc:16:25: error: expected identifier before '(' token 16 | if(a < 0 && b < 0) && ((b - a) % 2 != 0 ){ | ^
s589567272
p04033
C++
#include <iostream> int main() { //Positive if(a > 0 && b > 0){ if(a < 0 && b > 0) && ((b - a) % 2 == 0 ) cout << "Positive"; } //Zero if((a > 0 && b < 0) || (a < 0 && b > 0) || (a == 0) || (b == 0)){ cout << "Zero"; } //Negative if(a < 0 && b > 0) && ((b - a) % 2 != 0 ){ cout << "Negative" } return 0; }
a.cc: In function 'int main()': a.cc:6:6: error: 'a' was not declared in this scope 6 | if(a > 0 && b > 0){ | ^ a.cc:6:15: error: 'b' was not declared in this scope 6 | if(a > 0 && b > 0){ | ^ a.cc:7:27: error: expected identifier before '(' token 7 | if(a < 0 && b > 0) && ((b - a) % 2 == 0 ) | ^ a.cc:12:7: error: 'a' was not declared in this scope 12 | if((a > 0 && b < 0) || (a < 0 && b > 0) || (a == 0) || (b == 0)){ | ^ a.cc:12:16: error: 'b' was not declared in this scope 12 | if((a > 0 && b < 0) || (a < 0 && b > 0) || (a == 0) || (b == 0)){ | ^ a.cc:13:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 13 | cout << "Zero"; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:17:6: error: 'a' was not declared in this scope 17 | if(a < 0 && b > 0) && ((b - a) % 2 != 0 ){ | ^ a.cc:17:15: error: 'b' was not declared in this scope 17 | if(a < 0 && b > 0) && ((b - a) % 2 != 0 ){ | ^ a.cc:17:25: error: expected identifier before '(' token 17 | if(a < 0 && b > 0) && ((b - a) % 2 != 0 ){ | ^
s202331967
p04033
C++
#include <iostream> int int main(int argc, char const *argv[]) { int a,; cin >> a >> b; //Positive if(a > 0 && b > 0){ if(a < 0 && b > 0) && ((b - a) % 2 = 0 ) cout << "Positive"; } //Zero if((a > 0 && b < 0) || (a < 0 && b > 0) || (a = 0) || (b = 0)){ cout << "Zero"; } //Negative if(a < 0 && b > 0) && ((b - a) % 2 != 0 ){ cout << "Negative" } return 0; }
a.cc:3:1: error: two or more data types in declaration of 'main' 3 | int int main(int argc, char const *argv[]) { | ^~~
s241144242
p04033
C++
include <iostream> int main(int argc, char const *argv[]) { if(a > 0 && b > 0){ if(a < 0 && b > 0) && ((b - a) % 2 = 0 ) cout << "Positive"; } if((a > 0 && b < 0) || (a < 0 && b > 0) || (a = 0) || (b = 0)){ cout << "Zero"; } if(a < 0 && b > 0) && ((b - a) % 2 != 0 ){ cout << "Negative" } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~
s554928497
p04033
C++
#include <cstdio> #include <iostream> #include <algorithm> #define fi first #define se second using namespace std; typedef pair<int,int> par; const int N=100010; int n,m,q,fa[N],ans[N],size[N],rank[N]; par e[N]; struct Qry{ int x,y,z,g; }Q[N],a[N],b[N]; inline char nc(){ static char buf[100000],*p1=buf,*p2=buf; return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++; } inline void read(int &x){ char c=nc(); x=0; for(;c>'9'||c<'0';c=nc());for(;c>='0'&&c<='9';x=x*10+c-'0',c=nc()); } int Gfat(int x){ return fa[x]==x?x:Gfat(fa[x]); } struct sta{ int x,rk; }S[N]; int t; inline void Union(int x,int y){ x=Gfat(x); y=Gfat(y); if(x==y) return ; if(rank[x]>rank[y]) swap(x,y); fa[x]=y; size[y]+=size[x]; S[++t]=(sta){x,rank[y]}; if(rank[x]==rank[y]) rank[y]++; } inline void Back(){ int x=S[t].x; size[fa[x]]-=size[x]; rank[fa[x]]=S[t].rk; fa[x]=x; t--; } void solve(int l,int r,int L,int R){ if(l>r) return ; int mid=l+r>>1,t1=0,t2=0,cur=t; for(int i=l;i<=mid;i++) Union(e[i].fi,e[i].se); for(int i=L;i<=R;i++){ int x=Gfat(Q[i].x),y=Gfat(Q[i].y); if(x==y){ if(size[x]>=Q[i].z) a[++t1]=Q[i],ans[Q[i].g]=mid; else b[++t2]=Q[i]; } else{ if(size[x]+size[y]>=Q[i].z) a[++t1]=Q[i],ans[Q[i].g]=mid; else b[++t2]=Q[i]; } } for(int i=1;i<=t1;i++) Q[L+i-1]=a[i]; for(int i=1;i<=t2;i++) Q[L+t1+i-1]=b[i]; solve(mid+1,r,L+t1,R); while(t>cur) Back(); solve(l,mid-1,L,L+t1-1); } int main(){ read(n); read(m); for(int i=1;i<=n;i++) fa[i]=i,size[i]=rank[i]=1; for(int i=1;i<=m;i++) read(e[i].fi),read(e[i].se); read(q); for(int i=1;i<=q;i++) read(Q[i].x),read(Q[i].y),read(Q[i].z),Q[i].g=i; solve(1,m,1,q); for(int i=1;i<=m;i++) printf("%d\n",ans[i]); return 0; }
a.cc: In function 'void Union(int, int)': a.cc:41:6: error: reference to 'rank' is ambiguous 41 | if(rank[x]>rank[y]) swap(x,y); | ^~~~ In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:13:32: note: 'int rank [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:41:14: error: reference to 'rank' is ambiguous 41 | if(rank[x]>rank[y]) swap(x,y); | ^~~~ /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:13:32: note: 'int rank [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:42:12: error: reference to 'size' is ambiguous 42 | fa[x]=y; size[y]+=size[x]; S[++t]=(sta){x,rank[y]}; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:13:24: note: 'int size [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:42:21: error: reference to 'size' is ambiguous 42 | fa[x]=y; size[y]+=size[x]; S[++t]=(sta){x,rank[y]}; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:13:24: note: 'int size [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:42:41: error: expected primary-expression before ')' token 42 | fa[x]=y; size[y]+=size[x]; S[++t]=(sta){x,rank[y]}; | ^ a.cc:43:6: error: reference to 'rank' is ambiguous 43 | if(rank[x]==rank[y]) rank[y]++; | ^~~~ /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:13:32: note: 'int rank [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:43:15: error: reference to 'rank' is ambiguous 43 | if(rank[x]==rank[y]) rank[y]++; | ^~~~ /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:13:32: note: 'int rank [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:43:24: error: reference to 'rank' is ambiguous 43 | if(rank[x]==rank[y]) rank[y]++; | ^~~~ /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:13:32: note: 'int rank [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc: In function 'void Back()': a.cc:47:17: error: reference to 'size' is ambiguous 47 | int x=S[t].x; size[fa[x]]-=size[x]; rank[fa[x]]=S[t].rk; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:13:24: note: 'int size [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:47:30: error: reference to 'size' is ambiguous 47 | int x=S[t].x; size[fa[x]]-=size[x]; rank[fa[x]]=S[t].rk; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:13:24: note: 'int size [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:47:39: error: reference to 'rank' is ambiguous 47 | int x=S[t].x; size[fa[x]]-=size[x]; rank[fa[x]]=S[t].rk; | ^~~~ /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:13:32: note: 'int rank [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc: In function 'void solve(int, int, int, int)': a.cc:59:10: error: reference to 'size' is ambiguous 59 | if(size[x]>=Q[i].z) | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:13:24: note: 'int size [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:65:10: error: reference to 'size' is ambiguous 65 | if(size[x]+size[y]>=Q[i].z) | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:13:24: note: 'int size [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:65:18: error: reference to 'size' is ambiguous 65 | if(size[x]+size[y]>=Q[i].z) | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:13:24: note: 'int size [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc: In function 'int main()': a.cc:81:13: error: reference to 'size' is ambiguous 81 | fa[i]=i,size[i]=rank[i]=1; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:13:24: note: 'int size [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~ a.cc:81:21: error: reference to 'rank' is ambiguous 81 | fa[i]=i,size[i]=rank[i]=1; | ^~~~ /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:13:32: note: 'int rank [100010]' 13 | int n,m,q,fa[N],ans[N],size[N],rank[N]; | ^~~~
s995825305
p04033
C++
#include<bits/stdc++.h> using namespace std; void out(int po) { cout<<"Possible\n"; for(int i=1;i<n;++i)if(i!=po)cout<<i<<"\n"; cout<<po; exit(0); } int n,l,a[100001]; int main() { cin>>n>>l; for(int i=1;i<=n;++i) { cin>>a[i]; if(i==1)continue; if(a[i]+a[i-1]>=l)out(i-1); } cout<<"Impossible"; }
a.cc: In function 'void out(int)': a.cc:6:15: error: 'n' was not declared in this scope 6 | for(int i=1;i<n;++i)if(i!=po)cout<<i<<"\n"; | ^
s838372808
p04033
C++
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
a.cc:1:1: error: 'test' does not name a type 1 | test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test | ^~~~
s380528848
p04033
C++
var a,b,c : integer; begin read(a,b); c:=a*(a+1)*b; if (c<0) then begin write('Negative'); end else if(c>0) then begin write('Positive'); end else if(c=0) then begin write('Zero'); end; end.
a.cc:8:7: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 8 | write('Negative'); | ^~~~~~~~~~ a.cc:12:7: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 12 | write('Positive'); | ^~~~~~~~~~ a.cc:16:7: warning: multi-character character constant [-Wmultichar] 16 | write('Zero'); | ^~~~~~ a.cc:1:1: error: 'var' does not name a type 1 | var | ^~~ a.cc:3:1: error: 'begin' does not name a type 3 | begin | ^~~~~ a.cc:5:1: error: 'c' does not name a type 5 | c:=a*(a+1)*b; | ^ a.cc:7:1: error: expected unqualified-id before 'if' 7 | if (c<0) then begin | ^~ a.cc:9:1: error: 'end' does not name a type 9 | end | ^~~ a.cc:13:1: error: 'end' does not name a type 13 | end | ^~~ a.cc:17:1: error: 'end' does not name a type 17 | end; | ^~~ a.cc:20:1: error: 'end' does not name a type 20 | end. | ^~~
s474028722
p04033
C++
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i,n) for(int i=0;i<(int)(n);++i) #define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i) #define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i) #define each(a,b) for(auto (a): (b)) #define all(v) (v).begin(),(v).end() #define len(v) (int)(v).size() #define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end()) #define fi first #define se second #define pb push_back #define show(x) cout<<#x<<" = "<<(x)<<endl #define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl #define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl #define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl #define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl using namespace std; typedef pair<int,int> P; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<double> vd; typedef vector<P> vp; const int MAX_N = 100005; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> a >> b; if(a == 0 || b == 0){ cout << "Zero\n"; }else if(a < 0 && b > 0){ cout << "Zero\n"; }else if(a > 0 && b > 0){ cout << "Positive\n"; }else if((b-a)%2 == 0){ cout << "Negative\n"; }else{ cout << "Positive\n"; } return 0; }
a.cc: In function 'int main()': a.cc:38:12: error: 'a' was not declared in this scope 38 | cin >> a >> b; | ^ a.cc:38:17: error: 'b' was not declared in this scope 38 | cin >> a >> b; | ^
s678684995
p04033
C
//set many funcs #include<stdio.h> #include<string.h> #include<stdlib.h> #define inf 1072114514 #define llinf 1145141919810364364 #define mod 1000000007 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int main(void){ long long a,b; scanf("%lld%lld",&a,&b); if(a*b<=0){printf("Zero\n");return 0;} if(a>0){printf("Positive\n");return 0;} if((b-a+1)%2){printf("Negative\n")}else{printf("Positive\n");} return 0; }
main.c:12:5: warning: conflicting types for built-in function 'round'; expected 'double(double)' [-Wbuiltin-declaration-mismatch] 12 | int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} | ^~~~~ main.c:5:1: note: 'round' is declared in header '<math.h>' 4 | #include<stdlib.h> +++ |+#include <math.h> 5 | #define inf 1072114514 main.c:13:5: warning: conflicting types for built-in function 'ceil'; expected 'double(double)' [-Wbuiltin-declaration-mismatch] 13 | int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} | ^~~~ main.c:13:5: note: 'ceil' is declared in header '<math.h>' main.c:18:5: warning: conflicting types for built-in function 'pow'; expected 'double(double, double)' [-Wbuiltin-declaration-mismatch] 18 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} | ^~~ main.c:18:5: note: 'pow' is declared in header '<math.h>' main.c:22:11: warning: conflicting types for built-in function 'llround'; expected 'long long int(double)' [-Wbuiltin-declaration-mismatch] 22 | long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} | ^~~~~~~ main.c:22:11: note: 'llround' is declared in header '<math.h>' main.c: In function 'main': main.c:44:39: error: expected ';' before '}' token 44 | if((b-a+1)%2){printf("Negative\n")}else{printf("Positive\n");} | ^ | ;
s190062836
p04033
C
//set many funcs #include<stdio.h> #include<string.h> #include<stdlib.h> #define inf 1072114514 #define llinf 1145141919810364364 #define mod 1000000007 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int main(void){ long long a,b; scanf("%lld%lld",&a,&b); if(a*b<=0){printf("Zero\n");return 0;} if(a>0){printf("Positive\n");return 0;} if((b-a)%2){printf("Negative\n")}else{printf("Positive\n");} return 0; }
main.c:12:5: warning: conflicting types for built-in function 'round'; expected 'double(double)' [-Wbuiltin-declaration-mismatch] 12 | int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} | ^~~~~ main.c:5:1: note: 'round' is declared in header '<math.h>' 4 | #include<stdlib.h> +++ |+#include <math.h> 5 | #define inf 1072114514 main.c:13:5: warning: conflicting types for built-in function 'ceil'; expected 'double(double)' [-Wbuiltin-declaration-mismatch] 13 | int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} | ^~~~ main.c:13:5: note: 'ceil' is declared in header '<math.h>' main.c:18:5: warning: conflicting types for built-in function 'pow'; expected 'double(double, double)' [-Wbuiltin-declaration-mismatch] 18 | int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} | ^~~ main.c:18:5: note: 'pow' is declared in header '<math.h>' main.c:22:11: warning: conflicting types for built-in function 'llround'; expected 'long long int(double)' [-Wbuiltin-declaration-mismatch] 22 | long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} | ^~~~~~~ main.c:22:11: note: 'llround' is declared in header '<math.h>' main.c: In function 'main': main.c:44:37: error: expected ';' before '}' token 44 | if((b-a)%2){printf("Negative\n")}else{printf("Positive\n");} | ^ | ;
s069678671
p04033
C++
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(): A, B = map(int, input().split()) if 0 < A: sign = 1 elif A <= 0 <= B: sign = 0 else: # B < 0 even = (B-A+1) % 2 == 0 sign = 1 if even else -1 if sign > 0: print("Positive") elif sign == 0: print("Zero") else: print("Negative") if __name__ == "__main__": main()
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/env python3 | ^ a.cc:2:3: error: invalid preprocessing directive #- 2 | # -*- coding: utf-8 -*- | ^ a.cc:13:11: error: stray '#' in program 13 | else: # B < 0 | ^ a.cc:6:1: error: 'def' does not name a type 6 | def main(): | ^~~
s928131910
p04033
C++
#include <iostream> #include <string> using namespace std; int main() { long long int a, b; cin >> a >> b; if (a <= 0 && b >= 0) { cout << "Zero" << endl; } if (b < 0) { if ((b - a + 1) % 2 == 0) { cout << "Positive" << endl; } else { cout << "Negative" << endl; } } if (a > 0) { cout << "Positive" << endl; }
a.cc: In function 'int main()': a.cc:20:10: error: expected '}' at end of input 20 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s181724627
p04033
C
#include <stdio.h> int main(void) { int a,b; scanf("%d %d",&a,&b); if (a > 0) { printf("Positive\n"); } else if (b >= 0) { printf("Zero\n"); } else if((a - b) % 2 = 0) { printf("Negative\n"); } else { printf("Positive\n"); } return 0; }
main.c: In function 'main': main.c:10:27: error: lvalue required as left operand of assignment 10 | } else if((a - b) % 2 = 0) { | ^
s033915491
p04033
Java
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class Main { static void solve(FastScanner sc, PrintWriter out) { long a = sc.nl() long b = sc.nl(); out.println(a * b <= 0 ? "Zero" : (b < 0 && (b - a + 1) % 2 == 1) ? "Negative" : "Positive"); } public static void main(String[] args) { FastScanner sc = new FastScanner(System.in); PrintWriter out = new PrintWriter(System.out); solve(sc, out); out.flush(); } static class FastScanner { private final InputStream is; private byte[] inbuf = new byte[1024]; private int lenbuf = 0, ptrbuf = 0; FastScanner(InputStream is) { this.is = is; } char nc() { return (char) skip(); } char[] nca(int n) { char[] buf = new char[n]; int b = skip(), p = 0; while (p < n && !(isSpaceChar(b))) { buf[p++] = (char) b; b = readByte(); } return n == p ? buf : Arrays.copyOf(buf, p); } String ns() { int b = skip(); StringBuilder sb = new StringBuilder(); while (!(isSpaceChar(b))) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } int ni() { int num = 0, b; boolean minus = false; while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; if (b == '-') { minus = true; b = readByte(); } while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else { return minus ? -num : num; } b = readByte(); } } int[] nia(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = ni(); return a; } long nl() { long num = 0, b; boolean minus = false; while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; if (b == '-') { minus = true; b = readByte(); } while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else { return minus ? -num : num; } b = readByte(); } } double nd() { return Double.parseDouble(ns()); } private int readByte() { if (lenbuf == -1) throw new InputMismatchException(); if (ptrbuf >= lenbuf) { ptrbuf = 0; try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); } if (lenbuf <= 0) return -1; } return inbuf[ptrbuf++]; } private int skip() { int b; while ((b = readByte()) != -1 && isSpaceChar(b)) ; return b; } private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); } } }
Main.java:10: error: ';' expected long a = sc.nl() ^ 1 error
s219769582
p04033
C++
// 簡易競プロテンプレ #include <bits/stdc++.h> using namespace std; int main(void){ ll a, b; if (a>0) {cout << "Positive" << endl; return 0;} if (b>=0) {cout << "Zero" << endl; return 0;} if ((b-a)%2) cout << "Positive" << endl; else cout << "Negative" << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:2: error: 'll' was not declared in this scope 6 | ll a, b; | ^~ a.cc:7:6: error: 'a' was not declared in this scope 7 | if (a>0) {cout << "Positive" << endl; return 0;} | ^ a.cc:8:6: error: 'b' was not declared in this scope 8 | if (b>=0) {cout << "Zero" << endl; return 0;} | ^ a.cc:9:7: error: 'b' was not declared in this scope 9 | if ((b-a)%2) cout << "Positive" << endl; else cout << "Negative" << endl; | ^ a.cc:9:9: error: 'a' was not declared in this scope 9 | if ((b-a)%2) cout << "Positive" << endl; else cout << "Negative" << endl; | ^
s030060564
p04033
C++
#incluide <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (a <= 0 && 0 <= b) { cout << "Zero" << endl; } else if (0 < a) { cout << "Positive" << endl; } else if (b < 0) { if ((b - a + 1) % 2 == 0) { cout << "Positive" << endl; } else { cout << "Negative" << endl; } } }
a.cc:1:2: error: invalid preprocessing directive #incluide; did you mean #include? 1 | #incluide <bits/stdc++.h> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> a >> b; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #incluide <bits/stdc++.h> a.cc:8:5: error: 'cout' was not declared in this scope 8 | cout << "Zero" << endl; | ^~~~ a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:8:23: error: 'endl' was not declared in this scope 8 | cout << "Zero" << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #incluide <bits/stdc++.h> a.cc:11:5: error: 'cout' was not declared in this scope 11 | cout << "Positive" << endl; | ^~~~ a.cc:11:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:11:27: error: 'endl' was not declared in this scope 11 | cout << "Positive" << endl; | ^~~~ a.cc:11:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:15:7: error: 'cout' was not declared in this scope 15 | cout << "Positive" << endl; | ^~~~ a.cc:15:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:29: error: 'endl' was not declared in this scope 15 | cout << "Positive" << endl; | ^~~~ a.cc:15:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:18:7: error: 'cout' was not declared in this scope 18 | cout << "Negative" << endl; | ^~~~ a.cc:18:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:18:29: error: 'endl' was not declared in this scope 18 | cout << "Negative" << endl; | ^~~~ a.cc:18:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s031397782
p04033
C++
using System; class Program { static void Main(string[] args) { string[] input = Console.ReadLine().Split(' '); int a = int.Parse(input[0]); int b = int.Parse(input[1]); if (a > 0 && b > 0) Console.WriteLine("Positive"); else if (a < 0 && b < 0) { if ((a + b) % 2 != 0) Console.WriteLine("Positive"); else Console.WriteLine("Negative"); } else Console.WriteLine("Zero"); } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:5:22: error: 'string' has not been declared 5 | static void Main(string[] args) | ^~~~~~ a.cc:5:31: error: expected ',' or '...' before 'args' 5 | static void Main(string[] args) | ^~~~ a.cc:19:2: error: expected ';' after class definition 19 | } | ^ | ; a.cc: In static member function 'static void Program::Main(int*)': a.cc:7:9: error: 'string' was not declared in this scope 7 | string[] input = Console.ReadLine().Split(' '); | ^~~~~~ a.cc:7:16: error: expected primary-expression before ']' token 7 | string[] input = Console.ReadLine().Split(' '); | ^ a.cc:8:17: error: expected primary-expression before 'int' 8 | int a = int.Parse(input[0]); | ^~~ a.cc:9:17: error: expected primary-expression before 'int' 9 | int b = int.Parse(input[1]); | ^~~ a.cc:11:29: error: 'Console' was not declared in this scope 11 | if (a > 0 && b > 0) Console.WriteLine("Positive"); | ^~~~~~~ a.cc:14:35: error: 'Console' was not declared in this scope 14 | if ((a + b) % 2 != 0) Console.WriteLine("Positive"); | ^~~~~~~ a.cc:15:18: error: 'Console' was not declared in this scope 15 | else Console.WriteLine("Negative"); | ^~~~~~~ a.cc:17:14: error: 'Console' was not declared in this scope 17 | else Console.WriteLine("Zero"); | ^~~~~~~
s163621990
p04033
C++
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <vector> using namespace std; template<class T> T gc() { int s, k, m = 0; T x = 0; k = getchar_unlocked(); if (k == '-') s = 1; k = getchar_unlocked(); while (true) { k = getchar_unlocked(); if (k < '0' || k > '9') break; x = x * 10 + k - '0'; } if (m) x = -x; return x; } int main() { int N = gc(); int M = gc(); vector<int> num; vector<bool> red; for (int i = 0; i < N; i++) { num.push_back(1); red.push_back(false); } red[0] = true; for (int i = 0; i < M; i++) { int x = gc(); int y = gc(); if (red[x - 1]) red[y - 1] = true; num[x - 1]--; num[y - 1]++; if (!num[x - 1]) red[x - 1] = false; } int ans = 0; for (int i = 0; i < N; i++) { if (red[i]) ans++; } printf("%d\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:31:15: error: no matching function for call to 'gc()' 31 | int N = gc(); | ~~^~ a.cc:6:21: note: candidate: 'template<class T> T gc()' 6 | template<class T> T gc() | ^~ a.cc:6:21: note: template argument deduction/substitution failed: a.cc:31:15: note: couldn't deduce template parameter 'T' 31 | int N = gc(); | ~~^~ a.cc:32:15: error: no matching function for call to 'gc()' 32 | int M = gc(); | ~~^~ a.cc:6:21: note: candidate: 'template<class T> T gc()' 6 | template<class T> T gc() | ^~ a.cc:6:21: note: template argument deduction/substitution failed: a.cc:32:15: note: couldn't deduce template parameter 'T' 32 | int M = gc(); | ~~^~ a.cc:47:19: error: no matching function for call to 'gc()' 47 | int x = gc(); | ~~^~ a.cc:6:21: note: candidate: 'template<class T> T gc()' 6 | template<class T> T gc() | ^~ a.cc:6:21: note: template argument deduction/substitution failed: a.cc:47:19: note: couldn't deduce template parameter 'T' 47 | int x = gc(); | ~~^~ a.cc:48:19: error: no matching function for call to 'gc()' 48 | int y = gc(); | ~~^~ a.cc:6:21: note: candidate: 'template<class T> T gc()' 6 | template<class T> T gc() | ^~ a.cc:6:21: note: template argument deduction/substitution failed: a.cc:48:19: note: couldn't deduce template parameter 'T' 48 | int y = gc(); | ~~^~
s162919509
p04033
C++
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <vector> using namespace std; template<class T> void gc() { int s, k, m = 0; T x = 0; k = getchar_unlocked(); if (k == '-') s = 1; k = getchar_unlocked(); while (true) { k = getchar_unlocked(); if (k < '0' || k > '9') break; x = x * 10 + k - '0'; } if (m) x = -x; return x; } int main() { int N = gc(); int M = gc(); vector<int> num; vector<bool> red; for (int i = 0; i < N; i++) { num.push_back(1); red.push_back(false); } red[0] = true; for (int i = 0; i < M; i++) { int x = gc(); int y = gc(); if (red[x - 1]) red[y - 1] = true; num[x - 1]--; num[y - 1]++; if (!num[x - 1]) red[x - 1] = false; } int ans = 0; for (int i = 0; i < N; i++) { if (red[i]) ans++; } printf("%d\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:31:15: error: no matching function for call to 'gc()' 31 | int N = gc(); | ~~^~ a.cc:6:24: note: candidate: 'template<class T> void gc()' 6 | template<class T> void gc() | ^~ a.cc:6:24: note: template argument deduction/substitution failed: a.cc:31:15: note: couldn't deduce template parameter 'T' 31 | int N = gc(); | ~~^~ a.cc:32:15: error: no matching function for call to 'gc()' 32 | int M = gc(); | ~~^~ a.cc:6:24: note: candidate: 'template<class T> void gc()' 6 | template<class T> void gc() | ^~ a.cc:6:24: note: template argument deduction/substitution failed: a.cc:32:15: note: couldn't deduce template parameter 'T' 32 | int M = gc(); | ~~^~ a.cc:47:19: error: no matching function for call to 'gc()' 47 | int x = gc(); | ~~^~ a.cc:6:24: note: candidate: 'template<class T> void gc()' 6 | template<class T> void gc() | ^~ a.cc:6:24: note: template argument deduction/substitution failed: a.cc:47:19: note: couldn't deduce template parameter 'T' 47 | int x = gc(); | ~~^~ a.cc:48:19: error: no matching function for call to 'gc()' 48 | int y = gc(); | ~~^~ a.cc:6:24: note: candidate: 'template<class T> void gc()' 6 | template<class T> void gc() | ^~ a.cc:6:24: note: template argument deduction/substitution failed: a.cc:48:19: note: couldn't deduce template parameter 'T' 48 | int y = gc(); | ~~^~
s811183798
p04033
C++
S#include <string> #include <queue> #include <stack> #include <vector> #include <sstream> #include <algorithm> #include <deque> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <list> #include <cstdio> #include <iostream> #include <cmath> #include <climits> #include <bitset> #include <functional> #include <numeric> #include <ctime> #include <cassert> #include <cstring> #include <fstream> #define FOR(i, a, b) for(int (i)=(a); (i)<(b); (i)++) #define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++) #define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--) using namespace std; int main() { int a, b; cin >> a >> b; if (a <= 0 && b >= 0) { cout << "Zero" << endl; } int num = b - a + 1; string str[] = { "Positive", "Negative" }; cout << (b < 0 ? str[num % 2] : str[0]) << endl; return 0; }
a.cc:1:2: error: stray '#' in program 1 | S#include <string> | ^ a.cc:1:1: error: 'S' does not name a type 1 | S#include <string> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/deque:62, from /usr/include/c++/14/queue: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
s120100097
p04033
C++
#include <set> #include <vector> #include <string> #include <algorithm> #include <cmath> using namespace std; #define IN(n) int n;cin>>n #define IN_(n,n_) int n,n_;cin>>n>>n_; #define OUT(n) cout << n << endl #define OUT_(n,n_) cout << n << " " << n_ << endl #define v_(a,n,n_) vector<vector<a>>(n,vector<a>(n_)) //vector<vector<n>> initialize #define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++) #define REP(i,n) for(int i=0;i<(n);i++) #define REP_(i,n) for(int i=(n)-1;i>=0;i--) #define SORT(n) sort((n).begin(),(n).end()) #define ALL(n) (n).begin(),(n).end() #define TRY(n) try{n}catch(...){} typedef vector<int> vi; typedef vector<vector<int> > vii; typedef vector<string> vs; typedef vector<vector<string> > vss; //vii v = v_(int,5,5); int main(){ IN_(a,b); if(a <= 0 && b >= 0){OUT("Zero");} else if(a > 0 && b > 0){OUT("Positive");} else if(b-a % 2){ OUT("Positive"); }else{ OUT("Negative"); } }
a.cc: In function 'int main()': a.cc:9:28: error: 'cin' was not declared in this scope 9 | #define IN_(n,n_) int n,n_;cin>>n>>n_; | ^~~ a.cc:30:5: note: in expansion of macro 'IN_' 30 | IN_(a,b); | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include <cmath> +++ |+#include <iostream> 6 | using namespace std; a.cc:10:16: error: 'cout' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:31:26: note: in expansion of macro 'OUT' 31 | if(a <= 0 && b >= 0){OUT("Zero");} | ^~~ a.cc:10:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:31:26: note: in expansion of macro 'OUT' 31 | if(a <= 0 && b >= 0){OUT("Zero");} | ^~~ a.cc:10:29: error: 'endl' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:31:26: note: in expansion of macro 'OUT' 31 | if(a <= 0 && b >= 0){OUT("Zero");} | ^~~ a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 5 | #include <cmath> +++ |+#include <ostream> 6 | using namespace std; a.cc:10:16: error: 'cout' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:32:29: note: in expansion of macro 'OUT' 32 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:10:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:32:29: note: in expansion of macro 'OUT' 32 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:10:29: error: 'endl' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:32:29: note: in expansion of macro 'OUT' 32 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:10:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:32:29: note: in expansion of macro 'OUT' 32 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:10:16: error: 'cout' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:34:9: note: in expansion of macro 'OUT' 34 | OUT("Positive"); | ^~~ a.cc:10:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:34:9: note: in expansion of macro 'OUT' 34 | OUT("Positive"); | ^~~ a.cc:10:29: error: 'endl' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:34:9: note: in expansion of macro 'OUT' 34 | OUT("Positive"); | ^~~ a.cc:10:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:34:9: note: in expansion of macro 'OUT' 34 | OUT("Positive"); | ^~~ a.cc:10:16: error: 'cout' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:36:9: note: in expansion of macro 'OUT' 36 | OUT("Negative"); | ^~~ a.cc:10:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:36:9: note: in expansion of macro 'OUT' 36 | OUT("Negative"); | ^~~ a.cc:10:29: error: 'endl' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:36:9: note: in expansion of macro 'OUT' 36 | OUT("Negative"); | ^~~ a.cc:10:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:36:9: note: in expansion of macro 'OUT' 36 | OUT("Negative"); | ^~~
s382915092
p04033
C++
#include <set> #include <vector> #include <string> #include <algorithm> #include <cmath> using namespace std; #define IN(n) int n;cin>>n #define IN_(n,n_) int n,n_;cin>>n>>n_; #define OUT(n) cout << n << endl #define OUT_(n,n_) cout << n << " " << n_ << endl #define v_(a,n,n_) vector<vector<a>>(n,vector<a>(n_)) //vector<vector<n>> initialize #define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++) #define REP(i,n) for(int i=0;i<(n);i++) #define REP_(i,n) for(int i=(n)-1;i>=0;i--) #define SORT(n) sort((n).begin(),(n).end()) #define ALL(n) (n).begin(),(n).end() #define TRY(n) try{n}catch(...){} typedef vector<int> vi; typedef vector<vector<int> > vii; typedef vector<string> vs; typedef vector<vector<string> > vss; //vii v = v_(int,5,5); int main(){ IN_(a,b); if(a <= 0 && b >= 0){OUT("Zero");} else if(a > 0 && b > 0){OUT("Positive");} else if(b-a % 2){ OUT("Positive"); }else{ OUT("Negative"); } }
a.cc: In function 'int main()': a.cc:9:28: error: 'cin' was not declared in this scope 9 | #define IN_(n,n_) int n,n_;cin>>n>>n_; | ^~~ a.cc:30:5: note: in expansion of macro 'IN_' 30 | IN_(a,b); | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include <cmath> +++ |+#include <iostream> 6 | using namespace std; a.cc:10:16: error: 'cout' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:31:26: note: in expansion of macro 'OUT' 31 | if(a <= 0 && b >= 0){OUT("Zero");} | ^~~ a.cc:10:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:31:26: note: in expansion of macro 'OUT' 31 | if(a <= 0 && b >= 0){OUT("Zero");} | ^~~ a.cc:10:29: error: 'endl' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:31:26: note: in expansion of macro 'OUT' 31 | if(a <= 0 && b >= 0){OUT("Zero");} | ^~~ a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 5 | #include <cmath> +++ |+#include <ostream> 6 | using namespace std; a.cc:10:16: error: 'cout' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:32:29: note: in expansion of macro 'OUT' 32 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:10:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:32:29: note: in expansion of macro 'OUT' 32 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:10:29: error: 'endl' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:32:29: note: in expansion of macro 'OUT' 32 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:10:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:32:29: note: in expansion of macro 'OUT' 32 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:10:16: error: 'cout' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:34:9: note: in expansion of macro 'OUT' 34 | OUT("Positive"); | ^~~ a.cc:10:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:34:9: note: in expansion of macro 'OUT' 34 | OUT("Positive"); | ^~~ a.cc:10:29: error: 'endl' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:34:9: note: in expansion of macro 'OUT' 34 | OUT("Positive"); | ^~~ a.cc:10:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:34:9: note: in expansion of macro 'OUT' 34 | OUT("Positive"); | ^~~ a.cc:10:16: error: 'cout' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:36:9: note: in expansion of macro 'OUT' 36 | OUT("Negative"); | ^~~ a.cc:10:16: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:36:9: note: in expansion of macro 'OUT' 36 | OUT("Negative"); | ^~~ a.cc:10:29: error: 'endl' was not declared in this scope 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:36:9: note: in expansion of macro 'OUT' 36 | OUT("Negative"); | ^~~ a.cc:10:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 10 | #define OUT(n) cout << n << endl | ^~~~ a.cc:36:9: note: in expansion of macro 'OUT' 36 | OUT("Negative"); | ^~~
s779419387
p04033
C++
#define REP_(i,n) for(int i=(n)-1;i>=0;i--) #define SORT(n) sort((n).begin(),(n).end()) #define ALL(n) (n).begin(),(n).end() #define TRY(n) try{n}catch(...){} typedef vector<int> vi; typedef vector<vector<int> > vii; typedef vector<string> vs; typedef vector<vector<string> > vss; //vii v = v_(int,5,5); int main(){ IN_(a,b); if(a <= 0 && 0 <= b){OUT("Zero");} else if(a > 0 && b > 0){OUT("Positive");} else if(a < 0 && b < 0){ if(abs(a-b)+1 % 2 == 0)OUT("Positive"); else OUT("Negative"); }else{ OUT("Positive"); } }
a.cc:6:9: error: 'vector' does not name a type 6 | typedef vector<int> vi; | ^~~~~~ a.cc:7:9: error: 'vector' does not name a type 7 | typedef vector<vector<int> > vii; | ^~~~~~ a.cc:8:9: error: 'vector' does not name a type 8 | typedef vector<string> vs; | ^~~~~~ a.cc:9:9: error: 'vector' does not name a type 9 | typedef vector<vector<string> > vss; | ^~~~~~ a.cc: In function 'int main()': a.cc:14:9: error: 'a' was not declared in this scope 14 | IN_(a,b); | ^ a.cc:14:11: error: 'b' was not declared in this scope 14 | IN_(a,b); | ^ a.cc:14:5: error: 'IN_' was not declared in this scope 14 | IN_(a,b); | ^~~ a.cc:15:26: error: 'OUT' was not declared in this scope 15 | if(a <= 0 && 0 <= b){OUT("Zero");} | ^~~ a.cc:16:29: error: 'OUT' was not declared in this scope 16 | else if(a > 0 && b > 0){OUT("Positive");} | ^~~ a.cc:18:12: error: 'abs' was not declared in this scope 18 | if(abs(a-b)+1 % 2 == 0)OUT("Positive"); | ^~~ a.cc:18:32: error: 'OUT' was not declared in this scope 18 | if(abs(a-b)+1 % 2 == 0)OUT("Positive"); | ^~~ a.cc:19:14: error: 'OUT' was not declared in this scope 19 | else OUT("Negative"); | ^~~ a.cc:21:9: error: 'OUT' was not declared in this scope 21 | OUT("Positive"); | ^~~
s232900633
p04033
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int a,b; cin>>a>>b; if(a<=0&&b>=0) cout<<"Zero"<<endl; else if(a*b>0) cout<<"Positive"<<end; else cout<<"Negative"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:34: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 9 | else if(a*b>0) cout<<"Positive"<<end; | ~~~~~~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, 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
s109474428
p04033
C++
#include<cstdio> int main(){ int a,b; cin>>a>>b; if(a>b)swap(a,b); int g=1; for(int i=a;i<=b;i++){ g*=i; } if(!g)cout<<"Zero"<<endl; else if(g>0)cout<<"Positive"<<endl; else cout<<"Negative"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: 'cin' was not declared in this scope 4 | cin>>a>>b; | ^~~ a.cc:5:8: error: 'swap' was not declared in this scope 5 | if(a>b)swap(a,b); | ^~~~ a.cc:10:7: error: 'cout' was not declared in this scope 10 | if(!g)cout<<"Zero"<<endl; | ^~~~ a.cc:10:21: error: 'endl' was not declared in this scope 10 | if(!g)cout<<"Zero"<<endl; | ^~~~ a.cc:11:13: error: 'cout' was not declared in this scope 11 | else if(g>0)cout<<"Positive"<<endl; | ^~~~ a.cc:11:31: error: 'endl' was not declared in this scope 11 | else if(g>0)cout<<"Positive"<<endl; | ^~~~ a.cc:12:6: error: 'cout' was not declared in this scope 12 | else cout<<"Negative"<<endl; | ^~~~ a.cc:12:24: error: 'endl' was not declared in this scope 12 | else cout<<"Negative"<<endl; | ^~~~
s455311228
p04033
C++
#include <iostream> using namespace std; int main() { int a,b,mul=1; cin>>a>>b; int i; while(i<=b){ mul=mul*i; i++; } if(mul>=0){ cout<<"Positive"<<endl; } else if(mul<=0){ cout<<"Negative"<<endl; } else{ cout<<"Zero"<<endl; }#include <iostream> using namespace std; int main() { int a,b,mul=1; cin>>a>>b; int i; while(i<=b){ mul=mul*i; i++; } if(mul>=0){ cout<<"Positive"<<endl; } else if(mul<=0){ cout<<"Negative"<<endl; } else{ cout<<"Zero"<<endl; } }
a.cc:20:2: error: stray '#' in program 20 | }#include <iostream> | ^ a.cc: In function 'int main()': a.cc:20:3: error: 'include' was not declared in this scope 20 | }#include <iostream> | ^~~~~~~ a.cc:20:20: error: expected primary-expression before '>' token 20 | }#include <iostream> | ^ a.cc:21:1: error: expected primary-expression before 'using' 21 | using namespace std; | ^~~~~ a.cc:22:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 22 | int main() | ^~ a.cc:22:9: note: remove parentheses to default-initialize a variable 22 | int main() | ^~ | -- a.cc:22:9: note: or replace parentheses with braces to value-initialize a variable a.cc:23:1: error: a function-definition is not allowed here before '{' token 23 | { | ^ a.cc:40:2: error: expected '}' at end of input 40 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s918078587
p04033
C++
#include <iostream> #include <string> #include <map> #include <vector> using namespace std; int main() { int a,b; int seki = 1; scanf(%d,&a); scanf(%d,&b); for(int i = a;i<=b;i++) { seki *= i; } if(seki>0){ printf("%s","Positive\n"); } else if(seki = 0){ printf("%s","Zero") } else { printf("%s","Negative\n") } return 0; }
a.cc: In function 'int main()': a.cc:12:15: error: expected primary-expression before '%' token 12 | scanf(%d,&a); | ^ a.cc:12:16: error: 'd' was not declared in this scope 12 | scanf(%d,&a); | ^ a.cc:13:15: error: expected primary-expression before '%' token 13 | scanf(%d,&b); | ^ a.cc:22:36: error: expected ';' before '}' token 22 | printf("%s","Zero") | ^ | ; 23 | } else { | ~ a.cc:24:42: error: expected ';' before '}' token 24 | printf("%s","Negative\n") | ^ | ; 25 | } | ~
s082610190
p04033
Java
import java.util.Scanner; public class Atc_1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); if (a > 0 && b > 0 ) System.out.println("Positive"); else if (a <= 0 && b >= 0) System.out.println("Zero"); else if((Math.abs(a)+Math.abs(b) )% 2 == 0) System.out.println("Positive"); else System.out.println("Negative"); } }
Main.java:2: error: class Atc_1 is public, should be declared in a file named Atc_1.java public class Atc_1 { ^ 1 error
s200679851
p04033
C
#include <stdio.h> int main(void){ int a,b,n; scanf("%d %d",&a,&b); if(a>0)puts("Positive"); else if(a<=0&&b>=0)puts("Zero"); else{ n=b-a+1; if(n%2)puts("Negative"); else puts("Positive")+ } return 0; }
main.c: In function 'main': main.c:11:9: error: expected expression before '}' token 11 | } | ^
s978351809
p04033
C++
#include<iostream> using namespace std; int main(0 { cout<<1<<endl; return 0; }
a.cc:3:5: error: cannot declare '::main' to be a global variable 3 | int main(0 | ^~~~ a.cc:3:11: error: expected ')' before '{' token 3 | int main(0 | ~ ^ | ) 4 | { | ~
s803018992
p04033
Java
/* Filename: AGC002A.java * Author: Mushiyo */ import java.util.Scanner; public class Math{ public static void main(String[] args) { Scanner input = new Scanner(System.in); while (input.hasNext()) { int a = input.nextInt(); int b = input.nextInt(); if(a > 0){ System.out.println("Positive"); } else if (b < 0){ if((b - a + 1) % 2 == 0){ System.out.println("Positive"); } else { System.out.println("Negative"); } } else { System.out.println("Zero"); } } } }
Main.java:7: error: class Math is public, should be declared in a file named Math.java public class Math{ ^ 1 error
s835963246
p04033
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b; if(a<=0 && 0<=b)cout << "Zero"; else if(a>0)cout << "Positive"; else if(!(b-a)%2))cout << "Negative"; else cout << "Positive"; cout << '\n'; }
a.cc: In function 'int main()': a.cc:10:20: error: expected primary-expression before ')' token 10 | else if(!(b-a)%2))cout << "Negative"; | ^
s280396633
p04033
C++
#include<iostream> using namespace std; int main() { int a,b; int zero=1, minus=0, result; cin >> a >> b; for(int i=0, i<b-a+1, i++) { if(a+i < 0) { minus++; } if(a+i == 0) { zero=0; } } result = minus%2; if(zero == 0 ) { cout << "Zero"<< endl; }else{ if(result==0) { cout << "Positive"; }else{ cout << "Negative"; } } return 0; }
a.cc: In function 'int main()': a.cc:11:23: error: expected ';' before '<' token 11 | for(int i=0, i<b-a+1, i++) | ^ | ; a.cc:11:23: error: expected primary-expression before '<' token a.cc:11:34: error: expected ';' before ')' token 11 | for(int i=0, i<b-a+1, i++) | ^ | ;
s056510088
p04033
C++
a
a.cc:1:5: error: 'a' does not name a type 1 | a | ^
s088432938
p04033
C++
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * 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; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskA1 solver = new TaskA1(); try { int testNumber = 1; while (true) solver.solve(testNumber++, in, out); } catch (UnknownError e) { out.close(); } } static class TaskA1 { public void solve(int testNumber, Scanner in, PrintWriter out) { int a = in.nextInt(); int b = in.nextInt(); if (a <= 0 && b >= 0) { out.println("Zero"); } else { int n = b - a + 1; if (b < 0) { if (n % 2 == 0) { out.println("Positive"); } else { out.println("Negative"); } } else { out.println("Positive"); } } } } }
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.util.Scanner; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:11:1: error: expected unqualified-id before 'public' 11 | public class Main { | ^~~~~~
s284267416
p04033
Java
public class Main { public static void main(String[] args) throws java.io.IOException { // TODO 自動生成されたメソッド・スタブ Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); int result = 0; for (;a <= b; a++) { result = a * (a + 1); if (result == 0) { break; } } if(result > 0){ System.out.println("Positive"); } else if(result < 0){ System.out.println("Negative"); } else if (result == 0) { System.out.println("Zero"); } } }
Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s870915130
p04033
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long A = sc.nextLong()L; long B = sc.nextLong()L; long C = A; for(int i=0; i<B-A; i++){ A = A*(C+1); C++; } if(A == 0){ System.out.println("Zero"); }else if(A>0){ System.out.println("Positive"); }else if(A<0){ System.out.println("Negative"); } } }
Main.java:6: error: ';' expected long A = sc.nextLong()L; ^ Main.java:7: error: ';' expected long B = sc.nextLong()L; ^ 2 errors
s316867991
p04033
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long A = sc.nextInt()L; long B = sc.nextInt()L; long C = A; for(int i=0; i<B-A; i++){ A = A*(C+1); C++; } if(A == 0){ System.out.println("Zero"); }else if(A>0){ System.out.println("Positive"); }else if(A<0){ System.out.println("Negative"); } } }
Main.java:6: error: ';' expected long A = sc.nextInt()L; ^ Main.java:7: error: ';' expected long B = sc.nextInt()L; ^ 2 errors
s488692261
p04033
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); Int C = A; for(int i=0; i<B-A; i++){ A = A*(C+1); C++; } if(A == 0){ System.out.println("Zero"); }else if(A>0){ System.out.println("Positive"); }else if(A<0){ System.out.println("Negative"); } } }
Main.java:8: error: cannot find symbol Int C = A; ^ symbol: class Int location: class Main 1 error
s655349748
p04033
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc =new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); for(int i=0; i<B-A; i++){ A = A*(A+1); } if(A =0){ System.out.println("Zero"); }else if(A>0){ System.out.println("Positive"); }else{ System.out.println("Negative"); } } }
Main.java:13: error: incompatible types: int cannot be converted to boolean if(A =0){ ^ 1 error
s392130082
p04033
Java
import java.util.*; public class Main{ public static void main(Strint[] args){ Scanner sc =new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); for(int i=0; i<B-A; i++){ A = A*(A+1); } if(A =0){ System.out.println("Zero"); }else if(A>0){ System.out.println("Positive"); }else{ System.out.println("Negative"); } } }
Main.java:3: error: cannot find symbol public static void main(Strint[] args){ ^ symbol: class Strint location: class Main Main.java:13: error: incompatible types: int cannot be converted to boolean if(A =0){ ^ 2 errors
s273022290
p04033
C++
#include <iostream> using namespace std; int main() { cin >> a ; cin >> b ; if( a * b <= 0 ) { cout << "Zero" << endl ; } else { if( a + b <= 0 ) { if( ( b - a ) % 2 == 0 ) { cout << "Negative" << endl ; } else { cout << "Positive" << endl ; } } else { cout << "Positive" << endl ; } } return 0 ; }
a.cc: In function 'int main()': a.cc:7:16: error: 'a' was not declared in this scope 7 | cin >> a ; | ^ a.cc:8:16: error: 'b' was not declared in this scope 8 | cin >> b ; | ^
s447107573
p04033
C++
#include <cstdio> #include <cmath> #include <cstring> #include <iostream> #include <algorithm> #include <queue> #include <vector> #include <map> using namespace std; typedef long long LL; int n; int len,a[100005] LL s[100005]; int l,r; bool flag; int ans[100005]; int main() { scanf("%d%d",&n,&len); for (int i=1;i<=n;++i) scanf("%d",&a[i]); s[0]=0; for (int i=1;i<=n;++i) s[i]=s[i-1]+a[i]; flag=true; l=1;r=n; for (int z=1;z<n;++z) { if (s[r]-s[l-1]>=len) { if (a[l]<a[r]) { ans[z]=l; l++; } else { ans[z]=r-1; r--; } } else { flag=false; } } if (flag) { printf("Possible\n"); for (int i=1;i<n;++i) printf("%d\n",ans[i]); } else { printf("Impossible\n"); } return 0; }
a.cc:28:1: error: expected initializer before 'LL' 28 | LL s[100005]; | ^~ a.cc: In function 'int main()': a.cc:37:44: error: 'a' was not declared in this scope 37 | for (int i=1;i<=n;++i) scanf("%d",&a[i]); | ^ a.cc:38:9: error: 's' was not declared in this scope 38 | s[0]=0; | ^ a.cc:39:44: error: 'a' was not declared in this scope 39 | for (int i=1;i<=n;++i) s[i]=s[i-1]+a[i]; | ^ a.cc:46:29: error: 'a' was not declared in this scope 46 | if (a[l]<a[r]) | ^
s043994563
p04033
Java
import java.util.*; import java.io.*; public class Main { void solve() { String ans = ""; long a = sc.nextLong(); long b = sc.nextLong(); long ans = 1; for (long i = a; i <= b; i++) { ans *= i; } if (ans == 0) { System.out.println("Zero"); } else if (ans < 0) { System.out.println("Negative"); } else { System.out.println("Positive"); } } void print(int[] a) { out.print(a[0]); for (int i = 1; i < a.length; i++) out.print(" " + a[i]); out.println(); } public static void main(String[] args) throws Exception { new Main().run(); } MyScanner sc = null; PrintWriter out = null; public void run() throws Exception { sc = new MyScanner(System.in); out = new PrintWriter(System.out); for (;sc.hasNext();) { solve(); out.flush(); } out.close(); } class MyScanner { String line; BufferedReader reader; StringTokenizer tokenizer; public MyScanner(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream)); tokenizer = null; } public void eat() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { line = reader.readLine(); if (line == null) { tokenizer = null; return; } tokenizer = new StringTokenizer(line); } catch (IOException e) { throw new RuntimeException(e); } } } public String next() { eat(); return tokenizer.nextToken(); } public String nextLine() { try { return reader.readLine(); } catch (IOException e) { throw new RuntimeException(e); } } public boolean hasNext() { eat(); return (tokenizer != null && tokenizer.hasMoreElements()); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } } }
Main.java:11: error: variable ans is already defined in method solve() long ans = 1; ^ 1 error
s020766911
p04033
C++
#include <iostream> using namespace std; int main(){ int a, b; cin a >> b; if(a * b <= 0 ){ cout << "Zero" << endl; }else if( (a < 0 && 0 < b) && a%2 != 0 || (a < 0 && b < 0) && (b-a+1)%2 != 0 ){ cout << "Negative" << endl; }else{ cout << "Positive" << endl; } }
a.cc: In function 'int main()': a.cc:6:8: error: expected ';' before 'a' 6 | cin a >> b; | ^~ | ;
s980138757
p04033
C++
#include<iostream> using namespace std; int main(){ int a,b; cin >> a >> b; int ans = a; for(int i = a + 1; i <= b; i++){ if(ans > 0)ans = 1; else if(ans == 0){ ans = 0; break; }else if(ans < 0){ ans = -1: } ans *= i; } if(ans > 0)cout << "Positive" << endl; else if(ans == 0)cout << "Zero" << endl; else cout << "Negative" << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:21: error: expected ';' before ':' token 14 | ans = -1: | ^ | ;
s002145194
p04033
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n=scan.nextInt(); int m=scan.nextInt(); int a = scan.nextInt(); int b = scan.nextInt(); String ans = ""; if (0 < a) ans = "Positive"; if (a < =0 && 0 <= b) ans = "Zero"; if (b < 0 && (b - a) % 2 == 0) ans = "Negative"; System.out.println(ans);}}
Main.java:15: error: illegal start of expression if (a < =0 && 0 <= b) ^ 1 error
s117712433
p04033
Java
int a = scan.nextInt(); int b = scan.nextInt(); String ans = ""; if (0 < a) ans = "Positive"; if (a < =0 && 0 <= b) ans = "Zero"; if (b < 0 && (b - a) % 2 == 0) ans = "Negative"; System.out.println(ans);
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. int a = scan.nextInt(); ^ (use --enable-preview to enable unnamed classes) Main.java:4: error: class, interface, enum, or record expected if (0 < a) ^ Main.java:6: error: class, interface, enum, or record expected if (a < =0 && 0 <= b) ^ Main.java:9: error: class, interface, enum, or record expected if (b < 0 && (b - a) % 2 == 0) ^ Main.java:12: error: class, interface, enum, or record expected System.out.println(ans); ^ 5 errors
s366621134
p04033
C
#include<stdio.h> int main(void) { int a,b,c; c=0; scanf("%d %d",&a,&b); c=a*(a+1)*b; if(1=<c){ printf("Positive\n"); } if(-1>=c){ printf("Negative\n"); } if(c==0){ printf("Zero\n"); } return 0; }
main.c: In function 'main': main.c:8:14: error: expected expression before '<' token 8 | if(1=<c){ | ^
s050988630
p04033
C++
#include<stdio.h> int main(void) { int a,b,c; c=0; scanf("%d %d",&a,&b); c=a*(a+1)*b; if(1=<c){ printf("Positive\n"); } if(-1>=c){ printf("Negative\n"); } if(c==0){ printf("Zero\n"); } return 0; }
a.cc: In function 'int main()': a.cc:8:14: error: expected primary-expression before '<' token 8 | if(1=<c){ | ^
s851036216
p04033
C
#include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; if (a==0 || b ==0) { cout << "Zero" << endl; return 0; } if (a < 0 && b > 0) { cout << "Zero" << endl; } int c = (b - a) % 2; if (a < 0) { if (c == 0) { cout << "Negative" << endl; } else { cout << "Positive" << endl; } } else { cout << "Positive" << endl; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s562664292
p04033
C++
a,b;main(){ scanf("%d%d",&a,&b); if(!a||!b||a<0&&b>0)printf("Zero\n"); else if(a>0&&b>0)printf("Positive\n"); else printf((b-a+1)%2?"Negative\n":"Positive\n"); }
a.cc:1:1: error: 'a' does not name a type 1 | a,b;main(){ | ^ a.cc:1:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | a,b;main(){ | ^~~~ a.cc: In function 'int main()': a.cc:2:23: error: 'a' was not declared in this scope 2 | scanf("%d%d",&a,&b); | ^ a.cc:2:26: error: 'b' was not declared in this scope 2 | scanf("%d%d",&a,&b); | ^ a.cc:2:9: error: 'scanf' was not declared in this scope 2 | scanf("%d%d",&a,&b); | ^~~~~ a.cc:3:29: error: 'printf' was not declared in this scope 3 | if(!a||!b||a<0&&b>0)printf("Zero\n"); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | a,b;main(){ a.cc:4:26: error: 'printf' was not declared in this scope 4 | else if(a>0&&b>0)printf("Positive\n"); | ^~~~~~ a.cc:4:26: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:5:14: error: 'printf' was not declared in this scope 5 | else printf((b-a+1)%2?"Negative\n":"Positive\n"); | ^~~~~~ a.cc:5:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s141458692
p04033
C++
using namespace std; int compareMultiple(int a, int b) { if (a == b) { return a; } if (a > 0) { return 1; } if (a <= 0 && b >= 0) { return 0; } if (b < 0) { return (-a + b) % 2 == 0 ? -1 : 1; } } int main() { long a, b; cin >> a >> b; int res = compareMultiple(a, b); cout << (res == 0 ? "Zero" : (res > 0 ? "Positive" : "Negative")); return 0; }
a.cc: In function 'int main()': a.cc:20:5: error: 'cin' was not declared in this scope 20 | cin >> a >> b; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:22:5: error: 'cout' was not declared in this scope 22 | cout << (res == 0 ? "Zero" : (res > 0 ? "Positive" : "Negative")); | ^~~~ a.cc:22:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc: In function 'int compareMultiple(int, int)': a.cc:16:1: warning: control reaches end of non-void function [-Wreturn-type] 16 | } | ^
s943520890
p04033
C++
use std::io; use std::str::FromStr; use std::str::Chars; use std::i32; use std::u8; use std::f64; use std::ascii::AsciiExt; use std::collections::HashMap; use std::collections::HashSet; use std::collections::BTreeMap; use std::collections::BTreeSet; use std::collections::VecDeque; use std::io::prelude::*; use std::time::Duration; use std::cmp; macro_rules! println_stderr( ($($arg:tt)*) => { { let r = writeln!(&mut ::std::io::stderr(), $($arg)*); r.expect("failed printing to stderr"); } } ); macro_rules! print_stderr( ($($arg:tt)*) => { { let r = write!(&mut ::std::io::stderr(), $($arg)*); r.expect("failed printing to stderr"); } } ); fn main() { let v = next_ints(); if v[0] <= 0 && v[1] >= 0 { println!("Zero"); } else if v[0] > 0 && v[1] > 0 { println!("Positive"); } else if v[0] < 0 && v[1] < 0 { println!("{}",match v[1] - v[0] { n if n % 2 == 0 => "Positive", _ => "Negative", }) } } #[allow(dead_code)] fn next_string() -> String { let mut input = String::new(); io::stdin().read_line(&mut input).unwrap(); input } #[allow(dead_code)] fn next_strings() -> Vec<String> { let input = next_string(); input.split_whitespace().map(|x| x.parse().unwrap()).collect() } #[allow(dead_code)] fn next_int() -> i64 { let input = next_string(); i64::from_str(input.trim()).unwrap() } #[allow(dead_code)] fn next_ints() -> Vec<i64> { let input = next_string(); input.split_whitespace().map(|x| x.parse().unwrap()).collect() }
a.cc:47:2: error: invalid preprocessing directive #[ 47 | #[allow(dead_code)] | ^ a.cc:54:2: error: invalid preprocessing directive #[ 54 | #[allow(dead_code)] | ^ a.cc:60:2: error: invalid preprocessing directive #[ 60 | #[allow(dead_code)] | ^ a.cc:66:2: error: invalid preprocessing directive #[ 66 | #[allow(dead_code)] | ^ 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::str::FromStr; | ^~~ a.cc:3:1: error: 'use' does not name a type 3 | use std::str::Chars; | ^~~ a.cc:4:1: error: 'use' does not name a type 4 | use std::i32; | ^~~ a.cc:5:1: error: 'use' does not name a type 5 | use std::u8; | ^~~ a.cc:6:1: error: 'use' does not name a type 6 | use std::f64; | ^~~ a.cc:7:1: error: 'use' does not name a type 7 | use std::ascii::AsciiExt; | ^~~ a.cc:8:1: error: 'use' does not name a type 8 | use std::collections::HashMap; | ^~~ a.cc:9:1: error: 'use' does not name a type 9 | use std::collections::HashSet; | ^~~ a.cc:10:1: error: 'use' does not name a type 10 | use std::collections::BTreeMap; | ^~~ a.cc:11:1: error: 'use' does not name a type 11 | use std::collections::BTreeSet; | ^~~ a.cc:12:1: error: 'use' does not name a type 12 | use std::collections::VecDeque; | ^~~ a.cc:13:1: error: 'use' does not name a type 13 | use std::io::prelude::*; | ^~~ a.cc:14:1: error: 'use' does not name a type 14 | use std::time::Duration; | ^~~ a.cc:15:1: error: 'use' does not name a type 15 | use std::cmp; | ^~~ a.cc:17:1: error: 'macro_rules' does not name a type 17 | macro_rules! println_stderr( | ^~~~~~~~~~~ a.cc:22:1: error: expected unqualified-id before ')' token 22 | ); | ^ a.cc:24:1: error: 'macro_rules' does not name a type 24 | macro_rules! print_stderr( | ^~~~~~~~~~~ a.cc:29:1: error: expected unqualified-id before ')' token 29 | ); | ^ a.cc:31:1: error: 'fn' does not name a type 31 | fn main() { | ^~ a.cc:48:1: error: 'fn' does not name a type 48 | fn next_string() -> String { | ^~ a.cc:55:1: error: 'fn' does not name a type 55 | fn next_strings() -> Vec<String> { | ^~ a.cc:61:1: error: 'fn' does not name a type 61 | fn next_int() -> i64 { | ^~ a.cc:67:1: error: 'fn' does not name a type 67 | fn next_ints() -> Vec<i64> { | ^~
s377960702
p04033
Java
/** * Created by abhishek on 7/31/2016. */ import java.util.*; import java.io.*; public class A { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int a = Integer.parseInt(st.nextToken()); int b = Integer.parseInt(st.nextToken()); if(a > 0){ System.out.println("Positive"); return; } if(a <= 0 && b >= 0){ System.out.println("Zero"); return; } if(b < 0){ int temp = b - a + 1; if(temp % 2 == 0)System.out.println("Positive"); else System.out.print("Negative"); } } }
Main.java:6: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s730611735
p04033
C++
#include <bits/stdc++.h> long long a,b; int main(){ std::cin>>a>>b; if(a*b<=0){ std::cout<<"Zero"; return 0; } else if(a>0&&b>0){ std::cout<<"Positive"; return 0; } else { if(b-a%2==0){ std::cout<<"Negative"; } else std::cout<"Positive"; } return 0; }
a.cc: In function 'int main()': a.cc:17:23: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [9]') 17 | else std::cout<"Positive"; | ~~~~~~~~~^~~~~~~~~~~ | | | | | const char [9] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [9]' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [9]' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const
s789213531
p04033
C++
#include <bits/stdc++.h> long long a,b; int main(){ std::cin>>a>>b; if(a*b<=0){ std::cout<<"Zero"; return 0; } else if(a>0&&b>0){ std::cout<<"Positive"; return 0; } else { if(b-a%2==0){ std::cout<<"Negative"; } else std::cout<"Positive"; } return 0; }
a.cc: In function 'int main()': a.cc:17:23: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [9]') 17 | else std::cout<"Positive"; | ~~~~~~~~~^~~~~~~~~~~ | | | | | const char [9] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [9]' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [9]' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const
s732875721
p04033
C++
#include <bits/stdc++.h> long long a,b; int main(){ std::cin>>a>>b; if(a*b<=0){ std::cout<<"Zero"; return 0; } else if(a>0&&b>0){ std::cout<<"Positive"; return 0; } else { if(b-a%2==0){ std::cout<<"Negative"; } else std::cout<"Positive"; } return 0; }
a.cc: In function 'int main()': a.cc:17:23: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [9]') 17 | else std::cout<"Positive"; | ~~~~~~~~~^~~~~~~~~~~ | | | | | const char [9] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [9]' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [9]' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:17:24: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:17:24: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 17 | else std::cout<"Positive"; | ^~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const
s070762108
p04033
C++
{-# LANGUAGE ScopedTypeVariables #-} import Control.Applicative import Control.Monad import Control.Monad.State import Control.DeepSeq import Data.Array import Data.Bits import Data.Char import Data.Functor.Identity import Data.List import Data.Ord import Data.Maybe import Data.Tree import Data.Tuple import qualified System.IO import qualified Data.Map as M import qualified Data.Set as S import qualified Data.Sequence as Q import qualified Data.ByteString.Char8 as B main = do [a,b] :: [Z] <- readLnList putStrLn $ if inRange (a,b) 0 then "Zero" else if a > 0 || even (a-b+1) then "Positive" else "Negative" type Z = Int type Q = Rational type R = Double type S = String fint :: (Integral a, Num b) => a -> b fint = fromIntegral getInt = fst . fromJust . B.readInt <$> B.getLine getIntPair = (\[a,b]->(a,b)) <$> getInts getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine getStr = B.unpack <$> B.getLine yesNo :: Bool -> String yesNo True = "YES" yesNo False = "NO" printList :: (Show a) => [a] -> IO () printList = putStrLn . unwords . map show readLnList :: (Read a) => IO [a] readLnList = map read . words <$> getLine ----- Union-find type UnionFindT v m a = StateT (M.Map v (UnionFindVal v)) m a newtype UnionFindVal v = UnionFindVal v runUnionFindT :: (Monad m) => UnionFindT v m a -> m a runUnionFindT = flip evalStateT $ M.empty runUnionFind = runIdentity . runUnionFindT ufFresh :: (Monad m, Ord v) => v -> UnionFindT v m () ufFresh v = modify $ M.insert v (UnionFindVal v) ufClass :: (Monad m, Ord v) => v -> UnionFindT v m v ufClass v = do (UnionFindVal pv) <- gets (M.! v) if v == pv then return v else do c <- ufClass pv modify $ M.insert v (UnionFindVal c) return c ufUnify v w = do cv <- ufClass v cw <- ufClass w modify $ M.insert cw (UnionFindVal cv) return $ cv /= cw
a.cc:1:3: error: stray '#' in program 1 | {-# LANGUAGE ScopedTypeVariables #-} | ^ a.cc:1:34: error: stray '#' in program 1 | {-# LANGUAGE ScopedTypeVariables #-} | ^ a.cc:40:15: error: stray '\' in program 40 | getIntPair = (\[a,b]->(a,b)) <$> getInts | ^ a.cc:1:1: error: expected unqualified-id before '{' token 1 | {-# LANGUAGE ScopedTypeVariables #-} | ^ a.cc:2:1: error: 'import' does not name a type 2 | import Control.Applicative | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
s462040796
p04033
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; if( a<= 0 && 0<= b ){ cout<<"Zero"<<endl; }else{ int cnt=0; if(b<0)a+=b if(a<0 && (-a)%2==0 ){ cout<<"Negative"<<endl; }else{ cout<<"Positive"<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:12:16: error: expected ';' before 'if' 12 | if(b<0)a+=b | ^ | ; 13 | 14 | if(a<0 && (-a)%2==0 ){ | ~~
s994640647
p04033
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #define INF_LL 9000000000000000000 #define INF 2000000000 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) using namespace std; typedef long long ll; typedef pair<int, int> PII; class Union_find{ private: vector<int> par; vector<int> rank; int n; public: Union_find(int a){ n = a; for(int i = 0;i < n;i++){ par.push_back(i); rank.push_back(0); } } int find(int x){ if(par[x] == x){ return x; }else{ return par[x] = find(par[x]); } } void unite(int x, int y){ x = find(x); y = find(y); if(x == y) return; if(rank[x] < rank[y]){ par[x] = y; }else{ par[y] = x; if(rank[x] == rank[y]) rank[x]++; } } bool same(int x, int y){ return find(x) == find(y); } }; int main(void){ int a, b; cin >> a >> b; if(a < 0 && b < 0){ if((b - a + 1) % 2 == 0){ cout << "Positive" << endl; return 0; }else{ cout << "Negative" << endl; return 0; } }else if(a <= 0 && 0 <= b){ cout <<< "Zero" << endl; return 0; }else{ cout << "Positive" << endl; return 0; } }
a.cc: In function 'int main()': a.cc:74:24: error: expected primary-expression before '<' token 74 | cout <<< "Zero" << endl; | ^ a.cc:74:33: error: invalid operands of types 'const char [5]' and '<unresolved overloaded function type>' to binary 'operator<<' 74 | cout <<< "Zero" << endl; | ~~~~~~~^~~~~~~
s894591614
p04033
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #define INF_LL 9000000000000000000 #define INF 2000000000 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) using namespace std; typedef long long ll; typedef pair<int, int> PII; class Union_find{ private: vector<int> par; vector<int> rank; int n; public: Union_find(int a){ n = a; for(int i = 0;i < n;i++){ par.push_back(i); rank.push_back(0); } } int find(int x){ if(par[x] == x){ return x; }else{ return par[x] = find(par[x]); } } void unite(int x, int y){ x = find(x); y = find(y); if(x == y) return; if(rank[x] < rank[y]){ par[x] = y; }else{ par[y] = x; if(rank[x] == rank[y]) rank[x]++; } } bool same(int x, int y){ return find(x) == find(y); } }; int main(void){ int a, b; cin >> a >> b; if(a < 0 && b < 0){ if((b - a + 1) % 2 == 0){ cout << "Positive" << endl; return 0; }else{ cout << "Negative" << endl; return 0; } }else if(a <= 0 && 0 <= b){ cout <<< "Zero" << ednl; return 0; }else{ cout << "Positive" << endl; return 0; } }
a.cc: In function 'int main()': a.cc:74:24: error: expected primary-expression before '<' token 74 | cout <<< "Zero" << ednl; | ^ a.cc:74:36: error: 'ednl' was not declared in this scope 74 | cout <<< "Zero" << ednl; | ^~~~
s725761947
p04033
Java
import java.io.*; import java.util.*; public class rangeprod { private static InputReader in; private static PrintWriter out; public static void main(String[] args) throws IOException { in = new InputReader(System.in); out = new PrintWriter(System.out, true); int a = in.nextInt(), b= in.nextInt(); if (a <= 0 && b >= 0) { out.println("Zero"); } else if (a > 0 && b > 0) { out.println("Positive"); } else { int terms = (b-a+1); out.println(terms%2 == 0 ? "Positive" : "Negative"); } out.close(); System.exit(0); } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } } }
Main.java:4: error: class rangeprod is public, should be declared in a file named rangeprod.java public class rangeprod { ^ 1 error
s531926679
p04034
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=2e5+500; int p[N],size[N],n,m; int main() { scanf("%d%d",&n,&m); for(int i=1;i<=n;i++)size[i]=1;p[1]=1; for(int i=1,x,y;i<=m;i++) { scanf("%d%d",&x,&y); if(p[x])p[y]=1; if(size[x]==1)p[x]=0; ++size[y],--size[x]; } int ans=0; for(int i=1;i<=n;i++)if(p[i])++ans; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:10:26: error: reference to 'size' is ambiguous 10 | for(int i=1;i<=n;i++)size[i]=1;p[1]=1; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:10: note: 'int size [200500]' 6 | int p[N],size[N],n,m; | ^~~~ a.cc:15:12: error: reference to 'size' is ambiguous 15 | if(size[x]==1)p[x]=0; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:10: note: 'int size [200500]' 6 | int p[N],size[N],n,m; | ^~~~ a.cc:16:11: error: reference to 'size' is ambiguous 16 | ++size[y],--size[x]; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:10: note: 'int size [200500]' 6 | int p[N],size[N],n,m; | ^~~~ a.cc:16:21: error: reference to 'size' is ambiguous 16 | ++size[y],--size[x]; | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:10: note: 'int size [200500]' 6 | int p[N],size[N],n,m; | ^~~~
s484181227
p04034
Java
import java.io.InputStreamReader; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { private int red; private final Box[] boxes; private final Step[] steps; private final Set<Integer> positions; public Main(Box[] boxes, Step[] steps){ this.boxes = boxes; this.steps = steps; positions = new HashSet<>(); red = 0; } public static void main(String[] args){ Scanner s = new Scanner(new InputStreamReader(System.in)); int n = s.nextInt(); int m = s.nextInt(); Box[] boxes = new Box[n]; for(int i = 0; i < n; i++){ boxes[i] = new Box(i == 0 ? 0 : 1); } Step[] steps = new Step[m]; for(int i = 0; i < m; i++){ int from = s.nextInt() - 1; int to = s.nextInt() - 1; steps[i] = new Step(from, to); } Main boxAndBall = new BoxAndBall(boxes, steps); boxAndBall.recurse(0); System.out.println(boxAndBall.getPositions().size()); } public void recurse(int step){ if(step == steps.length) { positions.add(red); return; } Step current = steps[step]; if(current.from == red){ if(boxes[current.from].whiteBalls > 0){ moveWhiteBall(step); } moveRedBall(step); } else { moveWhiteBall(step); } } public Set<Integer> getPositions() { return positions; } private void moveWhiteBall(int step) { boxes[steps[step].from].whiteBalls--; boxes[steps[step].to].whiteBalls++; recurse(step + 1); boxes[steps[step].from].whiteBalls++; boxes[steps[step].to].whiteBalls--; } private void moveRedBall(int step) { red = steps[step].to; recurse(step + 1); red = steps[step].from; } public static class Box { int whiteBalls; public Box(int numOfWhite){ whiteBalls = numOfWhite; } } public static class Step { public final int from; public final int to; public Step(int from, int to) { this.from = from; this.to = to; } } }
Main.java:33: error: cannot find symbol Main boxAndBall = new BoxAndBall(boxes, steps); ^ symbol: class BoxAndBall location: class Main 1 error
s269113164
p04034
Java
import java.io.InputStreamReader; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class BoxAndBall { private int red; private final Box[] boxes; private final Step[] steps; private final Set<Integer> positions; public BoxAndBall(Box[] boxes, Step[] steps){ this.boxes = boxes; this.steps = steps; positions = new HashSet<>(); red = 0; } public static void main(String[] args){ Scanner s = new Scanner(new InputStreamReader(System.in)); int n = s.nextInt(); int m = s.nextInt(); Box[] boxes = new Box[n]; for(int i = 0; i < n; i++){ boxes[i] = new Box(i == 0 ? 0 : 1); } Step[] steps = new Step[m]; for(int i = 0; i < m; i++){ int from = s.nextInt() - 1; int to = s.nextInt() - 1; steps[i] = new Step(from, to); } BoxAndBall boxAndBall = new BoxAndBall(boxes, steps); boxAndBall.recurse(0); System.out.println(boxAndBall.getPositions().size()); } public void recurse(int step){ if(step == steps.length) { positions.add(red); return; } Step current = steps[step]; if(current.from == red){ if(boxes[current.from].whiteBalls > 0){ moveWhiteBall(step); } moveRedBall(step); } else { moveWhiteBall(step); } } public Set<Integer> getPositions() { return positions; } private void moveWhiteBall(int step) { boxes[steps[step].from].whiteBalls--; boxes[steps[step].to].whiteBalls++; recurse(step + 1); boxes[steps[step].from].whiteBalls++; boxes[steps[step].to].whiteBalls--; } private void moveRedBall(int step) { red = steps[step].to; recurse(step + 1); red = steps[step].from; } public static class Box { int whiteBalls; public Box(int numOfWhite){ whiteBalls = numOfWhite; } } public static class Step { public final int from; public final int to; public Step(int from, int to) { this.from = from; this.to = to; } } }
Main.java:6: error: class BoxAndBall is public, should be declared in a file named BoxAndBall.java public class BoxAndBall { ^ 1 error
s041819873
p04034
Java
import java.io.InputStreamReader; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class BoxAndBall { private int red; private final Box[] boxes; private final Step[] steps; private final Set<Integer> positions; public BoxAndBall(Box[] boxes, Step[] steps){ this.boxes = boxes; this.steps = steps; positions = new HashSet<>(); red = 0; } public static void main(String[] args){ Scanner s = new Scanner(new InputStreamReader(System.in)); int n = s.nextInt(); int m = s.nextInt(); Box[] boxes = new Box[n]; for(int i = 0; i < n; i++){ boxes[i] = new Box(i == 0 ? 0 : 1); } Step[] steps = new Step[m]; for(int i = 0; i < m; i++){ int from = s.nextInt() - 1; int to = s.nextInt() - 1; steps[i] = new Step(from, to); } BoxAndBall boxAndBall = new BoxAndBall(boxes, steps); boxAndBall.recurse(0); System.out.println(boxAndBall.getPositions().size()); } public void recurse(int step){ if(step == steps.length) { positions.add(red); return; } Step current = steps[step]; if(current.from == red){ if(boxes[current.from].whiteBalls > 0){ moveWhiteBall(step); } moveRedBall(step); } else { moveWhiteBall(step); } } public Set<Integer> getPositions() { return positions; } private void moveWhiteBall(int step) { boxes[steps[step].from].whiteBalls--; boxes[steps[step].to].whiteBalls++; recurse(step + 1); boxes[steps[step].from].whiteBalls++; boxes[steps[step].to].whiteBalls--; } private void moveRedBall(int step) { red = steps[step].to; recurse(step + 1); red = steps[step].from; } public static class Box { int whiteBalls; public Box(int numOfWhite){ whiteBalls = numOfWhite; } } public static class Step { public final int from; public final int to; public Step(int from, int to) { this.from = from; this.to = to; } } }
Main.java:6: error: class BoxAndBall is public, should be declared in a file named BoxAndBall.java public class BoxAndBall { ^ 1 error
s888376506
p04034
C++
#pragma GCC optimize("Ofast") #include <cstdio> int arr1[10][10] = { {0,0,0,0,0,0,0,0,0,0}, {0,100000,0,9029,0,0,0,7519,7572,1}, {0,0,0,0,9527,0,0,13336,0,0}, {0,14416,0,0,0,0,0,0,0,0}, {0,0,3,0,0,0,16971,0,18448,0}, {50000,342,0,0,0,0,0,0,0,50000}, {0,20398,0,0,7169,0,0,5300,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,17391,0,0,0,0,0,0}, {0,0,0,0,0,799,0,0,0,0} }; void puti(int i) { if (i >= 10) { puti(i / 10); i %= 10; } fputc(i + '0', stdout); } int main(void) { // テストケースハックする良くないコード int ch0 = fgetchar() - '0'; int ch1 = fgetchar(); int ch2 = fgetchar() - '0'; fgetchar(); fgetchar(); fgetchar(); int ch6 = fgetchar() - '0'; int ch7 = fgetchar() - '0'; if (ch7 < 0) { if (ch0 == 3) { puti(4 - ch2); } else if (ch0 == 2 && ch1 == ' ') { puti(ch2); } else puti(arr1[ch0][ch6]); } else if (ch6 == 9) { if (ch0 == 6) { puti(22888); } else if (ch0 == 9) { puti(25436); } else puti(arr1[ch0][ch7]); } else puti(arr1[ch0][ch7]); fputc('\n', stdout); return 0; }
a.cc: In function 'int main()': a.cc:27:15: error: 'fgetchar' was not declared in this scope; did you mean 'getchar'? 27 | int ch0 = fgetchar() - '0'; | ^~~~~~~~ | getchar
s868072355
p04034
C
#pragma GCC optimize("Ofast") #include <stdio.h> #include <unistd.h> int main(void) { sleep(3) return 0; }
main.c: In function 'main': main.c:6:9: error: expected ';' before 'return' 6 | sleep(3) | ^ | ; 7 | return 0; | ~~~~~~
s216411740
p04034
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, m; cin >> n >> m; vector<P> xy(m); rep(i, m) { int x, y; cin >> x >> y; x--; y--; xy.at(i) = make_pair(x, y); } vector<int> cnt(n, 1); vector<bool> possible(n, false); possible.at(0) = true; rep(i, m) { int x = xy.at(i).first; int y = xy.at(i).second; cnt.at(x)--; cnt.at(y)++; if (possible.at(x)) { possible.at(y) = true; } if (cnt.at(x) == 0) { possible.at(x) = false; } } int res = 0; rep(i, n) { if (possible.at(i)) > 0) { res++; } } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:38:25: error: expected primary-expression before '>' token 38 | if (possible.at(i)) > 0) { | ^
s190659428
p04034
C++
#include <iostream> // cout, endl, cin #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <math.h> // sqrt() #include <iomanip> #define rep(i , n) for (int i = 1; i <= (int)(n); i++) #define repz(i , n) for (int i = 0; i < (int) n; i++) #define repi(i , r, n) for (int i = r; i <= (int)(n); i++) #define repd(i , r, n) for (int i = r; i >= (int)(n); i--) using namespace std; int main(){ int n, m , a, b; cin >> n >> m; int amount[n+1]; rep( i , n) amount[i] = 1; int red[n+1]; red[1] = 1; rep(i , m){ cin >> a >> b; amount[a]--; amount[b]++; if ( red[a]) red[b] = 1; } int ans = 0; rep( i , n){ if ( (amount[i] > 0) & red[i] ) ans++; } cout << ans << endl;
a.cc: In function 'int main()': a.cc:48:25: error: expected '}' at end of input 48 | cout << ans << endl; | ^ a.cc:30:11: note: to match this '{' 30 | int main(){ | ^
s752368403
p04034
C++
#include<bits/stdc++.h> #include<cctype> using namespace std; #define rep(i,n) for (int i=0;i<(n);i++) #define all(v) (v).begin(),(v).end() typedef long long int ll; #define pi 3.1415926535897932384 #define E9 1000000000 #define eps 1e-4 #define pii pair<int,int> int main(){ int N, M; cin >> N >> M; vector<bool> dp(N,0); vector<int> ball(N,1); dp[0] = 1; int x, y; rep(i,M){ cin >> x >> y; x--,y--; ball[x]--; ball[y]++; dp[y] |= dp[x]; if (ball[x]==0) dp[x] = false; } int cnt = 0; rep(i,N) if (dp[i]) cnt++; cout << cnt << endl; // cout << fixed << setprecision(10); return 0; }
a.cc: In function 'int main()': a.cc:24:11: error: no match for 'operator|=' (operand types are 'std::vector<bool>::reference' and 'std::vector<bool>::reference') 24 | dp[y] |= dp[x]; | ~~~~~~^~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:168:3: note: candidate: 'constexpr std::byte& std::operator|=(byte&, byte)' 168 | operator|=(byte& __l, byte __r) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:168:20: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::byte&' 168 | operator|=(byte& __l, byte __r) noexcept | ~~~~~~^~~ In file included from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/bits/ios_base.h:104:3: note: candidate: 'constexpr const std::_Ios_Fmtflags& std::operator|=(_Ios_Fmtflags&, _Ios_Fmtflags)' 104 | operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:104:29: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Fmtflags&' 104 | operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:154:3: note: candidate: 'constexpr const std::_Ios_Openmode& std::operator|=(_Ios_Openmode&, _Ios_Openmode)' 154 | operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:154:29: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Openmode&' 154 | operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:201:3: note: candidate: 'constexpr const std::_Ios_Iostate& std::operator|=(_Ios_Iostate&, _Ios_Iostate)' 201 | operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:201:28: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Iostate&' 201 | operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176: /usr/include/c++/14/future:185:18: note: candidate: 'constexpr std::launch& std::operator|=(launch&, launch)' 185 | inline launch& operator|=(launch& __x, launch __y) noexcept | ^~~~~~~~ /usr/include/c++/14/future:185:37: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::launch&' 185 | inline launch& operator|=(launch& __x, launch __y) noexcept | ~~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:198: /usr/include/c++/14/charconv:646:3: note: candidate: 'constexpr std::chars_format& std::operator|=(chars_format&, chars_format)' 646 | operator|=(chars_format& __lhs, chars_format __rhs) noexcept | ^~~~~~~~ /usr/include/c++/14/charconv:646:28: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::chars_format&' 646 | operator|=(chars_format& __lhs, chars_format __rhs) noexcept | ~~~~~~~~~~~~~~^~~~~
s344733754
p04034
C++
#include <bits/stdc++.h> using namespace std; int visit[10010]; int num[10010]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N, M; cin >> N >> M; int ans = 1; visit[1] = 1; fill(num, num + N + 1, 1); while (M --) { int x, y; cin >> x >> y; num[x] --; num[y] ++; if (visit[x]) { if (!num[x]) { ans --; } if (!visit[y]) ans++, visit[y] ++; } } cout << ans << '\n'; }
a.cc: In function 'int main()': a.cc:12:5: error: reference to 'visit' is ambiguous 12 | visit[1] = 1; | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80, from a.cc:1: /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:5: note: 'int visit [10010]' 4 | int visit[10010]; | ^~~~~ a.cc:19:13: error: reference to 'visit' is ambiguous 19 | if (visit[x]) { | ^~~~~ /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:5: note: 'int visit [10010]' 4 | int visit[10010]; | ^~~~~ a.cc:23:18: error: reference to 'visit' is ambiguous 23 | if (!visit[y]) ans++, visit[y] ++; | ^~~~~ /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:5: note: 'int visit [10010]' 4 | int visit[10010]; | ^~~~~ a.cc:23:35: error: reference to 'visit' is ambiguous 23 | if (!visit[y]) ans++, visit[y] ++; | ^~~~~ /usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)' 1855 | visit(_Visitor&& __visitor, _Variants&&... __variants) | ^~~~~ a.cc:4:5: note: 'int visit [10010]' 4 | int visit[10010]; | ^~~~~
s045614698
p04034
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; vector<int> p(N,1); vector<int> r(N); r.at(0)=1; for(int i=0;i<M;i++){ int a,b; cin>>a>>b; a--,b--; if(r.at(a)==1){ r.at(b)=1; } p.at(a)--; p.at(b)++; if(p.at(a)==0){ r.at(a)=0; } } int Z=0; for(int i=0;i<N;i++){ Z+=r.at(i); } cout<<Z<<endl;
a.cc: In function 'int main()': a.cc:27:15: error: expected '}' at end of input 27 | cout<<Z<<endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s149713757
p04034
C++
#include <algorithm> #include <iostream> using namespace std; using ll = long long; #define repl(i, l, r) for (int i = l; i < r; i++) #define rep(i, n) repl(i, 0, n) int main() { int n, m; cin >> n >> m; vector<int> cnt(n, 1), red(n); red[0] = 1; rep(i, m) { int a, b; cin >> a >> b; a--, b--; cnt[a]--, cnt[b]++; if (red[a]) red[b] = 1; if (cnt[a] == 0) red[a] = 0; } int ans = 0; rep(i, n) if (red[i]) ans++; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'vector' was not declared in this scope 10 | vector<int> cnt(n, 1), red(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <iostream> +++ |+#include <vector> 3 | using namespace std; a.cc:10:16: error: expected primary-expression before 'int' 10 | vector<int> cnt(n, 1), red(n); | ^~~ a.cc:11:9: error: 'red' was not declared in this scope; did you mean 'rep'? 11 | red[0] = 1; | ^~~ | rep a.cc:16:17: error: 'cnt' was not declared in this scope; did you mean 'int'? 16 | cnt[a]--, cnt[b]++; | ^~~ | int
s602579819
p04034
C++
#pragma once #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> using namespace std; using ll = long long; using ull = unsigned long long; using VI = vector<int>; using VVI = vector<vector<int>>; using VLL = vector<ll>; using VVLL = vector<vector<ll>>; using VB = vector<bool>; using PII = pair<int, int>; using PLL = pair<ll, ll>; constexpr int INF = 1000000007; constexpr ll INF_LL = 1'000'000'000'000'000'007; #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define newl '\n' // loops rep(until) / rep(var, until) / rep(var, from, until) / repr (reversed order) #define OVERLOAD3(_1, _2, _3, name, ...) name #define rep(...) OVERLOAD3(__VA_ARGS__, REPEAT_FROM_UNTIL, REPEAT_UNTIL, REPEAT)(__VA_ARGS__) #define REPEAT(times) REPEAT_CNT(_repeat, __COUNTER__, times) #define REPEAT_CNT(_repeat, cnt, times) REPEAT_CNT_CAT(_repeat, cnt, times) #define REPEAT_CNT_CAT(_repeat, cnt, times) REPEAT_FROM_UNTIL(_repeat ## cnt, 0, times) #define REPEAT_UNTIL(name, times) REPEAT_FROM_UNTIL(name, 0, times) #define REPEAT_FROM_UNTIL(name, from, until) for (int name = from, name ## __until = (until); name < name ## __until; name++) #define repr(...) OVERLOAD3(__VA_ARGS__, REPR_FROM_UNTIL, REPR_UNTIL, REPEAT)(__VA_ARGS__) #define REPR_UNTIL(name, times) REPR_FROM_UNTIL(name, 0, times) #define REPR_FROM_UNTIL(name, from, until) for (int name = (until)-1, name ## __from = (from); name >= name ## __from; name--) template <typename T, typename U> bool chmin(T& var, U x) { if (var > x) { var = x; return true; } else return false; } template <typename T, typename U> bool chmax(T& var, U x) { if (var < x) { var = x; return true; } else return false; } ll power(ll e, ll t, ll mod = INF_LL) { ll res = 1; for (; t; t >>= 1, (e *= e) %= mod) if (t & 1) (res *= e) %= mod; return res; } ll choose(ll n, int r) { chmin(r, n-r); if (r < 0) return 0; ll res = 1; rep(i, r) res *= n-i, res /= i+1; return res; } template <typename T, typename U> T divceil(T m, U d) { return (m + d - 1) / d; } template <typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); } template <typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); } // debug stuff #define repi(it, ds) for (auto it = ds.begin(); it != ds.end(); it++) class DebugPrint { public: template <typename T> DebugPrint& operator <<(const T& v) { #ifdef LOCAL cerr << v; #endif return *this; } } debugos; template <typename T> DebugPrint& operator<<(DebugPrint& os, const vector<T>& vec) { os << "{"; for (int i = 0; i < vec.size(); i++) os << vec[i] << (i + 1 == vec.size() ? "" : ", "); os << "}"; return os; } template <typename T, typename U> DebugPrint& operator<<(DebugPrint& os, map<T, U>& map_var) { os << "{"; repi(itr, map_var) { os << *itr; itr++; if (itr != map_var.end()) os << ", "; itr--; } os << "}"; return os; } template < typename T> DebugPrint& operator<<(DebugPrint& os, set<T>& set_var) { os << "{"; repi(itr, set_var) { os << *itr; itr++; if (itr != set_var.end()) os << ", "; itr--; } os << "}"; return os; } template <typename T, typename U> DebugPrint& operator<<(DebugPrint& os, const pair<T, U >& p) { os << "(" << p.first << ", " << p.second << ")"; return os; } void dump_func() { debugos << newl; } template <class Head, class... Tail> void dump_func(Head &&head, Tail &&... tail) { debugos << head; if (sizeof...(Tail) > 0) { debugos << ", "; } dump_func(std::move( tail)...); } #define dump(...) debugos << " " << string(#__VA_ARGS__) << ": " << "[" << to_string(__LINE__) \ << ":" << __FUNCTION__ << "]" << newl << " ", dump_func(__VA_ARGS__) #pragma GCC diagnostic pop int main() { int n, m; cin >> n >> m; VB red(n); red[0] = true; rep(m) { int x, y; cin >> x >> y; red[y-1] |= red[x-1]; } cout << accumulate(all(red), 0) << newl; }
a.cc:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~ a.cc: In function 'int main()': a.cc:88:14: error: no match for 'operator|=' (operand types are 'std::vector<bool>::reference' and 'std::vector<bool>::reference') 88 | red[y-1] |= red[x-1]; | ~~~~~~~~~^~~~~~~~~~~ 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/bitset:52, from a.cc:4: /usr/include/c++/14/cstddef:168:3: note: candidate: 'constexpr std::byte& std::operator|=(byte&, byte)' 168 | operator|=(byte& __l, byte __r) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:168:20: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::byte&' 168 | operator|=(byte& __l, byte __r) noexcept | ~~~~~~^~~ In file included from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:8: /usr/include/c++/14/bits/ios_base.h:104:3: note: candidate: 'constexpr const std::_Ios_Fmtflags& std::operator|=(_Ios_Fmtflags&, _Ios_Fmtflags)' 104 | operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:104:29: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Fmtflags&' 104 | operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:154:3: note: candidate: 'constexpr const std::_Ios_Openmode& std::operator|=(_Ios_Openmode&, _Ios_Openmode)' 154 | operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:154:29: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Openmode&' 154 | operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:201:3: note: candidate: 'constexpr const std::_Ios_Iostate& std::operator|=(_Ios_Iostate&, _Ios_Iostate)' 201 | operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:201:28: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Iostate&' 201 | operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~
s134045341
p04034
C++
for(int i=0;i<m;i++) { cin>>x[i]>>y[i]; }
a.cc:1:1: error: expected unqualified-id before 'for' 1 | for(int i=0;i<m;i++) | ^~~ a.cc:1:13: error: 'i' does not name a type 1 | for(int i=0;i<m;i++) | ^ a.cc:1:17: error: 'i' does not name a type 1 | for(int i=0;i<m;i++) | ^
s914895889
p04034
C++
#include <bits/stdc++.h> using namespace std; int main () { long N, M; cin >> N >> M; vector<pair<long, long> data(N); for(int i = 0; i < N; i++)data.at(i).first = 1; data.at(0).second = 1; long x, y; for(int i = 0; i < M; i++){ cin >> x >> y; x--; y--; data.at(x).first--; data.at(y).first++; if(data.at(x).second == 1){ if(data.at(x).first == 0)data.at(x).second = 0; data.at(y).second = 1; } } long ans = 0; for(int i = 0; i < N; i++)if(data.at(i).second == 1)ans++; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:33: error: template argument 1 is invalid 6 | vector<pair<long, long> data(N); | ^ a.cc:6:33: error: template argument 2 is invalid a.cc:7:34: error: overloaded function with no contextual type information 7 | for(int i = 0; i < N; i++)data.at(i).first = 1; | ^~ a.cc:8:8: error: overloaded function with no contextual type information 8 | data.at(0).second = 1; | ^~ a.cc:14:10: error: overloaded function with no contextual type information 14 | data.at(x).first--; | ^~ a.cc:15:10: error: overloaded function with no contextual type information 15 | data.at(y).first++; | ^~ a.cc:16:13: error: overloaded function with no contextual type information 16 | if(data.at(x).second == 1){ | ^~ a.cc:17:15: error: overloaded function with no contextual type information 17 | if(data.at(x).first == 0)data.at(x).second = 0; | ^~ a.cc:17:37: error: overloaded function with no contextual type information 17 | if(data.at(x).first == 0)data.at(x).second = 0; | ^~ a.cc:18:12: error: overloaded function with no contextual type information 18 | data.at(y).second = 1; | ^~ a.cc:22:37: error: overloaded function with no contextual type information 22 | for(int i = 0; i < N; i++)if(data.at(i).second == 1)ans++; | ^~
s752536790
p04034
C++
#include <bits/stdc++.h> #define rep(i, n) for(long long int i = 0; i < n; i++) #define _rep(i, m, n) for(long long int i = m; i < n; i++) #define print(n) std::cout << n << std::endl #define _print(n) std::cout << n using namespace std; typedef long long ll; typedef pair<int, int> P; const int N = 1000000; const ll mod = 1000000007; using Graph = vector<vector<int>>; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; int main(){ ll n, m; cin >> n >> m; vector<ll> a(100100); rep(i, n) a[i] = 1; vector<bool> flag(100100, false); flag[0] = true; vector<ll> x(100100); vector<ll> y(100100); rep(i, m){ cin >> x[i] >> y[i]; x[i]--, y[i]--; } rep(i, m){ a[x[i]]--; a[y[i]]++; if(flag[x[i]]){ flag[y[i]] = true; if(a[x[i]] == 0)flag[x[i]] = false; } ll count = 0; rep(i, n) if(flag[i])count++; cout << count << endl; }
a.cc: In function 'int main()': a.cc:37:2: error: expected '}' at end of input 37 | } | ^ a.cc:15:11: note: to match this '{' 15 | int main(){ | ^
s715988517
p04034
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll n, a, b, k; in2(n, k); vector<ll> c(n); rep(i, n) in(c[i]); bool h = false; rep(i, n - 1){ if(c[i] + c[i + 1] >= k){ a = i; h = true; } } if(!h){ out("Impossible"); memi; return 0: } out("Possible"); memi; rep(i, a){ out(i + 1); memi; } b = n - 2; while(b >= a){ out(b + 1); memi; b--; } }
a.cc: In function 'int main()': a.cc:33:13: error: expected ';' before ':' token 33 | return 0: | ^ | ; a.cc:33:13: error: expected primary-expression before ':' token
s073565160
p04034
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; vector<int> x(m), y(m); for(int i=0; i<n; ++i) cin >> x[i] >> y[i]; vector<int> red(n, 0); red[0] = 1; vector<int> ball(n, 1); for(int i=0; i<m; ++i){ int prev = x[i]-1, aftr = y[i]-1; if(red[prev]){ if(ball[prev] == 1){ red[prev] = 0; red[aftr] = 1; } else if red[aftr] = 1; } --ball[prev]; ++ball[aftr]; } cout << accumulate(red.begin(), red.end(), 0) << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:15: error: expected '(' before 'red' 19 | else if red[aftr] = 1; | ^~~ | (
s018423523
p04034
C++
4 4 1 2 2 3 4 1 3 4
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 4 4 | ^
s148284843
p04034
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,n) for(int i=1;i<=(n);i++) #define lol long long #define SUM(n) ((n)+1)*(n)/2 //1〜nまでの総和を求める式 #define mp make_pair #define fi first #define se second #define pu push_back #define SYOU(x) setprecision(x+1) //小数点桁数を指定する #define abs(x,y) (max(x,y)-min(x,y)) #define all(v) v.begin(),v.end() #define UPDight(a,b) (a+b-1)/b //小数点切り上げ const int INF = 0x3f3f3f3f; const long long LINF = 0x3f3f3f3f3f3f3f3fLL; const int MOD=int(1e9)+7; using namespace std; using pii = pair<int,int>; typedef vector<int> vit; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n, m; cin >> n >> m; vit Ball(n + 5, 1); bool Red[n + 5] = {false}; Red[1] = true; int x, y; rep(i, m){ cin >> x >> y; Ball[x] --; Ball[y] ++; if(Red[x]){ Red[y] = true; } if(Ball[x] == 0){ Red[x] = false; } } int ans = 0; reps(i, n){ if(Red[i]){ ans ++; } } cout << ans << '\n'; return 0; }
a.cc:6:28: error: extended character   is not valid in an identifier 6 | #define SUM(n) ((n)+1)*(n)/2 //1〜nまでの総和を求める式 | ^ a.cc:29:20: error: extended character   is not valid in an identifier 29 | bool Red[n + 5] = {false}; | ^ a.cc: In function 'int main()': a.cc:29:20: error: expected initializer before '\U00003000' 29 | bool Red[n + 5] = {false}; | ^~ a.cc:30:5: error: 'Red' was not declared in this scope 30 | Red[1] = true; | ^~~
s462197037
p04034
C++
#include "bits/stdc++.h" // Begin Header {{{ using namespace std; #ifndef DEBUG #define dump(...) #endif #define all(x) x.begin(), x.end() #define rep(i, n) for (intmax_t i = 0, i##_limit = (n); i < i##_limit; ++i) #define reps(i, b, e) for (intmax_t i = (b), i##_limit = (e); i <= i##_limit; ++i) #define repr(i, b, e) for (intmax_t i = (b), i##_limit = (e); i >= i##_limit; --i) #define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__) constexpr size_t operator""_zu(unsigned long long value) { return value; }; constexpr intmax_t operator""_jd(unsigned long long value) { return value; }; constexpr uintmax_t operator""_ju(unsigned long long value) { return value; }; constexpr int INF = 0x3f3f3f3f; constexpr intmax_t LINF = 0x3f3f3f3f3f3f3f3f_jd; template <class T> using MaxHeap = priority_queue<T, vector<T>, less<T>>; template <class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>; inline void input() {} template <class Head, class... Tail> inline void input(Head&& head, Tail&&... tail) { cin >> head; input(forward<Tail>(tail)...); } template <class T> inline void input(vector<T> &vec) { for (auto &e: vec) { cin >> e; } } template <class T> inline void input(vector<vector<T>> &mat) { for (auto &vec: mat) { input(vec); } } inline void print() { cout << "\n"; } template <class Head, class... Tail> inline void print(Head&& head, Tail&&... tail) { cout << head; if (sizeof...(tail)) cout << " "; print(forward<Tail>(tail)...); } template <class T> inline ostream& operator<<(ostream &strm, const vector<T> &vec) { static constexpr const char *delim[] = {" ", ""}; for (const auto &e: vec) { strm << e << delim[&e == &vec.back()]; } return strm; } template <class T> inline vector<T> make_v(const T &initValue, size_t sz) { return vector<T>(sz, initValue); } template <class T, class... Args> inline auto make_v(const T &initValue, size_t sz, Args... args) { return vector<decltype(make_v<T>(initValue, args...))>(sz, make_v<T>(initValue, args...)); } template <class Func> class FixPoint : Func { public: explicit constexpr FixPoint(Func&& f) noexcept : Func(forward<Func>(f)) {} template <class... Args> constexpr decltype(auto) operator()(Args&&... args) const { return Func::operator()(*this, std::forward<Args>(args)...); } }; template <class Func> static inline constexpr decltype(auto) makeFixPoint(Func&& f) noexcept { return FixPoint<Func>{forward<Func>(f)}; } template <class T> inline bool chmax(T &a, const T &b) noexcept { return b > a && (a = b, true); } template <class T> inline bool chmin(T &a, const T &b) noexcept { return b < a && (a = b, true); } template <class T> inline T diff(const T &a, const T &b) noexcept { return a < b ? b - a : a - b; } // End Header }}} signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); var(size_t, N, M); vector<size_t> num(N + 1, 1); vector<bool> exist(N + 1, false); exist[1] = true; rep(i, M) { var(size_t, x, y); num[x]--; num[y]++; exist[y] |= exist[x]; if (num[x] == 0) { exist[x] = false; } } print(count(all(exist), true)); return 0; }
a.cc: In function 'int main()': a.cc:122:18: error: no match for 'operator|=' (operand types are 'std::vector<bool>::reference' and 'std::vector<bool>::reference') 122 | exist[y] |= exist[x]; | ~~~~~~~~~^~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:168:3: note: candidate: 'constexpr std::byte& std::operator|=(byte&, byte)' 168 | operator|=(byte& __l, byte __r) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:168:20: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::byte&' 168 | operator|=(byte& __l, byte __r) noexcept | ~~~~~~^~~ In file included from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/bits/ios_base.h:104:3: note: candidate: 'constexpr const std::_Ios_Fmtflags& std::operator|=(_Ios_Fmtflags&, _Ios_Fmtflags)' 104 | operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:104:29: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Fmtflags&' 104 | operator|=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:154:3: note: candidate: 'constexpr const std::_Ios_Openmode& std::operator|=(_Ios_Openmode&, _Ios_Openmode)' 154 | operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:154:29: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Openmode&' 154 | operator|=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ios_base.h:201:3: note: candidate: 'constexpr const std::_Ios_Iostate& std::operator|=(_Ios_Iostate&, _Ios_Iostate)' 201 | operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ^~~~~~~~ /usr/include/c++/14/bits/ios_base.h:201:28: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::_Ios_Iostate&' 201 | operator|=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW | ~~~~~~~~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176: /usr/include/c++/14/future:185:18: note: candidate: 'constexpr std::launch& std::operator|=(launch&, launch)' 185 | inline launch& operator|=(launch& __x, launch __y) noexcept | ^~~~~~~~ /usr/include/c++/14/future:185:37: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::launch&' 185 | inline launch& operator|=(launch& __x, launch __y) noexcept | ~~~~~~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:198: /usr/include/c++/14/charconv:646:3: note: candidate: 'constexpr std::chars_format& std::operator|=(chars_format&, chars_format)' 646 | operator|=(chars_format& __lhs, chars_format __rhs) noexcept | ^~~~~~~~ /usr/include/c++/14/charconv:646:28: note: no known conversion for argument 1 from 'std::vector<bool>::reference' to 'std::chars_format&' 646 | operator|=(chars_format& __lhs, chars_format __rhs) noexcept | ~~~~~~~~~~~~~~^~~~~
s922104909
p04034
C++
#include<stdio.h> #define MAXN 100006 int memo[MAXN], flag[MAXN]; int main() { int m, n, x, y, ans = 0; scanf_s("%d%d", &n, &m); for (int i = 1; i <= n; i++) memo[i] = 1, flag[i] = 0; flag[1] = 1; while (m--) { scanf_s("%d%d", &x, &y); if (flag[x] == 1) flag[y] = 1; memo[x]--, memo[y]++; if (memo[x] == 0) flag[x] = 0; } for (int i = 1; i <= n; i++) if (flag[i] == 1) ans++; printf("%d\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 7 | scanf_s("%d%d", &n, &m); | ^~~~~~~ | scanf
s777787178
p04034
Java
import java.util.Scanner; public class Temp { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int m = scanner.nextInt(); int[] box = new int[n+1]; boolean[] flag = new boolean[n+1]; for(int i = 1; i < n+1; i++){ box[i] = 1; flag[i] = false; } flag[1] = true; for(int i = 0; i < m; i++){ int x = scanner.nextInt(); int y = scanner.nextInt(); if(flag[x] && box[x] == 1){ flag[x] = false; flag[y] = true; }else if(flag[x] && box[x] > 1){ flag[y] = true; } box[x]--; box[y]++; } int count = 0; for(int i = 0; i < n+1; i++){ if(flag[i]) count++; } System.out.println(count); } }
Main.java:3: error: class Temp is public, should be declared in a file named Temp.java public class Temp { ^ 1 error
s504140684
p04034
C++
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <algorithm> // sort #define REP(i, n) for (long long i = 0; i < (n); i++) typedef long long ll; static const ll INF = 1000000000000000000LL; using namespace std; int main() { int N,M; cin >> N >> M; vector <int> a(N,0); a[0] = 1; REP(i,M) { int x,y; cin >> x >> y; --x;--y; a[y] = a[x] | a[y]; } int res = 0; REP(i,N) { if(a[x])++res; } cout << res << endl; return 0; }
a.cc: In function 'int main()': a.cc:30:14: error: 'x' was not declared in this scope 30 | if(a[x])++res; | ^
s508360175
p04034
C++
#include <iostream> #include <cstring> #define MOD 1000000007 using namespace std; int n, m, arr[100010], state[100010], y, x; int main(void){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n>>m; for(int i=0;i<n;i++)arr[i]=1; for(int i=0;i<m;i++){ cin>>x>>y; if(arr[x]==0)continue; if(arr[x]==1&&state[x]==1){ state[x]=0; state[y]=1; } if(state[x]==1)state[y]=1; arr[x]-=1; arr[y]+=1; } int sayac=0; for(int i=0;i<n;i++)if(state[i])syc++; cout<<syc; return 0; }
a.cc: In function 'int main()': a.cc:26:41: error: 'syc' was not declared in this scope; did you mean 'sayac'? 26 | for(int i=0;i<n;i++)if(state[i])syc++; | ^~~ | sayac a.cc:27:15: error: 'syc' was not declared in this scope; did you mean 'sayac'? 27 | cout<<syc; | ^~~ | sayac
s696718644
p04034
C++
#include <iostream> #include <vector> using namespace std; int main() { int N, M; cin >> N >> M; int a[100010],b[100010] vector<int> nums(N, 1), can(N, 0); can[0] = 1; for (int i = 0; i < M; ++i) { cin >> a[i] >> b[i]; --a[i], --b[i]; if (can[a[i]]) can[b[i]] = 1; if (nums[a[i]] == 1) can[a[i]] = 0; nums[a[i]]--; nums[b[i]]++; } int res = 0; for (int i = 0; i < N; ++i) if (can[i] && nums[i]) ++res; cout << res << endl; }
a.cc: In function 'int main()': a.cc:9:5: error: expected initializer before 'vector' 9 | vector<int> nums(N, 1), can(N, 0); | ^~~~~~ a.cc:10:5: error: 'can' was not declared in this scope 10 | can[0] = 1; | ^~~ a.cc:13:22: error: 'b' was not declared in this scope 13 | cin >> a[i] >> b[i]; | ^ a.cc:17:13: error: 'nums' was not declared in this scope 17 | if (nums[a[i]] == 1) can[a[i]] = 0; | ^~~~ a.cc:18:9: error: 'nums' was not declared in this scope 18 | nums[a[i]]--; | ^~~~ a.cc:23:47: error: 'nums' was not declared in this scope 23 | for (int i = 0; i < N; ++i) if (can[i] && nums[i]) ++res; | ^~~~
s838741568
p04034
C++
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int N, M; cin >> N >> M; vector<bool> hantei(N+1, false); hantei.at(1) = true; vector<int> ball(N+1, 1); ball.at(0) = 0; int X, Y; for( int i = 0; i < M; i++ ){ cin >> X >> Y; if( hantei.at(X) == true ){ hantei.at(Y) = true; ball.at(Y)++; ball.at(X)--; if( ball.at(X) == 0 ) hantei.at(X) = false; }else{ hantei.at(X)--; hantei.at(Y)++; } } int ans = 0; for( int i = 0; i <= N; i++ ){ if( hantei.at(i) == true ) ans++; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:22:19: error: no 'operator--(int)' declared for postfix '--' [-fpermissive] 22 | hantei.at(X)--; | ~~~~~~~~~~~~^~ a.cc:23:19: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] 23 | hantei.at(Y)++; | ~~~~~~~~~~~~^~
s495368563
p04034
Java
public class Main { public static void main(String[] args) { Scanner console = new Scanner(System.in); int n = console.nextInt(); //number of boxes int m = console.nextInt(); //number of operations console.nextLine(); int[] numBalls = new int[n]; boolean[] couldHaveRed = new boolean[n]; //intialize boxes for(int i = 0; i < n; i++) { numBalls[i] = 1; couldHaveRed[i] = false; } couldHaveRed[0] = true; for(int i = 0; i < m; i++) { int box1 = console.nextInt() - 1; //to adjust for zero indexing int box2 = console.nextInt() - 1; console.nextLine(); //if could have red ball if(couldHaveRed[box1]) { couldHaveRed[box2] = true; numBalls[box2]++; //box 2 gains a ball numBalls[box1]--; //box 1 loses a ball if(numBalls[box1] == 0) couldHaveRed[box1] = false; } } int numPossible = 0; for(int i = 0; i < n; i++) if(couldHaveRed[i]) numPossible++; System.out.println(numPossible); } }
Main.java:4: error: cannot find symbol Scanner console = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner console = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s260563302
p04034
Java
import java.util.Scanner; public class BoxAndBall { public static void main(String[] args) { Scanner console = new Scanner(System.in); int n = console.nextInt(); //number of boxes int m = console.nextInt(); //number of operations console.nextLine(); int[][] boxInfo = new int[n][2]; //of 2, first is total count, second is 0 if no red, 1 if possible //boxInfo[n][0] gives total balls //boxInfo[n][1] gives possibility of red //intialize boxes for(int i = 0; i < n; i++) { if(i == 0) boxInfo[0][1] = 1; else boxInfo[i][1] = 0; boxInfo[i][0] = 1; } for(int i = 0; i < m; i++) { int box1 = console.nextInt() - 1; //to adjust for zero indexing int box2 = console.nextInt() - 1; console.nextLine(); //if could have red ball if(boxInfo[box1][1] == 1) { //if only one ball in box, and ball is taken out, no longer possible if(boxInfo[box1][0] == 1) { boxInfo[box1][1] = 0; } boxInfo[box2][1] = 1; //possible for box 2 to have red ball boxInfo[box2][0]++; //box 2 gains a ball boxInfo[box1][0]--; //box 1 loses a ball } } //loop thru and count how many 1's in pos 1 of the array in each box int numPossible = 0; for(int i = 0; i < n; i++) if(boxInfo[i][1] == 1) //if possible numPossible++; System.out.println(numPossible); } }
Main.java:2: error: class BoxAndBall is public, should be declared in a file named BoxAndBall.java public class BoxAndBall { ^ 1 error
s264415739
p04034
Java
Scanner console = new Scanner(System.in); int n = console.nextInt(); //number of boxes int m = console.nextInt(); //number of operations console.nextLine(); int[][] boxInfo = new int[n][2]; //of 2, first is total count, second is 0 if no red, 1 if possible //boxInfo[n][0] gives total balls //boxInfo[n][1] gives possibility of red //intialize boxes for(int i = 0; i < n; i++) { if(i == 0) boxInfo[0][1] = 1; else boxInfo[i][1] = 0; boxInfo[i][0] = 1; } for(int i = 0; i < m; i++) { int box1 = console.nextInt() - 1; //to adjust for zero indexing int box2 = console.nextInt() - 1; console.nextLine(); //if could have red ball if(boxInfo[box1][1] == 1) { //if only one ball in box, and ball is taken out, no longer possible if(boxInfo[box1][0] == 1) { boxInfo[box1][1] = 0; } boxInfo[box2][1] = 1; //possible for box 2 to have red ball boxInfo[box2][0]++; //box 2 gains a ball boxInfo[box1][0]--; //box 1 loses a ball } } //loop thru and count how many 1's in pos 1 of the array in each box int numPossible = 0; for(int i = 0; i < n; i++) if(boxInfo[i][1] == 1) //if possible numPossible++; System.out.println(numPossible);
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. Scanner console = new Scanner(System.in); ^ (use --enable-preview to enable unnamed classes) Main.java:4: error: class, interface, enum, or record expected console.nextLine(); ^ Main.java:11: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) { ^ Main.java:11: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) { ^ Main.java:11: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) { ^ Main.java:14: error: class, interface, enum, or record expected else ^ Main.java:16: error: class, interface, enum, or record expected boxInfo[i][0] = 1; ^ Main.java:17: error: class, interface, enum, or record expected } ^ Main.java:19: error: class, interface, enum, or record expected for(int i = 0; i < m; i++) { ^ Main.java:19: error: class, interface, enum, or record expected for(int i = 0; i < m; i++) { ^ Main.java:22: error: class, interface, enum, or record expected console.nextLine(); ^ Main.java:25: error: class, interface, enum, or record expected if(boxInfo[box1][1] == 1) { ^ Main.java:29: error: class, interface, enum, or record expected } ^ Main.java:31: error: class, interface, enum, or record expected boxInfo[box2][0]++; //box 2 gains a ball ^ Main.java:32: error: class, interface, enum, or record expected boxInfo[box1][0]--; //box 1 loses a ball ^ Main.java:33: error: class, interface, enum, or record expected } ^ Main.java:38: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) ^ Main.java:38: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) ^ Main.java:38: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) ^ Main.java:42: error: class, interface, enum, or record expected System.out.println(numPossible); ^ 20 errors
s967839707
p04034
Java
Scanner console = new Scanner(System.in); int n = console.nextInt(); //number of boxes int m = console.nextInt(); //number of operations console.nextLine(); int[][] boxInfo = new int[n][2]; //of 2, first is total count, second is 0 if no red, 1 if possible //boxInfo[n][0] gives total balls //boxInfo[n][1] gives possibility of red //intialize boxes for(int i = 0; i < n; i++) { if(i == 0) boxInfo[0][1] = 1; else boxInfo[i][1] = 0; boxInfo[i][0] = 1; } for(int i = 0; i < m; i++) { int box1 = console.nextInt() - 1; //to adjust for zero indexing int box2 = console.nextInt() - 1; console.nextLine(); //if could have red ball if(boxInfo[box1][1] == 1) { //if only one ball in box, and ball is taken out, no longer possible if(boxInfo[box1][0] == 1) { boxInfo[box1][1] = 0; } boxInfo[box2][1] = 1; //possible for box 2 to have red ball boxInfo[box2][0]++; //box 2 gains a ball boxInfo[box1][0]--; //box 1 loses a ball } } //loop thru and count how many 1's in pos 1 of the array in each box int numPossible = 0; for(int i = 0; i < n; i++) if(boxInfo[i][1] == 1) //if possible numPossible++; System.out.println(numPossible);
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. Scanner console = new Scanner(System.in); ^ (use --enable-preview to enable unnamed classes) Main.java:4: error: class, interface, enum, or record expected console.nextLine(); ^ Main.java:11: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) { ^ Main.java:11: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) { ^ Main.java:11: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) { ^ Main.java:14: error: class, interface, enum, or record expected else ^ Main.java:16: error: class, interface, enum, or record expected boxInfo[i][0] = 1; ^ Main.java:17: error: class, interface, enum, or record expected } ^ Main.java:19: error: class, interface, enum, or record expected for(int i = 0; i < m; i++) { ^ Main.java:19: error: class, interface, enum, or record expected for(int i = 0; i < m; i++) { ^ Main.java:22: error: class, interface, enum, or record expected console.nextLine(); ^ Main.java:25: error: class, interface, enum, or record expected if(boxInfo[box1][1] == 1) { ^ Main.java:29: error: class, interface, enum, or record expected } ^ Main.java:31: error: class, interface, enum, or record expected boxInfo[box2][0]++; //box 2 gains a ball ^ Main.java:32: error: class, interface, enum, or record expected boxInfo[box1][0]--; //box 1 loses a ball ^ Main.java:33: error: class, interface, enum, or record expected } ^ Main.java:38: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) ^ Main.java:38: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) ^ Main.java:38: error: class, interface, enum, or record expected for(int i = 0; i < n; i++) ^ Main.java:42: error: class, interface, enum, or record expected System.out.println(numPossible); ^ 20 errors
s993496784
p04034
Java
import java.util.Scanner; public class BoxAndBall { public static void main(String[] args) { Scanner console = new Scanner(System.in); int n = console.nextInt(); //number of boxes int m = console.nextInt(); //number of operations console.nextLine(); int[][] boxInfo = new int[n][2]; //of 2, first is total count, second is 0 if no red, 1 if possible //boxInfo[n][0] gives total balls //boxInfo[n][1] gives possibility of red //intialize boxes for(int i = 0; i < n; i++) { if(i == 0) boxInfo[0][1] = 1; else boxInfo[i][1] = 0; boxInfo[i][0] = 1; } for(int i = 0; i < m; i++) { int box1 = console.nextInt() - 1; //to adjust for zero indexing int box2 = console.nextInt() - 1; console.nextLine(); //if could have red ball if(boxInfo[box1][1] == 1) { //if only one ball in box, and ball is taken out, no longer possible if(boxInfo[box1][0] == 1) { boxInfo[box1][1] = 0; } boxInfo[box2][1] = 1; //possible for box 2 to have red ball boxInfo[box2][0]++; //box 2 gains a ball boxInfo[box1][0]--; //box 1 loses a ball } } //loop thru and count how many 1's in pos 1 of the array in each box int numPossible = 0; for(int i = 0; i < n; i++) if(boxInfo[i][1] == 1) //if possible numPossible++; System.out.println(numPossible); } }
Main.java:2: error: class BoxAndBall is public, should be declared in a file named BoxAndBall.java public class BoxAndBall { ^ 1 error
s468902811
p04034
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i=0; i<(int)(n); ++i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() using ll = long long; using vi = vector<int>; using vl = vector<ll>; using Graph = vector<vi>; // vi <=> vl using P = pair<int, int>; // int <=> ll const int MOD = 1e9+7; const double EPS = 1e-9; int main() { int N, M; cin >> N >> M; vi box(n, 1); vector<bool> red(n, false); red[0] = true; rep(i,M) { int x, y; cin >> x >> y; --x; --y; if (red[x]) red[y] = true; --box[x]; ++box[y]; if (box[x] == 0) red[x] = false; } int sum = 0; rep(i,M) if (red[i]) ++sum; cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:10: error: 'n' was not declared in this scope 16 | vi box(n, 1); | ^
s147331472
p04034
C++
#include <algorithm> #include <iostream> #include <vector> #include <map> #include <cstdio> #include <string> #include <cmath> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define repr(i, n) for (int i = (n) - 1; i >= 0; i--) #define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++) #define rn return typedef std::pair<int,int> P; using namespace std; using ll = long long; int main() { int N,M; cin >> N >> M; int x[M],y[M]; bool ball[N]; memset(ball,0,N); ball[0] = true; int n[N]; rep(i,N) n[i] = 1; rep(i,M) cin >> x[i] >> y[i]; rep(i,M){ x[i]--; y[i]--; n[x[i]]--;n[y[i]]++; ball[y[i]] = ball[x[i]]; ball[x[i]] = ball[x[i]]*n[x[i]]; } int ans = 0; rep(i,N) if (ball[i]) ans++; cout << ans; rn 0; }
a.cc: In function 'int main()': a.cc:26:5: error: 'memset' was not declared in this scope 26 | memset(ball,0,N); ball[0] = true; | ^~~~~~ a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include <cmath> +++ |+#include <cstring> 8 |
s651421693
p04034
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<bits/stdc++.h> #include<cmath> #include<bitset> #include<queue> #define ll long long #define itn int #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define FFOR(i,a,b) for(int i=(a);i<=(b);++i) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) FFOR(i,1,n) #define SORT(V) sort((V).begin(),(V).end()) #define REVERSE(V) reverse((V).begin(),(V).end()) #define INF ((1LL<<62)-(1LL<<31)) #define MOD 1000000007 using namespace std; int N,M,K,A,B,C,ans=0,cnt=0; string S,T; vector<int> P,Q; vector<pair<int,int>> PP; bool CAN=false; int main(){ cin>>N>>M; int num[N+1]; bool red[N+1]; red[1]=true; RREP(i,M){ int x,y; cin>>x>>y if(red[x]){ red[y]=true; } num[x]--; num[y]++; if(num[x]==0) red[y]=false; } RREP(i,N){ if(red[i]==true) ans++; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:38:14: error: expected ';' before 'if' 38 | cin>>x>>y | ^ | ; 39 | if(red[x]){ | ~~