submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s283807924
p03655
C++
#include <iostream> #include <algorithm> #include <cmath> #include <stdio.h> #include <stdlib.h> #include <vector> #include <map> #include <queue> #include <set> #include <string> #include <string.h> #include <stack> #include <assert.h> #include <bitset> #define Endl endl #define mp make_pair #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define over(A) {cout<<A<<endl;exit(0);} #define all(A) A.begin(),A.end() #define ceil(a,b) ((a-1)/b+1) #define srand() mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define rand(l,r) uniform_int_distribution<int>(l,r)(rng) typedef unsigned long long ull; const int inf=1039074182; const int mod=1e9+7; using namespace std; int x1,x2,x3,x4,x5,x6; int y1,y2,y3,y4,y5,y6; ll zl[1000005]; ll yl[1000005]; ll sl[1000005]; ll xl[1000005]; ll zr[1000005]; ll yr[1000005]; ll sr[1000005]; ll xr[1000005]; namespace combinatorics { int *fac; int *ifac; int __Tmod; inline int add(int a,int b) { return (a+b)%__Tmod; } inline int sub(int a,int b) { return (a-b+__Tmod)%__Tmod; } inline int mult(int a,int b) { return (1LL*a*b)%__Tmod; } inline int fastpow(int basic,int x) { int res=1; while(x) { if(x&1) res=mult(res,basic); basic=mult(basic,basic); x>>=1; } return res; } inline int inv(int x) { return fastpow(x,__Tmod-2); } void init(int n,int tmod) { __Tmod=tmod; fac=new int[n+5]; ifac=new int[n+5]; fac[0]=1; for(int i=1;i<=n;i++) { fac[i]=mult(fac[i-1],i); } ifac[n]=inv(fac[n]); for(int i=n-1;i>=0;i--) { ifac[i]=mult(ifac[i+1],i+1); } } inline int C(int n,int m) { return mult(mult(fac[n],ifac[m]),ifac[n-m]); } inline int Cat(int x) { return mult(C(x*2,x),inv(x+1)); } }; using namespace combinatorics; ll calc(int sx,int sy,int ex,int ey) { if(sx>ex) return 0; if(sy>ey) return 0; return C(ex-sx+ey-sy,ex-sx); } ll lenof(int sx,int sy,int ex,int ey) { return abs(sx-ex)+abs(sy-ey); } ll solve(int sx,int sy,int ex,int ey) { ll res=0; for(int i=x3;i<=x4;i++) { res=add(res,mult(mult(calc(sx,sy,i,y4),calc(i,y4+1,ex,ey)),i+y4+1)); res=sub(res,mult(mult(calc(sx,sy,i,y3-1),calc(i,y3,ex,ey)),i+y3)); } for(int j=y3;j<=y4;j++) { res=add(res,mult(mult(calc(sx,sy,x4,j),calc(x4+1,j,ex,ey)),x4+j+1)); res=sub(res,mult(mult(calc(sx,sy,x3-1,j),calc(x3,j,ex,ey)),j+x3)); } return res; } int main() { // freopen("input.txt","r",stdin); init(4e6,mod); cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; ll res=0; res+=solve(x1-1,y1-1,x5,y5); res+=solve(x1-1,y1-1,x6+1,y6+1); res+=solve(x2,y2,x5,y5); res+=solve(x2,y2,x6+1,y6+1); res+=solve(x1-1,y2,x6+1,y5); res+=solve(x1-1,y2,x5,y6+1); res+=solve(x2,y1-1,x5,y6+1); res+=solve(x2,y1-1,x6+1,y5); res-=solve(x1-1,y1-1,x6+1,y5); res-=solve(x1-1,y1-1,x5,y6+1); res-=solve(x2,y2,x5,y6+1); res-=solve(x2,y2,x6+1,y5); res-=solve(x1-1,y2,x5,y5); res-=solve(x1-1,y2,x6+1,y6+1); res-=solve(x2,y1-1,x5,y5); res-=solve(x2,y1-1,x6+1,y6+1); res%=mod; if(res<0) res+=mod; cout<<res<<endl; return 0; }
a.cc:30:5: error: 'int y1' redeclared as different kind of entity 30 | int y1,y2,y3,y4,y5,y6; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:131:36: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept') 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ | | | | | double(double) noexcept | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept' 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(short int)y1' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(short unsigned int)y1' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(int)y1' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(unsigned int)y1' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(long int)y1' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(long unsigned int)y1' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(long long int)y1' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(long long unsigned int)y1' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive] 131 | cin>>x1>>x2>>x3>>x4>>x5>>x6>>y1>>y2>>y3>>y4>>y5>>y6; | ^~ | | | double (*)(double) noexcept a.cc:131:38: error: cannot bind rvalue '(void*)y1' to 'void*&' /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed: a.cc:131:38: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive] 131 | cin>>x1>>x2>>x
s759490411
p03655
C++
#include <bits/stdc++.h> using namespace std; const int mod=1e9+7; int fac[2000007],inv[2000007]; int x1,x2,x3,x4,x5,x6; int y1,y2,y3,y4,y5,y6; void init(){ fac[0]=1;fac[1]=1;inv[0]=1;inv[1]=1; for(int i=2;i<2000007;i++){ fac[i]=1ll*fac[i-1]*i%mod; inv[i]=1ll*(mod-mod/i)*inv[mod%i]%mod; } for(int i=2;i<2000007;i++){ inv[i]=1ll*inv[i]*inv[i-1]%mod; } } int c(int x,int y){ return 1ll*fac[x]*inv[y]%mod*inv[x-y]%mod; } int f(int x,int y){ return c(x+y,x); } int calc(int xs,int ys,int xt,int yt){ int s=0,i; y3--; for(i=x3;i<=x4;i++){ s=(s+1ll*f(i-xs,y4-ys)*f(xt-i,yt-y4-1)%mod*(i-xs+y4-ys))%mod; s=(s-1ll*f(i-xs,y3-ys)*f(xt-i,yt-y3-1)%mod*(i-xs+y3-ys))%mod; } y3++; x3--; for(i=y3;i<=y4;i++){ s=(s+1ll*f(x4-xs,i-ys)*f(xt-x4-1,yt-i)%mod*(x4-xs+i-ys))%mod; s=(s-1ll*f(x3-xs,i-ys)*f(xt-x3-1,yt-i)%mod*(x3-xs+i-ys))%mod; } x3++; return s; } int main(){ init(); int ans=0; scanf("%d%d%d%d%d%d",&x1,&x2,&x3,&x4,&x5,&x6); scanf("%d%d%d%d%d%d",&y1,&y2,&y3,&y4,&y5,&y6); vector<pair<pair<int,int>,int> > v1,v2; v1.push_back(make_pair(make_pair(x1-1,y1-1),1)); v1.push_back(make_pair(make_pair(x1-1,y2),-1)); v1.push_back(make_pair(make_pair(x2,y1-1),-1)); v1.push_back(make_pair(make_pair(x2,y2),1)); v2.push_back(make_pair(make_pair(x6+1,y6+1),1)); v2.push_back(make_pair(make_pair(x6+1,y5),-1)); v2.push_back(make_pair(make_pair(x5,y6+1),-1)); v2.push_back(make_pair(make_pair(x5,y5),1)); for(int i=0;i<v1.size();i++){ for(int j=0;j<v2.size();j++){ ans=(ans+calc(v1[i].first.first,v1[i].first.second,v2[j].first.first,v2[j].first.second)*v1[i].second*v2[j].second)%mod; } } printf("%d\n",(ans+mod)%mod); return 0; }
a.cc:6:5: error: 'int y1' redeclared as different kind of entity 6 | int y1,y2,y3,y4,y5,y6; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/cassert:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:45:49: warning: pointer to a function used in arithmetic [-Wpointer-arith] 45 | v1.push_back(make_pair(make_pair(x1-1,y1-1),1)); | ~~^~ a.cc:45:21: error: no matching function for call to 'std::vector<std::pair<std::pair<int, int>, int> >::push_back(std::pair<std::pair<int, double (*)(double) noexcept>, int>)' 45 | v1.push_back(make_pair(make_pair(x1-1,y1-1),1)); | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; value_type = std::pair<std::pair<int, int>, int>]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from 'std::pair<std::pair<int, double (*)(double) noexcept>, int>' to 'const std::vector<std::pair<std::pair<int, int>, int> >::value_type&' {aka 'const std::pair<std::pair<int, int>, int>&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; value_type = std::pair<std::pair<int, int>, int>]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from 'std::pair<std::pair<int, double (*)(double) noexcept>, int>' to 'std::vector<std::pair<std::pair<int, int>, int> >::value_type&&' {aka 'std::pair<std::pair<int, int>, int>&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:47:47: warning: pointer to a function used in arithmetic [-Wpointer-arith] 47 | v1.push_back(make_pair(make_pair(x2,y1-1),-1)); | ~~^~ a.cc:47:21: error: no matching function for call to 'std::vector<std::pair<std::pair<int, int>, int> >::push_back(std::pair<std::pair<int, double (*)(double) noexcept>, int>)' 47 | v1.push_back(make_pair(make_pair(x2,y1-1),-1)); | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; value_type = std::pair<std::pair<int, int>, int>]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from 'std::pair<std::pair<int, double (*)(double) noexcept>, int>' to 'const std::vector<std::pair<std::pair<int, int>, int> >::value_type&' {aka 'const std::pair<std::pair<int, int>, int>&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; value_type = std::pair<std::pair<int, int>, int>]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from 'std::pair<std::pair<int, double (*)(double) noexcept>, int>' to 'std::vector<std::pair<std::pair<int, int>, int> >::value_type&&' {aka 'std::pair<std::pair<int, int>, int>&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~
s759980554
p03655
C++
/*#pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/ #include<bits/stdc++.h> #define ll long long #define inf 1000000005 #define put putchar('\n') #define F(i,a,b) for (int i=(a);i<=(b);i++) #define D(i,a,b) for (int i=(a);i>=(b);i--) #define go(i,t) for (int i=head[t];i;i=Next[i]) #define sqr(x) ((x)*(x)) #define re register #define mp make_pair #define fi first #define se second #define pa pair<int,int> #define pb push_back #define be begin() #define en end() #define ret return puts("-1"),0; #define mod 1000000007 //#define N 500055 //#define int ll using namespace std; inline char gc(){ static char buf[100000],*p1=buf,*p2=buf; return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++; } #define gc getchar inline int read(){char c=getchar();int tot=1;while ((c<'0'|| c>'9')&&c!='-') c=getchar();if (c=='-'){tot=-1;c=getchar();} int sum=0;while (c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}return sum*tot;} inline void wr(int x){if (x<0) {putchar('-');wr(-x);return;}if(x>=10)wr(x/10);putchar(x%10+'0');} inline void wrn(int x){wr(x);put;}inline void wri(int x){wr(x);putchar(' ');} inline void wrn(int x,int y){wri(x);wrn(y);}inline void wrn(int a,int b,int c){wri(a);wrn(b,c);} int n,m; int ksm(ll x,int k){ int sum=1; while (k){ if (k&1) sum=sum*x%mod; x=x*x%mod;k>>=1; } return sum; } int C(int n,int m){return (n<m||m<0)?0:1LL*fac[n]*inv[m]%mod*inv[n-m]%mod;} void init(int x){ fac[0]=1;F(i,1,x) fac[i]=1LL*fac[i-1]*i%mod; inv[x]=ksm(fac[x],mod-2);F(i,x-1,0) inv[i]=1LL*inv[i+1]*(i+1)%mod; } inline add(int &x,int k){x+=k;x-=(x>=mod)?mod;0;x+=(x<0)?mod:0;} signed main(){ init(2000000); F(i,1,6) x[i]=read(); F(i,1,6) y[i]=read(); F(i,x[3]+1,x[4]){ x=-gt(i,y[3]-1); x=1LL*x*gt2(i,y[3])%mod; x=1LL*x*(i+y[3])%mod; add(ans,x); } F(i,y[3]+1,y[4]){ x=-gt(x[3]+1,i); x=1LL*x*gt2(x[3],i)%mod; x=1LL*x*(x[3]+i); add(ans,x); } x=-gt(x[3],y[3]); x=1LL*x*gt2(x[3],y[3])%mod; x=1LL*x*(x[3]+y[3]); add(ans,x); F(i,x[3],x[4]-1){ x=gt(i,y[4]); x=1LL*x*gt2(i,y[4]+1)%mod; x=1LL*x*(i+y[4]+1)%mod; add(ans,x); } F(i,y[3],y[4]-1){ x=gt(x[4],i); x=1LL*x*gt2(x[4]+1,i)%mod; x=1LL*x*(x[4]+1+i)%mod; add(ans,x); } x=gt(x[4],y[4]); x=1LL*x*gt2(x[4],y[4])%mod; x=1LL*x*(x[4]+y[4]+1)%mod; add(ans,x); return 0; }
a.cc: In function 'int C(int, int)': a.cc:44:44: error: 'fac' was not declared in this scope 44 | int C(int n,int m){return (n<m||m<0)?0:1LL*fac[n]*inv[m]%mod*inv[n-m]%mod;} | ^~~ a.cc:44:51: error: 'inv' was not declared in this scope; did you mean 'int'? 44 | int C(int n,int m){return (n<m||m<0)?0:1LL*fac[n]*inv[m]%mod*inv[n-m]%mod;} | ^~~ | int a.cc: In function 'void init(int)': a.cc:46:9: error: 'fac' was not declared in this scope 46 | fac[0]=1;F(i,1,x) fac[i]=1LL*fac[i-1]*i%mod; | ^~~ a.cc:47:9: error: 'inv' was not declared in this scope; did you mean 'int'? 47 | inv[x]=ksm(fac[x],mod-2);F(i,x-1,0) inv[i]=1LL*inv[i+1]*(i+1)%mod; | ^~~ | int a.cc: At global scope: a.cc:49:8: error: ISO C++ forbids declaration of 'add' with no type [-fpermissive] 49 | inline add(int &x,int k){x+=k;x-=(x>=mod)?mod;0;x+=(x<0)?mod:0;} | ^~~ a.cc: In function 'int add(int&, int)': a.cc:49:46: error: expected ':' before ';' token 49 | inline add(int &x,int k){x+=k;x-=(x>=mod)?mod;0;x+=(x<0)?mod:0;} | ^ a.cc:49:46: error: expected primary-expression before ';' token a.cc:49:64: warning: no return statement in function returning non-void [-Wreturn-type] 49 | inline add(int &x,int k){x+=k;x-=(x>=mod)?mod;0;x+=(x<0)?mod:0;} | ^ a.cc: In function 'int main()': a.cc:52:18: error: 'x' was not declared in this scope 52 | F(i,1,6) x[i]=read(); | ^ a.cc:53:18: error: 'y' was not declared in this scope 53 | F(i,1,6) y[i]=read(); | ^ a.cc:54:13: error: 'x' was not declared in this scope 54 | F(i,x[3]+1,x[4]){ | ^ a.cc:8:30: note: in definition of macro 'F' 8 | #define F(i,a,b) for (int i=(a);i<=(b);i++) | ^ a.cc:55:25: error: 'y' was not declared in this scope 55 | x=-gt(i,y[3]-1); | ^ a.cc:55:20: error: 'gt' was not declared in this scope; did you mean 'gc'? 55 | x=-gt(i,y[3]-1); | ^~ | gc a.cc:56:25: error: 'gt2' was not declared in this scope 56 | x=1LL*x*gt2(i,y[3])%mod; | ^~~ a.cc:58:21: error: 'ans' was not declared in this scope; did you mean 'abs'? 58 | add(ans,x); | ^~~ | abs a.cc:60:13: error: 'y' was not declared in this scope 60 | F(i,y[3]+1,y[4]){ | ^ a.cc:8:30: note: in definition of macro 'F' 8 | #define F(i,a,b) for (int i=(a);i<=(b);i++) | ^ a.cc:61:17: error: 'x' was not declared in this scope 61 | x=-gt(x[3]+1,i); | ^ a.cc:61:20: error: 'gt' was not declared in this scope; did you mean 'gc'? 61 | x=-gt(x[3]+1,i); | ^~ | gc a.cc:62:25: error: 'gt2' was not declared in this scope 62 | x=1LL*x*gt2(x[3],i)%mod; | ^~~ a.cc:64:21: error: 'ans' was not declared in this scope; did you mean 'abs'? 64 | add(ans,x); | ^~~ | abs a.cc:66:9: error: 'x' was not declared in this scope 66 | x=-gt(x[3],y[3]); | ^ a.cc:66:20: error: 'y' was not declared in this scope; did you mean 'yn'? 66 | x=-gt(x[3],y[3]); | ^ | yn a.cc:66:12: error: 'gt' was not declared in this scope; did you mean 'gc'? 66 | x=-gt(x[3],y[3]); | ^~ | gc a.cc:67:17: error: 'gt2' was not declared in this scope 67 | x=1LL*x*gt2(x[3],y[3])%mod; | ^~~ a.cc:69:13: error: 'ans' was not declared in this scope; did you mean 'abs'? 69 | add(ans,x); | ^~~ | abs
s748982943
p03655
C++
#include<bits/stdc++.h> #define me(a,x) memset(a,x,sizeof a) using namespace std; typedef long long LL; const int N=2e6+5,mod=1e9+7; char O[1<<14],*S=O,*T=O; #define gc (S==T&&(T=(S=O)+fread(O,1,1<<14,stdin),S==T)?-1:*S++) inline int read(){ int x=0,f=1; char ch=gc; while(ch<'0' || ch>'9'){if(ch=='-')f=-1; ch=gc;} while(ch>='0' && ch<='9'){x=(x<<1)+(x<<3)+(ch^48); ch=gc;} return x*f; } int x[7],y[7],jc[N],jn[N],ans; inline int C(int x,int y){return 1ll*jc[x+y]*jn[x]%mod*jn[y]%mod;} inline int F(int x1,int y1,int x2,int y2){ return (1ll*C(x2+1,y2+1)+C(x1,y1)-C(x2+1,y1)-C(x1,y2+1)+mod+mod)%mod; } int main(){ freopen("a.in","r",stdin); freopen("a.out","w",stdout); for(int i=1;i<7;++i) x[i]=read(); for(int i=1;i<7;++i) y[i]=read(); jc[0]=jn[0]=jc[1]=jn[1]=1; for(int i=2;i<=N-5;++i) jc[i]=1ll*jc[i-1]*i%mod,jn[i]=1ll*(mod-mod/i)*jn[mod%i]%mod; for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; for(int i=x[3];i<=x[4];++i) ans=(1ll*(mod-y[3]-i)*F(i-x[2],y[3]-1-y[2],i-x[1],y[3]-1-y[1])%mod*F(x[5]-i,y[5]-y[3],x[6]-i,y[6]-y[3])+ans)%mod; for(int i=x[3];i<=x[4];++i) ans=(1ll*(y[4]+i+1)*F(i-x[2],y[4]-y[2],i-x[1],y[4]-y[1])%mod*F(x[5]-i,y[5]-1-y[4],x[6]-i,y[6]-1-y[4])+ans)%mod; for(int i=y[3];i<=y[4];++i) ans=(1ll*(mod-x[3]-i)*F(x[3]-1-x[2],i-y[2],x[3]-1-x[1],i-y[1])%mod*F(x[5]-x[3],y[5]-i,x[6]-x[3],y[6]-i)+ans)%mod; for(int i=y[3];i<=y[4];++i) ans=(1ll*(x[4]+i+1)*F(x[4]-x[2],i-y[2],x[4]-x[1],i-y[1])%mod*F(x[5]-1-x[4],y[5]-i,x[6]-1-x[4],y[6]-i)+ans)%mod; printf("%d\n",ans); return 0; }
a.cc:14:25: error: 'int jn [2000005]' redeclared as different kind of entity 14 | int x[7],y[7],jc[N],jn[N],ans; | ^ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/cassert:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:255:1: note: previous declaration 'double jn(int, double)' 255 | __MATHCALL (jn,, (int, _Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int C(int, int)': a.cc:15:50: warning: pointer to a function used in arithmetic [-Wpointer-arith] 15 | inline int C(int x,int y){return 1ll*jc[x+y]*jn[x]%mod*jn[y]%mod;} | ^ a.cc:15:45: error: invalid operands of types 'long long int' and 'double(int, double) noexcept' to binary 'operator*' 15 | inline int C(int x,int y){return 1ll*jc[x+y]*jn[x]%mod*jn[y]%mod;} | ~~~~~~~~~~~^~~~~~ | | | | | double(int, double) noexcept | long long int a.cc:15:60: warning: pointer to a function used in arithmetic [-Wpointer-arith] 15 | inline int C(int x,int y){return 1ll*jc[x+y]*jn[x]%mod*jn[y]%mod;} | ^ a.cc: In function 'int main()': a.cc:24:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] 24 | jc[0]=jn[0]=jc[1]=jn[1]=1; | ^ a.cc:24:31: warning: pointer to a function used in arithmetic [-Wpointer-arith] 24 | jc[0]=jn[0]=jc[1]=jn[1]=1; | ^ a.cc:24:32: error: assignment of read-only location '*(jn + 1)' 24 | jc[0]=jn[0]=jc[1]=jn[1]=1; | ~~~~~^~ a.cc:25:61: warning: pointer to a function used in arithmetic [-Wpointer-arith] 25 | for(int i=2;i<=N-5;++i) jc[i]=1ll*jc[i-1]*i%mod,jn[i]=1ll*(mod-mod/i)*jn[mod%i]%mod; | ^ a.cc:25:87: warning: pointer to a function used in arithmetic [-Wpointer-arith] 25 | for(int i=2;i<=N-5;++i) jc[i]=1ll*jc[i-1]*i%mod,jn[i]=1ll*(mod-mod/i)*jn[mod%i]%mod; | ^ a.cc:25:78: error: invalid operands of types 'long long int' and 'double(int, double) noexcept' to binary 'operator*' 25 | for(int i=2;i<=N-5;++i) jc[i]=1ll*jc[i-1]*i%mod,jn[i]=1ll*(mod-mod/i)*jn[mod%i]%mod; | ~~~~~~~~~~~~~~~^~~~~~~~~~ | | | | long long int double(int, double) noexcept a.cc:26:37: warning: pointer to a function used in arithmetic [-Wpointer-arith] 26 | for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; | ^ a.cc:26:49: warning: pointer to a function used in arithmetic [-Wpointer-arith] 26 | for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; | ^ cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith] a.cc:26:42: error: invalid operands of types 'long long int' and 'double(int, double) noexcept' to binary 'operator*' 26 | for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; | ~~~^~~~~~~~ | | | | | double(int, double) noexcept | long long int a.cc:26:55: warning: pointer to a function used in arithmetic [-Wpointer-arith] 26 | for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; | ^
s071666740
p03655
C++
#include<bits/stdc++.h> using namespace std; const int N=2e6+5,mod=1e9+7; char O[1<<14],*S=O,*T=O; #define gc (S==T&&(T=(S=O)+fread(O,1,1<<14,stdin),S==T)?-1:*S++) inline int read(){ int x=0,f=1; char ch=gc; while(ch<'0' || ch>'9'){if(ch=='-')f=-1; ch=gc;} while(ch>='0' && ch<='9'){x=(x<<1)+(x<<3)+(ch^48); ch=gc;} return x*f; } int x[7],y[7],jc[N],jn[N],ans; inline int C(int x,int y){return 1ll*jc[x+y]*jn[x]%mod*jn[y]%mod;} inline int F(int x1,int y1,int x2,int y2){ return (1ll*C(x2+1,y2+1)+C(x1,y1)-C(x2+1,y1)-C(x1,y2+1)+mod+mod)%mod; } int main(){ for(int i=1;i<7;++i) x[i]=read(); for(int i=1;i<7;++i) y[i]=read(); jc[0]=jn[0]=jc[1]=jn[1]=1; for(int i=2;i<=N-5;++i) jc[i]=1ll*jc[i-1]*i%mod,jn[i]=1ll*(mod-mod/i)*jn[mod%i]%mod; for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; for(int i=x[3];i<=x[4];++i) ans=(1ll*(mod-y[3]-i)*F(i-x[2],y[3]-1-y[2],i-x[1],y[3]-1-y[1])%mod*F(x[5]-i,y[5]-y[3],x[6]-i,y[6]-y[3])+ans)%mod; for(int i=x[3];i<=x[4];++i) ans=(1ll*(y[4]+i+1)*F(i-x[2],y[4]-y[2],i-x[1],y[4]-y[1])%mod*F(x[5]-i,y[5]-1-y[4],x[6]-i,y[6]-1-y[4])+ans)%mod; for(int i=y[3];i<=y[4];++i) ans=(1ll*(mod-x[3]-i)*F(x[3]-1-x[2],i-y[2],x[3]-1-x[1],i-y[1])%mod*F(x[5]-x[3],y[5]-i,x[6]-x[3],y[6]-i)+ans)%mod; for(int i=y[3];i<=y[4];++i) ans=(1ll*(x[4]+i+1)*F(x[4]-x[2],i-y[2],x[4]-x[1],i-y[1])%mod*F(x[5]-1-x[4],y[5]-i,x[6]-1-x[4],y[6]-i)+ans)%mod; printf("%d\n",ans); return 0; }
a.cc:12:25: error: 'int jn [2000005]' redeclared as different kind of entity 12 | int x[7],y[7],jc[N],jn[N],ans; | ^ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/cassert:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:255:1: note: previous declaration 'double jn(int, double)' 255 | __MATHCALL (jn,, (int, _Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int C(int, int)': a.cc:13:50: warning: pointer to a function used in arithmetic [-Wpointer-arith] 13 | inline int C(int x,int y){return 1ll*jc[x+y]*jn[x]%mod*jn[y]%mod;} | ^ a.cc:13:45: error: invalid operands of types 'long long int' and 'double(int, double) noexcept' to binary 'operator*' 13 | inline int C(int x,int y){return 1ll*jc[x+y]*jn[x]%mod*jn[y]%mod;} | ~~~~~~~~~~~^~~~~~ | | | | | double(int, double) noexcept | long long int a.cc:13:60: warning: pointer to a function used in arithmetic [-Wpointer-arith] 13 | inline int C(int x,int y){return 1ll*jc[x+y]*jn[x]%mod*jn[y]%mod;} | ^ a.cc: In function 'int main()': a.cc:20:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] 20 | jc[0]=jn[0]=jc[1]=jn[1]=1; | ^ a.cc:20:31: warning: pointer to a function used in arithmetic [-Wpointer-arith] 20 | jc[0]=jn[0]=jc[1]=jn[1]=1; | ^ a.cc:20:32: error: assignment of read-only location '*(jn + 1)' 20 | jc[0]=jn[0]=jc[1]=jn[1]=1; | ~~~~~^~ a.cc:21:61: warning: pointer to a function used in arithmetic [-Wpointer-arith] 21 | for(int i=2;i<=N-5;++i) jc[i]=1ll*jc[i-1]*i%mod,jn[i]=1ll*(mod-mod/i)*jn[mod%i]%mod; | ^ a.cc:21:87: warning: pointer to a function used in arithmetic [-Wpointer-arith] 21 | for(int i=2;i<=N-5;++i) jc[i]=1ll*jc[i-1]*i%mod,jn[i]=1ll*(mod-mod/i)*jn[mod%i]%mod; | ^ a.cc:21:78: error: invalid operands of types 'long long int' and 'double(int, double) noexcept' to binary 'operator*' 21 | for(int i=2;i<=N-5;++i) jc[i]=1ll*jc[i-1]*i%mod,jn[i]=1ll*(mod-mod/i)*jn[mod%i]%mod; | ~~~~~~~~~~~~~~~^~~~~~~~~~ | | | | long long int double(int, double) noexcept a.cc:22:37: warning: pointer to a function used in arithmetic [-Wpointer-arith] 22 | for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; | ^ a.cc:22:49: warning: pointer to a function used in arithmetic [-Wpointer-arith] 22 | for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; | ^ cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith] a.cc:22:42: error: invalid operands of types 'long long int' and 'double(int, double) noexcept' to binary 'operator*' 22 | for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; | ~~~^~~~~~~~ | | | | | double(int, double) noexcept | long long int a.cc:22:55: warning: pointer to a function used in arithmetic [-Wpointer-arith] 22 | for(int i=2;i<=N-5;++i) jn[i]=1ll*jn[i-1]*jn[i]%mod; | ^
s227195543
p03655
C++
#include<bits/stdc++.h> typedef unsigned int uint; typedef long long ll; typedef unsigned long long ull; typedef double lf; typedef long double llf; typedef std::pair<int,int> pii; #define xx first #define yy second template<typename T> inline T max(T a,T b){return a>b?a:b;} template<typename T> inline T min(T a,T b){return a<b?a:b;} template<typename T> inline T abs(T a){return a>0?a:-a;} template<typename T> inline bool repr(T &a,T b){return a<b?a=b,1:0;} template<typename T> inline bool repl(T &a,T b){return a>b?a=b,1:0;} template<typename T> inline T gcd(T a,T b){T t;if(a<b){while(a){t=a;a=b%a;b=t;}return b;}else{while(b){t=b;b=a%b;a=t;}return a;}} template<typename T> inline T sqr(T x){return x*x;} #define mp(a,b) std::make_pair(a,b) #define pb push_back #define I inline #define mset(a,b) memset(a,b,sizeof(a)) #define mcpy(a,b) memcpy(a,b,sizeof(a)) #define fo0(i,n) for(int i=0,i##end=n;i<i##end;i++) #define fo1(i,n) for(int i=1,i##end=n;i<=i##end;i++) #define fo(i,a,b) for(int i=a,i##end=b;i<=i##end;i++) #define fd0(i,n) for(int i=(n)-1;~i;i--) #define fd1(i,n) for(int i=n;i;i--) #define fd(i,a,b) for(int i=a,i##end=b;i>=i##end;i--) #define foe(i,x)for(__typeof((x).end())i=(x).begin();i!=(x).end();++i) struct Cg{I char operator()(){return getchar();}}; struct Cp{I void operator()(char x){putchar(x);}}; #define OP operator #define RT return *this; #define RX x=0;char t=P();while((t<'0'||t>'9')&&t!='-')t=P();bool f=0;\ if(t=='-')t=P(),f=1;x=t-'0';for(t=P();t>='0'&&t<='9';t=P())x=x*10+t-'0' #define RL if(t=='.'){lf u=0.1;for(t=P();t>='0'&&t<='9';t=P(),u*=0.1)x+=u*(t-'0');}if(f)x=-x #define RU x=0;char t=P();while(t<'0'||t>'9')t=P();x=t-'0';for(t=P();t>='0'&&t<='9';t=P())x=x*10+t-'0' #define TR *this,x;return x; I bool IS(char x){return x==10||x==13||x==' ';}template<typename T>struct Fr{T P;I Fr&OP,(int&x) {RX;if(f)x=-x;RT}I OP int(){int x;TR}I Fr&OP,(ll &x){RX;if(f)x=-x;RT}I OP ll(){ll x;TR}I Fr&OP,(char&x) {for(x=P();IS(x);x=P());RT}I OP char(){char x;TR}I Fr&OP,(char*x){char t=P();for(;IS(t);t=P());if(~t){for(;!IS (t)&&~t;t=P())*x++=t;}*x++=0;RT}I Fr&OP,(lf&x){RX;RL;RT}I OP lf(){lf x;TR}I Fr&OP,(llf&x){RX;RL;RT}I OP llf() {llf x;TR}I Fr&OP,(uint&x){RU;RT}I OP uint(){uint x;TR}I Fr&OP,(ull&x){RU;RT}I OP ull(){ull x;TR}};Fr<Cg>in; #define WI(S) if(x){if(x<0)P('-'),x=-x;char s[S],c=0;while(x)s[c++]=x%10+'0',x/=10;while(c--)P(s[c]);}else P('0') #define WL if(y){lf t=0.5;for(int i=y;i--;)t*=0.1;if(x>=0)x+=t;else x-=t,P('-');*this,(ll)(abs(x));P('.');if(x<0)\ x=-x;while(y--){x*=10;x-=floor(x*0.1)*10;P(((int)x)%10+'0');}}else if(x>=0)*this,(ll)(x+0.5);else *this,(ll)(x-0.5); #define WU(S) if(x){char s[S],c=0;while(x)s[c++]=x%10+'0',x/=10;while(c--)P(s[c]);}else P('0') template<typename T>struct Fw{T P;I Fw&OP,(int x){WI(10);RT}I Fw&OP()(int x){WI(10);RT}I Fw&OP,(uint x){WU(10);RT} I Fw&OP()(uint x){WU(10);RT}I Fw&OP,(ll x){WI(19);RT}I Fw&OP()(ll x){WI(19);RT}I Fw&OP,(ull x){WU(20);RT}I Fw&OP() (ull x){WU(20);RT}I Fw&OP,(char x){P(x);RT}I Fw&OP()(char x){P(x);RT}I Fw&OP,(const char*x){while(*x)P(*x++);RT} I Fw&OP()(const char*x){while(*x)P(*x++);RT}I Fw&OP()(lf x,int y){WL;RT}I Fw&OP()(llf x,int y){WL;RT}};Fw<Cp>out; const int N=2000077,P=1000000007; inline int pow(int a,int b) { int r=1; for(;b;b>>=1,a=(ll)a*a%P) if(b&1)r=(ll)r*a%P; return r; } struct data { int x,y,v; }; int fac[N],fin[N]; int x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6,xa,ya,xb,yb; inline int F(int a,int b) { if(a>=0&&b>=0)return (ll)fac[a+b]*fin[a]%P*fin[b]%P; return 0; } inline int cal(int x,int y,int xp,int yp) { //out,"cal:",x,' ',y,' ',(ll)F(x-xa,y-ya)*F(xb-x-xp,yb-y-yp)%P,'\n'; return(ll)F(x-xa,y-ya)*F(xb-x-xp,yb-y-yp)%P; } inline int solve() { //out,"solve:",xa,' ',ya,' ',xb,' ',yb,'\n'; int res=0; fo(i,x3+1,x4)res=(res+(ll)cal(i,y3-1,0,1)*(P-i-y3))%P; fo(i,x3,x4-1)res=(res+(ll)cal(i,y4,0,1)*(i+y4+1))%P; fo(i,y3+1,y4)res=(res+(ll)cal(x3-1,i,1,0)*(P-i-x3))%P; fo(i,y3,y4-1)res=(res+(ll)cal(x4,i,1,0)*(i+x4+1))%P; res=(res+(ll)cal(x3,y3,0,0)*(P-x3-y3)+(ll)cal(x4,y4,0,0)*(x4+y4+1))%P; return res; } int main() { fac[0]=1; fo1(i,N-1)fac[i]=(ll)fac[i-1]*i%P; fin[N-1]=pow(fac[N-1],P-2); fd1(i,N-1)fin[i-1]=(ll)fin[i]*i%P; in,x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6; //xa=1,ya=1,xb=3,yb=4; //out,solve(),'\n'; //return 0; data a[4],b[4]; a[0]=(data){x1-1,y1-1,1}; a[1]=(data){x1-1,y2,-1}; a[2]=(data){x2,y1-1,-1}; a[3]=(data){x2,y2,1}; b[0]=(data){x6+1,y6+1,1}; b[1]=(data){x6+1,y5,-1}; b[2]=(data){x5,y6+1,-1}; b[3]=(data){x5,y5,1}; ll ans=0; fo0(i,4)fo0(j,4)xa=a[i].x,ya=a[i].y,xb=b[j].x,yb=b[j].y,ans+=solve()*a[i].v*b[j].v; out,(ans%P+P)%P,'\n'; }
a.cc:73:23: error: 'int y1' redeclared as different kind of entity 73 | int x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6,xa,ya,xb,yb; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/cassert:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:110:28: warning: pointer to a function used in arithmetic [-Wpointer-arith] 110 | a[0]=(data){x1-1,y1-1,1}; | ~~^~ a.cc:110:28: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 110 | a[0]=(data){x1-1,y1-1,1}; | ~~^~ | | | double (*)(double) noexcept a.cc:112:26: warning: pointer to a function used in arithmetic [-Wpointer-arith] 112 | a[2]=(data){x2,y1-1,-1}; | ~~^~ a.cc:112:26: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 112 | a[2]=(data){x2,y1-1,-1}; | ~~^~ | | | double (*)(double) noexcept
s283594213
p03655
C++
#include<set> #include<map> #include<cmath> #include<queue> #include<bitset> #include<string> #include<cstdio> #include<cctype> #include<cassert> #include<cstdlib> #include<cstring> #include<sstream> #include<iostream> #include<algorithm> #define For(i,x,y) for (int i=x;i<y;i++) #define pb push_back #define mp make_pair #define fi first #define se second #define lf else if #define dprintf(...) fprintf(stderr,__VA_ARGS__) using namespace std; typedef long long ll; typedef double db; typedef pair<int,int> pii; typedef vector<int> Vi; int IN(){ int c,f,x; while (!isdigit(c=getchar())&&c!='-');c=='-'?(f=1,x=0):(f=0,x=c-'0'); while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-'0';return !f?x:-x; } const int N=2e6+19; const int p=1e9+7; int Pow(int a,int b){ int res=1; for (;b;b>>=1,a=1ll*a*a%p) if (b&1) res=1ll*res*a%p; return res; } int fac[N],inv[N]; int x1,x2,x3,x4,x5,x6; int y1,y2,y3,y4,y5,y6; int ans,tmp; int C(int n,int m){ return 1ll*fac[n]*inv[m]%p*inv[n-m]%p; } int F(int a,int b,int c,int d){ assert(a<=c&&b<=d); return C(c-a+d-b,c-a); } void Work(int a,int b,int c,int d,int f){ tmp=0; For(i,y3,y4+1){ tmp=(tmp-1ll*(x3+i)*F(x3,i,c,d)%p*F(a,b,x3-1,i))%p; tmp=(tmp+1ll*(x4+i+1)*F(a,b,x4,i)%p*F(x4+1,i,c,d))%p; } For(i,x3,x4+1){ tmp=(tmp-1ll*(y3+i)*F(i,y3,c,d)%p*F(a,b,i,y3-1))%p; tmp=(tmp+1ll*(y4+i+1)*F(a,b,i,y4)%p*F(i,y4+1,c,d))%p; } tmp=(tmp+p)%p; if (f==1) ans=(ans+tmp)%p;else ans=(ans-tmp+p)%p; } int main(){ fac[0]=1; For(i,1,N) fac[i]=1ll*fac[i-1]*i%p; inv[N-1]=Pow(fac[N-1],p-2); for (int i=N-1;i;i--) inv[i-1]=1ll*inv[i]*i%p; x1=IN(),x2=IN(),x3=IN(),x4=IN(),x5=IN(),x6=IN(); y1=IN(),y2=IN(),y3=IN(),y4=IN(),y5=IN(),y6=IN(); Work(x1-1,y1-1,x6+1,y6+1,1); Work(x1-1,y2,x6+1,y6+1,-1); Work(x2,y1-1,x6+1,y6+1,-1); Work(x2,y2,x6+1,y6+1,1); Work(x1-1,y1-1,x5,y6+1,-1); Work(x1-1,y2,x5,y6+1,1); Work(x2,y1-1,x5,y6+1,1); Work(x2,y2,x5,y6+1,-1); Work(x1-1,y1-1,x6+1,y5,-1); Work(x1-1,y2,x6+1,y5,1); Work(x2,y1-1,x6+1,y5,1); Work(x2,y2,x6+1,y5,-1); Work(x1-1,y1-1,x5,y5,1); Work(x1-1,y2,x5,y5,-1); Work(x2,y1-1,x5,y5,-1); Work(x2,y2,x5,y5,1); printf("%d\n",ans); }
a.cc:48:5: error: 'int y1' redeclared as different kind of entity 48 | int y1,y2,y3,y4,y5,y6; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/set:60, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:78:11: error: assignment of function 'double y1(double)' 78 | y1=IN(),y2=IN(),y3=IN(),y4=IN(),y5=IN(),y6=IN(); | ~~^~~~~ a.cc:80:21: warning: pointer to a function used in arithmetic [-Wpointer-arith] 80 | Work(x1-1,y1-1,x6+1,y6+1,1); | ~~^~ a.cc:80:21: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 80 | Work(x1-1,y1-1,x6+1,y6+1,1); | ~~^~ | | | double (*)(double) noexcept a.cc:58:21: note: initializing argument 2 of 'void Work(int, int, int, int, int)' 58 | void Work(int a,int b,int c,int d,int f){ | ~~~~^ a.cc:82:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] 82 | Work(x2,y1-1,x6+1,y6+1,-1); | ~~^~ a.cc:82:19: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 82 | Work(x2,y1-1,x6+1,y6+1,-1); | ~~^~ | | | double (*)(double) noexcept a.cc:58:21: note: initializing argument 2 of 'void Work(int, int, int, int, int)' 58 | void Work(int a,int b,int c,int d,int f){ | ~~~~^ a.cc:85:21: warning: pointer to a function used in arithmetic [-Wpointer-arith] 85 | Work(x1-1,y1-1,x5,y6+1,-1); | ~~^~ a.cc:85:21: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 85 | Work(x1-1,y1-1,x5,y6+1,-1); | ~~^~ | | | double (*)(double) noexcept a.cc:58:21: note: initializing argument 2 of 'void Work(int, int, int, int, int)' 58 | void Work(int a,int b,int c,int d,int f){ | ~~~~^ a.cc:87:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] 87 | Work(x2,y1-1,x5,y6+1,1); | ~~^~ a.cc:87:19: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 87 | Work(x2,y1-1,x5,y6+1,1); | ~~^~ | | | double (*)(double) noexcept a.cc:58:21: note: initializing argument 2 of 'void Work(int, int, int, int, int)' 58 | void Work(int a,int b,int c,int d,int f){ | ~~~~^ a.cc:90:21: warning: pointer to a function used in arithmetic [-Wpointer-arith] 90 | Work(x1-1,y1-1,x6+1,y5,-1); | ~~^~ a.cc:90:21: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 90 | Work(x1-1,y1-1,x6+1,y5,-1); | ~~^~ | | | double (*)(double) noexcept a.cc:58:21: note: initializing argument 2 of 'void Work(int, int, int, int, int)' 58 | void Work(int a,int b,int c,int d,int f){ | ~~~~^ a.cc:92:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] 92 | Work(x2,y1-1,x6+1,y5,1); | ~~^~ a.cc:92:19: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 92 | Work(x2,y1-1,x6+1,y5,1); | ~~^~ | | | double (*)(double) noexcept a.cc:58:21: note: initializing argument 2 of 'void Work(int, int, int, int, int)' 58 | void Work(int a,int b,int c,int d,int f){ | ~~~~^ a.cc:95:21: warning: pointer to a function used in arithmetic [-Wpointer-arith] 95 | Work(x1-1,y1-1,x5,y5,1); | ~~^~ a.cc:95:21: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 95 | Work(x1-1,y1-1,x5,y5,1); | ~~^~ | | | double (*)(double) noexcept a.cc:58:21: note: initializing argument 2 of 'void Work(int, int, int, int, int)' 58 | void Work(int a,int b,int c,int d,int f){ | ~~~~^ a.cc:97:19: warning: pointer to a function used in arithmetic [-Wpointer-arith] 97 | Work(x2,y1-1,x5,y5,-1); | ~~^~ a.cc:97:19: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 97 | Work(x2,y1-1,x5,y5,-1); | ~~^~ | | | double (*)(double) noexcept a.cc:58:21: note: initializing argument 2 of 'void Work(int, int, int, int, int)' 58 | void Work(int a,int b,int c,int d,int f){ | ~~~~^
s608358879
p03655
C++
#include <bits/stdc++.h> #define mod 1000000007 #define semn(i) (i == 0 || i == 3 ? 1 : -1) using namespace std; const int NMAX = 1e6 + 5; int st, dr, up, down; int fact[2 * NMAX + 10], invfact[2 * NMAX + 10]; inline add(int & a, int b) { a = a + b; if (a < 0) a += mod; if (a > mod) a -= mod; } int put(int n, int p) { int ans = 1; while (p) { if (p & 1) ans = 1ll * ans * n % mod; n = 1ll * n * n % mod; p >>= 1; } return ans; } void precalc() { fact[0] = 1; for (int i(1); i <= 2 * NMAX; i++) fact[i] = 1ll * fact[i - 1] * i % mod; invfact[2 * NMAX] = put(fact[2 * NMAX], mod - 2); for (int i(2 * NMAX - 1); i >= 0; i--) invfact[i] = 1ll * invfact[i + 1] * (i + 1) % mod; } inline int comb(int a, int b) { if (a < 0 || b < 0 || a < b) return 0; return 1ll * fact[a] * invfact[b] % mod * invfact[a - b] % mod; } inline int moduri(int x1, int y1, int x2, int y2) { return comb(abs(x1 - x2) + abs(y1 - y2), abs(x1 - x2)); } inline int dist(int x1, int y1, int x2, int y2) { return abs(x1 - x2) + abs(y1 - y2); } int solve(int x1, int y1, int x2, int y2) { int ans = 0; for (int i(up); i <= down; i++) { add(ans, 1ll * dist(x1, y1, i, dr) * moduri(x1, y1, i, dr) % mod * moduri(i, dr + 1, x2, y2) % mod); add(ans, -1ll * dist(x1, y1, i, st - 1) * moduri(x1, y1, i, st - 1) % mod * moduri(i, st, x2, y2) % mod); } for (int i(st); i <= dr; i++) { add(ans, 1ll * dist(x1, y1, down, i) * moduri(x1, y1, down, i) % mod * moduri(down + 1, i, x2, y2) % mod); add(ans, -1ll * dist(x1, y1, up - 1, i) * moduri(x1, y1, up - 1, i) % mod * moduri(up, i, x2, y2) % mod); } return ans; } int main() { precalc(); if (1) { vector <pair <int, int>> first(4), last(4); cin >> first[0].first >> first[2].first >> up >> down >> last[0].first >> last[2].first; first[0].first--; first[1].first = first[0].first; first[3].first = first[2].first; last[2].first++; last[1].first = last[0].first; last[3].first = last[2].first; cin >> first[0].second >> first[1].second >> st >> dr >> last[0].second >> last[1].second; first[0].second--; first[2].second = first[0].second; first[3].second = first[1].second; last[1].second++; last[2].second = last[0].second; last[3].second = last[1].second; int ans = 0; for (int i(0); i < 4; i++) for (int j(0); j < 4; j++) add(ans, semn(i) * semn(j) * solve(first[i].first, first[i].second, last[j].first, last[j].second)); cout << ans; return 0; } up = down = st = dr = 1; cout << solve(0, 0, 2, 2); return 0; }
a.cc:10:8: error: ISO C++ forbids declaration of 'add' with no type [-fpermissive] 10 | inline add(int & a, int b) | ^~~ a.cc: In function 'int add(int&, int)': a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type] 17 | } | ^
s563921736
p03655
C++
#include <cstdio> #include <cstdlib> #include <iostream> #include <cstring> #include <ctime> #include <algorithm> #include <vector> #include <set> #include <queue> #include <map> #include <stack> #include <bitset> using namespace std; typedef long long LL; LL gi () { LL ret=0; char ch=getchar(); while((ch<'0' || ch>'9') && ch!='-') ch=getchar(); char c=ch=='-'?getchar():ch; while(c>='0' && c<='9') ret=ret*10+c-'0',c=getchar(); return ch=='-'?-ret:ret; } const int N = 2000000 + 10; const int mo = 1e9 + 7; int n,x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6; LL fac[N],ifc[N]; LL ksm (LL a,LL b) { LL ret = 1; while(b) { if(b&1) ret = ret * a %mo; a = a * a %mo; b >>= 1; } return ret; } LL calc (int x,int y) { return (fac[x+y+2] * ifc[x+1] %mo * ifc[y+1] %mo - 1) %mo; } LL calc1 (int i,int j) { return (calc(i-x1,j-y1) - calc(i-x1,j-y2-1) - calc(i-x2-1,j-y1) + calc(i-x2-1,j-y2-1)ng) %mo; } LL calc2 (int i,int j) { return (calc(x6-i,y6-j) - calc(x6-i,y5-j-1) - calc(x5-i-1,y6-j) + calc(x5-i-1,y5-j-1)) %mo; } int main () { x1 = gi(); x2 = gi(); x3 = gi(); x4 = gi(); x5 = gi(); x6 = gi(); y1 = gi(); y2 = gi(); y3 = gi(); y4 = gi(); y5 = gi(); y6 = gi(); fac[0] = 1; for(int i=1;i<N;i+=1) fac[i] = fac[i-1] * i %mo; ifc[N-1] = ksm(fac[N-1],mo-2); for(int i=N-2;i>=0;i-=1) ifc[i] = ifc[i+1] * (i+1) %mo; LL ans = 0; for(int x=x3;x<=x4;x+=1) { ans = (ans + (-x-y3) * calc1(x,y3-1) %mo * calc2(x,y3) %mo) %mo; ans = (ans + (x+y4+1) * calc1(x,y4) %mo * calc2(x,y4+1) %mo) %mo; } for(int y=y3;y<=y4;y+=1) { ans = (ans + (-y-x3) * calc1(x3-1,y) %mo * calc2(x3,y) %mo) %mo; ans = (ans + (y+x4+1) * calc1(x4,y) %mo * calc2(x4+1,y) %mo) %mo; } cout << (ans+mo) %mo; return 0; }
a.cc:24:25: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch] 24 | int n,x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6; | ^~ a.cc: In function 'LL calc1(int, int)': a.cc:38:90: error: expected ')' before 'ng' 38 | return (calc(i-x1,j-y1) - calc(i-x1,j-y2-1) - calc(i-x2-1,j-y1) + calc(i-x2-1,j-y2-1)ng) %mo; | ~ ^~ | )
s023810483
p03655
C++
//#define USEPB_DS #define USETR1 #define CPPELEVEN #define GPP /* * temp.cpp * * Created on: 2012-7-18 * Author: BSBandme */ //#pragma comment(linker, "/STACK:1024000000,1024000000") #include <iostream> #include <fstream> #include <string.h> #include <cstdio> #include <algorithm> #include <string> #include <vector> #include <queue> #include <cassert> #include <list> #include <iomanip> #include <math.h> #include <deque> #include <utility> #include <map> #include <set> #include <bitset> #include <numeric> #include <climits> #include <cctype> #include <cmath> #include <cstdlib> #include <ctime> #include <functional> #include <sstream> #include <tuple> using namespace std; #ifndef CPPELEVEN #ifdef USETR1 #include <tr1/unordered_map> #include <tr1/unordered_set> using namespace tr1; #endif #else #include <unordered_map> #include <unordered_set> #endif #ifdef USEPB_DS #include <ext/pb_ds/priority_queue.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; // binomial_heap_tag, rc_binomial_heap_tag, thin_heap_tag, binary_heap_tag typedef __gnu_pbds::priority_queue<int, greater<int>, pairing_heap_tag> pq_type; // splay_tree_tag, ov_tree_tag typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> tree_type; #endif #define mpr make_pair typedef unsigned int ui; typedef unsigned long long ull; typedef long long ll; typedef pair <int, int> pii; typedef pair <ll, ll> pll; typedef pair <double, double> pdd; typedef vector <int> vi; typedef vector <ll> vll; typedef vector <double> vd; typedef vector <string> vs; typedef map <string, int> mpsi; typedef map <double, int> mpdi; typedef map <int, int> mpii; const double pi = acos(0.0) * 2.0; const long double eps = 1e-10; const int step[8][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}, {-1, 1}, {1, 1}, {1, -1}, {-1, -1}}; template <class T> inline T abs1(T a) {return a < 0 ? -a : a;} #ifndef CPPELEVEN template <class T> inline T max1(T a, T b) { return b < a ? a : b; } template <class T> inline T max1(T a, T b, T c) { return max1(max1(a, b), c); } template <class T> inline T max1(T a, T b, T c, T d) { return max1(max1(a, b, c), d); } template <class T> inline T max1(T a, T b, T c, T d, T e) { return max1(max1(a, b, c, d), e); } template <class T> inline T min1(T a, T b) { return a < b ? a : b; } template <class T> inline T min1(T a, T b, T c) { return min1(min1(a, b), c); } template <class T> inline T min1(T a, T b, T c, T d) { return min1(min1(a, b, c), d); } template <class T> inline T min1(T a, T b, T c, T d, T e) { return min1(min1(a, b, c, d), e); } #else template <typename t, typename t1> t min1(t a, t1 b) { return a < b ? a : b; } template <typename t, typename... arg> t min1(t a, arg... arr) { return min1(a, min1(arr...)); } template <typename t, typename t1> t max1(t a, t1 b) { return a > b ? a : b; } template <typename t, typename... arg> t max1(t a, arg... arr) { return max1(a, max1(arr...)); } #endif inline int jud(double a, double b){ if(abs(a) < eps && abs(b) < eps) return 0; else if(abs1(a - b) / max(abs1(a), abs1(b)) < eps) return 0; if(a < b) return -1; return 1; } template <typename t> inline int jud(t a, t b){ if(a < b) return -1; if(a == b) return 0; return 1; } // f_lb == 1代表返回相同的一串的左边界,f_small == 1代表返回如果没有寻找的值返回小的数 template <typename it, typename t1> inline int find(t1 val, it a, int na, bool f_small = 1, bool f_lb = 1){ if(na == 0) return 0; int be = 0, en = na - 1; if(*a <= *(a + na - 1)){ if(f_lb == 0) while(be < en){ int mid = (be + en + 1) / 2; if(jud(*(a + mid), val) != 1) be = mid; else en = mid - 1; }else while(be < en){ int mid = (be + en) / 2; if(jud(*(a + mid), val) != -1) en = mid; else be = mid + 1; } if(f_small && jud(*(a + be), val) == 1) be--; if(!f_small && jud(*(a + be), val) == -1) be++; } else { if(f_lb) while(be < en){ int mid = (be + en + 1) / 2; if(jud(*(a + mid), val) != -1) be = mid; else en = mid - 1; }else while(be < en){ int mid = (be + en) / 2; if(jud(*(a + mid), val) != 1) en = mid; else be = mid + 1; } if(!f_small && jud(*(a + be), val) == -1) be--; if(f_small && jud(*(a + be), val) == 1) be++; } return be; } template <class T> inline T lowb(T num) {return num & (-num); } #ifdef GPP inline int bitnum(ui nValue) { return __builtin_popcount(nValue); } inline int bitnum(int nValue) { return __builtin_popcount(nValue); } inline int bitnum(ull nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); } inline int bitnum(ll nValue) { return __builtin_popcount(nValue) + __builtin_popcount(nValue >> 32); } inline int bitmaxl(ui a) { if(a == 0) return 0; return 32 - __builtin_clz(a); } inline int bitmaxl(int a) { if(a == 0) return 0; return 32 - __builtin_clz(a); } inline int bitmaxl(ull a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); } inline int bitmaxl(ll a) { int temp = a >> 32; if(temp) return 32 - __builtin_clz(temp) + 32; return bitmaxl(int(a)); } #else #endif long long pow(long long n, long long m, long long mod = 0){ if(m < 0) return 0; long long ans = 1; long long k = n; while(m){ if(m & 1) { ans *= k; if(mod) ans %= mod; } k *= k; if(mod) k %= mod; m >>= 1; } return ans; } #define MOD 1000000007 template <class t1, class t2> inline void add(t1 &a, t2 b, int mod = -1) { if(mod == -1) mod = MOD; a += b; while(a >= mod) a -= mod; while(a < 0) a += mod; } template <class t> void output1(t arr) { for(int i = 0; i < (int)arr.size(); i++) cerr << arr[i] << ' '; cerr << endl; } template <class t> void output2(t arr) { for(int i = 0; i < (int)arr.size(); i++) output1(arr[i]); } //....................密..........封..........线..........下..........禁..........止..........hack............................................... const int mod = MOD; const int maxn = 2000100; ll fac[maxn], invfac[maxn]; ll c(int a, int b) { if (b > a) return 0; return fac[a] * invfac[a - b] % mod * invfac[b] % mod; } ll x1, x2, x3, x4, x5, x6; ll y1, y2, y3, y4, y5, y6; ll get (pll st, pll en) { ll ans = c(en.second - st.second + en.first - st.first, en.first - st.first); for (int i = st.second; i < y3; i++) { ans -= c(i - st.second + x4 - st.first, x4 - st.first) * c(en.first - x4 - 1 + en.second - i, en.second - i) % mod; ans %= mod; } for (int i = st.first; i < x3; i++) { ans -= c(i - st.first + y4 - st.second, y4 - st.second) * c(en.second - y4 - 1 + en.first - i, en.first - i) % mod; ans %= mod; } return ans; } ll get1(pll st, pll en, pll xrange, int y, int rd) { ll ans = 0; for (int i = xrange.first; i <= xrange.second; i++) { ans += (i + rd - xrange.first + 1) * c(i - st.first + y - st.second, y - st.second) % mod * c(en.first - i + en.second - y - 1, en.first - i) % mod; } return ans; } int main() { //............................不要再忘了检查maxn大小了!!!!BSBandme你个SB!!!!................................................... ios_base::sync_with_stdio(0); #ifdef DEBUG //...................................................................................................... freopen("input.txt", "r", stdin); int __size__ = 256 << 20; // 256MB char *__p__ = (char*)malloc(__size__) + __size__; __asm__("movl %0, %%esp\n" :: "r"(__p__)); #endif //........................................................................................................... fac[0] = 1; invfac[0] = 1; for (int i = 1; i < maxn; i++) { fac[i] = fac[i - 1] * i % mod; invfac[i] = invfac[i - 1] * pow(i, mod - 2, mod) % mod; } cin >> x1 >> x2 >> x3 >> x4 >> x5 >> x6; cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; ll ans = 0; pll rst, ren; ans = 0; for (int i = 0; i < 4; i++) { rst = mpr(x1 - 1, y1 - 1); if (i & 1) rst.first = x2; if (i & 2) rst.second = y2; for (int j = 0; j < 4; j++) { ren = mpr(x6 + 1, y6 + 1); if (j & 1) ren.first = x5; if (j & 2) ren.second = y5; int flag = bitnum(i) + bitnum(j); flag = (flag % 2) * 2 - 1; flag = -flag; ans -= flag * get1(rst, ren, mpr(x3, x4), y3 - 1, 0); ans += flag * get1(rst, ren, mpr(x3, x4), y4, y4 - y3 + 1); pll rst1 = mpr(rst.second, rst.first); pll ren1 = mpr(ren.second, ren.first); ans -= flag * get1(rst1, ren1, mpr(y3, y4), x3 - 1, 0); ans += flag * get1(rst1, ren1, mpr(y3, y4), x4, x4 - x3 + 1); // ans += flag * get(rst, ren); } } ans = ans % mod + mod; ans %= mod; cout << ans << endl; return 0; }
a.cc:212:4: error: 'll y1' redeclared as different kind of entity 212 | ll y1, y2, y3, y4, y5, y6; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:15: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:256:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double(double) noexcept') 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ~~~ ^~ ~~ | | | | | double(double) noexcept | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept' 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(short int)y1' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(short unsigned int)y1' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(int)y1' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(unsigned int)y1' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(long int)y1' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(long unsigned int)y1' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(long long int)y1' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(long long unsigned int)y1' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept a.cc:256:16: error: cannot bind rvalue '(void*)y1' to 'void*&' /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive] 256 | cin >> y1 >> y2 >> y3 >> y4 >> y5 >> y6; | ^~ | | | double (*)(double) noexcept /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match) 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed: a.cc:256:16: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive] 256 |
s984641788
p03655
C++
#include<bits/stdc++.h> using namespace std; int x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6, N, fac[2001017], inv[2001017]; const int mod = 1e9 + 7; int add (int x, int y) {int ans = x + y; if (ans >= mod) ans -= mod; return ans;} int subtract (int x, int y) {if (x >= y) return x - y; return x - y + mod;} int mul (int x, int y) {return 1LL * x * y % mod;} void adto (int &x, int y) {x += y; if (x >= mod) x -= mod;} int power (int a, int b) { int p = 1; for (int i=0; (1<<i) <= b; i++) { if (b & (1 << i)) p = mul (p, a); a = mul (a, a); } return p; } void Prec (int lim){fac[0] = inv[0] = 1;for (int i=1; i<=lim; i++)fac[i] = mul (fac[i - 1], i); inv[lim] = power (fac[lim], mod - 2);for (int i=lim - 1; i>=1; i--)inv[i] = mul (inv[i + 1], i + 1);} int comb (int N, int K){int ans = mul (fac[N], inv[N - K]);ans = mul (ans, inv[K]);return ans;} namespace fft { static int Konst = 1000, rev[1 << 21]; double PI = acos (-1.0); struct comp { double a, b;///a + bi comp (): a (0.0), b (0.0) {} comp (double _a, double _b): a (_a), b (_b) {} comp (int val): a (val), b (0.0) {} }; comp unit (int N) {comp x; x.a = (double) cos (2.0 * PI / N), x.b = sin (2.0 * PI / N); return x;} comp operator / (comp x, double val) {return comp (x.a / val, x.b / val);} comp operator - (comp a, comp b) {return comp (a.a - b.a, a.b - b.b);} comp operator + (comp a, comp b) {return comp (a.a + b.a, a.b + b.b);} comp operator * (comp a, comp b) {return comp (1.0 * a.a * b.a - 1.0 * a.b * b.b, 1.0 * a.b * b.a + 1.0 * a.a * b.b);} void DFT (comp a[], int N, bool inv) { for (int i=0; i<N; i++) if (i < rev[i]) swap (a[i], a[rev[i]]); for (int l=2; l<=N; l <<= 1) { comp omega = unit (l); if (inv) omega = unit (-l); for (int i=0; i<N; i+=l) { comp put = comp(1.0); for (int j=0; j<l / 2; j++) { comp u = a[i + j], v = a[i + j + l / 2] * put; a[i + j] = u + v; a[i + j + l / 2] = u - v; put = put * omega; } } } if (inv) { for (int i=0; i<N; i++) a[i] = a[i] / N; } } void initRev (int n) { int N = 1; while (N <= 2 * n) N <<= 1; for (int i=0; (1<<i) < N; i++) for (int j=0; j<N; j++) rev[j] = ((rev[j] << 1) | ((j >> i) & 1)); } void GetProd (int a[], int b[], int c[], int n) { int N = 1; while (N <= 2 * n) N <<= 1; comp dfa[N], dfb[3][N], aux[N]; for (int i=0; i<N; i++) c[i] = 0; for (int i=0; i<3; i++) { for (int j=0; j<N; j++) dfb[i][j] = comp (b[j] % Konst), b[j] /= Konst; DFT (dfb[i], N, 0); } int put = 1; for (int i=0; i<3; i++) { for (int j=0; j<N; j++) dfa[j] = comp (a[j] % Konst), a[j] /= Konst; DFT (dfa, N, 0); int aux_put = put; for (int j=0; j<3; j++) { for (int k=0; k<N; k++) aux[k] = dfa[k] * dfb[j][k]; DFT (aux, N, 1); for (int k=0; k<N; k++) { int curr = ((long long) (aux[k].a + 0.5)) % mod; c[k] = ((long long) c[k] + 1LL * aux_put * curr) % mod; } aux_put = (1LL * aux_put * Konst) % mod; } put = (1LL * put * Konst) % mod; } }}; int paths (int dx, int dy) {return comb (dx + dy, dx);} int first_term[1 << 21], second_term[1 << 21], res[1 << 21]; int solve (int a1, int b1, int a2, int b2) { int ans = 0, n = max (x4, y4); /* for (int i=x3; i<=x4; i++) for (int j=y3; j<=y4; j++) { int f1 = mul (fac[i + j - a1 - b1], mul (inv[i - a1], inv[j - b1])), f2 = mul (fac[a2 + b2 - i - j], mul (inv[a2 - i], inv[b2 - j])); int curr = mul (f1, f2); adto (ans, curr); // adto (ans, mul (paths (i - a1, j - b1), paths (a2 - i, b2 - j))); } return ans;*/ for (int i=0; i<=n; i++) { if (x3 <= i && i <= x4) first_term[i] = mul (inv[i - a1], inv[a2 - i]); else first_term[i] = 0; if (y3 <= i && i <= y4) second_term[i] = mul (inv[i - b1], inv[b2 - i]); else second_term[i] = 0; } for (int i=n + 1; i<=2 * n; i++) first_term[i] = second_term[i] = 0; /* for (int i=0; i<=2 * n; i++) res[i] = 0; for (int i=0; i<=n; i++) for (int j=0; j<=n; j++) adto (res[i + j], mul (first_term[i], second_term[j]));*/ fft::GetProd (first_term, second_term, res, n); for (int i=0; i<=2 * n; i++) if (res[i] != 0) adto (ans, mul (res[i], mul (fac[i - a1 - b1], fac[a2 + b2 - i]))); return ans; /* int ans = 0; for (int i=x4 + 1; i<=a2; i++) adto (ans, mul (paths (i - a1, y3 - 1 - b1), paths (a2 - i, b2 - y3))); for (int j=y4 + 1; j<=b2; j++) adto (ans, mul (paths (x3 - 1 - a1, j - b1), paths (a2 - x3, b2 - j))); ans = subtract (paths (a2 - a1, b2 - b1), ans);*/ // return ans; } int main () { //freopen ("input", "r", stdin); //freopen ("output", "w", stdout); Prec (2001000); scanf ("%d %d %d %d %d %d", &x1, &x2, &x3, &x4, &x5, &x6), x1 --, x2 --, x5 ++, x6 ++; scanf ("%d %d %d %d %d %d", &y1, &y2, &y3, &y4, &y5, &y6), y1 --, y2 --, y5 ++, y6 ++; fft::initRev (max (x4, y4)); vector < pair < pair < int, int >, int > > L, R; L.push_back ({{x1, y1}, +1}); L.push_back ({{x1, y2 + 1}, -1}); L.push_back ({{x2 + 1, y1}, -1}); L.push_back ({{x2 + 1, y2 + 1}, +1}); R.push_back ({{x5 - 1, y5 - 1}, +1}); R.push_back ({{x5 - 1, y6}, -1}); R.push_back ({{x6, y5 - 1}, -1}); R.push_back ({{x6, y6}, +1}); int ans = 0; for (auto stanga_sus : L) for (auto dreapta_jos : R) { int a1 = stanga_sus.first.first, b1 = stanga_sus.first.second, a2 = dreapta_jos.first.first, b2 = dreapta_jos.first.second, sg = stanga_sus.second * dreapta_jos.second; int val = solve (a1, b1, a2, b2); if (sg < 0) val = subtract (mod, val); adto (ans, val); } printf ("%d\n", ans); /*Prec (100); for (int n=0; n<=20; n++) for (int m=0; m<=20; m++) { int cor = 0, poa = 0; for (int i=0; i<=n; i++) for (int j=0; j<=m; j++) adto (cor, comb (i + j, j)); poa = subtract (comb (n + 1 + m + 1, m + 1), 1); if (poa != cor) { printf ("wa (%d, %d) %d instead of %d\n", n, m, poa, cor); return 0; } }*/ return 0; }
a.cc:5:29: error: 'int y1' redeclared as different kind of entity 5 | int x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6, N, fac[2001017], inv[2001017]; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/cassert:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:168:60: warning: ISO C++ forbids decrementing a pointer of type 'double (*)(double) noexcept' [-Wpointer-arith] 168 | scanf ("%d %d %d %d %d %d", &y1, &y2, &y3, &y4, &y5, &y6), y1 --, y2 --, y5 ++, y6 ++; | ^~ a.cc:168:63: error: lvalue required as decrement operand 168 | scanf ("%d %d %d %d %d %d", &y1, &y2, &y3, &y4, &y5, &y6), y1 --, y2 --, y5 ++, y6 ++; | ^~ a.cc:172:13: error: no matching function for call to 'std::vector<std::pair<std::pair<int, int>, int> >::push_back(<brace-enclosed initializer list>)' 172 | L.push_back ({{x1, y1}, +1}); | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; value_type = std::pair<std::pair<int, int>, int>]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<std::pair<std::pair<int, int>, int> >::value_type&' {aka 'const std::pair<std::pair<int, int>, int>&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; value_type = std::pair<std::pair<int, int>, int>]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<std::pair<int, int>, int> >::value_type&&' {aka 'std::pair<std::pair<int, int>, int>&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:174:13: error: no matching function for call to 'std::vector<std::pair<std::pair<int, int>, int> >::push_back(<brace-enclosed initializer list>)' 174 | L.push_back ({{x2 + 1, y1}, -1}); | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; value_type = std::pair<std::pair<int, int>, int>]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<std::pair<std::pair<int, int>, int> >::value_type&' {aka 'const std::pair<std::pair<int, int>, int>&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<std::pair<int, int>, int>; _Alloc = std::allocator<std::pair<std::pair<int, int>, int> >; value_type = std::pair<std::pair<int, int>, int>]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<std::pair<int, int>, int> >::value_type&&' {aka 'std::pair<std::pair<int, int>, int>&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~
s989989318
p03656
C++
#pragma comment(linker, "/STACK:102400000,102400000") #include<bits/stdc++.h> using namespace std; int n; int fa[200200]; int d[200200]; int rt1,rt2; int te; struct data{ int to,pre,nxt,id; }mp[1000100]; int head[200200],cnt; void link(int x,int y,int id) { mp[++cnt].to=y; mp[cnt].id=id; mp[cnt].nxt=head[x]; mp[head[x]].pre=cnt; head[x]=cnt; } int ans[200200]; bool del[500500]; int sta[500500][2],top; void dfs(int x) { sta[++top][0]=s; sta[top][1]=1; int x,v; while(top) { x=sta[top][0]; int fl=1; if(sta[top][1]==1) { for(int i=head[x];i;i=mp[i].nxt) { if(del[mp[i].id])continue; del[mp[i].id]=1; head[x]=mp[i].nxt; fl=0; v=mp[i].to; sta[++top][0]=v; sta[top][1]=1; if(x<=n&&v>n)ans[x]=ans[v]=-1; else if(x>n&&v<=n)ans[x]=ans[v]=1; break; } if(fl) { sta[top][1]=2; break; } } else top--; } /* int v; for(int i=head[x];i;i=mp[i].nxt) { if(del[mp[i].id]) { if(mp[i].pre)mp[mp[i].pre].nxt=mp[i].nxt; if(mp[i].nxt)mp[mp[i].nxt].pre=mp[i].pre; continue; } del[mp[i].id]=1; if(mp[i].pre)mp[mp[i].pre].nxt=mp[i].nxt; if(mp[i].nxt)mp[mp[i].nxt].pre=mp[i].pre; v=mp[i].to; if(x<=n&&v>n)ans[x]=ans[v]=-1; else if(x>n&&v<=n)ans[x]=ans[v]=1; dfs(v); } */ } void getd(int x) { for(int i=head[x];i;i=mp[i].nxt) if(mp[i].to!=fa[x]) { d[x]++; getd(mp[i].to); } } int main() { scanf("%d",&n); for(int i=1;i<=n;++i) { scanf("%d",&fa[i]); if(fa[i]==-1){rt1=i;continue;} ++te; link(fa[i],i,te); link(i,fa[i],te); } for(int i=n+1;i<=n+n;++i) { scanf("%d",&fa[i]); if(fa[i]==-1){rt2=i;continue;} ++te; fa[i]+=n; link(fa[i],i,te); link(i,fa[i],te); } getd(rt1); getd(rt2); for(int i=1;i<=n;++i) { if((d[i]&1)!=(d[i+n]&1)) { puts("IMPOSSIBLE"); return 0; } if(!(d[i]&1)) { ++te; link(i,i+n,te); link(i+n,i,te); } } dfs(1); puts("POSSIBLE"); for(int i=1;i<=n;++i)printf("%d ",ans[i]);puts(""); return 0; }
a.cc: In function 'void dfs(int)': a.cc:28:23: error: 's' was not declared in this scope 28 | sta[++top][0]=s; | ^ a.cc:30:13: error: declaration of 'int x' shadows a parameter 30 | int x,v; | ^ a.cc:26:14: note: 'int x' previously declared here 26 | void dfs(int x) | ~~~~^
s188979236
p03656
C++
#include <algorithm> #include <cstdio> using namespace std ; const int N=2e6+10 ; int to[N<<2] , nxt[N<<2] , v[N<<2] ; int lst[N<<1] ; inline void add ( int u , int v ) { static int cnt=1 ; ++cnt,to[cnt]=v,nxt[cnt]=lst[u],lst[u]=cnt, ++cnt,to[cnt]=u,nxt[cnt]=lst[v],lst[v]=cnt; } int sz[N<<1] ; int fa[N<<1] , sa , sb ; int da[N<<1] , db[N<<1] ; int n ; int ans[N<<1] ; inline void Euler ( int x ) { for ( int &i=lst[x] ; i ; i=e[i].nxt ) if ( !e[i].v ) { // printf("From %d to %d\n",x,e[i].to); if ( to[i]==x+n ) ans[x]=1; if ( to[i]==x-n ) ans[x-n]=-1; v[i]=v[i^1]=1,Euler(e[i].to); } return ; } int main () { freopen("nitai.in","r",stdin); freopen("nitai.out","w",stdout); int i ; scanf("%d",&n); for ( i=1 ; i<=n ; i++ ) { scanf("%d",fa+i); if ( ~fa[i] ) add(i,fa[i]), da[fa[i]]^=1; sa=(~fa[i]?sa:i); } for ( i=1 ; i<=n ; i++ ) { scanf("%d",fa+n+i); if ( ~fa[i+n] ) add(i+n,fa[i+n]+n), db[fa[i+n]]^=1; sb=(~fa[i+n]?sb:i+n); } for ( i=1 ; i<=n ; i++ ) if ( da[i]^db[i] ) return puts("IMPOSSIBLE")*0; // for ( i=1 ; i<=n ; i++ ) // printf("%d ",v[i]); puts(""); for ( i=1 ; i<=n ; i++ ) if ( !da[i] ) add(i,i+n); int S=2*n+1 ; add(S,sa),add(S,sb); Euler(S); puts("POSSIBLE"); for ( i=1 ; i<=n ; i++ ) printf("%d ",ans[i]); return 0 ; }
a.cc: In function 'void Euler(int)': a.cc:26:37: error: 'e' was not declared in this scope 26 | for ( int &i=lst[x] ; i ; i=e[i].nxt ) | ^
s323116521
p03656
C++
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 100; int n, fa[N], fb[N], is_odd[2][N]; struct Edge { int e, *h, *nx, *to, V, E; Edge(int V, int E):V(V), E(E) { e = 0; h = new int [V]; nx = new int [E]; to = new int [E]; memset(h, -1, 4 * V); } ~Edge() { delete h; delete nx; delete to; } void clear() { e = 0; memset(h, -1, 4 * V); } void add(int u, int v) { to[e] = v, nx[e] = h[u], h[u] = e++; to[e] = u, nx[e] = h[v], h[v] = e++; } } *tr, *bi; int dfs(int u, int f) { vector<int> odd_son; for (int i = tr->h[u]; i != -1; i = tr->nx[i]) { int v = tr->to[i]; if (v != f) { v = dfs(v, u); if (v != 0) odd_son.push_back(v); else cassert(false); } } if (!is_odd[0][u]) odd_son.push_back(u); for (int i = 0; i < (int)odd_son.size() - 1; i += 2) { bi->add(odd_son[i], odd_son[i + 1]); } return odd_son.size() % 2 == 0 ? 0 : odd_son.back(); } bool vis[N], col[N]; void coloring(int u, int c) { vis[u] = true; col[u] = c; for (int i = bi->h[u]; i != -1; i = bi->nx[i]) { int v = bi->to[i]; if (!vis[v]) coloring(v, c ^ 1); } } int main() { #ifdef lol freopen("f.in", "r", stdin); freopen("f.out", "w", stdout); #endif scanf("%d", &n); for (int i = 1; i <= n; ++i) { scanf("%d", &fa[i]); if (fa[i] != -1) { is_odd[0][fa[i]] ^= 1; } } for (int i = 1; i <= n; ++i) { scanf("%d", &fb[i]); if (fb[i] != -1) is_odd[1][fb[i]] ^= 1; } for (int i = 1; i <= n; ++i) { if (is_odd[0][i] ^ is_odd[1][i]) { puts("IMPOSSIBLE"); return 0; } } tr = new Edge(n + 1, (n + 1) * 2); bi = new Edge(n + 10, (n + 10) * 4); int rt; for (int i = 1; i <= n; ++i) { if (fa[i] == -1) { rt = i; continue; } tr->add(i, fa[i]); } dfs(rt, -1); tr->clear(); for (int i = 1; i <= n; ++i) { if (fb[i] == -1) { rt = i; continue; } tr->add(i, fb[i]); } dfs(rt, -1); for (int i = 1; i <= n; ++i) if (!vis[i]) { coloring(i, 1); } puts("POSSIBLE"); for (int i = 1; i <= n; ++i) { if (is_odd[0][i]) { printf("%d ", 0); } else { printf("%d ", col[i] ? 1 : -1); } } puts(""); return 0; }
a.cc: In function 'int dfs(int, int)': a.cc:40:18: error: 'cassert' was not declared in this scope; did you mean 'assert'? 40 | else cassert(false); | ^~~~~~~ | assert
s960530695
p03656
C++
#include<bits/stdc++.h> using namespace std; int n,RT1,RT2,ff,S; int tot=1,head[200005],nx[600005],to[600005]; int ru[200005],bj[300005],tt[100005]; struct FastIO { static const int S = 1e7; int wpos; char wbuf[S]; FastIO() : wpos(0) {} inline int xchar() { static char buf[S]; static int len = 0, pos = 0; if (pos == len) pos = 0, len = fread(buf, 1, S, stdin); if (pos == len) exit(0); return buf[pos++]; } inline int xuint() { int c = xchar(), x = 0; while (c <= 32) c = xchar(); for (; '0' <= c && c <= '9'; c = xchar()) x = x * 10 + c - '0'; return x; } inline int xint() { int s = 1, c = xchar(), x = 0; while (c <= 32) c = xchar(); if (c == '-') s = -1, c = xchar(); for (; '0' <= c && c <= '9'; c = xchar()) x = x * 10 + c - '0'; return x * s; } inline void xstring(char *s) { int c = xchar(); while (c <= 32) c = xchar(); for (; c > 32; c = xchar()) * s++ = c; *s = 0; } inline void wchar(int x) { if (wpos == S) fwrite(wbuf, 1, S, stdout), wpos = 0; wbuf[wpos++] = x; } inline void wint(ll x) { if (x < 0) wchar('-'), x = -x; char s[24]; int n = 0; while (x || !n) s[n++] = '0' + x % 10, x /= 10; while (n--) wchar(s[n]); wchar('\n'); } inline void wstring(const char *s) { while (*s) wchar(*s++); } ~FastIO() { if (wpos) fwrite(wbuf, 1, wpos, stdout), wpos = 0; } }io; void jia(int aa,int bb) { tot++; nx[tot]=head[aa]; to[tot]=bb; head[aa]=tot; return; } void oula(int rt) { for(int i=head[rt];i;i=nx[i]) if(!bj[i/2]) { int yy=to[i]; bj[i/2]=yy; oula(yy); } return; } int main() { n=io.xint(); for(int i=1;i<=n;++i) { int x=io.xint(); if(x==-1) {RT1=i;continue;} jia(i,x);jia(x,i); ru[i]^=1;ru[x]^=1; } ru[RT1]^=1; for(int i=1;i<=n;++i) { int x=io.xint(); if(x==-1) {RT2=i+n;continue;} jia(i+n,x+n);jia(x+n,i+n); ru[i+n]^=1;ru[x+n]^=1; } ru[RT2]^=1; for(int i=1;i<=n;++i) if(ru[i]!=ru[i+n]) ff=1; if(ff) {puts("IMPOSSIBLE");return 0;} puts("POSSIBLE"); S=n*2+1; for(int i=1;i<=n;++i) if(ru[i]) jia(i,i+n),tt[i]=tot/2,jia(i+n,i); jia(S,RT1);jia(RT1,S); jia(RT2,S);jia(S,RT2); oula(S); for(int i=1;i<=n;++i) if(ru[i]) { if(bj[tt[i]]>n) printf("1 "); else printf("-1 "); } else printf("0 "); return 0; }
a.cc:42:26: error: 'll' has not been declared 42 | inline void wint(ll x) { | ^~
s524580989
p03656
C++
/* 对于每棵树,都满足每个点的子树点权和在mod 2意义下是1,所以可以从下往上递推出每个点权的奇偶性。需要满足每个点在两棵树中奇偶性相同,否则无解 更具体地,当一个点有偶数个儿子时点权mod 2 = 1,有奇数个儿子时点权mod 2 = 0 有这么一种构造方法,只要令偶数点权 = 0,奇数点权 = +1或-1即可构造出解。具体如下(称点权mod 2 = 1的点为奇点): 选择任意一个奇点为特殊点。对于两棵树,首先从下往上进行匹配 匹配到点u时,每个子树中会多出一个奇点,包括u本身如果是奇点也算在内,会有2k + 1个奇点 这些点中如果有特殊点就去掉特殊点,否则去掉任意一个点。对于剩下的点,任意两两匹配。如果匹配了x和y就连一条无向边(x, y)。被去掉的点就是该子树多出来的点 进行了这样的匹配操作后,显然有: (1)任意u的子树中有2k + 1个奇点,其中有k对奇点两两匹配,被去掉的点就是在u处匹配时被去掉的点 (2)特殊点在两棵树中都没有参与匹配,度数 = 0 (3)非特殊点的奇点在两棵树中都恰好参与一次匹配,度数 = 2 图由若干个环构成,同时一个点连接的两条边是在不同的树中的匹配,所以每个环都是偶环,该图是二分图。令黑点权值 = +1,白点权值 = -1 进行这样的操作后,每一对匹配的点权和是0,每个子树的点权和由该子树中多出来的点决定。显然也就完成了构造 */ #include <cstdio> #include <algorithm> using namespace std; const int Max_N(100050); int N, spe, Father[Max_N], Dist[Max_N]; int Get_Father(int x) { if (Father[x] == x) return x; int root(Get_Father(Father[x])); Dist[x] ^= Dist[Father[x]]; return Father[x] = root; } inline void merge(int u, int v) { int x = Get_Father(u), y = Get_Father(v); if (x == y) return; Dist[y] = (Dist[v] ^ Dist[u] ^ 1), Father[y] = u; } struct T { int root, Head[Max_N], Total, To[Max_N], Next[Max_N], Son[Max_N]; inline void Add_Edge(int s, int t) { ++Total, To[Total] = t, Next[Total] = Head[s], Head[s] = Total; } void init() { for (int i = 1, fa;i <= N;++i) { scanf("%d", &fa); if (fa == -1) root = i; else Add_Edge(fa, i), ++Son[fa]; } } int work(int u) { vector<int> All; for (int i = Head[u];i;i = Next[i]) All.push_back(work(To[i])); if ((Son[u] & 1) == 0) All.push_back(u); sort(All.begin(), All.end()); for (int i = 1;i < All.size();i += 2) merge(All[i], All[i + 1]); return All[0]; } }; T A, B; int main() { scanf("%d", &N), A.init(), B.init(); for (int i = 1;i <= N;++i) { Father[i] = i, Dist[i] = 0; if ((A.Son[i] & 1) != (B.Son[i] & 1)) { puts("IMPOSSIBLE"); return 0; } } puts("POSSIBLE"); for (int i = 1;i <= N;++i) if ((A.Son[i] & 1) == 0) { spe = i; break; } A.work(A.root), B.work(B.root); for (int i = 1;i <= N;++i) if ((A.Son[i] & 1) == 0) printf("%d ", (Get_Father(i), Dist[i]) ? +1 : -1); else printf("%d ", 0); return 0; }
a.cc: In member function 'int T::work(int)': a.cc:61:17: error: 'vector' was not declared in this scope 61 | vector<int> All; | ^~~~~~ a.cc:18:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 17 | #include <algorithm> +++ |+#include <vector> 18 | a.cc:61:24: error: expected primary-expression before 'int' 61 | vector<int> All; | ^~~ a.cc:63:25: error: 'All' was not declared in this scope 63 | All.push_back(work(To[i])); | ^~~ a.cc:65:25: error: 'All' was not declared in this scope 65 | All.push_back(u); | ^~~ a.cc:66:22: error: 'All' was not declared in this scope 66 | sort(All.begin(), All.end()); | ^~~
s906426957
p03656
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define llu unsigned long long #define ld double #define llu unsigned long long #define rep(i,x,y) for(int i=int(x);i<int(y);++i) #define For(i,x,y) for(int i=int(x);i<=int(y);++i) #define FOr(i,x,y) for(int i=int(x);i>=int(y);--i) #define pi acos(-1) #define mk make_pair #define pa pair<ll,ll> #define lf else if #define IL inline #define max(x,y) ((x)<(y)?(y):(x)) #define min(x,y) ((x)<(y)?(x):(y)) #define sqr(x) ((x)*(x)) #define Mul(x,y) ((x)=1LL*(x)*(y)%mod) #define Add(x,y) ((x)=((x)+(y))%mod) #define Max(x,y) ((x)=((x)<(y)?(y):(x))) #define Min(x,y) ((x)=((x)>(y)?(y):(x))) #define E(x) return writeln(x),0 #define LL (long long) #define p(x) printf("~%lld~\n",LL(x)) #define pp(x,y) printf("~~%lld %lld~~\n",LL(x),LL(y)) #define ppp(x,y,z) printf("~~~%lld %lld %lld~~~\n",LL(x),LL(y),LL(z)) #define pppp(a,b,c,d) printf("~~~%lld %lld %lld %lld\n",LL(a),LL(b),LL(c),LL(d)) #define f_in(x) freopen(x".in","r",stdin) #define f_out(x) freopen(x".out","w",stdout) #define open(x) f_in(x),f_out(x) #define fi first #define se second #define GuYue puts("\nGuYueNa________________________________________________________________________________") typedef complex<double> E; namespace SHENZHEBEI{ #ifdef LOCAL struct _{_(){freopen("cf.in","r",stdin);}}_; #endif #define NEG 1 static const int GYN=2333333; char SZB[GYN],*SS=SZB,*TT=SZB; inline char gc(){ if (SS==TT){ TT=(SS=SZB)+fread(SZB,1,GYN,stdin); if (SS==TT) return '\n'; } return *SS++; } #if NEG inline ll read(){ ll x=0,g=1; char ch=gc(); for (;!isdigit(ch);ch=gc()) if (ch=='-') g=-1; for (;isdigit(ch);ch=gc()) x=x*10-48+ch; return x*g; } inline void write(ll x){ if (x<0) putchar('-'),x=-x; if (x>=10) write(x/10); putchar(x%10+'0'); } #else inline ll read(){ ll x=0; char ch=gc(); for (;!isdigit(ch);ch=gc()); for (;isdigit(ch);ch=gc()) x=x*10-48+ch; return x; } inline void write(ll x){ if (x>=10) write(x/10); putchar(x%10+'0'); } #endif inline char readchar(){ char ch=gc(); for(;isspace(ch);ch=gc()); return ch; } inline ll readstr(char *s){ char ch=gc(); int cur=0; for(;isspace(ch);ch=gc()); for(;!isspace(ch);ch=gc()) s[cur++]=ch; s[cur]='\0'; return cur; } void Print(long long *a,int s,int t){For(i,s,t)printf("%lld ",a[i]);} void Print(int *a,int s,int t){For(i,s,t)printf("%d ",a[i]);} void Print(char *a,int s,int t){For(i,s,t)putchar(a[i]);} void writeln(ll x){write(x);puts("");} }using namespace SHENZHEBEI; void dfs int main(){ n=read(); For(i,1,n)fa[0][i]=read(),rt[0]=fa[i][0]==-1?i:rt[0],g[0][fa[0][i]].push_back(i); For(i,1,n)fa[1][i]=read(),rt[1]=fa[i][1]==-1?i:rt[1],g[1][fa[1][i]].push_back(i); Dfs(rt[0],0); } /* 4---3---2 | | | | 5 1 4---2 | | 1---4 | | 3 每个子树中。。 */
a.cc:58:1: error: expected initializer before 'int' 58 | int main(){ | ^~~
s397133529
p03656
C++
#include <bits/stdc++.h> #define N 200005 using namespace std; typedef pair <int,int> P; vector <int> vec[N]; int par[N],dep[N]; int pr[N],ng[N]; bool use[N]; int n; int rev(int v) { if(v>=n) return v-n; return v+n; } int dfs(int v,int d) { dep[v]=d; int a=-1; for(int i=0;i<vec[v].N();i++) { int to=vec[v][i]; int tg=dfs(to,d+1); if(tg!=-1) { if(a==-1) a=tg; else { //printf("%d %d\n",a,tg); pr[a]=tg; pr[tg]=a; a=-1; } } } if(a==-1) a=v; return a; } int LCA(int a,int b) { while(a!=b) { if(dep[a]>dep[b]) swap(a,b); b=par[b]; } return a; } int main() { scanf("%d",&n); for(int i=0;i<2*n;i++) { int p; scanf("%d",&p);p--; if(p<0) p=2*n; else if(i>=n) p+=n; par[i]=p; vec[p].push_back(i); } for(int i=0;i<n;i++) { if(vec[i].N()%2!=vec[i+n].N()%2) { puts("IMPOSSIBLE"); return 0; } } memset(pr,-1,Nof(pr)); dfs(2*n,0); for(int i=0;i<2*n;i++) { if(!use[i]&&pr[i]!=-1) { use[i]=true; int now=i; do { use[now]=true; int to=pr[now]; int p=LCA(now,to); for(int j=now;j!=p;j=par[j]) ng[j]=1; for(int j=to;j!=p;j=par[j]) ng[j]=-1; now=rev(to); }while(now!=i); } } puts("POSSIBLE"); for(int i=0;i<n;i++) { int ret=ng[i]; for(int j=0;j<vec[i].N();j++) { int to=vec[i][j]; ret-=ng[to]; } if(i!=0) printf(" "); printf("%d",ret); }puts(""); return 0; }
a.cc: In function 'int dfs(int, int)': a.cc:2:11: error: expected unqualified-id before numeric constant 2 | #define N 200005 | ^~~~~~ a.cc:22:30: note: in expansion of macro 'N' 22 | for(int i=0;i<vec[v].N();i++) | ^ a.cc:22:30: error: expected ';' before numeric constant 22 | for(int i=0;i<vec[v].N();i++) | ^ | ; a.cc:22:31: error: expression cannot be used as a function 22 | for(int i=0;i<vec[v].N();i++) | ^ a.cc:22:33: error: expected ')' before ';' token 22 | for(int i=0;i<vec[v].N();i++) | ~ ^ | ) a.cc:22:34: error: 'i' was not declared in this scope 22 | for(int i=0;i<vec[v].N();i++) | ^ a.cc: In function 'int main()': a.cc:2:11: error: expected unqualified-id before numeric constant 2 | #define N 200005 | ^~~~~~ a.cc:64:27: note: in expansion of macro 'N' 64 | if(vec[i].N()%2!=vec[i+n].N()%2) | ^ a.cc:64:27: error: expected ')' before numeric constant 64 | if(vec[i].N()%2!=vec[i+n].N()%2) | ~ ^ | ) a.cc:70:22: error: 'Nof' was not declared in this scope 70 | memset(pr,-1,Nof(pr)); | ^~~ a.cc:2:11: error: expected unqualified-id before numeric constant 2 | #define N 200005 | ^~~~~~ a.cc:93:38: note: in expansion of macro 'N' 93 | for(int j=0;j<vec[i].N();j++) | ^ a.cc:93:38: error: expected ';' before numeric constant 93 | for(int j=0;j<vec[i].N();j++) | ^ | ; a.cc:93:39: error: expression cannot be used as a function 93 | for(int j=0;j<vec[i].N();j++) | ^ a.cc:93:41: error: expected ')' before ';' token 93 | for(int j=0;j<vec[i].N();j++) | ~ ^ | ) a.cc:93:42: error: 'j' was not declared in this scope 93 | for(int j=0;j<vec[i].N();j++) | ^
s775774664
p03656
C++
#include<bits/stdc++.h> #include<vector> #define N 200005 using namespace std; vector<int> G[N]; int n,m=1,a[N],b[N],head[N],next[2*N],num[2*N],vis[2*N],op[N],dex[2*N],X[N],rt; void link(int x,int y,int z) { num[++m]=y,dex[m]=z,next[m]=head[x],head[x]=m; num[++m]=x,dex[m]=z,next[m]=head[y],head[y]=m; } void dfs(int t) { int i; for(i=head[t];i;i=next[i]){ if(vis[i]|vis[i^1]) continue; vis[i]=vis[i^1]=1; dfs(num[i]); if(i&1) X[dex[i]]=1; else X[dex[i]]=-1; } } void DFS(int t) { int i; for(i=0;i<G[t].size();i++) X[t]-=X[G[t][i]],DFS(G[t][i]); } int main() { int i; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d",&a[i]); for(i=1;i<=n;i++) scanf("%d",&b[i]); for(i=1;i<=n;i++){ if(a[i]!=-1) G[a[i]].push_back(i); else rt=i; link(i,a[i]==-1 ? n+1 : a[i],i); link(b[i]==-1 ? n+1 : b[i],i,i); if(a[i]>0) op[a[i]]^=1; if(b[i]>0) op[b[i]]^=1; } for(i=1;i<=n;i++) if(op[i]){ printf("IMPOSSIBLE"); return 0; } dfs(1); DFS(rt); printf("POSSIBLE\n"); for(i=1;i<=n;i++) printf("%d ",X[i]); return 0; }
a.cc: In function 'void link(int, int, int)': a.cc:9:29: error: reference to 'next' is ambiguous 9 | num[++m]=y,dex[m]=z,next[m]=head[x],head[x]=m; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:6:29: note: 'int next [400010]' 6 | int n,m=1,a[N],b[N],head[N],next[2*N],num[2*N],vis[2*N],op[N],dex[2*N],X[N],rt; | ^~~~ a.cc:10:29: error: reference to 'next' is ambiguous 10 | num[++m]=x,dex[m]=z,next[m]=head[y],head[y]=m; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:6:29: note: 'int next [400010]' 6 | int n,m=1,a[N],b[N],head[N],next[2*N],num[2*N],vis[2*N],op[N],dex[2*N],X[N],rt; | ^~~~ a.cc: In function 'void dfs(int)': a.cc:15:27: error: reference to 'next' is ambiguous 15 | for(i=head[t];i;i=next[i]){ | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:6:29: note: 'int next [400010]' 6 | int n,m=1,a[N],b[N],head[N],next[2*N],num[2*N],vis[2*N],op[N],dex[2*N],X[N],rt; | ^~~~
s966704635
p03656
C++
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.Iterator; import java.io.IOException; import java.util.NoSuchElementException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskF solver = new TaskF(); solver.solve(1, in, out); out.close(); } static class TaskF { int[] parent1; int[] parent2; IntList[] tree1; IntList[] tree2; int root1 = -1; int root2 = -1; IntList[] adj; int[] values; public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.nextInt(); parent1 = new int[n]; tree1 = new IntList[n]; for (int i = 0; i < n; ++i) { tree1[i] = new IntList(); } for (int i = 0; i < n; ++i) { parent1[i] = in.nextInt() - 1; if (parent1[i] == -2) { parent1[i] = -1; root1 = i; } else { tree1[parent1[i]].add(i); } } parent2 = new int[n]; tree2 = new IntList[n]; for (int i = 0; i < n; ++i) { tree2[i] = new IntList(); } for (int i = 0; i < n; ++i) { parent2[i] = in.nextInt() - 1; if (parent2[i] == -2) { root2 = i; parent2[i] = -1; } else { tree2[parent2[i]].add(i); } } adj = new IntList[n]; for (int i = 0; i < n; ++i) { if (tree1[i].size() % 2 != tree2[i].size() % 2) { out.println("IMPOSSIBLE"); return; } adj[i] = new IntList(); } values = new int[n]; Arrays.fill(values, -2); dfsMatch(tree1, root1); dfsMatch(tree2, root2); for (int i = 0; i < n; ++i) { if (values[i] == -2) { values[i] = 1; putValues(i); } } out.println("POSSIBLE"); for (int i = 0; i < n; ++i) { if (i > 0) { out.print(" "); } out.print(values[i]); } out.println(); } private int dfsMatch(IntList[] tree, int node) { for (int i = 0; i + 1 < tree[node].size(); i += 2) { int to1 = tree[node].get(i); int to2 = tree[node].get(i + 1); int n1 = dfsMatch(tree, to1); int n2 = dfsMatch(tree, to2); adj[n1].add(n2); adj[n2].add(n1); } if (tree[node].size() % 2 == 0) { return node; } else { values[node] = 0; return dfsMatch(tree, tree[node].last()); } } private void putValues(int node) { for (int to : adj[node]) { if (values[to] == -2) { values[to] = -values[node]; putValues(to); } } } } static class IntList implements Iterable<Integer> { int[] elem; int length; public IntList() { this(0, 0, 1); } public IntList(int length) { this(length, 0, Math.max(1, length)); } public IntList(int length, int value) { this(length, value, Math.max(1, length)); } public IntList(int length, int value, int capacity) { elem = new int[capacity]; Arrays.fill(elem, 0, length, value); this.length = length; } private IntList(int... e) { elem = e.clone(); length = e.length; } public void add(int e) { if (length + 1 > elem.length) { increaseCapacity(); } elem[length++] = e; } public int get(int pos) { if (pos < 0 || pos >= length) { throw new IndexOutOfBoundsException(String.valueOf(pos)); } return elem[pos]; } public int last() { if (length == 0) { throw new NoSuchElementException(); } return elem[length - 1]; } private void increaseCapacity() { changeCapacity(3 * elem.length / 2 + 1); } private void changeCapacity(int newCapacity) { int[] nElem = new int[newCapacity]; System.arraycopy(elem, 0, nElem, 0, Math.min(elem.length, newCapacity)); elem = nElem; } public Iterator<Integer> iterator() { return new Iterator<Integer>() { int pos = 0; public Integer next() { return IntList.this.elem[pos++]; } public boolean hasNext() { return pos < IntList.this.length; } }; } public int size() { return length; } public int hashCode() { int hashCode = 0; for (int i = 0; i < length; ++i) { hashCode = 31 * hashCode + elem[i]; } return hashCode; } } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new UnknownError(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new UnknownError(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { return Integer.parseInt(next()); } public String next() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuffer res = new StringBuffer(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } private boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.OutputStream; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.InputStream; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.io.PrintWriter; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import java.util.Arrays; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import java.util.Iterator; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import java.io.IOException; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: 'import' does not name a type 8 | import java.util.NoSuchElementException; | ^~~~~~ a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:9:1: error: 'import' does not name a type 9 | import java.io.InputStream; | ^~~~~~ a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:15:1: error: expected unqualified-id before 'public' 15 | public class Main { | ^~~~~~
s770555749
p03656
C++
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key typedef long long ll; typedef pair<int,ll> ii; typedef vector<int> vi; typedef long double ld; typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds; typedef set<ll>::iterator sit; typedef map<ll,ll>::iterator mit; vi adj[100001]; vi adj2[100001]; int dp[100001]; int dp2[100001]; int ans[100001]; int ans2[100001]; void dfs(int u, int p) { dp[u]=1; int cur=-1; for(int i=0;i<adj[u].size();i++) { int v=adj[u][i]; if(v==p) continue; dp[u]^=1; dfs(v,u); if(dp[v]) { ans[v]=cur; cur*=-1; } } } void dfs2(int u, int p) { dp2[u]=1; int cur=-1; for(int i=0;i<adj2[u].size();i++) { int v=adj2[u][i]; if(v==p) continue; //cerr<<v<<' '<<u<<'\n'; dfs2(v,u); dp2[u]^=1; if(dp2[v]) { ans2[v]=cur; cur*=-1; } } } int dfs3(int u, int p) { ll as=ans[u]; for(int i=0;i<adj2[u].size();i++) { int v=adj2[u][i]; if(v==p) continue; //cerr<<v<<' '<<u<<'\n'; as+=dfs3(v,u); } if(abs(as)!=1) return 238123131; else return as; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin>>n; int r1=0; int r2=0; for(int i=0;i<n;i++) { int u; cin>>u; if(u==-1) { r1=i; } else { u--; adj[u].pb(i); } } for(int i=0;i<n;i++) { int u; cin>>u; if(u==-1) { r2=i; } else { u--; adj2[u].pb(i); } } dfs(r1,-1); dfs2(r2,-1); for(int i=0;i<n;i++) { if(dp[i]!=dp2[i]) { cerr<<i<<' '<<dp[i]<<' '<<dp2[i]<<'\n'; cout<<"IMPOSSIBLE\n"; return 0; } } cout<<"POSSIBLE\n"; ans[r1]=dp[r1]; ans[r2]=dp[r2]; if(pos) { for(int i=0;i<n;i++) { cout<<ans[i]; if(i+1<n) cout<<' '; } } else { for(int i=0;i<n;i++) { cout<<ans2[i]; if(i+1<n) cout<<' '; } } cout<<'\n'; }
a.cc: In function 'int main()': a.cc:125:12: error: 'pos' was not declared in this scope; did you mean 'pow'? 125 | if(pos) | ^~~ | pow
s125747177
p03657
C++
#include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; if((a+b)%3==0||a%3==0||b%3==0) cout<<"Possible"; else cout<<"Impossible" }
a.cc: In function 'int main()': a.cc:10:19: error: expected ';' before '}' token 10 | cout<<"Impossible" | ^ | ; 11 | } | ~
s168195510
p03657
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) rep2(i, 0, n) #define rep2(i, m, n) for (ll i = m; i < (n); i++) using ll = long long; using pii = pair<int, int>; using Vi = vector<int>; int main() { int a,b; cin >>a>>b; if(min(a,b)*3=<a+b){ cout << "Possible" << endl; } else{ cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:14:17: error: expected primary-expression before '<' token 14 | if(min(a,b)*3=<a+b){ | ^
s432080094
p03657
C++
#include <cstdio> #include <iostream> using namespace std; int main() { int a,b; cin >> a >> b; if(a%3==0) { cout << "Possible"; } if(b%3==0) { cout << "Possible"; } if((a+b)%3==0) { cout << "Possible"; } elseå { cout << "Impossible"; } }
a.cc: In function 'int main()': a.cc:24:5: error: 'else\U000000e5' was not declared in this scope 24 | elseå | ^~~~~
s719720065
p03657
C++
#include <bits/stdc++.h> #define arep(a,i,n) for(ll i=(a);i<(n);i++) #define rep(i,n) for(ll i=0;i<(n);i++) #define cinf(x,n) for(ll i=0;i<(n);i++)cin>>x[i]; #define coutf(x,n) for(ll i=0;i<(n);i++)cout<<x[i]<<endl; typedef long long ll; typedef unsigned long long ull; typedef long double ld; using namespace std; int main(){ int a,b; cin >> a >> b; if(a%3!=0&&b%3!=0(a+b)%3!=0) cout << "Impossible" << endl; else cout << "Possible" << endl; }
a.cc: In function 'int main()': a.cc:15:26: error: expression cannot be used as a function 15 | if(a%3!=0&&b%3!=0(a+b)%3!=0) | ~^~~~~
s141591667
p03657
C++
#include<iostream> using namespace std; int main(){ int a,b; cin>>a>>b; if(a%s==0||b%3==0||(a+b)%3==0) cout<<"Possible"; else cout<<"Impossible"; return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: 's' was not declared in this scope 7 | if(a%s==0||b%3==0||(a+b)%3==0) | ^
s875756680
p03657
C++
#include<bits/stdc++.h> #include<iostream> using namespace std; int main() { int x,y; cin>>x>>y if(x>y || y>x) cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:12: error: expected ';' before 'if' 8 | cin>>x>>y | ^ | ; 9 | if(x>y || y>x) | ~~ a.cc:11:3: error: 'else' without a previous 'if' 11 | else | ^~~~
s706094548
p03657
C++
#include<iostream> #include<stdlib.h> #include<math.h> #include<algorithm> #include<string.h> using namespace std; int main() { std::ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(0); int n, m; cin >> n >> m; int sum = (m + n); if ()cout << "Possible" << endl; else cout << "Impossible" << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:13: error: expected primary-expression before ')' token 15 | if ()cout << "Possible" << endl; | ^
s424757897
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b ; count << ( a%3==0 || b%3==0 || (a+b)%3==0 ? "Possible" : "Impossible") << endl; }
a.cc: In function 'int main()': a.cc:7:9: error: invalid operands of types '<unresolved overloaded function type>' and 'const char*' to binary 'operator<<' 7 | count << ( a%3==0 || b%3==0 || (a+b)%3==0 ? | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 | "Possible" : "Impossible") | ~~~~~~~~~~~~~~~~~~~~~~~~~~
s803531794
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b ; count << ( a%3==0 || b%3==0 || (a+b)%3==0 ? 'Possible' : 'Impossible') << endl; }
a.cc:8:13: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 8 | 'Possible' : 'Impossible') | ^~~~~~~~~~ a.cc:8:26: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes 8 | 'Possible' : 'Impossible') | ^~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:7:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<' 7 | count << ( a%3==0 || b%3==0 || (a+b)%3==0 ? | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 | 'Possible' : 'Impossible') | ~~~~~~~~~~~~~~~~~~~~~~~~~~
s920936909
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b ; count << ( a%3==0 || b%3==0 || (a+b)%3==0 ? "Possible" : "Impossible") << endl; }
a.cc: In function 'int main()': a.cc:7:9: error: invalid operands of types '<unresolved overloaded function type>' and 'const char*' to binary 'operator<<' 7 | count << ( a%3==0 || b%3==0 || (a+b)%3==0 ? | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 | "Possible" : "Impossible") | ~~~~~~~~~~~~~~~~~~~~~~~~~~
s374632951
p03657
C++
#include "bits/stdc++.h" using namespace std; #define rep(i,n)for(int i=0;i<(int)(n);i++) #define PI 3.141592653589793 //vector < vector<int>>a(0, vector<int>(0));二次元配列宣言 int main() { int a, b; cin >> a >> b; if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) cout << "Possible" << endl; else cout << "Impossible" << end; }
a.cc: In function 'int main()': a.cc:15:38: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 15 | cout << "Impossible" << 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:
s303148410
p03657
Java
public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a=scan.nextInt(); int b=scan.nextInt(); if((a+b)%3==0) System.out.println("Possible"); else System.out.println("Impossible"); } }
Main.java:4: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s204907736
p03657
C++
//#include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1}; #define yes cout << "Yes" << endl #define YES cout << "YES" << endl #define no cout << "No" << endl #define NO cout << "NO" << endl #define rep(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() #define debug(v) \ cout << #v << ":"; \ for (auto x : v) \ { \ cout << x << ' '; \ } \ cout << endl; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } //cout<<fixed<<setprecision(15);有効数字15桁 //-std=c++14 //-std=gnu++17 ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n, a, b; cin >> a >> b; if (a % 3 && b % 3 && (a + b) % 3) cout << "Impossible "<<"\n"; else cout << "Possible "<<"\n"; }
a.cc:57:17: warning: missing terminating " character 57 | cout << "Impossible | ^ a.cc:57:17: error: missing terminating " character 57 | cout << "Impossible | ^~~~~~~~~~~ a.cc:58:21: error: stray '\' in program 58 | "<<"\n"; | ^ a.cc:58:23: warning: missing terminating " character 58 | "<<"\n"; | ^ a.cc:58:23: error: missing terminating " character 58 | "<<"\n"; | ^~ a.cc:60:17: warning: missing terminating " character 60 | << "Possible | ^ a.cc:60:17: error: missing terminating " character 60 | << "Possible | ^~~~~~~~~ a.cc:61:21: error: stray '\' in program 61 | "<<"\n"; | ^ a.cc:61:23: warning: missing terminating " character 61 | "<<"\n"; | ^ a.cc:61:23: error: missing terminating " character 61 | "<<"\n"; | ^~ a.cc: In function 'int main()': a.cc:58:21: error: expected ';' before 'n' 58 | "<<"\n"; | ^~ | ;
s979112803
p03657
C++
//#include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1}; #define yes cout << "Yes" << endl #define YES cout << "YES" << endl #define no cout << "No" << endl #define NO cout << "NO" << endl #define rep(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() #define debug(v) \ cout << #v << ":"; \ for (auto x : v) \ { \ cout << x << ' '; \ } \ cout << endl; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } //cout<<fixed<<setprecision(15);有効数字15桁 //-std=c++14 //-std=gnu++17 ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n, a, b; cin >> a >> b; if (a % 3 && b % 3 && (a + b) % 3) cout << "Impossible "<<"\n "; else cout << "Possible "<<"\n "; }
a.cc:57:17: warning: missing terminating " character 57 | cout << "Impossible | ^ a.cc:57:17: error: missing terminating " character 57 | cout << "Impossible | ^~~~~~~~~~~ a.cc:58:21: error: stray '\' in program 58 | "<<"\n "; | ^ a.cc:58:24: warning: missing terminating " character 58 | "<<"\n "; | ^ a.cc:58:24: error: missing terminating " character 58 | "<<"\n "; | ^~ a.cc:60:17: warning: missing terminating " character 60 | << "Possible | ^ a.cc:60:17: error: missing terminating " character 60 | << "Possible | ^~~~~~~~~ a.cc:61:21: error: stray '\' in program 61 | "<<"\n "; | ^ a.cc:61:24: warning: missing terminating " character 61 | "<<"\n "; | ^ a.cc:61:24: error: missing terminating " character 61 | "<<"\n "; | ^~ a.cc: In function 'int main()': a.cc:58:21: error: expected ';' before 'n' 58 | "<<"\n "; | ^~ | ;
s183292360
p03657
C++
//#include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1}; #define yes cout << "Yes" << endl #define YES cout << "YES" << endl #define no cout << "No" << endl #define NO cout << "NO" << endl #define rep(i, n) for (int i = 0; i < n; i++) #define ALL(v) v.begin(), v.end() #define debug(v) \ cout << #v << ":"; \ for (auto x : v) \ { \ cout << x << ' '; \ } \ cout << endl; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } //cout<<fixed<<setprecision(15);有効数字15桁 //-std=c++14 //-std=gnu++17 ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n, a, b; cin >> a >> b; if (a % 3 && b % 3 && (a + b) % 3) cout << "Impossible "<<"\n " else cout << "Possible "<<"\n "; }
a.cc:57:17: warning: missing terminating " character 57 | cout << "Impossible | ^ a.cc:57:17: error: missing terminating " character 57 | cout << "Impossible | ^~~~~~~~~~~ a.cc:58:21: error: stray '\' in program 58 | "<<"\n " | ^ a.cc:58:24: warning: missing terminating " character 58 | "<<"\n " | ^ a.cc:58:24: error: missing terminating " character a.cc:60:17: warning: missing terminating " character 60 | << "Possible | ^ a.cc:60:17: error: missing terminating " character 60 | << "Possible | ^~~~~~~~~ a.cc:61:21: error: stray '\' in program 61 | "<<"\n "; | ^ a.cc:61:24: warning: missing terminating " character 61 | "<<"\n "; | ^ a.cc:61:24: error: missing terminating " character 61 | "<<"\n "; | ^~ a.cc: In function 'int main()': a.cc:58:21: error: expected ';' before 'n' 58 | "<<"\n " | ^~ | ;
s847910499
p03657
C++
#include<bits/stdc++.h> using namespace std; #define ll long long int #define pi 3.141592653589793238 #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define mod 1000000007 ll ceil1(ll n,ll m){if(n%m==0){return n/m;}return n/m +1;} ll factor(ll n){ vll ans; if(n==2)ans.pb(2); else {for(ll i=2;i*i<=n;i++){if(n%i==0 && n%i!=i){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}ans.pb(n);} return ans.sz+1; } ll fact(ll n){ll res = 1;for (ll i = 2; i <= n; i++)res = res * i; return res; } ll nCr(ll n, ll r){ return fact(n) / (fact(r) * fact(n - r)); } void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) { par[k]=p; dis[k]=dis[p]+1; for(ll i=0;i<v[k].sz;i++){ if(v[k][i]!=p){ dfs(v,v[k][i],par,dis,k); } } } bool sortbysec(const pair<string,int> &a,const pair<string,int> &b){return (a.second<b.second);} ll pow2(ll n,ll k){ll ans=1; while(k>0){ if(k%2==1)ans=ans*n;n=n*n;k/=2; }return ans;} bool prime(int n){ int i,j; for(i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } void solve() { ll a,b; cin>>a>>b; if((a+b)%3==0) cout<<"Possible"; else cout<<"Impossible"; } int main() { fast; ll q; q=1; // cin>>q; while(q--) { solve(); } return 0; }
a.cc: In function 'long long int factor(long long int)': a.cc:12:5: error: 'vll' was not declared in this scope; did you mean 'll'? 12 | vll ans; | ^~~ | ll a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | if(n==2)ans.pb(2); | ^~~ | abs a.cc:15:50: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | {for(ll i=2;i*i<=n;i++){if(n%i==0 && n%i!=i){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}ans.pb(n);} | ^~~ | abs a.cc:15:84: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | {for(ll i=2;i*i<=n;i++){if(n%i==0 && n%i!=i){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}ans.pb(n);} | ^~~ | abs a.cc:16:12: error: 'ans' was not declared in this scope; did you mean 'abs'? 16 | return ans.sz+1; | ^~~ | abs a.cc: At global scope: a.cc:23:6: error: variable or field 'dfs' declared void 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^~~ a.cc:23:10: error: 'vllv' was not declared in this scope; did you mean 'll'? 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^~~~ | ll a.cc:23:16: error: 'v' was not declared in this scope 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^ a.cc:4:12: error: expected primary-expression before 'long' 4 | #define ll long long int | ^~~~ a.cc:23:18: note: in expansion of macro 'll' 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^~ a.cc:23:23: error: 'vll' was not declared in this scope; did you mean 'll'? 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^~~ | ll a.cc:23:28: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'? 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^~~ | __pstl::execution::v1::par In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15, from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here 43 | _GLIBCXX17_INLINE constexpr parallel_policy par{}; | ^~~ a.cc:23:32: error: 'vll' was not declared in this scope; did you mean 'll'? 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^~~ | ll a.cc:23:37: error: 'dis' was not declared in this scope; did you mean 'div'? 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^~~ | div a.cc:4:12: error: expected primary-expression before 'long' 4 | #define ll long long int | ^~~~ a.cc:23:41: note: in expansion of macro 'll' 23 | void dfs(vllv &v,ll k,vll &par,vll &dis,ll p) | ^~
s060951689
p03657
C
#include<stdio.h> int main(void) { int a,b; scanf("%d%d",&a,&b); if((a+b)%3=0 || a%3=0 || b%3=0)printf("Possible¥n"); else printf("Impossible¥n"); return 0; }
main.c: In function 'main': main.c:7:34: error: lvalue required as left operand of assignment 7 | if((a+b)%3=0 || a%3=0 || b%3=0)printf("Possible¥n"); | ^
s727537992
p03657
C++
A,B=map(int,input().split(' ')) if (A+B)%3 and A%3 and B%3: print('Impossible') else: print('Possible')
a.cc:3:9: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes 3 | print('Impossible') | ^~~~~~~~~~~~ a.cc:5:9: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 5 | print('Possible') | ^~~~~~~~~~ a.cc:1:1: error: 'A' does not name a type 1 | A,B=map(int,input().split(' ')) | ^
s419731222
p03657
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<set> #include<iomanip> #define rep(i, a, n) for(int i = a; i < n; i++) using namespace std; int main(){ int a, b; cin >> a >> b; if(a % 3 == 0){ cout << "Possible"; } esel if(b % 3 == 0){ cout << "Possible"; } esel if((a + b) % 3 == 0){ cout << "Possible"; } esel{ cout << "Impossible"; } }
a.cc: In function 'int main()': a.cc:15:3: error: 'esel' was not declared in this scope 15 | esel if(b % 3 == 0){ | ^~~~ a.cc:18:5: error: expected ';' before 'if' 18 | esel if((a + b) % 3 == 0){ | ^~~ | ; a.cc:21:5: error: expected ';' before '{' token 21 | esel{ | ^ | ;
s908508615
p03657
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define rep(i, n) FOR(i, 0, n) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define whole(x) (x).begin(),(x).end() #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) using P = pair<int, int>; #define debug(var) cerr << "[" << #var << "] " << var << endl #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) const ll mod = 1000000007; const int dx[] = {-1,0,1,0}; const int dy[] = {0,-1,0,1}; int main(){ int a, b; cin >> a >> b; vecotr<int> v = {a, b, a+b}; string ans = "Impossible"; rep(i, 3) if (v[i]%3==0) ans = "Possible"; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:21:5: error: 'vecotr' was not declared in this scope 21 | vecotr<int> v = {a, b, a+b}; | ^~~~~~ a.cc:21:12: error: expected primary-expression before 'int' 21 | vecotr<int> v = {a, b, a+b}; | ^~~ a.cc:23:19: error: 'v' was not declared in this scope 23 | rep(i, 3) if (v[i]%3==0) ans = "Possible"; | ^
s543242641
p03657
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; cin >> A >> B; int C = A + B; if(A % 3 = 0; || B % 3 = 0 || C % 3 = 0){ cout << "Possible" << endl; } else{ cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:8:8: error: lvalue required as left operand of assignment 8 | if(A % 3 = 0; || B % 3 = 0 || C % 3 = 0){ | ~~^~~ a.cc:8:17: error: expected primary-expression before '||' token 8 | if(A % 3 = 0; || B % 3 = 0 || C % 3 = 0){ | ^~ a.cc:8:30: error: lvalue required as left operand of assignment 8 | if(A % 3 = 0; || B % 3 = 0 || C % 3 = 0){ | ~~^~~~~~~~
s756052325
p03657
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; cin >> A >> B; int C = A + B; if(A % 3 == 0; || B % 3 == 0 || C % 3 == 0){ cout << "Possible" << endl; } else{ cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:8:18: error: expected primary-expression before '||' token 8 | if(A % 3 == 0; || B % 3 == 0 || C % 3 == 0){ | ^~
s626504375
p03657
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; using vi = vector<int>; using vvi = vector<vector<int>>; using vl = vector<ll>; using vvl = vector<vector<ll>>; #define MOD 1000000007ULL; #define rep(i,n) for(int i=0;i<n;i++) int main() { int a,b; cin>>a>>b; if(A%3==0||B%3==0||(A+B)%3==0) cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; }
a.cc: In function 'int main()': a.cc:14:12: error: 'A' was not declared in this scope 14 | if(A%3==0||B%3==0||(A+B)%3==0) cout<<"Possible"<<endl; | ^ a.cc:14:20: error: 'B' was not declared in this scope 14 | if(A%3==0||B%3==0||(A+B)%3==0) cout<<"Possible"<<endl; | ^
s584110210
p03657
C++
#include <bits/stdc++.h> using namespace std; #define int long long int findLowerBound( vector<pair<int, int>> &arr, pair<int, int> &p) { auto low = lower_bound(arr.begin(), arr.end(), p); return low - arr.begin(); } int findUpperBound( vector<pair<int, int>> &arr, pair<int, int> &p) { auto up = upper_bound(arr.begin(), arr.end(), p); return up - arr.begin(); } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); string str; int n, m; cin >> n >> m; if ((n + m) % 3 == 0) { cout << "Possible" << "\n"; } else { /* code */ cout << "Impossible" << "\n" } cin >> str; return 0; }
a.cc: In function 'int32_t main()': a.cc:41:21: error: expected ';' before '}' token 41 | << "\n" | ^ | ; 42 | } | ~
s071656377
p03657
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(); System.out.println(a+b >= 3 ? "Possible" : "Impossible"); } }
Main.java:1: error: ';' expected import java.util*; ^ 1 error
s965759759
p03657
C
#include<stdio.h> int mian() { int a,b; scanf("%d %d",&a,&b); if((a%3==0)||(b%3==0)||((a+b)%3==0))printf("Possible"); else printf("Impossible"); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s331837287
p03657
C++
#include <bits/stdc++.h> using namespace std; int main(){ if(a%3==0){ cout << Possible << endl; } else if(b%3==0){ cout << Possible << endl; } else if((a+b)%3==0){ cout << Possible << endl; } else{ cout << Impossible << endl; } }
a.cc: In function 'int main()': a.cc:5:6: error: 'a' was not declared in this scope 5 | if(a%3==0){ | ^ a.cc:6:13: error: 'Possible' was not declared in this scope 6 | cout << Possible << endl; | ^~~~~~~~ a.cc:8:11: error: 'b' was not declared in this scope 8 | else if(b%3==0){ | ^ a.cc:9:13: error: 'Possible' was not declared in this scope 9 | cout << Possible << endl; | ^~~~~~~~ a.cc:12:13: error: 'Possible' was not declared in this scope 12 | cout << Possible << endl; | ^~~~~~~~ a.cc:15:13: error: 'Impossible' was not declared in this scope 15 | cout << Impossible << endl; | ^~~~~~~~~~
s247191906
p03657
C
#include<stdio.h> int main(){ int a,b; scanf("%d%d",&a,&b); printf(a%3&&b%3&&(a+b)%3?"Impossible":"Possible") }
main.c: In function 'main': main.c:5:52: error: expected ';' before '}' token 5 | printf(a%3&&b%3&&(a+b)%3?"Impossible":"Possible") | ^ | ; 6 | } | ~
s146443168
p03657
C++
#include<iostream> int main(){ int A, B; std::cin >> A >> B; std::cout << (A%3 == 0 || B%3 == 0 || (A+B)%3 == 0 ? "Possible" : "Impossible"); } ~
a.cc:7:2: error: expected class-name at end of input 7 | ~ | ^
s159496669
p03657
C++
#include<iostream> using namespace std; int main(){ int a,b; cin>>a>>b; if((a%3==0||b%3==0)||(a+b)%3==0) cout<<Possible<<endl; else cout<<Impossible<<endl; }
a.cc: In function 'int main()': a.cc:7:11: error: 'Possible' was not declared in this scope 7 | cout<<Possible<<endl; | ^~~~~~~~ a.cc:9:11: error: 'Impossible' was not declared in this scope 9 | cout<<Impossible<<endl; | ^~~~~~~~~~
s368242238
p03657
Java
Impossible
Main.java:1: error: reached end of file while parsing Impossible ^ 1 error
s293257371
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b,s; cin>>a>>b; s=a+b; if(a%3==0) cout << "Possible" << endl; else if(b%3==0){ cout <<"Possible"<<endl; } else if(s%3==0){ cout <<"Possible"<<endl; } else cout <<"Impossible"<<endl; }
a.cc: In function 'int main()': a.cc:12:9: error: 's\U0000ff053' was not declared in this scope 12 | else if(s%3==0){ | ^~~~
s198301893
p03657
C
#include<stdio.h> int main(void) { int A,B; scanf("%d%d",&A,&B); if((A + B) % 3 == 0)printf(Possible); else printf(Impossible); return 0; }
main.c: In function 'main': main.c:7:28: error: 'Possible' undeclared (first use in this function) 7 | if((A + B) % 3 == 0)printf(Possible); | ^~~~~~~~ main.c:7:28: note: each undeclared identifier is reported only once for each function it appears in main.c:8:13: error: 'Impossible' undeclared (first use in this function) 8 | else printf(Impossible); | ^~~~~~~~~~
s892359991
p03657
C
#include <stdio.h> int a,b; int main() { scanf("%d %d",&a,&b); int c=(a+b)%3; if(a+b!=0){ if(c==0){printf("Possible\n");} else{printf("Impossible\n");}} else{printf("Impossible\n");} return 0;
main.c: In function 'main': main.c:16:3: error: expected declaration or statement at end of input 16 | return 0; | ^~~~~~
s337892454
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if ( a%3 == 0 || b%3 == 0 || (a+b)%3 == 0 ) { cout << "Possible" << endl; else { cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:10:3: error: expected '}' before 'else' 10 | else { | ^~~~ a.cc:8:47: note: to match this '{' 8 | if ( a%3 == 0 || b%3 == 0 || (a+b)%3 == 0 ) { | ^
s492246083
p03657
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++) #define VL vector<ll> #define VS vector<string> #define VB vector<bool> #define VP vector<pair<ll,ll>> #define VVL vector<vector<ll>> #define VVP vector<vector<pair<ll,ll>>> #define PL pair<ll,ll> #define ALL(v) (v).begin(), (v).end() int main(){ ll A,B; cin>>A>>B; if(A%3==0||B%3==||(A+B)%3==)cout<<"Possible"; else cout<<"Impossible"; return 0; }
a.cc: In function 'int main()': a.cc:17:21: error: expected primary-expression before '||' token 17 | if(A%3==0||B%3==||(A+B)%3==)cout<<"Possible"; | ^~ a.cc:17:32: error: expected primary-expression before ')' token 17 | if(A%3==0||B%3==||(A+B)%3==)cout<<"Possible"; | ^
s558398414
p03657
C++
#include <iostream> #include <algorithm> #include <math.h> #include <vector> #include <string> #include <queue> #include <map> #include <utility> using namespace std; using ll = long long; int main() { int a,b; cin >> a >> b; if (a%3 == 0 || b%3==0 || (A+b)%3==0) cout << "Possible" << endl; else cout << "Impossible" << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:30: error: 'A' was not declared in this scope 15 | if (a%3 == 0 || b%3==0 || (A+b)%3==0) cout << "Possible" << endl; | ^
s973116774
p03657
C++
#include <iostream> #include <algorithm> #include <math.h> #include <vector> #include <string> #include <queue> #include <map> #include <utility> using namespace std; using ll = long long; int main() { int a,b; cin >> a >> b; if (a%3 == 0 || b%3==0 || (A|b)%3==0) cout << "Possible" << endl; else cout << "Impossible" << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:30: error: 'A' was not declared in this scope 15 | if (a%3 == 0 || b%3==0 || (A|b)%3==0) cout << "Possible" << endl; | ^
s189698243
p03657
C++
#include<stdio.h> int main() { int a, b, c; scanf("%d %d", &a,&b); c=a+b; if(c%2==0){ printf("possible"); } else{ printf("impossible"); } return o; }
a.cc: In function 'int main()': a.cc:13:10: error: 'o' was not declared in this scope 13 | return o; | ^
s828409183
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a, b; if (a % 3 = 0) { cout << "Possible" << endl; } else if (b % 3 = 0) { cout << "Possible" << endl; } else if ((a + b) % 3 = 0) { cout << "Possible" << endl; } else { cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:8:9: error: lvalue required as left operand of assignment 8 | if (a % 3 = 0) { | ~~^~~ a.cc:11:14: error: lvalue required as left operand of assignment 11 | else if (b % 3 = 0) { | ~~^~~ a.cc:14:20: error: lvalue required as left operand of assignment 14 | else if ((a + b) % 3 = 0) { | ~~~~~~~~^~~
s341667188
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b; if ( a % 3 == 0 || b % 3 == 0 || ( a + b ) % == 0 ){ cout << "Possible" << endl; }else{ cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:9:48: error: expected primary-expression before '==' token 9 | if ( a % 3 == 0 || b % 3 == 0 || ( a + b ) % == 0 ){ | ^~
s023357288
p03657
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (n); ++i) #define fin(ans) cout << (ans) << endl; #define blank(ans) cout << (ans) << " "; #define mp(p, q) make_pair(p, q) #define pb(n) push_back(n) #define all(a) a.begin(), a.end() typedef long long ll; typedef long long lli; typedef unsigned long long ull; typedef long double ld; typedef string str; typedef vector<char> vc; typedef vector<bool> vb; typedef vector<ld> vd; typedef vector<str> vs; typedef vector<ll> vll; typedef vector<pair<ll, ll>> vpll; typedef vector<pair<ll, str>> vpls; typedef vector<tuple<str, ll, ll>> vtsl; typedef vector<vector<ll>> vvll; typedef vector<vector<char>> vvc; typedef vector<vector<str>> vvs; const ld PI = acos(-1.0); const ll MAX = 9000000000000000000; const ll MIN = -9000000000000000000; const ld DMAX = 4500; const ld DMIN = -4500; const ll MOD = 1000000007; //実行部 void Main() { ll a, b; cin >> a >> b; a += b; fin(n%3==0?"Possible":"Impossible") } //前処理 int main() { //ios::sync_with_stdio(false); //cin.tie(0); cout << fixed << setprecision(20); //高精度少数表示 Main(); return 0; }
a.cc: In function 'void Main()': a.cc:41:7: error: 'n' was not declared in this scope 41 | fin(n%3==0?"Possible":"Impossible") | ^ a.cc:6:27: note: in definition of macro 'fin' 6 | #define fin(ans) cout << (ans) << endl; | ^~~
s058594545
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b; if (a%3==0) cout << "Possible" << endl; else if (b%3==0) cout << "Possible" << endl; else if ((a+b)%==0) cout << "Possible" << endl; else cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:9:19: error: expected primary-expression before '=' token 9 | else if ((a+b)%==0) cout << "Possible" << endl; | ^
s718220956
p03657
C++
#include<iostream> // #include<algorithm> #include <vector> using namespace std; int main(){ int a,b; cin>>a>>b; if (a%3==0 || b %3==0 || a+b %3 ==0) cout<<"Possible "<<endl; else cout<<"Impossible"<<endl; return 0; }
a.cc:9:52: warning: missing terminating " character 9 | if (a%3==0 || b %3==0 || a+b %3 ==0) cout<<"Possible | ^ a.cc:9:52: error: missing terminating " character 9 | if (a%3==0 || b %3==0 || a+b %3 ==0) cout<<"Possible | ^~~~~~~~~ a.cc:10:1: warning: missing terminating " character 10 | "<<endl; | ^ a.cc:10:1: error: missing terminating " character 10 | "<<endl; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:11:5: error: expected primary-expression before 'else' 11 | else cout<<"Impossible"<<endl; | ^~~~
s673550081
p03657
C++
#include <bits/stdc++.h> using namespace std; #define MOD (long long int)(1e9+7) #define ll long long int #define rep(i,n) for(int i=0; i<(int)(n); i++) #define reps(i,n) for(int i=1; i<=(int)(n); i++) #define REP(i,n) for(int i=n-1; i>=0; i--) #define REPS(i,n) for(int i=n; i>0; i--) #define FOR(i,a,b) for(int i=a; i<(int)(b); i++) #define ALL(x) (x).begin(),(x).end() #define RALL(a) (a).rbegin(), (a).rend() #define CLR(a) memset((a), 0 ,sizeof(a)) #define PB push_back #define MP make_pair #define SP << " " << const int INF = 1001001001; const ll LINF = 100100100100100100; const double EPS = 1e-10; const long double PI = acos(-1.0L); typedef pair<int,int> PII; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VL; #define chmax(a,b) a = (((a)<(b))?(b):(a)) #define chmin(a,b) a = (((a)>(b))?(b):(a)) __attribute__((constructor)) void initial(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } signed main(){ int n,m; cin>>n>>m; if(a%3==0||b%3==0||(a+b)%3==0) cout<<"Possible"<<endl; else cout<<"Impossible"<<<endl; return 0; }
a.cc: In function 'int main()': a.cc:37:12: error: 'a' was not declared in this scope 37 | if(a%3==0||b%3==0||(a+b)%3==0) cout<<"Possible"<<endl; | ^ a.cc:37:20: error: 'b' was not declared in this scope 37 | if(a%3==0||b%3==0||(a+b)%3==0) cout<<"Possible"<<endl; | ^ a.cc:38:34: error: expected primary-expression before '<' token 38 | else cout<<"Impossible"<<<endl; | ^
s494441642
p03657
C
#include<stdio.h> int main(void){ int a,b; scanf("%d%d",&a,&b); if(a%3==0||%3==0||(a+b)%3==0) printf("Possible"); else printf("Impossible"); return 0; }
main.c: In function 'main': main.c:5:14: error: expected expression before '%' token 5 | if(a%3==0||%3==0||(a+b)%3==0) | ^
s086364960
p03657
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; cin >> A >> B; if((A%3==0)||(B%3==0)||((A+B)%3==0)){ cout << "Possible" << endl; else cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:8:3: error: expected '}' before 'else' 8 | else | ^~~~ a.cc:6:39: note: to match this '{' 6 | if((A%3==0)||(B%3==0)||((A+B)%3==0)){ | ^
s302655638
p03657
C++
#include <bits/stdc++.h> using namespace std; int main(){ int A,B; cin >> A >> B; if((A%3==0)||(B%3==0)||((A+B)%3==0)){ cout >> "Possible" >> endl; else cout >> "Impossible" >> endl; }
a.cc: In function 'int main()': a.cc:7:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [9]') 7 | cout >> "Possible" >> endl; | ~~~~ ^~ ~~~~~~~~~~ | | | | | const char [9] | std::ostream {aka std::basic_ostream<char>} 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:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:7:5: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 7 | cout >> "Possible" >> endl; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ In file included from /usr/include/c++/14/istream:1109, 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: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[9]]': a.cc:7:13: required from here 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:7:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 7 | cout >> "Possible" >> endl; | ^~~~~~~~~~ /usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)' 207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:207:5: note: template argument deduction/s
s619389857
p03657
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const int INF= 1e9+5; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll> >vvl; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> T; const ll MOD=1000000007LL; string abc="abcdefghijklmnopqrstuvwxyz"; string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int main(){ ll n,k;cin>>n>>k; vl a(n); rep(i,n)cin>>a[i]; sort(a.begin(),a.end()); reverse(a.begin(),a.end()); ll ans=0; rep(i,k)ans+=a; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:23:14: error: no match for 'operator+=' (operand types are 'll' {aka 'long long int'} and 'vl' {aka 'std::vector<long long int>'}) 23 | rep(i,k)ans+=a; | ~~~^~~
s407368825
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c; cin >> a>>b; int flag=0; if(A%3==0)flag=1; else if(B%3==0)flag=1; else if((A+B)%3==0)flag=1; if(flag==1) cout <<"Possible"<<endl; else if(flag==0)cout <<"Impossible"<<endl; }
a.cc: In function 'int main()': a.cc:7:7: error: 'A' was not declared in this scope 7 | if(A%3==0)flag=1; | ^ a.cc:8:12: error: 'B' was not declared in this scope 8 | else if(B%3==0)flag=1; | ^
s626712604
p03657
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; if(a%3==0||b%3==0||(a+b)%3==0)cout<<"Possible" else cout<<"Impossible"; return 0; }
a.cc: In function 'int main()': a.cc:7:51: error: expected ';' before 'else' 7 | if(a%3==0||b%3==0||(a+b)%3==0)cout<<"Possible" | ^ | ; 8 | else cout<<"Impossible"; | ~~~~
s133064676
p03657
C++
#include<iostream> using namespace std; int main(void) { int a,b; cin>>a>>b; if((a+b)%3==0){cout<<"Possible"<<endl;} else{cout<<"Impossible">>endl;} return 0; }
a.cc: In function 'int main()': a.cc:11:26: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 11 | else{cout<<"Impossible">>endl;} | ~~~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/string:55, 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/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | else{cout<<"Impossible">>endl;} | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:11:28: note: couldn't deduce template parameter '_IntegerType' 11 | else{cout<<"Impossible">>endl;} | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | else{cout<<"Impossible">>endl;} | ^~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>' 11 | else{cout<<"Impossible">>endl;} | ^~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>' 11 | else{cout<<"Impossible">>endl;} | ^~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | else{cout<<"Impossible">>endl;} | ^~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>' 11 | else{cout<<"Impossible">>endl;} | ^~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:11:28: note: 'std::basic_ostream<char>' is not derived from 'std::basic_istream<char, _Traits>' 11 | else{cout<<"Impossible">>endl;} | ^~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: a.cc:11:28: note: couldn't deduce template parameter '_Tp' 11 | else{cout<<"Impossible">>endl;} | ^~~~
s646297543
p03657
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<map> #include<set> #include<cstdio> #include<cmath> #include<deque> #include<numeric> #include<queue> #include<stack> #include<cstring> #include<limits> #include<functional> #include<unordered_set> #include<iomanip> #include<cassert> #include<regex> #include<bitset> #include<complex> #include<chrono> #include<random> #define rep(i,a) for(int i=(int)0;i<(int)a;++i) #define pb push_back #define eb emplace_back #define all(x) x.begin(),x.end() using ll=long long; constexpr ll mod = 1e9 + 7; constexpr ll INF = 1LL << 60; ll gcd(ll n, ll m) { ll tmp; while (m!=0) { tmp = n % m; n = m; m = tmp; } return n; } ll lcm(ll n, ll m) { return abs(n * m) / gcd(n, m);//gl=xy } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; //ここから void solve(){ int a,b; cin>>a>>b; if(a%3==0||b%3==0||(a+b)%3==0)cout<<"Possible"; else cout<<<"Impossible"; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout<<fixed<<setprecision(15); solve(); return 0; }
a.cc: In function 'void solve()': a.cc:68:14: error: expected primary-expression before '<' token 68 | else cout<<<"Impossible"; | ^
s458610166
p03657
C++
int main(){ int A,B; cin >> A >> B; if(A + B % 3 == 0){ cout << "Possible" << endl; }else{ cout << "Impossible" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> A >> B; | ^~~ a.cc:5:9: error: 'cout' was not declared in this scope 5 | cout << "Possible" << endl; | ^~~~ a.cc:5:31: error: 'endl' was not declared in this scope 5 | cout << "Possible" << endl; | ^~~~ a.cc:7:9: error: 'cout' was not declared in this scope 7 | cout << "Impossible" << endl; | ^~~~ a.cc:7:33: error: 'endl' was not declared in this scope 7 | cout << "Impossible" << endl; | ^~~~
s527904402
p03657
Java
import java.util.Scanner; import java.util.Arrays; import java.util.Collections; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); //棒の全体数 int K = sc.nextInt(); //取る棒の本数 Integer[] rodList = new int[55]; int rodSum = 0; for(int i=0; i < N; i++){ rodList[i] = sc.nextInt(); } Arrays.sort(rodList, Collections.reverseOrder()); for(int i = 0; i < K; i++){ rodSum += rodList[i]; } System.out.println(rodSum); } }
Main.java:9: error: incompatible types: int[] cannot be converted to Integer[] Integer[] rodList = new int[55]; ^ 1 error
s006546404
p03657
Java
import java.util.Scanner; import java.util.Arrays; import java.util.Collections; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); //棒の全体数 int K = sc.nextInt(); //取る棒の本数 int[] rodList = new int[55]; int rodSum = 0; for(int i=0; i < N; i++){ rodList[i] = sc.nextInt(); } Arrays.sort(rodList, Collections.reverseOrder()); for(int i = 0; i < K; i++){ rodSum += rodList[i]; } System.out.println(rodSum); } }
Main.java:15: error: no suitable method found for sort(int[],Comparator<Object>) Arrays.sort(rodList, Collections.reverseOrder()); ^ method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable (inference variable T#1 has incompatible bounds equality constraints: int upper bounds: Object) method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable (cannot infer type-variable(s) T#2 (actual and formal argument lists differ in length)) where T#1,T#2 are type-variables: T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>) T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>) Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s641942362
p03657
Java
import java.util.Scanner; import java.util.Arrays; import java.util.Collections; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); //棒の全体数 int K = sc.nextInt(); //取る棒の本数 int[] rodList = new int[55]; int rodSum = 0; for(int i=0; i < N; i++){ rodList[i] = sc.nextInt(); } Arrays.sort(rodlist, Collections.reverseOrder()); for(int i = 0; i < K; i++){ rodSum += rodList[i]; } System.out.println(rodSum); } }
Main.java:15: error: cannot find symbol Arrays.sort(rodlist, Collections.reverseOrder()); ^ symbol: variable rodlist location: class Main 1 error
s952300755
p03657
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); //棒の全体数 int K = sc.nextInt(); //取る棒の本数 int[] rodList = new int[55]; int rodSum = 0; for(int i=0; i < N; i++){ rodList[i] = sc.nextInt(); } Arrays.sort(rodlist); for(int i = 0; i < K; i++){ rodSum += rodList[i]; } System.out.println(rodSum); } }
Main.java:13: error: cannot find symbol Arrays.sort(rodlist); ^ symbol: variable rodlist location: class Main Main.java:13: error: cannot find symbol Arrays.sort(rodlist); ^ symbol: variable Arrays location: class Main 2 errors
s154981287
p03657
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); //棒の全体数 int K = sc.nextInt(); //取る棒の本数 int[] rodList = new int[55]; int rodSum = 0; for(int i=0; i < N; i++){ rodList[i] = sc.nextInt(); } Arrays.sort(rodlist); } for(int i = 0; i < K; i++){ rodSum += rodList[i]; } System.out.println(rodSum); } }
Main.java:16: error: illegal start of type for(int i = 0; i < K; i++){ ^ Main.java:16: error: > or ',' expected for(int i = 0; i < K; i++){ ^ Main.java:16: error: <identifier> expected for(int i = 0; i < K; i++){ ^ Main.java:19: error: <identifier> expected System.out.println(rodSum); ^ Main.java:19: error: <identifier> expected System.out.println(rodSum); ^ Main.java:21: error: class, interface, enum, or record expected } ^ 6 errors
s230918181
p03657
C++
#include<bits/stdc++.h> int main() { int a,b; std::cin>>a>>c; if(!a%3||!b%3||!(a+b)%3) std::cout<<"Possible"; else std::cout<<"Impossible"; }
a.cc: In function 'int main()': a.cc:5:22: error: 'c' was not declared in this scope 5 | std::cin>>a>>c; | ^
s165026234
p03657
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int a,b; cin >> a >> b; if ((a%3==0) || (b%3==0) || ((a+b)%3)) { cout << Possible << endl; } else cout << Impossible << endl; }
a.cc: In function 'int main()': a.cc:10:13: error: 'Possible' was not declared in this scope 10 | cout << Possible << endl; | ^~~~~~~~ a.cc:12:16: error: 'Impossible' was not declared in this scope 12 | else cout << Impossible << endl; | ^~~~~~~~~~
s434999355
p03657
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int i,n,k,a[55],ans=0; cin >> n >> k; for(i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n,greater<int>()); for(i=0;i<k;i++){ ans=ans+a[i]; } cout << ans << endl; return 0; {
a.cc: In function 'int main()': a.cc:16:4: error: expected '}' at end of input 16 | { | ~^ a.cc:16:4: error: expected '}' at end of input a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s591154143
p03657
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int i,n,k,a[55],ans=0; cin >> n >> k; for(i=0;i<n;i++){ cin >> a[i]; } sort(a,a+n,greater<int>()); for(i=0;i<k;i++){ ans=ans+a{i}; } cout << ans << endl; return 0; {
a.cc: In function 'int main()': a.cc:12:12: error: invalid conversion from 'int*' to 'int' [-fpermissive] 12 | ans=ans+a{i}; | ~~~^~ | | | int* a.cc:12:14: error: expected ';' before '{' token 12 | ans=ans+a{i}; | ^ | ; a.cc:16:4: error: expected '}' at end of input 16 | { | ~^ a.cc:16:4: error: expected '}' at end of input a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s146570175
p03657
C++
#include <iostream> using namespace std; int main(){ int a,b; cin >> a >> b; if((a%3==0||b%3==0||)||(a+b)%3==0){ cout << "Possible" << endl; } else cout << "impossible" << endl; }
a.cc: In function 'int main()': a.cc:7:25: error: expected primary-expression before ')' token 7 | if((a%3==0||b%3==0||)||(a+b)%3==0){ | ^
s142000595
p03657
C++
#include <iostream> using namespace std; int main(){ int a,b; cin >> a >> b; if((a%3==0||b%3==0||)(a+b)%3==0){ cout << "Possible" << endl; } else cout << "impossible" << endl; }
a.cc: In function 'int main()': a.cc:7:25: error: expected primary-expression before ')' token 7 | if((a%3==0||b%3==0||)(a+b)%3==0){ | ^
s637164045
p03657
C++
#include <iostream> using namespace std; int main(){ int a,b; cin >> a >> b; if((a%3==0||b%3==0||)a+b%3==0){ cout << "Possible" << endl; } else cout << "impossible" << endl; }
a.cc: In function 'int main()': a.cc:7:25: error: expected primary-expression before ')' token 7 | if((a%3==0||b%3==0||)a+b%3==0){ | ^ a.cc:7:26: error: expected ')' before 'a' 7 | if((a%3==0||b%3==0||)a+b%3==0){ | ~ ^ | )
s923507211
p03657
C++
#include<stdio.h> int main() { int A; int B; scanf_s("%d %d", &A, &B); int C; C = (A + B) % 3; if (C == 0) { printf("Possible"); } else { printf("Impossible"); } }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d %d", &A, &B); | ^~~~~~~ | scanf
s872338244
p03657
C++
#include<stdio.h> int main() { int A; int B; scanf_s("%d %d", &A, &B); int C; C = (A + B) % 3; if (C == 0) { printf("Possible"); } else { printf("Impossible"); } }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d %d", &A, &B); | ^~~~~~~ | scanf
s705143320
p03657
C++
#include<stdio.h> int main() { int A; int B; scanf_s("%d %d", &A, &B); int C; C = (A + B) % 3; if (C == 0) { printf("Possible"); } else { printf("Impossible"); } }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d %d", &A, &B); | ^~~~~~~ | scanf
s922702612
p03657
C++
#include<stdio.h> int main() { int A; int B; scanf_s("%d %d", &A, &B); int C; C = (A + B) % 3; if (C == 0) { printf("Possible"); } else { printf("Impossible"); } }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d %d", &A, &B); | ^~~~~~~ | scanf
s351030669
p03657
C++
#include<stdio.h> int main() { int A; int B; scanf_s("%d %d", &A, &B); int C; C = (A + B) % 3; if (C == 0) { printf("Possible"); } else { printf("Impossible"); } }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d %d", &A, &B); | ^~~~~~~ | scanf
s306266152
p03657
C
#include<stdio.h> int main() { int A; int B; scanf_s("%d %d", &A, &B); int C; C = (A + B) % 3; if (C == 0) { printf("Possible"); } else { printf("Impossible"); } }
main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 5 | scanf_s("%d %d", &A, &B); | ^~~~~~~ | scanf
s023095231
p03657
C++
#include<stdio.h> int main() { int A; int B; scanf_s("%d %d", &A, &B); int C; C = (A + B) % 3; if (C == 0) { printf("Possible"); } else { printf("Impossible"); } }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d %d", &A, &B); | ^~~~~~~ | scanf
s101740086
p03657
C++
#include <bits/stdc++.h> #include <string> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <numeric> using namespace std; int abs(int num){ if (num > 0) return num; else return -num; } int main(){ int A,B; cin >> A >> B; C = A + B; if(C%3 == 0 || A%3 == 0 || B%3 == 0){ cout << "Possible" << endl; } else{ cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:20:3: error: 'C' was not declared in this scope 20 | C = A + B; | ^
s234801429
p03657
C++
#include <bits/stdc++.h> #include <string> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <numeric> using namespace std; int abs(int num){ if (num > 0) return num; else return -num; } int main(){ int A,B; C = A + B; if(C%3 == 0 || A%3 == 0 || B%3 == 0){ cout << "Possible" << endl; } else{ cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:18:3: error: 'C' was not declared in this scope 18 | C = A + B; | ^
s874225645
p03657
C++
#inlcude<iostream> int main(){int a,b;std::cin>>a>>b;std::printf("%sossible\n",(a*b%3&1)?"Imp":"P");}
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<iostream> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:2:25: error: 'cin' is not a member of 'std' 2 | int main(){int a,b;std::cin>>a>>b;std::printf("%sossible\n",(a*b%3&1)?"Imp":"P");} | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #inlcude<iostream> a.cc:2:40: error: 'printf' is not a member of 'std' 2 | int main(){int a,b;std::cin>>a>>b;std::printf("%sossible\n",(a*b%3&1)?"Imp":"P");} | ^~~~~~
s171332640
p03657
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if((A + B) % 3 == 0){ puts("Possible"); }else{ puts("Impossible"); } }
a.cc: In function 'int main()': a.cc:7:7: error: 'A' was not declared in this scope 7 | if((A + B) % 3 == 0){ | ^ a.cc:7:11: error: 'B' was not declared in this scope 7 | if((A + B) % 3 == 0){ | ^
s367993756
p03657
C++
A, B = map(int, input().split()) print('Possible') if(A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0) else print('Impossible')
a.cc:2:7: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 2 | print('Possible') if(A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0) else print('Impossible') | ^~~~~~~~~~ a.cc:2:79: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes 2 | print('Possible') if(A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0) else print('Impossible') | ^~~~~~~~~~~~ a.cc:1:1: error: 'A' does not name a type 1 | A, B = map(int, input().split()) | ^
s646160509
p03657
C++
#include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; if( if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0 ){ cout<<"Possible"<<endl; } else cout<<"Impossible"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: expected primary-expression before 'if' 10 | if( if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0 ){ | ^~ a.cc:10:8: error: expected ')' before 'if' 10 | if( if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0 ){ | ~^~~ | )