submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s690023472
p03823
C++
#include<bits/stdc++.h> using namespace std; #define fs first #define sc second #define pb push_back #define mp make_pair #define eb emplace_back #define ALL(A) A.begin(),A.end() #define RALL(A) A.rbegin(),A.rend() typedef long long LL; typedef pair<LL,LL> P; const LL mod=1000000007; const LL LINF=1LL<<60; const int INF=1<<30; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; const int M_N=200000; struct BIT{ //1-indexed LL bit[M_N+1],n; //iまでの総和を返す LL sum(int i){ LL s=0; while(i>0){ s=(s + bit[i])%mod; i=i&(i-1); } return s; } //iにx加算する void add(int i,LL x){ x %= mod; while(i<=n){ bit[i]=(bit[i] + x)%mod; i+=i&-i; } } }; int main(){ int n; LL A,B; cin >> n >> A >> B; vector<LL> s(n+1,-LINF); for (int i = 0; i < n; i++) { cin >> s[i+1]; } BIT bit[2]; bit[0].n = bit[1].n = n + 1; bit[0].add(1,1); bit[1].add(1,1); int la = 0, lb = 0; for (int i = 1; i < n; i++) { auto x = upper_bound(ALL(s),s[i+1] - A) - s.begin(); bit[0].add(i + 1,(bit[1].sum(min(i,(int)x))-bit[1].sum(lb)+mod)%mod); auto y = upper_bound(ALL(s),s[i+1] - B) - s.begin(); bit[1].add(i + 1,(bit[0].sum(min(i,(int)y))-bit[0].sum(la)+mod)%mod); if(s[i+1] < s[i] + A) la = i; if(s[i+1] < s[i] + B) lb = i; } cout << (bit[0].sum(n+1) - bit[0].sum(la) + mod)%mod + (bit[1].sum(n+1) - bit[1].sum(lb) + mod)%mod)%mod << endl; return 0; }
a.cc: In function 'int main()': a.cc:66:104: error: expected ';' before ')' token 66 | cout << (bit[0].sum(n+1) - bit[0].sum(la) + mod)%mod + (bit[1].sum(n+1) - bit[1].sum(lb) + mod)%mod)%mod << endl; | ^ | ;
s535235339
p03823
C++
#include<iostream> #include<algorithm> #include<vector> #include<queue> #define lol(i,n) for(int i=0;i<n;i++) #define mod 1000000007 typedef long long ll; using namespace std; #define N 100010 ll v[N],n; class RangeSum{ public: vector<ll> cs; void Pb(ll x){ ll news=x+cs[cs.size()-1]; news%=mod; cs.push_back(news); } ll sum(ll l,ll r){ ll res=cs[r]-cs[l-1]; res%=mod; if(res<0)res+=mod; return res; } }; class Surf{ public: int surf; void Update(int i){ if(v[i]>v[i-1])x=i; } }; class Cut{ int D,cut; void Init(int d){ D=d; } void Update(int i){ if(v[i-1]+D>v[i])cut=i; } }; ll a[N],b[N]; int main(){ cin>>n; lol(i,n)cin>>v[i]; a[0]=b[0]=1; lol(i,n){ } return 0; }
a.cc: In member function 'void Surf::Update(int)': a.cc:31:32: error: 'x' was not declared in this scope 31 | if(v[i]>v[i-1])x=i; | ^
s601367523
p03823
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define sqr(x) ((x)*(x)) #define mp make_pair #define int long long #define uint unsigned 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(){ int x = 0; char ch = gc(); bool positive = 1; for (; !isdigit(ch); ch = gc()) if (ch == '-') positive = 0; for (; isdigit(ch); ch = gc()) x = x * 10 + ch - '0'; return positive ? x : -x; } inline void write(int a){ if(a>=10)write(a/10); putchar('0'+a%10); } inline void writeln(int a){ if(a<0){ a=-a; putchar('-'); } write(a); puts(""); } const int N=100005,mod=1000000007; ll n,a,b,arr[N]; int f[N],g[N],s1[N],s2[N],s3[N],s4[N]; signed main(){ n=read(); a=read(); b=read(); for(int i=1;i<=n;i++)arr[i]=read(); arr[0]=-4e18; arr[n+1]=4e18; f[0]=g[0]=1; f[1]=g[1]=-1; s1[n+1]=s2[n+1]=n+1; for(int i=n;i;i--){ s1[i]=arr[i+1]-arr[i]<a?i+1:s1[i+1]; s2[i]=arr[i+1]-arr[i]<b?i+1:s2[i+1]; } for(int i=0;i<=n;i++){ if(i)s3[i]=s3[i-1]; while(arr[s3[i]+1]-arr[i]<a)s3[i]++; if(i)s4[i]=s4[i-1]; while(arr[s4[i]+1]-arr[i]<b)s4[i]++; } for(int i=0;i<n;i++){ s3[i]=max(s3[i],i+1); s4[i]=max(s4[i],i+1); f[i+1]=(f[i+1]+f[i])%mod; if(s3[i]<s2[i+1]){g[s3[i]]=(g[s3[i]]+f[i])%mod; g[s2[i+1]]=(g[s2[i+1]]-f[i])%mod;} g[i+1]=(g[i+1]+g[i])%mod; if(s4[i]<s1[i+1]){f[s4[i]]=(f[s4[i]]+g[i])%mod; f[s1[i+1]]=(f[s1[i+1]]-g[i])%mod;} //cout<<i<<" "<<f[i]<<" "<<g[i]<<" "<<s3[i]<<" "<<s2[i+1]<<" "<<s4[i]<<" "<<s1[i+1]<<endl; } cout<<(f[n]+g[n])%mod+mod)%mod; }
a.cc: In function 'int main()': a.cc:55:34: error: expected ';' before ')' token 55 | cout<<(f[n]+g[n])%mod+mod)%mod; | ^ | ;
s820845430
p03823
C++
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) { Solver_agc009c solver = new Solver_agc009c(); solver.input(); solver.solve(); } } class FastScanner { BufferedReader br; StringTokenizer st; public FastScanner(Reader in) { br = new BufferedReader(in); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException("Can't read more inputs."); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String readNextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } class Solver_agc009c { static FastScanner in = new FastScanner(new InputStreamReader(System.in)); static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); final int mod = (int)1e9 + 7; int n; long a, b, s[]; int f[], g[], sum_f[], sum_g[]; void input() { n = in.nextInt(); a = in.nextLong(); b = in.nextLong(); s = new long[n + 1]; for(int i = 0; i < n; i++) s[i] = in.nextLong(); s[n] = Long.MAX_VALUE; f = new int[n + 1]; g = new int[n + 1]; sum_f = new int[n + 1]; sum_g = new int[n + 1]; } int addmod(int a, int b) { return (a + b) % mod; } void solve() { f[n - 1] = g[n - 1] = 1; sum_f[n - 1] = sum_g[n - 1] = 1; int l_f = n, r_f = n, l_g = n, r_g = n; for(int i = n - 2; i >= 0; i--) { while(l_f - 1 > i + 1 && s[l_f - 1] - s[i] >= a) l_f--; while(l_g - 1 > i + 1 && s[l_g - 1] - s[i] >= b) l_g--; if(s[i + 2] - s[i + 1] < b) r_f = i + 2; if(s[i + 2] - s[i + 1] < a) r_g = i + 2; if(l_f <= r_f) { f[i] = addmod(sum_g[l_f - 1], mod - sum_g[r_f]); } if(l_g <= r_g) { g[i] = addmod(sum_f[l_g - 1], mod - sum_f[r_g]); } sum_f[i] = addmod(f[i], sum_f[i + 1]); sum_g[i] = addmod(g[i], sum_g[i + 1]); } int ans = addmod(f[0], g[0]); for(int i = 1; i < n; i++) { if(s[i] - s[i - 1] < a) break; ans = addmod(ans, f[i]); } for(int i = 1; i < n; i++) { if(s[i] - s[i - 1] < b) break; ans = addmod(ans, g[i]); } out.println(ans); out.close(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~ a.cc:11:9: error: 'BufferedReader' does not name a type 11 | BufferedReader br; | ^~~~~~~~~~~~~~ a.cc:12:9: error: 'StringTokenizer' does not name a type 12 | StringTokenizer st; | ^~~~~~~~~~~~~~~ a.cc:13:15: error: expected ':' before 'FastScanner' 13 | public FastScanner(Reader in) { | ^~~~~~~~~~~~ | : a.cc:13:34: error: expected ')' before 'in' 13 | public FastScanner(Reader in) { | ~ ^~~ | ) a.cc:17:9: error: 'String' does not name a type 17 | String next() { | ^~~~~~ a.cc:37:9: error: 'String' does not name a type 37 | String readNextLine() { | ^~~~~~ a.cc:46:2: error: expected ';' after class definition 46 | } | ^ | ; a.cc: In member function 'int FastScanner::nextInt()': a.cc:29:24: error: 'Integer' was not declared in this scope 29 | return Integer.parseInt(next()); | ^~~~~~~ a.cc:29:41: error: 'next' was not declared in this scope; did you mean 'nextInt'? 29 | return Integer.parseInt(next()); | ^~~~ | nextInt a.cc: In member function 'long int FastScanner::nextLong()': a.cc:32:24: error: 'Long' was not declared in this scope; did you mean 'long'? 32 | return Long.parseLong(next()); | ^~~~ | long a.cc:32:39: error: 'next' was not declared in this scope; did you mean 'nextInt'? 32 | return Long.parseLong(next()); | ^~~~ | nextInt a.cc: In member function 'double FastScanner::nextDouble()': a.cc:35:24: error: 'Double' was not declared in this scope; did you mean 'double'? 35 | return Double.parseDouble(next()); | ^~~~~~ | double a.cc:35:43: error: 'next' was not declared in this scope; did you mean 'nextInt'? 35 | return Double.parseDouble(next()); | ^~~~ | nextInt a.cc: At global scope: a.cc:48:53: error: expected type-specifier before 'InputStreamReader' 48 | static FastScanner in = new FastScanner(new InputStreamReader(System.in)); | ^~~~~~~~~~~~~~~~~ a.cc:48:28: error: 'constexpr' needed for in-class initialization of static data member 'FastScanner Solver_agc009c::in' of non-integral type [-fpermissive] 48 | static FastScanner in = new FastScanner(new InputStreamReader(System.in)); | ^~ a.cc:48:81: error: non-constant in-class initialization invalid for non-inline static member 'Solver_agc009c::in' 48 | static FastScanner in = new FastScanner(new InputStreamReader(System.in)); | ^ a.cc:48:81: note: (an out of class initialization is required) a.cc:49:16: error: 'PrintWriter' does not name a type 49 | static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); | ^~~~~~~~~~~ a.cc:50:9: error: 'final' does not name a type 50 | final int mod = (int)1e9 + 7; | ^~~~~ a.cc:52:20: error: flexible array member 'Solver_agc009c::s' not at end of 'class Solver_agc009c' 52 | long a, b, s[]; | ^ a.cc:97:2: error: expected ';' after class definition 97 | } | ^ | ; a.cc: In member function 'void Solver_agc009c::input()': a.cc:58:17: error: invalid use of array with unspecified bounds 58 | s = new long[n + 1]; | ^ a.cc:60:24: error: 'Long' was not declared in this scope; did you mean 'long'? 60 | s[n] = Long.MAX_VALUE; | ^~~~ | long a.cc:61:17: error: invalid use of array with unspecified bounds 61 | f = new int[n + 1]; | ^ a.cc:62:17: error: invalid use of array with unspecified bounds 62 | g = new int[n + 1]; | ^ a.cc:63:17: error: invalid use of array with unspecified bounds 63 | sum_f = new int[n + 1]; | ^~~~~ a.cc:64:17: error: invalid use of array with unspecified bounds 64 | sum_g = new int[n + 1]; | ^~~~~ a.cc: In member function 'int Solver_agc009c::addmod(int, int)': a.cc:66:53: error: 'mod' was not declared in this scope 66 | int addmod(int a, int b) { return (a + b) % mod; } | ^~~ a.cc: In member function 'void Solver_agc009c::solve()': a.cc:77:63: error: 'mod' was not declared in this scope 77 | f[i] = addmod(sum_g[l_f - 1], mod - sum_g[r_f]); | ^~~ a.cc:80:63: error: 'mod' was not declared in this scope 80 | g[i] = addmod(sum_f[l_g - 1], mod - sum_f[r_g]); | ^~~ a.cc:94:17: error: 'out' was not declared in this scope 94 | out.println(ans); | ^~~
s013562618
p03823
C++
werwerwer
a.cc:1:1: error: 'werwerwer' does not name a type 1 | werwerwer | ^~~~~~~~~
s153493349
p03823
C++
#include<bits/stdc++.h> #define N 400005 #define P 1000000007 #define ll long long #define inf ((ll)1e18) using namespace std; int n;ll A,B,a[N]; struct seg { int val[N],tg[N]; void mdy(int x,int l,int r,int p) { tg[x]=p;val[x]=(ll)p*(r-l+1)%P; } void dn(int x,int l,int r) { if (tg[x]!=-1) { int mid=l+r>>1; mdy(x<<1,l,mid,tg[x]); mdy(x<<1|1,mid+1,r,tg[x]); tg[x]=-1; } } void up(int x) { val[x]=(val[x<<1]+val[x<<1|1])%P; } void mdy(int k,int l,int r,int x,int y,int p) { if (x<=l&&r<=y) { mdy(k,l,r,p); return; } int mid=l+r>>1;dn(k,l,r); if (x<=mid) mdy(k<<1,l,mid,x,y,p); if (y>mid) mdy(k<<1|1,mid+1,r,x,y,p); up(k); } void add(int k,int l,int r,int x,int p) { if (l==r) { val[k]=(val[k]+p)%P; return; } int mid=l+r>>1;dn(k,l,r); if (x<=mid) add(k<<1,l,mid,x,p); else add(k<<1|1,mid+1,r,x,p); up(k); } int qry(int k,int l,int r,int x,int y) { if (x<=l&&r<=y) return val[k]; int mid=l+r>>1,ans=0;dn(k,l,r) if (x<=mid) ans+=qry(k<<1,l,mid,x,y); if (y>mid) ans+=qry(k<<1|1,mid+1,r,x,y); return ans%P; } void mdy(int l,int r,int p) { mdy(1,0,n,l,r,p); } void add(int x,int y) { add(1,0,n,x,y); } int qry(int l,int r) { return qry(1,0,n,l,r); } }TA,TB; int main() { scanf("%lld%lld%lld",&n,&A,&B); TA.add(0,1); TB.add(0,1); a[0]=-inf; scanf("%lld",&a[1]); for (int i=2;i<=n;i++) { scanf("%lld",&a[i]); int t1=lower_bound(a+0,a+i,a[i]-A+1)-a-1,t2=lower_bound(a+0,a+i,a[i]-B+1)-a-1; int s1=TA.qry(0,t2),s2=TB.qry(0,t1); if (a[i-1]+A>a[i]) TA.mdy(0,n,0); if (a[i-1]+B>a[i]) TB.mdy(0,n,0); TA.add(i-1,s2);TB.add(i-1,s1); } printf("%lld\n",(TA.val[1]+TB.val[1])%P); }
a.cc: In member function 'int seg::qry(int, int, int, int, int)': a.cc:58:17: error: expected ';' before 'if' 58 | if (x<=mid) ans+=qry(k<<1,l,mid,x,y); | ^~
s051882921
p03823
C++
#include<bits/stdc++.h> using namespace std; typedef double db; typedef long long ll; #define w1 first #define w2 second #define ls (x<<1) #define rs (x<<1|1) #define pb push_back #define mid ((l+r)>>1) #define SZ(x) ((x).size()) #define All(x) (x).begin(),(x).end() #define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++) #define rep2(i,a,b) for(int (i)=(a);(i)<(b);(i)++) #define per(i,a,b) for(int (i)=(a);(i)>=(b);(i)--) #define Rep(p,x) for(int (p)=head[(x)];(p);(p)=nxt[(p)]) template<class T>void read(T&num){ num=0;T f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar(); num*=f; } int power(int x,int k,int p){int res=1;for(;k;k>>=1,x=1ll*x*x%p)if(k&1)res=1ll*res*x%p;return res;} const int maxn=1e5+5,mod=1e9+7; int n; ll A,B,x[maxn]; int sum[maxn<<2][2],tag[maxn<<2][2]; void M(int x,int l,int r,int num,int id){ tag[x][id]=num; sum[x][id]=1ll*num*(r-l+1)%mod; } void PD(int x,int l,int r){ rep(i,0,1)if(tag[x][i]!=-1){ M(ls,l,mid,tag[x][i],i); M(rs,mid+1,r,tag[x][i],i); tag[x][i]=-1; } } void U(int x){ rep(i,0,1)sum[x][i]=(sum[ls][i]+sum[rs][i])%mod; } void M(int x,int l,int r,int ll,int rr,int num,int id){ if(l==ll&&r==rr){ M(x,l,r,num,id); return; } PD(x,l,r); if(rr<=mid)M(ls,l,mid,ll,rr,num,id); else if(ll>mid)M(rs,mid+1,r,ll,rr,num,id); else M(ls,l,mid,ll,mid,num,id),M(rs,mid+1,r,mid+1,rr,num,id); U(x); } int Q(int x,int l,int r,int ll,int rr,int id){ if(l==ll&&r==rr)return sum[x][id]; PD(x,l,r); if(rr<=mid)return Q(ls,l,mid,ll,rr,id); else if(ll>mid)return Q(rs,mid+1,r,ll,rr,id); else return (Q(ls,l,mid,ll,mid,id)+Q(rs,mid+1,r,mid+1,rr,id))%mod; } int main(){ memset(tag,-1,sizeof tag); read(n); read(A);read(B); rep(i,1,n)read(x[i]); x[0]=-1e18; M(1,0,n,0,0,1,0); M(1,0,n,0,0,1,1); rep(i,1,n-1){ ll mind=x[i+1]-(B-1); int pos=min(i-1,lower_bound(x,x+n+1,mind)-x-1); M(1,0,n,i,i,Q(1,0,n,0,pos,0),1); if(x[i+1]-x[i]<A)M(1,0,n,0,i-1,0,0); mind=x[i+1]-(A-1); pos=min(i-1,lower_bound(x,x+n+1,mind)-x-1); M(1,0,n,i,i,Q(1,0,n,0,pos,1),0); if(x[i+1]-x[i]<B)M(1,0,n,0,i-1,0,1); } printf("%d\n",(Q(1,0,n,0,n-1,0)+Q(1,0,n,0,n-1,1))%mod); return 0; }
a.cc: In function 'int main()': a.cc:70:28: error: no matching function for call to 'min(int, long int)' 70 | int pos=min(i-1,lower_bound(x,x+n+1,mind)-x-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:70:28: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long int') 70 | int pos=min(i-1,lower_bound(x,x+n+1,mind)-x-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:70:28: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 70 | int pos=min(i-1,lower_bound(x,x+n+1,mind)-x-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:75:24: error: no matching function for call to 'min(int, long int)' 75 | pos=min(i-1,lower_bound(x,x+n+1,mind)-x-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:75:24: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long int') 75 | pos=min(i-1,lower_bound(x,x+n+1,mind)-x-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:75:24: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 75 | pos=min(i-1,lower_bound(x,x+n+1,mind)-x-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s710899793
p03823
C++
#include<cstdio> #include<algorithm> using namespace std; #define ll long long inline ll read() { ll x;char c; while((c=getchar())<'0'||c>'9'); for(x=c-'0';(c=getchar())>='0'&&c<='9';)x=x*10+c-'0'; return x; } #define MN 100000 #define MOD 1000000007 ll s[MN+5]; int l[MN+5],f[MN+5][2],S[MN+5]; inline int mod(int x){return x<MOD?x:x-MOD;} int main() { int n,i,x;ll a,b; n=read();a=read();b=read();if(a>b)swap(a,b); for(i=1;i<=n;++i)s[i]=read();s[0]=-1e18;s[++n]=2e18; for(l[1]=i=1;++i<n;)l[i]=s[i]-s[i-1]<a?i:l[i-1]; for(f[0][1]=S[0]=i=1;i<=n;++i) { if(s[i]-s[i-1]>=b)f[i][1]=mod(f[i-1][0]+f[i-1][1]); if(i>1) { x=min(i-2,upper_bound(s,s+n+1,s[i]-b)-s-1); if(l[i-1]-1<=x)f[i][0]=mod(S[x]+MOD-(l[i-1]-1>0?S[l[i-1]-2]:0)); } S[i]=mod(S[i-1]+mod((s[i+1]-s[i-1]>=a?f[i][0]:0)+f[i][1])); } printf("%d",mod(f[n][0]+f[n][1])); }
a.cc: In function 'int main()': a.cc:28:30: error: no matching function for call to 'min(int, long int)' 28 | x=min(i-2,upper_bound(s,s+n+1,s[i]-b)-s-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:28:30: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long int') 28 | x=min(i-2,upper_bound(s,s+n+1,s[i]-b)-s-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:28:30: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 28 | x=min(i-2,upper_bound(s,s+n+1,s[i]-b)-s-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s851538976
p03823
C++
#include<ctime> #include<iostream> #include<algorithm> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<cassert> #include<string> #include<sstream> #include<fstream> #include<deque> #include<queue> #include<vector> #include<map> #include<list> #include<stack> #include<set> #include<bitset> #include<iomanip> #include<utility> #include<functional> #include<cctype> #include<cerrno> #include<cfloat> #include<ciso646> #include<climits> #include<clocale> #include<complex> #include<csetjmp> #include<csignal> #include<cstdarg> #include<cstddef> #include<cwchar> #include<cwctype> #include<exception> #include<locale> #include<numeric> #include<new> #include<stdexcept> #include<limits> using namespace std; #define ll long long #define INF 1e9 #define rep(i,n) for(int (i)=0;(i)<n;i++) #define REP(i,n) for(int (i)=1;(i)<=n;i++) #define mk(a,b) make_pair(a,b) #define fi first #define se second #define pii pair<int,int> #define sz(s) s.size() #define all(s) (s.begin(),s.end()) const int maxn=100005; const int mod=1e9+7; int n,A[2]; int s[maxn]; int tree[maxn*4][2],tag[maxn*4][2]; int next[maxn][2]; void Push(int node,int set){ if(tag[node][set]){ tree[node][set]=(tree[node][set]+tag[node][set])%mod; tag[node*2][set]=(tag[node*2][set]+tag[node][set])%mod; tag[node*2+1][set]=(tag[node*2+1][set]+tag[node][set])%mod; tag[node][set]=0; } } void Pull(int node,int set){ tree[node][set]=(tree[node][set]+tree[node*2][set])%mod; tree[node][set]=(tree[node][set]+tree[node*2+1][set])%mod; } void update(int l,int r,int vl,int vr,int node,int val,int set){ if(vl>vr)return; if(l>vr||r<vl)return; if(l>=vl&&r<=vr){ tag[node][set]=(tag[node][set]+val)%mod; Push(node,set); return; } Push(node,set); int mid=(l+r)>>1; update(l,mid,vl,vr,node*2,val,set); update(mid+1,r,vl,vr,node*2+1,val,set); Pull(node,set); } int query(int l,int r,int vl,int vr,int node,int set){ if(l>vr||r<vl)return 0; if(l>=vl&&r<=vr)return (tree[node][set]+tag[node][set])%mod; Push(node,set); int mid=(l+r)>>1; return (query(l,mid,vl,vr,node*2,set)+query(mid+1,r,vl,vr,node*2+1,set))%mod; } int main(){ ios::sync_with_stdio(false); cin>>n>>A[0]>>A[1]; rep(i,n)cin>>s[i]; next[n-1][0]=next[n-1][1]=n-1; for(int i=n-2;i>=0;i--){ rep(j,2){ if(s[i+1]-s[i]>=A[j])next[i][j]=next[i+1][j]; else next[i][j]=i; } } rep(i,2)update(0,n-1,0,0,1,1,i); rep(i,n){ rep(j,2){ int cur=query(0,n-1,i,i,1,j); int low=lower_bound(s,s+n,s[i]+A[j])-s; int high=next[i+1][j^1]; // cout<<i<<" "<<j<<" "<<cur<<endl; update(0,n-1,max(low-1,i+1),high,1,cur,j^1); // cout<<"update:"<<(j^1)<<" "<<max(low-1,i+1)<<" "<<high<<endl; // update(0,n-1,max(low,i+2),min(high+1,n-1),1,cur,j); // cout<<"update:"<<j<<" "<<max(low,i+2)<<" "<<min(high+1,n-1)<<endl; } } cout<<(query(0,n-1,n-1,n-1,1,0)+query(0,n-1,n-1,n-1,1,1))%mod; return 0; }
a.cc: In function 'int main()': a.cc:103:9: error: reference to 'next' is ambiguous 103 | next[n-1][0]=next[n-1][1]=n-1; | ^~~~ In file included from /usr/include/c++/14/string:47, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:60:5: note: 'int next [100005][2]' 60 | int next[maxn][2]; | ^~~~ a.cc:103:22: error: reference to 'next' is ambiguous 103 | next[n-1][0]=next[n-1][1]=n-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:60:5: note: 'int next [100005][2]' 60 | int next[maxn][2]; | ^~~~ a.cc:106:46: error: reference to 'next' is ambiguous 106 | if(s[i+1]-s[i]>=A[j])next[i][j]=next[i+1][j]; | ^~~~ /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:60:5: note: 'int next [100005][2]' 60 | int next[maxn][2]; | ^~~~ a.cc:106:57: error: reference to 'next' is ambiguous 106 | if(s[i+1]-s[i]>=A[j])next[i][j]=next[i+1][j]; | ^~~~ /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:60:5: note: 'int next [100005][2]' 60 | int next[maxn][2]; | ^~~~ a.cc:107:30: error: reference to 'next' is ambiguous 107 | else next[i][j]=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:60:5: note: 'int next [100005][2]' 60 | int next[maxn][2]; | ^~~~ a.cc:115:34: error: reference to 'next' is ambiguous 115 | int high=next[i+1][j^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:60:5: note: 'int next [100005][2]' 60 | int next[maxn][2]; | ^~~~
s509265724
p03823
C++
#include <cstdio> #include <cstring> #include <vector> #include <queue> #include <string> #include <algorithm> #include <iostream> #include <string> #include <map> #include <set> #include <functional> #include <iostream> #define INF 1000000007LL using namespace std; typedef long long ll; typedef pair<int,int> P; int n,n_; ll a,b; ll s[100001]; ll dp[150001][2]; ll dat[1<<20]; void add(int k,ll a){ k+=n_-1; dat[k]=a; while(k>0){ k=(k-1)/2; dat[k]=min(dat[k*2+1],dat[k*2+2]); } } ll query(ll a,ll b,int k=0,int l=0,int r=n_){ if(b<=l || r<=a)return INF*INF; if(a<=l && r<=b)return dat[k]; ll vl=query(a,b,k*2+1,l,(l+r)/2); ll vr=query(a,b,k*2+2,(l+r)/2,r); return min(vl,vr); } ll func(int v,int prev){ if(dp[v][prev]!=-1)return dp[v][prev]; if(v>=n)return 1LL; ll res=0; if(v==0){ res=func(1,0); int nexa=lower_bound(s,s+n,s[v]+b)-s; if(nexa==v+1){ res+=func(v+1,1); }else if(nexa==v+2){ res+=func(v+2,0); }else if(query(v+1,nexa-1)>=a){ res+=func(nexa,0); } }else{ if(prev==0){ if(s[v-1]+a<=s[v]){ res=func(v+1,0); } int nexa=lower_bound(s,s+n,s[v]+b)-s; bool flag2=true; if(v!=n-1){ if(nexa!=v+1 && s[v-1]+a>s[v+1]){ flag2=false; } } if(nexa==v+1){ res+=func(v+1,1); }else if(nexa==v+2){ if(flag2)res+=func(v+2,0); }else if(query(v+1,nexa-1)>=a){ if(flag2)res+=func(nexa,0); } }else{ if(s[v-1]+b<=s[v]){ res=func(v+1,1); } res+=func(v+1,0); } } return (dp[v][prev]=(res%MOD)); } bool flag[100001]; int main(void){ scanf("%d%lld%lld",&n,&a,&b); if(n==1){ printf("1\n"); return 0; } n_=1; while(n_<n)n_*=2; if(a>b)swap(a,b); for(int i=0;i<n;i++){ scanf("%lld",&s[i]); } for(int i=0;i<n-1;i++){ add(i,s[i+1]-s[i]); } memset(dp,-1,sizeof(dp)); printf("%lld\n",func(0,0)); return 0; }
a.cc: In function 'll func(int, int)': a.cc:81:34: error: 'MOD' was not declared in this scope 81 | return (dp[v][prev]=(res%MOD)); | ^~~
s713076438
p03823
C
#include <stdio.h> int dp[2][200000 + 3]; int c[100000 + 1]; static inline int fg(int i, int j){ return (i < j) ? i : i+j ; } int main() { int n; int a; int b; scanf("%d", &n); scanf("%d", &a); scanf("%d", &b); int min_diff = (a<b)? b+1 : a+1; scanf("%d", &c[0]); for(int i=1; i<n; i++){ scanf("%d", &c[i]); if (c[i]-c[i-1]<mindiff) mindiff=c[i]-c[i-1]; //min_diff = (c[i] - c[i-1] > min_diff) ? min_diff :c[i]-c[i-1]; } //printf("%d\n", min_diff); dp[1][0]=1; dp[1][1]=1; for(int i=1; i<=n-2; i++){ for(int j=0; j<=i-1; j++){ int ij = dp[i%2][fg(i,j)]%1000000007; int ji = dp[i%2][fg(j,i)]%1000000007; if(c[i+1] - c[i] >= a) dp[(i+1)%2][fg(i+1,j)] += ij;// if c[i+1] - c[i] >= a if(c[i+1] - c[j] >= b) dp[(i+1)%2][fg(i,i+1)] += ij; if(c[i+1] - c[i] >= b) dp[(i+1)%2][fg(j,i+1)] += ji; if(c[i+1] - c[j] >= a) dp[(i+1)%2][fg(i+1,i)] += ji; dp[i%2][fg(i,j)]=0; dp[i%2][fg(j,i)]=0; } } int sum = 0; if(min_diff>=a)sum += 1; if(min_diff>=b)sum += 1; //sum += 1 if c.each_cons(2).map{|k| (k[1]-k[0]) >= a[1]}.all?#(TRUE) //sum += 1 if c.each_cons(2).map{|k| (k[1]-k[0]) >= a[2]}.all?#(TRUE) for(int j=0;j<2*n-1;j++){ sum += dp[(n-1)%2][j] % 1000000007; //printf("%d %d\n",j, dp[(n-1)%2][j]); //sum += dp[(n-1)%2][j]; } printf("%d\n", sum); }
main.c: In function 'main': main.c:20:21: error: 'mindiff' undeclared (first use in this function); did you mean 'min_diff'? 20 | if (c[i]-c[i-1]<mindiff) mindiff=c[i]-c[i-1]; | ^~~~~~~ | min_diff main.c:20:21: note: each undeclared identifier is reported only once for each function it appears in
s267518268
p03823
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <vector> #include <string> #include <queue> #include <deque> #include <list> #include <stack> #include <set> #include <map> #include <unordered_map> #include <algorithm> #define int long long #define MOD7 1000000007 #define MOD9 1000000009 #define MOD MOD7 #define rep(i, n) for (int i = 0; i < (n); i++) #define REP(i, a, n) for (int i = (a); i <= (n); i++) #define all(a) (a).begin(), (a).end() #define mp make_pair #define MINF -1000000000000000000 using namespace std; int dx[4] = { 1, 0, -1, 0 }; int dy[4] = { 0, -1, 0, 1 }; int nextInt() {int a; cin >> a; return a;} char nextChar() {char a; cin >> a; return a;} double nextDouble() {double a; cin >> a; return a;} string nextString() {string a; cin >> a; return a;} template<class T> void inputVector(vector<T>& v, int n) { v.resize(n); for (int i = 0; i < v.size(); i++) cin >> v[i]; } int dp[100010]; signed main() { int N, A, B; cin >> N >> A >> B; swap(A, B); vector<int> S; inputVector(S, N); rep(i, N - 2) { if (S[i + 2] - S[i] < B) { cout << 0 << endl; return 0; } } S.insert(S.begin(), -1000000000000000001); int dp[0] = 1; int pt = 0, pt2 = 0;; int sum = 1; int ret = 0; rep(ti, N) { int i = ti + 1; if (S[i] - S[i - 1] >= A) { dp[i] = sum; while (i < N && pt2 <= i && S[pt2 + 1] - S[pt2] >= B) { sum += S[pt2]; sum %= MOD; pt2++; if (pt2 == N) break; } } else { while (pt < i) { sum -= S[pt]; sum += MOD; sum %= MOD; pt++; } pt2 = i; dp[i] = dp[i - 1]; } } return 0; }
a.cc: In function 'int main()': a.cc:64:17: error: array must be initialized with a brace-enclosed initializer 64 | int dp[0] = 1; | ^
s599700350
p03823
C++
#define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) typedef long long LL; int N; LL A,B; LL S[100002]; LL dp[100002]; LL MOD=1000000007; const int MAX_N=10001; int bit[MAX_N+1]; int sum(int i){ int s=0; while(i>0){ s+=bit[i]; i-=i&-i; } return s; } void add(int i,int x){ while(i<=N+1){ bit[i]+=x; i+=i&-i; } } int main(){ REP(i,100002){ dp[i]=0; } dp[0]=1; cin>>N; cin>>A>>B; if(A>B){ LL temp=A; A=B; B=temp; } S[0]=-10000000000; REP(i,N){ cin>>S[i+1]; } //A+S[i]>S[i+2]は解なし REP(i,N-1){ if(A+S[i]>S[i+2]){ cout<<0<<endl; return 0; } } int p=0; int s0=0; add(1,1); REP(i,N){ //S[i+1]をyに振り分ける時 int pp=((upper_bound(S,S+N+1,S[i+1]-B))-S); //cout<<pp<<endl; //REP(j,pp){ // dp[i+1]+=dp[j]; //} dp[i+1]=sum(pp); add(i+1+1,dp[i+1]); //S[i+1]をxに振り分ける時 if(S[i+1]-S[i]<A){ //cout<<"aaa"<<endl; for(int j=s0;j<=i-1;j++){ add(j+1,-dp[j]); dp[j]=0; } s0=i-1; } //REP(j,i+2){ // cout<<dp[j]<<endl; //} //cout<<endl; } LL ans=0; REP(i,N+1){ ans+=dp[i]; } cout<<ans<<endl; return(0); }
a.cc: In function 'int main()': a.cc:35:9: error: 'cin' was not declared in this scope 35 | cin>>N; | ^~~ a.cc:49:16: error: 'cout' was not declared in this scope 49 | cout<<0<<endl; | ^~~~ a.cc:49:25: error: 'endl' was not declared in this scope 49 | cout<<0<<endl; | ^~~~ a.cc:59:21: error: 'upper_bound' was not declared in this scope 59 | int pp=((upper_bound(S,S+N+1,S[i+1]-B))-S); | ^~~~~~~~~~~ a.cc:84:9: error: 'cout' was not declared in this scope 84 | cout<<ans<<endl; | ^~~~ a.cc:84:20: error: 'endl' was not declared in this scope 84 | cout<<ans<<endl; | ^~~~
s469745065
p03823
C++
#include <bits/stdc++.h> #define pii pair <int, int> #define ll long long #define f first #define s second #define pb push_back using namespace std; const int N = 1e5 + 5; ll d[3][N]; ll p[N]; int main() { ll n, a, b; cin >> n >> a >> b; for (int i = 1; i <= n; ++i) { scanf("%lld", &p[i]); } sort(p + 1, p + n + 1); int la, ra, lb, rb; la = ra = lb = rb = 0; d[1][1] = 1; d[2][1] = 1; d[1][0] = d[2][0] = 1; p[0] = -2e18; for (int i = 2; i <= n; ++i) { while (p[i] - p[ra + 1] >= a) ra++; while (p[i] - p[rb + 1] >= b) rb++; if (la <= ra) { if (ra == i - 1) d[1][i] = d[1][i - 1] + d[2][i - 1]; else d[1][i] = d[2][ra + 1]; } if (lb <= rb) { if (rb == i - 1) d[2][i] = d[2][i - 1] + d[1][i - 1]; else d[2][i] = d[1][rb + 1]; } d[1][i] %= int(1e9) + 7; d[2][i] %= int(1e9) + 7; if (p[i] - p[i - 1] < b) { la = i - 1; } if (p[i] - p[i - 1] < a) { lb = i - 1; } } cout << (d[1][n] + d[2][n]) %= (int(1e9) + 7) << endl; return 0; }
a.cc: In function 'int main()': a.cc:54:51: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 54 | cout << (d[1][n] + d[2][n]) %= (int(1e9) + 7) << endl; | ~~~~~~~~~~~~~~~^~~~~~~
s442753795
p03823
C++
8 2 9 3 4 5 13 15 22 26 32
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 8 2 9 | ^
s461696791
p03823
C++
#include <iostream> #include <vector> #include <algorithm> #include <cstdlib> using namespace std; const int mod = 1e9 + 7; void upd(int &a, int b) { a += b; if (a >= mod) a -= mod; } int main() { int n; long long A, B; cin >> n >> A >> B; vector<long long> a(n); for (int i = 0; i < n; i++) { scanf("%lld", &a[i]); } if (n == 1) { cout << 2 << endl; return 0; } static int dp0[2][4]; static int dp1[2][4]; dp0[a[1] - a[0] < A][0]++; dp0[0][1]++; dp0[0][2]++; dp0[a[1] - a[0] < B][3]++; for (int i = 2; i < n; i++) { memset(dp1, 0, sizeof(dp1)); for (int j = 0; j < 2; j++) { // AAA upd(dp1[j || a[i] - a[i - 1] < A][0], dp0[j][0]); // AAB upd(dp1[j][1], dp0[j][0]); // ABA upd(dp1[j || a[i] - a[i - 2] < A][2], dp0[j][1]); // ABB upd(dp1[j || a[i] - a[i - 1] < B][3], dp0[j][1]); // BAA upd(dp1[j || a[i] - a[i - 1] < A][0], dp0[j][2]); // BAB upd(dp1[j || a[i] - a[i - 2] < B][1], dp0[j][2]); // BBA upd(dp1[j][2], dp0[j][3]); // BBB upd(dp1[j || a[i] - a[i - 1] < B][3], dp0[j][3]); } swap(dp0, dp1); } int ans = 0; for (int k = 0; k < 4; k++) { upd(ans, dp0[0][k]); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:33:17: error: 'memset' was not declared in this scope 33 | memset(dp1, 0, sizeof(dp1)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <cstdlib> +++ |+#include <cstring> 5 | using namespace std;
s119929640
p03823
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; const int mod = 1e9 + 7; void upd(int &a, int b) { a += b; if (a >= mod) a -= mod; } int main() { int n; long long A, B; cin >> n >> A >> B; vector<long long> a(n); for (int i = 0; i < n; i++) { scanf("%lld", &a[i]); } if (n == 1) { cout << 2 << endl; return 0; } static int dp0[2][4]; static int dp1[2][4]; dp0[a[1] - a[0] < A][0]++; dp0[0][1]++; dp0[0][2]++; dp0[a[1] - a[0] < B][3]++; for (int i = 2; i < n; i++) { memset(dp1, 0, sizeof(dp1)); for (int j = 0; j < 2; j++) { // AAA upd(dp1[j || a[i] - a[i - 1] < A][0], dp0[j][0]); // AAB upd(dp1[j][1], dp0[j][0]); // ABA upd(dp1[j || a[i] - a[i - 2] < A][2], dp0[j][1]); // ABB upd(dp1[j || a[i] - a[i - 1] < B][3], dp0[j][1]); // BAA upd(dp1[j || a[i] - a[i - 1] < A][0], dp0[j][2]); // BAB upd(dp1[j || a[i] - a[i - 2] < B][1], dp0[j][2]); // BBA upd(dp1[j][2], dp0[j][3]); // BBB upd(dp1[j || a[i] - a[i - 1] < B][3], dp0[j][3]); } swap(dp0, dp1); } int ans = 0; for (int k = 0; k < 4; k++) { upd(ans, dp0[0][k]); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:32:17: error: 'memset' was not declared in this scope 32 | memset(dp1, 0, sizeof(dp1)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 | using namespace std;
s316916884
p03823
C++
#include<bits/stdc++.h> using namespace std; typedef long long int64; const int mod = 1e9 + 7; struct BinaryIndexedTree { vector< int > data; BinaryIndexedTree(int sz) { data.assign(++sz, 0); } int sum(int k) { int ret = 0; for(++k; k > 0; k -= k & -k) (ret += data[k]) %= mod; return (ret); } void add(int k, int x) { for(++k; k < data.size(); k += k & -k) (data[k] += x) %= mod; } int get(int k) { return ((sum(k) - sum(k - 1) + mod) % mod); } }; int main() { int64 N, A, B, X[100000]; int64 AA[100000], BB[100000]; cin >> N >> A >> B; for(int i = 0; i < N; i++) { cin >> X[i]; AA[i] = upper_bound(X, X + i + 1, X[i] - A) - X; BB[i] = upper_bound(X, X + i + 1, X[i] - B) - X; } BinaryIndexedTree dp1(N), dp2(N); dp1.add(0, 1); dp2.add(0, 1); int aa = 0, bb = 0; for(int i = 1; i < N; i++) { dp1.add(i, dp2.sum(AA[i])); dp2.add(i, dp1.sum(BB[i])); if(X[i] - X[i - 1] < A) for(; aa<i; aa++) dp1.add(aa, mod - dp1.get(aa)); if(X[i] - X[i - 1] < B) for(; bb<j; bb++) dp2.add(bb, mod - dp2.get(bb)); } cout << (dp1.sum(N - 1) + dp2.sum(N - 1)) % mod << endl; }
a.cc: In function 'int main()': a.cc:59:16: error: 'j' was not declared in this scope 59 | for(; bb<j; bb++) dp2.add(bb, mod - dp2.get(bb)); | ^
s383410921
p03823
C++
#include <iostream> #include <fstream> #include <cstdio> #include <cmath> #include <vector> #include <cstring> #include <string> #include <set> #include <map> #include <stack> #include <queue> #include <algorithm> using namespace std; #define REP(i,n) for(int i=0; i<n; ++i) #define FOR(i,a,b) for(int i=a; i<=b; ++i) #define FORR(i,a,b) for (int i=a; i>=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector<int> VI; typedef vector<ll> VL; typedef vector<VI> VVI; typedef pair<int,int> P; typedef pair<ll,ll> PL; #define mod 1000000007 const int MAX_N = 100010; int n, width; ll data[MAX_N*4], datb[MAX_N*4]; void init(ll *dat){ width = 1; while(width<n) width*=2; REP(i,2*width-1) dat[i] = 0; } void update(int i, int x, ll *dat){ i += width-1; dat[i] = x; while (i>0){ i = (i-1)/2; dat[i] = (dat[i*2+1] + dat[i*2+2]) % mod; } } ll query(int a, int b, int k, int l, int r, ll *dat){ if (r<=a || b<=l) return 0; if (a<=l && r<=b) return dat[k]; ll vl = query(a,b,k*2+1,l,(l+r)/2,dat); ll vr = query(a,b,k*2+2,(l+r)/2,r,dat); return (vl + vr) % mod; } ll dpa[100001], dpb[100001]; int main() { ll a, b; cin >> n >> a >> b; VL s(n+1); s[0] = -mod; REP(i,n) scanf("%lld", &s[i+1]); init(data); init(datb); update(0,1,data); update(0,1,datb); int la = 0, lb = 0; FOR(i,1,n-1){ int ra = min(i, lower_bound(ALL(s), s[i+1] - b + 1) - s.begin()); int rb = min(i, lower_bound(ALL(s), s[i+1] - a + 1) - s.begin()); dpb[i] = query(la, ra, 0, 0, width, data); dpa[i] = query(lb, rb, 0, 0, width, datb); update(i,dpa[i],data); update(i,dpb[i],datb); if (s[i+1] - s[i] < a) la = i; if (s[i+1] - s[i] < b) lb = i; } ll ans = 0; FOR(i,la,n-1) ans = (ans + dpa[i]) % mod; FOR(i,lb,n-1) ans = (ans + dpb[i]) % mod; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:66:10: error: reference to 'data' is ambiguous 66 | init(data); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:32:4: note: 'll data [400040]' 32 | ll data[MAX_N*4], datb[MAX_N*4]; | ^~~~ a.cc:68:16: error: reference to 'data' is ambiguous 68 | update(0,1,data); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:32:4: note: 'll data [400040]' 32 | ll data[MAX_N*4], datb[MAX_N*4]; | ^~~~ a.cc:72:21: error: no matching function for call to 'min(int&, __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type)' 72 | int ra = min(i, lower_bound(ALL(s), s[i+1] - b + 1) - s.begin()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:72:21: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type' {aka 'long int'}) 72 | int ra = min(i, lower_bound(ALL(s), s[i+1] - b + 1) - s.begin()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:12: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:72:21: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 72 | int ra = min(i, lower_bound(ALL(s), s[i+1] - b + 1) - s.begin()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:73:21: error: no matching function for call to 'min(int&, __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type)' 73 | int rb = min(i, lower_bound(ALL(s), s[i+1] - a + 1) - s.begin()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:73:21: note: deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type' {aka 'long int'}) 73 | int rb = min(i, lower_bound(ALL(s), s[i+1] - a + 1) - s.begin()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:73:21: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 73 | int rb = min(i, lower_bound(ALL(s), s[i+1] - a + 1) - s.begin()); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:74:45: error: reference to 'data' is ambiguous 74 | dpb[i] = query(la, ra, 0, 0, width, data); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:32:4: note: 'll data [400040]' 32 | ll data[MAX_N*4], datb[MAX_N*4]; | ^~~~ a.cc:76:25: error: reference to 'data' is ambiguous 76 | update(i,dpa[i],data); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:32:4: note: 'll data [400040]' 32 | ll data[MAX_N*4], datb[MAX_N*4]; | ^~~~
s286974065
p03823
C++
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- int N; ll A,B,S[101010]; ll mo=1000000007; template<class V, int ME> class BIT { public: V bit[1<<ME],val[1<<ME]; V total(int e) {V s=0;e++;while(e) s+=bit[e-1],e-=e&-e; return s;} V add(int e,V v) { val[e++]+=v; while(e<=1<<ME) bit[e-1]+=v,e+=e&-e;} V set(int e,V v) { add(e,v-val[e]);} }; BIT<ll,20> BTA,BTB; vector<int> VA,VB; void solve() { int i,j,k,l,r,x,y; string s; cin>>N>>A>>B; S[0]=-1LL<<60; cin>>S[1]; int LA=0,LB=0; BTA.add(0,1); BTB.add(0,1); VA.push_back(0); VB.push_back(0); for(i=2;i<=N;i++) { cin>>S[i]; while(LA<i-2&&S[i]-S[LA+1]>=A) LA++; while(LB<i-2&&S[i]-S[LB+1]>=B) LB++; BTA.add(i-1,BTA.total(LA)%mo); BTB.add(i-1,BTB.total(LB)%mo); if(S[i]<S[i-1]+A) { FORR(r,VB) BTB.set(r,0); VB.clear(); } if(S[i]<S[i-1]+B) { FORR(r,VA) BTA.set(r,0); VA.clear(); } VA.push_back(i-1); VB.push_back(i-1); } ll ret=0; FOR(i,N+1) ret+=TA[i]+TB[i]; cout<<ret%mo<<endl; } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false), cin.tie(0); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); solve(); return 0; }
a.cc: In function 'void solve()': a.cc:65:25: error: 'TA' was not declared in this scope; did you mean 'LA'? 65 | FOR(i,N+1) ret+=TA[i]+TB[i]; | ^~ | LA a.cc:65:31: error: 'TB' was not declared in this scope; did you mean 'LB'? 65 | FOR(i,N+1) ret+=TA[i]+TB[i]; | ^~ | LB a.cc: In instantiation of 'V BIT<V, ME>::add(int, V) [with V = long long int; int ME = 20]': a.cc:39:9: required from here 39 | BTA.add(0,1); | ~~~~~~~^~~~~ a.cc:23:77: warning: no return statement in function returning non-void [-Wreturn-type] 23 | V add(int e,V v) { val[e++]+=v; while(e<=1<<ME) bit[e-1]+=v,e+=e&-e;} | ^ a.cc: In instantiation of 'V BIT<V, ME>::set(int, V) [with V = long long int; int ME = 20]': a.cc:53:22: required from here 53 | FORR(r,VB) BTB.set(r,0); | ~~~~~~~^~~~~ a.cc:24:44: warning: no return statement in function returning non-void [-Wreturn-type] 24 | V set(int e,V v) { add(e,v-val[e]);} | ^
s477234902
p03823
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,a) FOR(i,0,a) typedef long long ll; const int MAX_N=1e5,MOD=1e9+7; const ll INF=(1e18)+4; int N; ll A[2]; ll S[MAX_N]; ll memo[MAX_N]; int next[MAX_N][2]; ll diff[MAX_N]; int st_size; ll dat[MAX_N*4]; void init(){ st_size=1; while(st_size<N-1) st_size<<=1; REP(i,st_size){ dat[i+st_size-1]=INF; } REP(i,N-1){ dat[i+st_size-1]=diff[i]; } for(int i=st_size-2;i>=0;i--){ dat[i]=min(dat[i*2],dat[i*2+1]); } } ll query(int s,int t,int k,int a,int b){ if (s<=a && b<=t){ return dat[k]; }else if (t<=a || b<=s){ return INF; }else{ int m=(a+b)/2; return min(query(s,t,k*2+1,a,m),query(s,t,k*2+2,m,b)); } } int dfs(int n){ if (n==N){ return 1; } if (memo[n]!=-1){ return memo[n]; } int res=0; REP(g,2){ int ne=next[n][g]; if (ne!=-1){ res+=dfs(ne); res%=MOD; } } return res; } int main(){ cin>>N; REP(i,2) cin>>A[i]; REP(i,N){ cin>>S[i]; } REP(i,N-1){ diff[i]=S[i+1]-S[i]; } init(); for(int n=N-1;n>=0;n--){ REP(g,2){ int lb=lower_bound(S,S+N,S[n]+A[g])-S; if (n+1<lb-1){ int mdiff=query(n+1,lb-1,0,0,st_size); if (mdiff<A[(g+1)%2]){ next[n][g]=-1; continue; } } if (lb==N){ next[n][g]=N; continue; } int s=S[lb]; if (n+1==lb){ next[n][g]=n+1; continue; } if (S[lb-1]+A[(g+1)%2]<=s){ next[n][g]=lb; }else{ next[n][g]=next[lb-1][(g+1)%2]; } } } memset(memo,-1,sizeof(memo)); printf("%d\n",dfs(0)); return 0; }
a.cc: In function 'int dfs(int)': a.cc:54:24: error: reference to 'next' is ambiguous 54 | int ne=next[n][g]; | ^~~~ 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:14:5: note: 'int next [100000][2]' 14 | int next[MAX_N][2]; | ^~~~ a.cc: In function 'int main()': a.cc:79:41: error: reference to 'next' is ambiguous 79 | next[n][g]=-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:14:5: note: 'int next [100000][2]' 14 | int next[MAX_N][2]; | ^~~~ a.cc:84:33: error: reference to 'next' is ambiguous 84 | next[n][g]=N; | ^~~~ /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:14:5: note: 'int next [100000][2]' 14 | int next[MAX_N][2]; | ^~~~ a.cc:89:33: error: reference to 'next' is ambiguous 89 | next[n][g]=n+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:14:5: note: 'int next [100000][2]' 14 | int next[MAX_N][2]; | ^~~~ a.cc:93:33: error: reference to 'next' is ambiguous 93 | next[n][g]=lb; | ^~~~ /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:14:5: note: 'int next [100000][2]' 14 | int next[MAX_N][2]; | ^~~~ a.cc:95:33: error: reference to 'next' is ambiguous 95 | next[n][g]=next[lb-1][(g+1)%2]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:14:5: note: 'int next [100000][2]' 14 | int next[MAX_N][2]; | ^~~~ a.cc:95:44: error: reference to 'next' is ambiguous 95 | next[n][g]=next[lb-1][(g+1)%2]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:14:5: note: 'int next [100000][2]' 14 | int next[MAX_N][2]; | ^~~~
s742569475
p03823
C++
// Template {{{ #include <bits/stdc++.h> #define REP(i,n) for(int i=0; i<(int)(n); ++i) using namespace std; typedef long long LL; #ifdef LOCAL #include "contest.h" #else #define error(args...) #endif const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; inline bool valid(int x, int w) { return 0 <= x && x < w; } void iostream_init() { ios::sync_with_stdio(false); cin.tie(0); cout.setf(ios::fixed); cout.precision(12); } //}}} // ModInt (ref. anta) {{{ template<int MOD> struct ModInt{ static const int Mod = MOD; unsigned val; ModInt():val(0){} ModInt(unsigned x):val(x%MOD){} ModInt(signed x) { int y = x % MOD; if(y < 0) y += MOD; val = y; } ModInt(signed long long x) { int y = (int)(x % MOD); if(y < 0) y += MOD; val = y; } ModInt &operator+=(ModInt rhs) { val += rhs.val; if(val >= MOD) val -= MOD; return *this; } ModInt &operator-=(ModInt rhs) { val += MOD - rhs.val; if(val >= MOD) val -= MOD; return *this; } ModInt &operator*=(ModInt rhs) { val = (unsigned)((unsigned long long)val * rhs.val % MOD); return *this; } ModInt &operator/=(ModInt rhs) { return *this *= rhs.inv(); } ModInt inv() const { signed a = val, b = MOD, u = 1, v = 0; while(b) { signed t = a / b; a -= t * b; std::swap(a, b); u -= t * v; std::swap(u, v); } if(u < 0) u += MOD; ModInt res; res.val = u; return res; } ModInt operator+(ModInt rhs) const { return ModInt(*this) += rhs; } ModInt operator-(ModInt rhs) const { return ModInt(*this) -= rhs; } ModInt operator*(ModInt rhs) const { return ModInt(*this) *= rhs; } ModInt operator/(ModInt rhs) const { return ModInt(*this) /= rhs; } // compare bool operator==(ModInt rhs) const { return val == rhs.val; } bool operator!=(ModInt rhs) const { return val != rhs.val; } bool operator< (ModInt rhs) const { return val < rhs.val; } bool operator<=(ModInt rhs) const { return val <= rhs.val; } bool operator> (ModInt rhs) const { return val > rhs.val; } bool operator>=(ModInt rhs) const { return val >= rhs.val; } }; template<int MOD> ostream& operator << (ostream& os, const ModInt<MOD> m) { return os << m.val; } template<int MOD, typename T> ModInt<MOD> pow(ModInt<MOD> a, T b) { if(b == 0) { return 1; } else { auto w = pow(a*a, b/2); if(b&1) w *= a; return w; } } // }}} typedef ModInt<1000000007> mint; // {{{ template<typename T, typename Comp=less<T>> class SparseTable{ private: Comp comp; int N, K; vector<T> value; vector<vector<int>> idx; inline int log2(int x) { return 31 - __builtin_clz(x); } public: SparseTable(const vector<T>& v) : value(v) { N = (int)v.size(); K = log2(N) + 1; idx.resize(K); idx[0].resize(N); REP(i, N) idx[0][i] = i; for(int log = 0; log+1 < K; log++) { const int L = N+1 - (1<<(log+1)); idx[log+1].resize(L); for(int i = 0; i < L; i++) { const int p = idx[log][i]; const int q = idx[log][i+(1<<log)]; idx[log+1][i] = (comp(v[p], v[q]) ? p : q); } } } // return index of minimum/maximum value in v[b], ..., v[e-1] int query_idx(int b, int e) { const int log = log2(e-b); const int p = idx[log][b]; const int q = idx[log][e-(1<<log)]; return (comp(value[p], value[q]) ? p : q); } // return minimum/maximum value in v[b], ..., v[e-1] T query(int b, int e) { assert(b >= 0); b = max(0, b); assert(e <= N); e = min(N, e); if(e - b <= 0) return LLONG_MAX; // only this code return value[query_idx(b, e)]; } }; // }}} #define int long long // {{{ struct AddMinimum { typedef long long T; static constexpr T INF = 1LL<<60; int M; vector<T> part, data; AddMinimum(int N=1): M(2<<__lg(max(1, N))), part(2*M), data(2*M) {} AddMinimum(const vector<T> &A): M(2<<__lg(max(1, (int)A.size()))), part(2*M), data(2*M) { for (int i=0; i<(int)A.size(); i++) data[i+M] = A[i]; for (int i=M; --i;) data[i] = min(data[2*i], data[2*i+1]); } void add(int x, int y, const T &v) { add(x, y, 1, 0, M, v); } T add(int x, int y, int k, int l, int r, const T &v) { if (x <= l && r <= y) return (part[k] += v) + data[k]; if (y <= l || r <= x) return part[k] + data[k]; return part[k] + (data[k] = min(add(x, y, k*2, l, (l+r)/2, v), add(x, y, k*2+1, (l+r)/2, r, v))); } T minimum(int x, int y) { return minimum(x, y, 1, 0, M); } T minimum(int x, int y, int k, int l, int r) { if (x <= l && r <= y) return part[k] + data[k]; if (y <= l || r <= x) return INF; return part[k] + min(minimum(x, y, k*2, l, (l+r)/2), minimum(x, y, k*2+1, (l+r)/2, r)); } }; //}}} int N; LL A, B; #define error(...) #define assert(...) mint calc(const vector<LL>& v) { error(v.size()); if(v.size() == 1) { return mint(2); } assert(A < B && A >= 1 && B >= 1); vector<LL> diffs; for(int i = 0; i+1 < v.size(); i++) { assert(v[i+1] - v[i] < B); diffs.push_back(v[i+1] - v[i]); } diffs.push_back(LLONG_MAX); SparseTable<LL> sp(diffs); vector<mint> dp(v.size()+1); dp[0] = 1; for(int i = 0; i < v.size(); i++) { error(i, dp[i]); if(!(i > 0 && v[i] - v[i-1] < A)) { // a dp[i+1] += dp[i]; error(dp[i+1]); } { // b const LL nx = v[i] + B; size_t ni = lower_bound(v.begin(), v.end(), nx) - v.begin(); if(ni - i == 1) { error(ni, v.size()); assert(ni == v.size()); dp[ni] += dp[i]; } else { LL min_diff = (ni - i >= 2 ? sp.query(i+1, (int)ni) : LLONG_MAX); if(i+1 < v.size() && i-1 >= 0) { min_diff = min(min_diff, v[i+1] - v[i-1]); } if(min_diff >= A) { dp[ni] += dp[i]; } error(nx, ni, min_diff, A, dp[ni]); } } } return dp.back(); } signed main(){ iostream_init(); while(cin >> N >> A >> B) { if(A > B) swap(A, B); vector<vector<LL>> VS; vector<LL> cur; REP(i, N) { LL x; cin >> x; if(cur.size() > 0 && cur.back() + B <= x) { VS.push_back(cur); cur.assign(1, x); } else { cur.push_back(x); } } VS.push_back(cur); mint res = 1; for(const auto& v : VS) { res *= calc(v); } cout << res << endl; // break; } return 0; }
a.cc:207:9: warning: "error" redefined 207 | #define error(...) | ^~~~~ a.cc:10:9: note: this is the location of the previous definition 10 | #define error(args...) | ^~~~~ a.cc:208:9: warning: "assert" redefined 208 | #define assert(...) | ^~~~~~ In file included from /usr/include/c++/14/cassert:44, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106, from a.cc:2: /usr/include/assert.h:102:11: note: this is the location of the previous definition 102 | # define assert(expr) \ | ^~~~~~ a.cc: In constructor 'AddMinimum::AddMinimum(long long int)': a.cc:185:39: error: no matching function for call to 'max(int, long long int&)' 185 | AddMinimum(int N=1): M(2<<__lg(max(1, N))), part(2*M), data(2*M) {} | ~~~^~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:185:39: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 185 | AddMinimum(int N=1): M(2<<__lg(max(1, N))), part(2*M), data(2*M) {} | ~~~^~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:185:39: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 185 | AddMinimum(int N=1): M(2<<__lg(max(1, N))), part(2*M), data(2*M) {} | ~~~^~~~~~ a.cc: In constructor 'AddMinimum::AddMinimum(const std::vector<long long int>&)': a.cc:186:50: error: no matching function for call to 'max(int, long long int)' 186 | AddMinimum(const vector<T> &A): M(2<<__lg(max(1, (int)A.size()))), part(2*M), data(2*M) { | ~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:186:50: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 186 | AddMinimum(const vector<T> &A): M(2<<__lg(max(1, (int)A.size()))), part(2*M), data(2*M) { | ~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:186:50: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 186 | AddMinimum(const vector<T> &A): M(2<<__lg(max(1, (int)A.size()))), part(2*M), data(2*M) { | ~~~^~~~~~~~~~~~~~~~~~
s279225484
p03823
C++
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; int N; long long A, B; vector<long long> S; bool visited[100001]; long long memo[100001]; bool g(long long x, long long y, long long z) { if (y < 0) return true; return x - y >= z; } unordered_map<long long, unordered_map<long long, int>> memo_h; int h(long long x, long long y, int pp) { ++ pp; int c = 1; vector<pair<long long, long long>> hoge; while (pp < N) { if (memo_h.count(x) && memo_h[x].count(y)) { pp = memo_h[x][y]; break } bool xx = g(S[pp], x, A); bool yy = g(S[pp], y, B); if (xx && yy) break; if (xx) x = S[pp]; else if (yy) y = S[pp]; else { pp = -1; break; } ++ c; if (c % 10 == 0) hoge.push_back({x,y}); ++ pp; } for (auto xy : hoge) memo_h[xy.first][xy.second] = pp; return pp; } long long f(int p) { if (p == N) return 1; if (visited[p]) return memo[p]; visited[p] = true; long long r = 0; { int pp = h(S[p], -1, p); if (pp >= 0) r += f(pp); } { int pp = h(-1, S[p], p); if (pp >= 0) r += f(pp); } return memo[p] = r % mod; } int main() { cin >> N >> A >> B; S.resize(N); for (auto& x : S) cin >> x; cout << f(0) << endl; }
a.cc: In function 'int h(long long int, long long int, int)': a.cc:20:86: error: expected ';' before '}' token 20 | if (memo_h.count(x) && memo_h[x].count(y)) { pp = memo_h[x][y]; break } | ^~ | ;
s150467191
p03823
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll mod = 1e9+7, inf = 2e18; ll n, a, b, x[100005], za, zb; vector<ll> ca, cb; ll getA (ll X) { if(X < za) return 0; if(za) return (ca[X] - ca[za-1] + mod) % mod; return ca[X]; } ll getB (ll X) { if(X < zb) return 0; if(zb) return (cb[X] - cb[zb-1] + mod) % mod; return cb[X]; } int main() { scanf("%lld%lld%lld",&n,&a,&b); for(int i=1;i<=n;i++) { scanf("%lld",&x[i]); } x[0] = -inf; ca.push_back(1); cb.push_back(1); for(int i=2;i<=n;i++) { ll fa = min(upper_bound(x, x+n+1, x[i]-a) - x - 1, i - 2ll); ll fb = min(upper_bound(x, x+n+1, x[i]-b) - x - 1, i - 2ll); ca.push_back((getB(fb)+ca.back())%mod); cb.push_back((getA(fa)+cb.back())%mod); if(x[i-1] + a > x[i]) zb = i-1; if(x[i-1] + b > x[i]) za = i-1; } printf("%lld\n",(getA(n-1)+getB(n-1)) % mod); }
a.cc: In function 'int main()': a.cc:30:28: error: no matching function for call to 'min(long int, long long int)' 30 | ll fa = min(upper_bound(x, x+n+1, x[i]-a) - x - 1, i - 2ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:30:28: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int') 30 | ll fa = min(upper_bound(x, x+n+1, x[i]-a) - x - 1, i - 2ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:30:28: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 30 | ll fa = min(upper_bound(x, x+n+1, x[i]-a) - x - 1, i - 2ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:31:28: error: no matching function for call to 'min(long int, long long int)' 31 | ll fb = min(upper_bound(x, x+n+1, x[i]-b) - x - 1, i - 2ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:31:28: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int') 31 | ll fb = min(upper_bound(x, x+n+1, x[i]-b) - x - 1, i - 2ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:31:28: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 31 | ll fb = min(upper_bound(x, x+n+1, x[i]-b) - x - 1, i - 2ll); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s463729917
p03823
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll mod = 1e9+7, inf = 2e18; ll n, a, b, x[100005], za, zb; vector<ll> ca, cb; ll getA (ll X) { if(X < za) return 0; if(za) return (ca[X] - ca[za-1] + mod) % mod; return ca[X]; } ll getB (ll X) { if(X < zb) return 0; if(zb) return (cb[X] - cb[zb-1] + mod) % mod; return cb[X]; } int main() { scanf("%lld%lld%lld",&n,&a,&b); for(int i=1;i<=n;i++) { scanf("%lld",&x[i]); } x[0] = -inf; ca.push_back(1); cb.push_back(1); for(int i=2;i<=n;i++) { ll fa = min(upper_bound(x, x+n+1, x[i]-a) - x - 1, i - 2); ll fb = min(upper_bound(x, x+n+1, x[i]-b) - x - 1, i - 2); ca.push_back((getB(fb)+ca.back())%mod); cb.push_back((getA(fa)+cb.back())%mod); if(x[i-1] + a > x[i]) zb = i-1; if(x[i-1] + b > x[i]) za = i-1; } printf("%lld\n",(getA(n-1)+getB(n-1)) % mod); }
a.cc: In function 'int main()': a.cc:30:28: error: no matching function for call to 'min(long int, int)' 30 | ll fa = min(upper_bound(x, x+n+1, x[i]-a) - x - 1, i - 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:30:28: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 30 | ll fa = min(upper_bound(x, x+n+1, x[i]-a) - x - 1, i - 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:30:28: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 30 | ll fa = min(upper_bound(x, x+n+1, x[i]-a) - x - 1, i - 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:31:28: error: no matching function for call to 'min(long int, int)' 31 | ll fb = min(upper_bound(x, x+n+1, x[i]-b) - x - 1, i - 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:31:28: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'int') 31 | ll fb = min(upper_bound(x, x+n+1, x[i]-b) - x - 1, i - 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:31:28: note: mismatched types 'std::initializer_list<_Tp>' and 'long int' 31 | ll fb = min(upper_bound(x, x+n+1, x[i]-b) - x - 1, i - 2); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s852789435
p03824
C++
#include<iostream> #include<algorithm> #include<vector> #include<unordered_map> using namespace std; typedef long long ll; using namespace std; #define N 100010 vector<ll> t[N]; //bool dead[N]; class DivideTree{ public: bool dead[N]; class FindCentroid{ public: ll res,n; ll alt(ll x,ll from){ if(dead[x])return 0; ll sum=1; for(auto y:t[x]){ if(y!=from)sum+=alt(y,x); } return sum; } ll dfs(ll x,ll from){ if(dead[x])return 0; ll sum=1,maxi=-1; for(auto y:t[x]){ if(y==from)continue; ll val=dfs(y,x); sum+=val,maxi=max(maxi,val); } ll rem=n-sum; maxi=max(maxi,rem); if(maxi<=n/2)res=x; return sum; } ll main(ll s){ n=alt(s,-1); dfs(s,-1); return res; } };FindCentroid fc; ll solve(ll s){ //cout<<s<<":"; s=fc.main(s); //cout<<s<<endl; dead[s]=1; ll res=-1; for(auto y:t[s]){ if(dead[y])continue; res=max(res,solve(y)); } dead[s]=0; return res+1; } ll main(){ for(int i=0;i<N;i++)dead[i]=0; return solve(1); } };DivideTree dt; int main(){ ll n,a,b;cin>>n; for(int i=0;i<n-1;i++){ cin>>a>>b; t[a].push_back(b); t[b].push_back(a); } cout<<dt.main()<<endl; return 0; }
a.cc: In member function 'll DivideTree::FindCentroid::alt(ll, ll)': a.cc:19:14: error: invalid use of non-static data member 'DivideTree::dead' 19 | if(dead[x])return 0; | ^~~~ a.cc:14:8: note: declared here 14 | bool dead[N]; | ^~~~ a.cc: In member function 'll DivideTree::FindCentroid::dfs(ll, ll)': a.cc:27:14: error: invalid use of non-static data member 'DivideTree::dead' 27 | if(dead[x])return 0; | ^~~~ a.cc:14:8: note: declared here 14 | bool dead[N]; | ^~~~
s948946956
p03824
C++
Copy #include <bits/stdc++.h> using namespace std; const int N=200010; int i,j,k,n,m,x,y,t,b[20]; int fi[N*2],ne[N*2],la[N*2],a[N*2],w[N]; int f[N][20],g[N][20]; void add(int x,int y){ k++;a[k]=y; if (fi[x]==0)fi[x]=k;else ne[la[x]]=k; la[x]=k; } void dfs(int x,int fa){ for (j=0;j<20;j++)f[x][j]=1; for (int i=fi[x];i;i=ne[i])if (a[i]!=fa){ dfs(a[i],x); for (j=0;j<20;j++)f[x][j]&=f[a[i]][j],g[x][j]+=g[a[i]][j]; } memset(b,0,sizeof b); for (int i=fi[x];i;i=ne[i])if (a[i]!=fa)b[w[a[i]]]++; for (j=19;j>=0;j--)if (b[j]>1){ for (k=j;k<20;k++)if (f[x][k]){w[x]=k;break;} break; } if (!w[x]){for (j=0;j<20;j++)if (f[x][j]){w[x]=max(w[x],j);break;}} f[x][w[x]]=0;g[x][w[x]]++; for (j=0;j<w[x];j++)f[x][j]=1; } int main(){ scanf("%d",&n); for (i=1;i<n;i++){ scanf("%d%d",&x,&y); add(x,y);add(y,x); } dfs(1,-1); int ans=0; for (i=1;i<=n;i++)ans=max(ans,w[i]); printf("%d\n",ans); return 0; }
a.cc:2:1: error: 'Copy' does not name a type 2 | Copy | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/incl
s897125692
p03824
C++
#include<bits/stdc++.h> using namespace std; const int N=2e5+10; int n,w[N],head[N],next[N]; void add(int f,int t){ static int cnt=0; w[++cnt]=t; next[cnt]=head[f]; head[f]=cnt; } int dep[N]; void dfs(int x,int fa){ for (int i=head[x];i;i=next[i]) if (w[i]!=fa) dep[w[i]]=dep[x]+1,dfs(w[i],x); } int main() { scanf("%d",&n); for (int i=1;i<n;i++){ int u,v; scanf("%d%d",&u,&v); add(u,v);add(v,u); } dep[1]=1;dfs(1,0); int v=1; for (int i=1;i<=n;i++) if (dep[i]>dep[v]) v=i; dep[v]=1;dfs(v,0); int len=0; for (int i=1;i<=n;i++) len=max(len,dep[i]); //printf("%d\n",len); int k=1,ans=0; while (k<len) k=k*2+1,ans++; printf("%d\n",ans); return 0; }
a.cc: In function 'void add(int, int)': a.cc:8:9: error: reference to 'next' is ambiguous 8 | next[cnt]=head[f]; | ^~~~ 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:4:20: note: 'int next [200010]' 4 | int n,w[N],head[N],next[N]; | ^~~~ a.cc: In function 'void dfs(int, int)': a.cc:13:32: error: reference to 'next' is ambiguous 13 | for (int i=head[x];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:4:20: note: 'int next [200010]' 4 | int n,w[N],head[N],next[N]; | ^~~~
s892229806
p03824
C++
#include <cstdio> #include <algorithm> #define repu(i,x,y) for (int i=x; i<=y; ++i) using namespace std; int n,dep[100100],ans; struct edge { int v; edge *nxt; } pool[200100],*tp=pool,*fst[100100]; int dfs(int x,int fa) { int ret=x; dep[x]=dep[fa]+1; for (edge *i=fst[x]; i; i=i->nxt) if (i->v!=fa) { int t=dfs(i->v,x); if (dep[t]>dep[ret]) ret=t; } return ret;0 } int main() { scanf("%d",&n); repu(i,1,n-1) { int u,v; scanf("%d%d",&u,&v); *tp=(edge){v,fst[u]},fst[u]=tp++; *tp=(edge){u,fst[v]},fst[v]=tp++; } int t=dep[dfs(dfs(1,0),0)]; for (; t>1; t>>=1,++ans); printf("%d\n",ans); return 0; }
a.cc: In function 'int dfs(int, int)': a.cc:24:17: error: expected ';' before '}' token 24 | return ret;0 | ^ | ; 25 | } | ~
s276584283
p03824
C++
#include <bits/stdc++.h> using namespace std; static vector<int> e[2][100000]; int recon(int i,int p,bool b,int &N) { //printf("%d %d %d\n",i,p,N); int t=N; e[!b][t]=vector<int>(0); N++; int S=0; for(int x=0;x<e[b][i].size();x++){ if(e[b][i][x].size()==1){ S++; } } for(int x=0;x<e[b][i].size();x++){ int j=e[b][i][x]; if(j==p)continue; if(e[b][j].size()==2&&S>=e[b][i].size()-1){ int k=(e[b][j][0]==i?e[b][j][1]:e[b][j][0]); int c=recon(k,j,b,N); e[!b][t].push_back(c); e[!b][c].push_back(t); } else if(e[b][j].size()>=2){ int c=recon(j,i,b,N); e[!b][t].push_back(c); e[!b][c].push_back(t); } } return t; } int main() { int n; scanf("%d",&n); bool b=0; for(int i=0;i<n-1;i++){ int u,v; scanf("%d%d",&u,&v); u--,v--; e[b][u].push_back(v); e[b][v].push_back(u); } int N=n,t=0; while(N>1){ //printf("%d\n",N); t++; int r; for(int i=0;i<N;i++){ if(e[b][i].size()==1){ r=e[b][i][0]; break; } } N=0; recon(r,-1,b,N); b=!b; } printf("%d\n",t); return 0; }
a.cc: In function 'int recon(int, int, bool, int&)': a.cc:14:19: error: request for member 'size' in 'e[((int)b)][i].std::vector<int>::operator[](((std::vector<int>::size_type)x))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} 14 | if(e[b][i][x].size()==1){ | ^~~~
s799559477
p03824
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for (int i = (a); i < (b); i++) #define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--) #define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++) #define FILL(a,value) memset(a, value, sizeof(a)) #define SZ(a) (int)a.size() #define ALL(a) a.begin(), a.end() #define MP make_pair #define PB push_back typedef long long LL; typedef vector<int> VI; typedef pair<int, int> PII; const double PI = acos(-1.0); const int INF = 1000 * 1000 * 1000 + 7; const LL LINF = INF * (LL)INF; const int MAX = 100100; vector<int> g[MAX]; int D[MAX]; int mx; void go(int x, int p, int val, int diff) { //cout<<x<<' '<<val<<' '<<mx<<endl; if (val == -1) { mx++; D[x] = mx; diff = 1; } else { if (val == mx - 1) diff = -1; D[x] = val; } FOR (i, 0, SZ(g[x])) { int to = g[x][i]; if (to == p) continue; go(to, x, val + diff, diff, mx); } } int main() { //freopen("in.txt", "r", stdin); //ios::sync_with_stdio(false); cin.tie(0); int n; scanf("%d", &n); FOR (i, 0, n-1) { int x, y; scanf("%d%d", &x, &y); x--; y--; g[x].PB(y); g[y].PB(x); } mx = 0; go(0, -1, 0, -1); int res = 0; FOR (i, 0, n) { res = max(res, D[i]); // cout<<i+1<<' '<<D[i]<<endl; } cout<<res<<endl; }
a.cc: In function 'void go(int, int, int, int)': a.cc:50:19: error: too many arguments to function 'void go(int, int, int, int)' 50 | go(to, x, val + diff, diff, mx); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:29:6: note: declared here 29 | void go(int x, int p, int val, int diff) | ^~
s333014699
p03824
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for (int i = (a); i < (b); i++) #define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--) #define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++) #define FILL(a,value) memset(a, value, sizeof(a)) #define SZ(a) (int)a.size() #define ALL(a) a.begin(), a.end() #define MP make_pair #define PB push_back typedef long long LL; typedef vector<int> VI; typedef pair<int, int> PII; const double PI = acos(-1.0); const int INF = 1000 * 1000 * 1000 + 7; const LL LINF = INF * (LL)INF; const int MAX = 100100; vector<int> g[MAX]; int D[MAX]; int mx; void go(int x, int p, int val, int diff) { //cout<<x<<' '<<val<<' '<<mx<<endl; if (val == -1) { mx++; D[x] = mx; diff = 1; } else { if (val == mx - 1) diff = -1; D[x] = val; } FOR (i, 0, SZ(g[x])) { int to = g[x][i]; if (to == p) continue; go(to, x, val + diff, diff, mx); } } int main() { //freopen("in.txt", "r", stdin); //ios::sync_with_stdio(false); cin.tie(0); int n; scanf("%d", &n); FOR (i, 0, n-1) { int x, y; scanf("%d%d", &x, &y); x--; y--; g[x].PB(y); g[y].PB(x); } go(0, -1, 0, -1, 0); int res = 0; FOR (i, 0, n) { res = max(res, D[i]); // cout<<i+1<<' '<<D[i]<<endl; } cout<<res<<endl; }
a.cc: In function 'void go(int, int, int, int)': a.cc:50:19: error: too many arguments to function 'void go(int, int, int, int)' 50 | go(to, x, val + diff, diff, mx); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:29:6: note: declared here 29 | void go(int x, int p, int val, int diff) | ^~ a.cc: In function 'int main()': a.cc:72:11: error: too many arguments to function 'void go(int, int, int, int)' 72 | go(0, -1, 0, -1, 0); | ~~^~~~~~~~~~~~~~~~~ a.cc:29:6: note: declared here 29 | void go(int x, int p, int val, int diff) | ^~
s688634706
p03824
C++
#include <iostream> #include <vector> using namespace std; class Tree { public: Tree(int size): m_edges(size), m_size(size) {} int size() const { return m_edges.size(); } void addEdge(int x, int y) { m_edges[x].emplace_back(y); m_edges[y].emplace_back(x); } int uninity() { return dfsUninity(0); } private: int dfsUninity(int node) { if (m_edges[node].size() == 0) return 0; dfsSize(node); int center = node; while (true) { bool found_next = false; for (auto &x : m_edges[center]) if (m_size[x] < m_size[center] && m_size[x] > m_size[node] / 2) { center = x; found_next = true; break; } if (!found_next) break; } int answer = 0; for (auto &x : m_edges[center]) { m_edges[x].erase(find(m_edges[x].begin(), m_edges[x].end(), center)); answer = max(answer, dfsUninity(x)); } return answer + 1; } void dfsSize(int node, int father = -1) { m_size[node] = 1; for (auto &x : m_edges[node]) if (x != father) { dfsSize(x, node); m_size[node] += m_size[x]; } } vector< vector<int> > m_edges; vector<int> m_size; }; int main() { int N; cin >> N; Tree T(N); for (int i = 1; i < N; ++i) { int x, y; cin >> x >> y; T.addEdge(x - 1, y - 1); } cout << T.uninity() << "\n"; }
a.cc: In member function 'int Tree::dfsUninity(int)': a.cc:46:34: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 46 | m_edges[x].erase(find(m_edges[x].begin(), m_edges[x].end(), center)); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:46:34: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 46 | m_edges[x].erase(find(m_edges[x].begin(), m_edges[x].end(), center)); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s200764549
p03824
C++
#include<algorithm> #include<cmath> #include<iomanip> #include<iostream> #include<map> #include<numeric> #include<queue> #include<set> #include<sstream> #include<vector> using namespace std; using uint = unsigned int; using ll = long long; const int M = 1e9 + 7; const ll MLL = 1e18L + 9; #pragma unused(M) #pragma unused(MLL) #ifdef LOCAL #include"basic.hpp" #else template <class... T> void printl(T&&...){ } template <class... T> void printc(T&&...){ } template <class... T> void prints(T&&...){ } #endif struct Node{ vector<Node*> dests; void add(Node* n){ dests.push_back(n); } void add2(Node* n){ add(n); n->add(this); } pair<int, Node*> dfs(Node* from = nullptr){ pair<int, Node*> ret = {0, this}; for(Node* d : dests){ if(d == from){ continue; } auto p = d -> dfs(this); p.first++; ret = max(ret, p); } return ret; } }; int main(){ int n; cin >> n; vector<Node> nodes(n); for(int i=0;i<n;i++){ int a, b; cin >> a >> b; a--; b--; nodes[a].add2(&nodes[b]); } auto f1 = nodes[0].dfs(); auto f2 = f1.second->dfs(); int d = f2.first; printd(d); int num = 0, ans = 0; for(int i=1;i<M;i++){ num = num * 2 + 2; prints(num, d, i); if(num >= d){ ans = i; break; } } cout << ans << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:59:5: error: 'printd' was not declared in this scope; did you mean 'prints'? 59 | printd(d); | ^~~~~~ | prints
s546595234
p03825
Java
na j jvaivjva
Main.java:1: error: class, interface, enum, or record expected na j jvaivjva ^ 1 error
s760950673
p03825
Java
jviva
Main.java:1: error: reached end of file while parsing jviva ^ 1 error
s592908260
p03825
C++
//Zory-2020 #include<bits/stdc++.h> using namespace std; typedef long long ll; // typedef __int128 ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; #define FR first #define SE second #define MP make_pair #define PB push_back #define vc vector #define db double #define all(x) (x).begin(),(x).end() #define sz(x) ((int)(x).size()) #define bin(x) (1ll<<(x)) #define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++) #define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--) #define mem(x,val) memset(x,val,sizeof x) #define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I]) #define PC __builtin_popcountll #ifdef DEBUG #define debug(A,args...) fprintf(stderr,A,##args) #else #define debug(A,args...) #endif namespace mine { ll qread() { ll ans=0,f=1;char c=getchar(); while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();} while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar(); return ans*f; } void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);} void write1(ll num){write(num);putchar(' ');} void write2(ll num){write(num);putchar('\n');} template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;} template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;} ll gcd(ll x,ll y){return y?gcd(y,x%y):x;} bool IN(ll x,ll l,ll r){return l<=x and x<=r;} void GG(){puts("No");exit(0);} const db eps=1e-8; const int INF=0x3f3f3f3f; const int MOD=1e9+7; int mm(const int x){return x>=MOD?x-MOD:x;} template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);} ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;} ll invm(ll x){return qpower(x,MOD-2);} const int M=5e6+10; ll fac[M],facinv[M],Inv[M];ll C(int n,int m){return n<0 or n<m?0:fac[n]*facinv[m]%MOD*facinv[n-m]%MOD;} void PRE() { fac[0]=1;fo(i,1,M-1) fac[i]=fac[i-1]*i%MOD; facinv[M-1]=invm(fac[M-1]);fd(i,M-1,1) facinv[i-1]=facinv[i]*i%MOD; Inv[1]=1;fo(i,2,M-1) Inv[i]=(MOD-MOD/i)*Inv[MOD%i]%MOD; } const int N=4e3+10; //------------------FIXED------------------ int dp[N][N]; void main() { int n=qread(),m=qread(),K=qread()-1;int L=(n+m-1)/K;dp[0][0]=1;int ans=0; fo(l,1,L) fo(sum,0,m) if(dp[l-1][sum]) fo(now,0,K) if(sum+now<=m) { add(dp[l][sum+now],dp[l-1][sum]); if(now and (sum+now-m)%K==0 and l*K-(sum+now)<=n-1) add(ans,dp[l-1][sum]); }write(ans); };//变量重名! signed main() { #ifdef DEBUG //freopen("a.in","r",stdin); freopen("z.txt","r",stdin); //freopen("a.out","w",stdout); #endif srand(time(0)); mine::PRE();//线性预处理模意义 mine::main(); debug("\n---------------------Zory---------------------\nTime: %.2lf s",1.0*clock()/CLOCKS_PER_SEC); }
a.cc:72:8: error: ambiguating new declaration of 'int mine::main()' 72 | signed main() | ^~~~ a.cc:63:14: note: old declaration 'void mine::main()' 63 | void main() | ^~~~ a.cc: In function 'int mine::main()': a.cc:83:1: warning: no return statement in function returning non-void [-Wreturn-type] 83 | } | ^ a.cc: At global scope: a.cc:83:2: error: expected '}' at end of input 83 | } | ^ a.cc:28:1: note: to match this '{' 28 | { | ^
s025763416
p03825
C++
/* Author: zxy_hhhh date: 2019/12/10 */ #include<cstdio> #include<cstring> #include<algorithm> #include<cctype> #include<cmath> #include<set> #include<vector> #include<map> #include<queue> #include<iostream> #define ll long long inline ll rd() { ll _x=0;int _ch=getchar(),_f=1; for(;!isdigit(_ch)&&(_ch!='-')&&(_ch!=EOF);_ch=getchar()); if (_ch=='-'){_f=0;_ch=getchar();} for(;isdigit(_ch);_ch=getchar()) _x=_x*10+_ch-'0'; return _f?_x:-_x; } void write(ll _x){if (_x>=10) write(_x/10),putchar(_x%10+'0'); else putchar(_x+'0'); } inline void wrt(ll _x,char _p){if (_x<0) putchar('-'),_x=-_x; write(_x); if (_p) putchar(_p);} #define maxn 2005 #define mod 1000000007 int n,m,k; int dp[maxn<<1][maxn<<1]; int main() { n=rd(),m=rd(),k=rd(); int res=0;dp[0][0]=1; for(int i=0;i<=n;i++) { for(int j=0;j<=m;j++) if (f[i][j]){ for(int c=0;c<=k-1;c++) { (dp[i+c][j+(k-1-c)]+=dp[i][j])%=mod; } int nxw=(n-i)%(k-1); if (!nxw) nxw+=k-1; if (i+nxw<=n&&j+(k-nxw)<=m) { (res+=dp[i][j])%=mod; } } } wrt(res,'\n'); }
a.cc: In function 'int main()': a.cc:34:43: error: 'f' was not declared in this scope 34 | for(int j=0;j<=m;j++) if (f[i][j]){ | ^
s565094613
p03825
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define sqr(x) ((x)*(x)) #define mp make_pair #define uint unsigned #define PI pair<int,int> 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(){ int x = 0; char ch = gc(); bool positive = 1; for (; !isdigit(ch); ch = gc()) if (ch == '-') positive = 0; for (; isdigit(ch); ch = gc()) x = x * 10 + ch - '0'; return positive ? x : -x; } inline void write(int a){ if(a<0){ a=-a; putchar('-'); } if(a>=10)write(a/10); putchar('0'+a%10); } inline void writeln(int a){ if(a<0){ a=-a; putchar('-'); } write(a); puts(""); } inline int rnd(int x){ return rand()%x; } inline ull rnd(){ return ((ull)rand()<<30^rand())<<4|rand()%4; } const int N=4005,mod=1000000007; int n,m,k,dp[N],ans; inline void add(int &a,int b){ a=a+b>=mod?a+b-mod:a+b; } signed main(){ n=read(); m=read(); k=read(); swap(n,m); int jb=k-1; for(int i=n;i;i--)if((n-i)%jb==0)nxt[i]=i; else nxt[i]=nxt[i+1]; dp[0]=1; for(int i=0;i<(n+m-1)/(k-1);i++){ int meiju=min(n,i*(k-1)),mmm=min(n,(i+1)*(k-1)); for(int j=1;j<=meiju;j++)add(dp[j],dp[j-1]); for(int j=meiju;j>=0;j--){ if(j+k<=mmm)add(dp[j+k],mod-dp[j]); if(nxt[j]<=n&&(i+1)*jb-nxt[j]<m)ans=(ans+dp[j])%mod; //cout<<dp[j]<<" "<<i<<" "<<j<<" "<<(i+1)*jb-(j+(n-j)%jb)<<endl; } } cout<<(ans+mod)%mod<<endl; }
a.cc: In function 'int main()': a.cc:47:42: error: 'nxt' was not declared in this scope 47 | for(int i=n;i;i--)if((n-i)%jb==0)nxt[i]=i; else nxt[i]=nxt[i+1]; | ^~~ a.cc:47:57: error: 'nxt' was not declared in this scope 47 | for(int i=n;i;i--)if((n-i)%jb==0)nxt[i]=i; else nxt[i]=nxt[i+1]; | ^~~ a.cc:54:28: error: 'nxt' was not declared in this scope 54 | if(nxt[j]<=n&&(i+1)*jb-nxt[j]<m)ans=(ans+dp[j])%mod; | ^~~
s612085873
p03825
C++
#include <cstdio> #include <vector> #include <string> using namespace std; const int MOD = 1e9 + 7; int dp[2001][2001]; int dfs(int a, int b, int k) { if (a + b == 1) return dp[a][b] = 1; if (a + b == k) { if (a == k || b == k) return dp[a][b] = 0; return dp[a][b] = 1; } if (dp[a][b] > 0) return dp[a][b]; int &res = dp[a][b]; res = 0; for (int i = 0; i < k; i ++) if (a >= i && b >= k - i - 1) (res += dfs(a - i, b - (k - i - 1), k)) %= MOD; return res; } int main() { int n, m, k, ans = 0; scanf("%d%d%d", &n, &m, &k); memset(dp, -1, sizeof dp); for (int i = n; i > 0; i -= k - 1) for (int j = m; j > 0; j -= k - 1) (ans += dfs(i, j, k)) %= MOD; printf("%d\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:26:9: error: 'memset' was not declared in this scope 26 | memset(dp, -1, sizeof dp); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <string> +++ |+#include <cstring> 4 | using namespace std;
s128220547
p03825
C++
#include <cstdio> #include <vector> using namespace std; const int MOD = 1e9 + 7; int dp[2001][2001]; int dfs(int a, int b, int k) { if (a + b == 1) return dp[a][b] = 1; if (a + b == k) { if (a == k || b == k) return dp[a][b] = 0; return dp[a][b] = 1; } if (dp[a][b] > 0) return dp[a][b]; int &res = dp[a][b]; res = 0; for (int i = 0; i < k; i ++) if (a >= i && b >= k - i - 1) (res += dfs(a - i, b - (k - i - 1), k)) %= MOD; return res; } int main() { int n, m, k, ans = 0; scanf("%d%d%d", &n, &m, &k); memset(dp, -1, sizeof dp); for (int i = n; i > 0; i -= k - 1) for (int j = m; j > 0; j -= k - 1) (ans += dfs(i, j, k)) %= MOD; printf("%d\n", ans); return 0; }
a.cc: In function 'int main()': a.cc:25:9: error: 'memset' was not declared in this scope 25 | memset(dp, -1, sizeof dp); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <vector> +++ |+#include <cstring> 3 | using namespace std;
s238641100
p03825
C++
include<stdio.h> #include<algorithm> using namespace std; int n, m, K, L, S[30010]; long long D[4010][2010], Mod = 1000000007, Res; int main(){ scanf("%d%d%d",&n,&m,&K); if(n>m)swap(n,m); L = (n+m-1)/(K-1); int i, j; for(i=0;i<=n;i++)D[0][i] = 1; for(i=1;i<=L;i++){ for(j=0;j<=n;j++){ D[i][j] = D[i-1][j]; if(j>=K) D[i][j] = (D[i][j]-D[i-1][j-K]+Mod)%Mod; } for(j=1;j<=n;j++){ D[i][j] = (D[i][j]+D[i][j-1])%Mod; } } int c = L; for(i=n;i>=1;i-=(K-1)){ Res = (Res + D[c][i])%Mod; if(i)Res = (Res - D[c][i-1] + Mod)%Mod; // Res = (Res + Mod - S[i])%Mod; c--; } printf("%lld\n",Res); }
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> |
s242518799
p03826
C++
#include <bits/stdc++.h> using namespace std; using pp=pair<int, int>; int main() { int a, b, c, d; int>>a>>b>>c>>d; cout << max(a*b, c*d) << endl; }
a.cc: In function 'int main()': a.cc:7:6: error: expected unqualified-id before '>>' token 7 | int>>a>>b>>c>>d; | ^~
s202330920
p03826
C++
#include<iostream> using namespace std; int main() { int A,B,C.D; cin>>A>>B>>C>>D; if(A*B>C*D){ cout<<A*B; } else{ cout<<C*D; } }
a.cc: In function 'int main()': a.cc:5:12: error: expected initializer before '.' token 5 | int A,B,C.D; | ^ a.cc:6:14: error: 'C' was not declared in this scope 6 | cin>>A>>B>>C>>D; | ^ a.cc:6:17: error: 'D' was not declared in this scope 6 | cin>>A>>B>>C>>D; | ^
s872660159
p03826
C++
#include<iostream> #include<string> #include<algorithm> #include<vector> #include<set> #include<iomanip> #define pi 3.14159265358979323846 #define ll long long #define rep(i, a, n) for(int i = a; i < n; i++) using namespace std; int main(){ int a, b, c, d; cin >> a >> b >> c >> d; a = a * b; c = c * d; if(a >= c){ cout << << "\n"; return 0; } cout << c << "\n"; }
a.cc: In function 'int main()': a.cc:17:14: error: expected primary-expression before '<<' token 17 | cout << << "\n"; | ^~
s543731482
p03826
C++
#inclu de<bits/stdc++.h> using namespace std; int main(){ long int a,b,c,d; cin>>a>>b>>c>>d; if((a*b)>(c*d)) cout<<a*b; else cout<<c*d; return 0; }
a.cc:1:2: error: invalid preprocessing directive #inclu; did you mean #include? 1 | #inclu de<bits/stdc++.h> | ^~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin>>a>>b>>c>>d; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #inclu de<bits/stdc++.h> a.cc:9:5: error: 'cout' was not declared in this scope 9 | cout<<a*b; | ^~~~ a.cc:9:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:11:5: error: 'cout' was not declared in this scope 11 | cout<<c*d; | ^~~~ a.cc:11:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s663929050
p03826
Java
(defun area (h w) (* h w)) (write (max (area (read) (read)) (area (read) (read))))
Main.java:1: error: class, interface, enum, or record expected (defun area (h w) (* h w)) ^ 1 error
s109951518
p03826
C++
#include <iostream> int main() { int A, B, C, D, area; std::cin >> A >> B >> C >> D; if(A * B >= C * D) { area = A * B; } else { area = C * D } std::cout << area; return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: expected ';' before '}' token 14 | area = C * D | ^ | ; 15 | } | ~
s430498842
p03826
C
#include <stdio.h> int main() { int a, b, c, d, i, f; scanf("%d %d %d %d", &a, &b, &c, &d); i = a*b; f = c*d; if(e>f) { printf("%d", i); } else { printf("%d", f); } return 0; }
main.c: In function 'main': main.c:9:8: error: 'e' undeclared (first use in this function) 9 | if(e>f) | ^ main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
s346399998
p03826
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b , c, d ; cin >> a >> b >> c >> d; cout << (a*b < c*d ? c*d : a*b) << endl;
a.cc: In function 'int main()': a.cc:7:43: error: expected '}' at end of input 7 | cout << (a*b < c*d ? c*d : a*b) << endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s939995919
p03826
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b , c, d ; cin >> a >> b >> c >> d; cout << (a*b<c*d ? c*d : a*b) << endl;
a.cc: In function 'int main()': a.cc:7:41: error: expected '}' at end of input 7 | cout << (a*b<c*d ? c*d : a*b) << endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s864759702
p03826
C
#include <stdio.h> int main(void){ long long A,B,C,D; scanf("%lld %lld %lld %lld",&N); if(A*B<=C*D){ printf("%lld",C*D); } else printf("%lld",A*B); return 0; }
main.c: In function 'main': main.c:6:32: error: 'N' undeclared (first use in this function) 6 | scanf("%lld %lld %lld %lld",&N); | ^ main.c:6:32: note: each undeclared identifier is reported only once for each function it appears in
s413139927
p03826
C
#include <stdio.h> int main(void){ long long A,B,C,D; scanf("%lld %lld %lld %lld",&N); if(A*B<=C*D){ printf("%lld",C*D); } else printf("lld",A*B); return 0; }
main.c: In function 'main': main.c:6:32: error: 'N' undeclared (first use in this function) 6 | scanf("%lld %lld %lld %lld",&N); | ^ main.c:6:32: note: each undeclared identifier is reported only once for each function it appears in
s635056712
p03826
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, c, d; cin >> a >> b >> c << d; int e = a * b, f = c * d; if(e < f){ cout << f << "\n"; } else{ cout << e << "\n"; } }
a.cc: In function 'int main()': a.cc:11:22: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 11 | cin >> a >> b >> c << d; | ~~~~~~~~~~~~~~~~~~ ^~ ~ | | | | | int | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:11:22: note: candidate: 'operator<<(int, int)' (built-in) 11 | cin >> a >> b >> c << d; | ~~~~~~~~~~~~~~~~~~~^~~~ a.cc:11:22: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/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/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin >> a >> b >> c << d; | ^ 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:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:11:17: note: cannot convert '(&(& std::cin.std::basic_istream<char>::operator>>(a))->std::basic_istream<char>::operator>>(b))->std::basic_istream<char>::operator>>(c)' (type 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'}) to type 'std::byte' 11 | cin >> a >> b >> c << d; | ~~~~~~~~~~~~~~^~~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin >> a >> b >> c << d; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:11:25: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 11 | cin >> a >> b >> c << d; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/includ
s650940866
p03826
Java
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextLine(); int b = sc.nextLine(); int c = sc.nextLine(); int d = sc.nextLine(); int e = a * b; int f = c * d; if(e >= f){ System.out.println(e); }else{ System.out.println(f); } } }
Main.java:8: error: incompatible types: String cannot be converted to int int a = sc.nextLine(); ^ Main.java:9: error: incompatible types: String cannot be converted to int int b = sc.nextLine(); ^ Main.java:10: error: incompatible types: String cannot be converted to int int c = sc.nextLine(); ^ Main.java:11: error: incompatible types: String cannot be converted to int int d = sc.nextLine(); ^ 4 errors
s096400418
p03826
Java
import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt() System.out.println(a * b >= c * d ? a * b : c * d); } }
Main.java:9: error: ';' expected int d = sc.nextInt() ^ 1 error
s211523544
p03826
C++
#include <bits/stdc++.h> using namespace std; int main(void){ string a, b, c, d; cin >> a >> b >> c >> d ; /* if(a - b >= 0){ cout << b * c + ( a - b ) * d << endl; } else { cout << a * c << endl; } */ cout << max(a * b, c * d) << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:19: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 16 | cout << max(a * b, c * d) << endl; | ~ ^ ~ | | | | | basic_string<[...]> | basic_string<[...]> In file included 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/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)' 400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:400:5: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)' 409 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:409:5: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)' 418 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:418:5: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 16 | cout << max(a * b, c * d) << endl; | ^ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed: a.cc:16:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>' 16 | cout << max(a * b, c * d) << endl; | ^ a.cc:16:26: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 16 | cout << max(a * b, c * d) << endl; | ~ ^ ~ | | | | | basic_string<[...]> | basic_string<[...]> /usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)' 400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:400:5: note: template argument deduction/substitution failed: a.cc:16:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)' 409 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:409:5: note: template argument deduction/substitution failed: a.cc:16:28: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>' 16 | cout << max(a * b, c * d) << endl; | ^ /usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)' 418 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:418:5: note: template argument deduction/substitution failed:
s493871769
p03826
C++
#include<bits/stdc++.h> using namespace std; int main(){ int A,B,C,D; cin>>A>>B>>C>>D; int x=A*B; int y=C*D; if(x>=y){ cout<<x<<endl; if(x<<y){ cout<<y<<endl; }
a.cc: In function 'int main()': a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:10:9: note: to match this '{' 10 | if(x>=y){ | ^ a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s099803515
p03826
C++
#include <iostream> using namespace std; int main(void){ // Your code here! int A, B, C, D; cin >> A >> B >> C >> D; int ans1 = A * B; int ans2 = C * D; int a = (ans1 > ans2;) int b = (ans2 > ans1;) int c = (ans1 = ans2;) if (a) { cout << ans1 <<endl; } if(b) { cout << ans2 <<endl; } if(c) { cout << ans1 << endl; } }
a.cc: In function 'int main()': a.cc:9:25: error: expected ')' before ';' token 9 | int a = (ans1 > ans2;) | ~ ^ | ) a.cc:9:26: error: expected primary-expression before ')' token 9 | int a = (ans1 > ans2;) | ^ a.cc:10:26: error: expected primary-expression before ')' token 10 | int b = (ans2 > ans1;) | ^ a.cc:11:26: error: expected primary-expression before ')' token 11 | int c = (ans1 = ans2;) | ^ a.cc:16:8: error: 'b' was not declared in this scope 16 | if(b) | ^ a.cc:20:8: error: 'c' was not declared in this scope 20 | if(c) | ^
s811770152
p03826
C++
#include <iostream> using namespace std; int main(void){ // Your code here! int A, B, C, D, a, b; cin >> A >> B >> C >> D; int ans1 = A * B; int ans2 = C * B; int a = ans1 > ans2; int b = ans2 > ans2; if (a) { cout << ans1 <<endl; } if(b); { cout << ans2 <<endl; } }
a.cc: In function 'int main()': a.cc:9:9: error: redeclaration of 'int a' 9 | int a = ans1 > ans2; | ^ a.cc:5:21: note: 'int a' previously declared here 5 | int A, B, C, D, a, b; | ^ a.cc:10:9: error: redeclaration of 'int b' 10 | int b = ans2 > ans2; | ^ a.cc:5:24: note: 'int b' previously declared here 5 | int A, B, C, D, a, b; | ^
s564612455
p03826
C++
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; cout << max(a * b.c * d) << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:23: error: request for member 'c' in 'b', which is of non-class type 'int' 7 | cout << max(a * b.c * d) << endl; | ^
s193801950
p03826
C++
#include<iostream> uisng namespace std; int main(){ int a,b,c,d; cin >> a >> b >> c >> d; cout << max(a*b,c*d) << endl; }
a.cc:3:1: error: 'uisng' does not name a type 3 | uisng namespace std; | ^~~~~ a.cc: In function 'int main()': a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> a >> b >> c >> d; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | cout << max(a*b,c*d) << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:8:11: error: 'max' was not declared in this scope; did you mean 'std::max'? 8 | cout << max(a*b,c*d) << endl; | ^~~ | std::max In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41: /usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ a.cc:8:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 8 | cout << max(a*b,c*d) << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s253637563
p03826
C++
#include<bits/stdc++.h> using namespace std; int main{ int a , b , c , d; cin >> a >> b >> c >> d; cout << max(a * b , c * d) << endl; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int a , b , c , d; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6:3: error: 'cin' does not name a type 6 | cin >> a >> b >> c >> d; | ^~~ a.cc:7:3: error: 'cout' does not name a type 7 | cout << max(a * b , c * d) << endl; | ^~~~ a.cc:8:1: error: expected declaration before '}' token 8 | } | ^
s882408836
p03826
C++
#include<bits/c++.h> using namespace std; int main{ int a , b , c , d; cin >> a >> b >> c >> d; cout << max(a * b , c * d) << endl; }
a.cc:1:9: fatal error: bits/c++.h: No such file or directory 1 | #include<bits/c++.h> | ^~~~~~~~~~~~ compilation terminated.
s990693538
p03826
C++
#include<bits/stdc++.h> using namespace std; int main(){ int. a,b,c,d; cin>>a>>b>>c>>d; if(a*b>=c*d){ cout<<a*b<<endl; } else{ cout<<c*d<<endl; } }
a.cc: In function 'int main()': a.cc:4:6: error: expected unqualified-id before '.' token 4 | int. a,b,c,d; | ^ a.cc:5:8: error: 'a' was not declared in this scope 5 | cin>>a>>b>>c>>d; | ^ a.cc:5:11: error: 'b' was not declared in this scope 5 | cin>>a>>b>>c>>d; | ^ a.cc:5:14: error: 'c' was not declared in this scope 5 | cin>>a>>b>>c>>d; | ^ a.cc:5:17: error: 'd' was not declared in this scope 5 | cin>>a>>b>>c>>d; | ^
s202355815
p03826
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a, b, c, d; cin >> a, b. c, d; int e, f; e = a * b; f = c * d; if (e >= f){ cout << e << endl; } else { cout << f << endl; } }
a.cc: In function 'int main()': a.cc:7:18: error: request for member 'c' in 'b', which is of non-class type 'int' 7 | cin >> a, b. c, d; | ^
s321534694
p03826
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a, b, c, d; cin >> a, b. c, d; int e, f; e = a * b; f = c * d; if (e > f){ cout << e << endl; } else { cout << f << endl; } cout << s << endl; }
a.cc: In function 'int main()': a.cc:7:18: error: request for member 'c' in 'b', which is of non-class type 'int' 7 | cin >> a, b. c, d; | ^ a.cc:20:13: error: 's' was not declared in this scope 20 | cout << s << endl; | ^
s239480077
p03826
C++
#include<bits/stdc++.h> using namespace std; int main() { int a, b, c, d, r1, r2; cin >> a >> b >> c >> d; r1 = a * b; r2 = c * d; if (r1 >= r2) { cout << r1 << endl; } else { cout << r2 << endl: } return 0; }
a.cc: In function 'int main()': a.cc:13:23: error: expected ';' before ':' token 13 | cout << r2 << endl: | ^ | ;
s838091314
p03826
C++
#include<bits/stdc++.h> using namespace std; int main() { int a, b, c, d, r1, r2; cin >> a >> b >> c >> d; r1 = a * b; r2 = c * d; if (r1 >= r2) { cout << r1 << end; } else { cout << r2 << endl: } return 0; }
a.cc: In function 'int main()': a.cc:11:16: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 11 | cout << r1 << end; | ~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 |
s386212878
p03826
C
#include<stdio.h> int main() { int A,B,C,D; scanf("%d%d%d%d",&A,&B,&C,&D); if((A*B==C*D)||(A*B>C*D))rintf("%d\n",A*B); else if(A*B<C*D)printf("%d\n",C*D); return 0; }
main.c: In function 'main': main.c:9:27: error: implicit declaration of function 'rintf' [-Wimplicit-function-declaration] 9 | if((A*B==C*D)||(A*B>C*D))rintf("%d\n",A*B); | ^~~~~ main.c:2:1: note: include '<math.h>' or provide a declaration of 'rintf' 1 | #include<stdio.h> +++ |+#include <math.h> 2 | main.c:9:27: warning: incompatible implicit declaration of built-in function 'rintf' [-Wbuiltin-declaration-mismatch] 9 | if((A*B==C*D)||(A*B>C*D))rintf("%d\n",A*B); | ^~~~~ main.c:9:27: note: include '<math.h>' or provide a declaration of 'rintf' main.c:9:33: error: incompatible type for argument 1 of 'rintf' 9 | if((A*B==C*D)||(A*B>C*D))rintf("%d\n",A*B); | ^~~~~~ | | | char * main.c:9:33: note: expected 'float' but argument is of type 'char *' main.c:9:27: error: too many arguments to function 'rintf' 9 | if((A*B==C*D)||(A*B>C*D))rintf("%d\n",A*B); | ^~~~~
s299887909
p03826
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,C,D; cin<<A<<B<<C<<D; cout<<max(A*B,C*D)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:16:8: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'll' {aka 'long long int'}) 16 | cin<<A<<B<<C<<D; | ~~~^~~ | | | | | ll {aka long long int} | std::istream {aka std::basic_istream<char>} a.cc:16:8: note: candidate: 'operator<<(int, ll {aka long long int})' (built-in) 16 | cin<<A<<B<<C<<D; | ~~~^~~ a.cc:16:8: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:16:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 16 | cin<<A<<B<<C<<D; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ 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: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 16 | cin<<A<<B<<C<<D; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:16:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
s579567771
p03826
C++
#include<iostream> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; if(a * b > c * d) cout << a * b; else cout << c * d;
a.cc: In function 'int main()': a.cc:9:22: error: expected '}' at end of input 9 | else cout << c * d; | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s861215197
p03826
C++
#include <iostream> using namespace std; void ABC52(void); int main(void){ ABC52(); return 0; } void ABC52(void){ int a,b,c,d; cin >> a>>b>>c>>d; if(a*b>c*d)cout<<a*b<<endl; else acout<<c*d<<endl; }
a.cc: In function 'void ABC52()': a.cc:14:10: error: 'acout' was not declared in this scope 14 | else acout<<c*d<<endl; | ^~~~~
s602001252
p03826
C++
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include<set> #include<map> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; cout << maxi(a*b,c*d); cout << endl; }
a.cc: In function 'int main()': a.cc:14:13: error: 'maxi' was not declared in this scope 14 | cout << maxi(a*b,c*d); | ^~~~
s641436136
p03826
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c,d; cin>>a>>x>>c>>d; int x,y x=a*b,y=c*d; cout<<max(x,y)<<endl; }
a.cc: In function 'int main()': a.cc:6:11: error: 'x' was not declared in this scope 6 | cin>>a>>x>>c>>d; | ^ a.cc:8:5: error: expected initializer before 'x' 8 | x=a*b,y=c*d; | ^ a.cc:9:15: error: 'y' was not declared in this scope 9 | cout<<max(x,y)<<endl; | ^
s130536207
p03826
C++
#include <iostream> using namespae std; int main(){ int a,b,c,d; cin >> a >> b >> c >> d; if(a*b > c * d){ cout << a * b << endl; } else{ cout << c * d << endl; } return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'namespae' 2 | using namespae std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> a >> b >> c >> d; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | cout << a * b << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:8:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 8 | cout << a * b << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:11:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 11 | cout << c * d << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:11:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 11 | cout << c * d << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s315955201
p03826
C
#include<stdio.h> int main(void){ int a,b,c,d; scanf("%d %d %d %d",&a,&b,&c,&d); int mul_ab,mul_cd; mul_ab=a*b; mul_cd=c*d; int max=0; if(mul_ab<=mul_cd) max=mul_cd; if(mul_ab>=mul_cd) max=mul_ab; printf("%d",ans); return 0; }
main.c: In function 'main': main.c:11:15: error: 'ans' undeclared (first use in this function) 11 | printf("%d",ans); | ^~~ main.c:11:15: note: each undeclared identifier is reported only once for each function it appears in
s736863948
p03826
C++
#include<bits/stdc++.h> using namespace std; int a,b,c,d,e,f; int main() { cin>>a>>b>>c>>d; ← e=a*b; f=c*d; if(e>f) cout<<e<<endl; else cout<<f<<endl; }
a.cc:7:33: error: extended character ← is not valid in an identifier 7 | cin>>a>>b>>c>>d; ← | ^ a.cc: In function 'int main()': a.cc:7:33: error: '\U00002190' was not declared in this scope 7 | cin>>a>>b>>c>>d; ← | ^
s110168847
p03826
C++
#include<bits/stdc++.h> using namespace std; int main{ int a,b,c,d; cin>>a>>b>>c>>d; cout<<(a*b >=c*d ? a*b:c*d)<<endl; return 0; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:9: error: expected primary-expression before 'int' 5 | int a,b,c,d; | ^~~ a.cc:5:9: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:6:9: error: 'cin' does not name a type 6 | cin>>a>>b>>c>>d; | ^~~ a.cc:7:9: error: 'cout' does not name a type 7 | cout<<(a*b >=c*d ? a*b:c*d)<<endl; | ^~~~ a.cc:8:3: error: expected unqualified-id before 'return' 8 | return 0; | ^~~~~~ a.cc:10:1: error: expected declaration before '}' token 10 | } | ^
s288955656
p03826
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n); for(int i = 0;i<n;++i) using ll = long long; using P = pair<int,int>; int main(){ int a,b,c,d; cin << a << b << c << d; cout << max(a*b,c*d) << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 9 | cin << a << b << c << d; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:9:7: note: candidate: 'operator<<(int, int)' (built-in) 9 | cin << a << b << c << d; | ~~~~^~~~ a.cc:9:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:9:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 9 | cin << a << b << c << d; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ 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: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << a << b << c << d; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << a << b << c << d; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << a << b << c << d; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << a << b << c << d; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<c
s274898830
p03826
C++
a, b, c, d = map(int, input().split()) if a*b>c*d: print(a*b) elif a*b==c*d: print(c*d) else: print(a*b)
a.cc:1:1: error: 'a' does not name a type 1 | a, b, c, d = map(int, input().split()) | ^
s490586717
p03826
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define INF 1999999999 #define MODA 1000000007 int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); ios::sync_with_stdio(fals cin.tie(0); int a, b, c, d; cin >> a >> b >> c >> d; int side1 = a * b; int side2 = c * d; if(side1 > side2) cout << side1 << endl; else cout << side2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:26: error: 'fals' was not declared in this scope; did you mean 'fabs'? 12 | ios::sync_with_stdio(fals cin.tie(0); | ^~~~ | fabs
s477746502
p03826
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,,c,d; cin>>a>>b>>c>>d; cout<<max(a*b,c*d)<<endl; }
a.cc: In function 'int main()': a.cc:5:11: error: expected unqualified-id before ',' token 5 | int a,b,,c,d; | ^
s564895820
p03826
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B,C,D; cin >> A >> B >> C >> D; if(A*B>C*D){ cout << A*B << endl; } else if(A*B<C*D){ cout << C*D << endl; }
a.cc: In function 'int main()': a.cc:13:2: error: expected '}' at end of input 13 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s964509284
p03826
C++
#include <bits/stdc++.h> using namespace std; int main() { int A,B,C,D; cin >> A >> B >> C >> D; if(A*B>C*D){ cout << A*B << endl; }
a.cc: In function 'int main()': a.cc:10:2: error: expected '}' at end of input 10 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s380322060
p03826
C++
#include<bits/stdc++.h> using namespace std; int32_t main() { c_p_c(); int a,b,c,d; cin>>a>>b>>c>>d; if((a*b)>(c*d)) { cout<<(a*b); } else if((a*b)<(c*d)) { cout<<(c*d); } else { cout<<(a*b); } return 0; }
a.cc: In function 'int32_t main()': a.cc:5:9: error: 'c_p_c' was not declared in this scope 5 | c_p_c(); | ^~~~~
s019429145
p03826
C++
#include <iostream> using namespace std ; int main () { int A,B ; cin >> A,B ; area = A*B*2 ; cout << Area ; return 0;
a.cc: In function 'int main()': a.cc:7:1: error: 'area' was not declared in this scope 7 | area = A*B*2 ; | ^~~~ a.cc:8:9: error: 'Area' was not declared in this scope 8 | cout << Area ; | ^~~~ a.cc:10:10: error: expected '}' at end of input 10 | return 0; | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s329184405
p03826
C++
#include <iostream> using namespace std ; int main () { int A,B ; cin >> A,B ; area = A*B*2 ; cout << Area ; return 0;
a.cc: In function 'int main()': a.cc:7:1: error: 'area' was not declared in this scope 7 | area = A*B*2 ; | ^~~~ a.cc:8:9: error: 'Area' was not declared in this scope 8 | cout << Area ; | ^~~~ a.cc:10:10: error: expected '}' at end of input 10 | return 0; | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s114021102
p03826
C++
#include <bits/stdc++.h> #include <math.h> #define REP(i, n) for(int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using namespace std; typedef long long ll; typedef pair<int, int> P; const int INF = 1001001001; const int mINF = -1001001001; int main() int A,B,C,D; cin >> A >> B >> C >> D; if(A*B<C*D) { cout << C*D << endl; } else { cout << A*B << endl; } return 0; }
a.cc:13:1: error: expected initializer before 'int' 13 | int A,B,C,D; | ^~~ a.cc:14:1: error: 'cin' does not name a type 14 | cin >> A >> B >> C >> D; | ^~~ a.cc:15:1: error: expected unqualified-id before 'if' 15 | if(A*B<C*D) { | ^~ a.cc:17:3: error: expected unqualified-id before 'else' 17 | } else { | ^~~~ a.cc:20:1: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s410239537
p03826
C++
#include <bits/stdc++.h> using namespace std; int main(void) { int a,b,c,d; cin>>a>>b>>c>>d; if(a*b > c*d) cout<<a*b<<endl; else cout<<c*d<<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:25: error: expected primary-expression before '<' token 9 | else cout<<c*d<<<endl; | ^
s138530200
p03826
C++
#include<bits/stdc++.h> using namespace std; template <class T1, class T2> using dict = std::unordered_map<T1, T2>; int main(){ ll A,B,C,D; cin >> A >> B>>C>>D; cout << max(A*B,C*D) << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: 'll' was not declared in this scope 8 | ll A,B,C,D; | ^~ a.cc:9:12: error: 'A' was not declared in this scope 9 | cin >> A >> B>>C>>D; | ^ a.cc:9:17: error: 'B' was not declared in this scope 9 | cin >> A >> B>>C>>D; | ^ a.cc:9:20: error: 'C' was not declared in this scope 9 | cin >> A >> B>>C>>D; | ^ a.cc:9:23: error: 'D' was not declared in this scope 9 | cin >> A >> B>>C>>D; | ^
s550340527
p03826
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++) #define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++) #define setp(n) fixed << setprecision(n) 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 (a>b) { a=b; return 1; } return 0; } #define ll long long #define vll vector<ll> #define vi vector<int> #define pll pair<ll,ll> #define pi pair<int,int> #define all(a) (a.begin()),(a.end()) #define rall(a) (a.rbegin()),(a.rend()) #define fi first #define se second #define pb push_back #define mp make_pair #define ins insert using namespace std; /* Some Libraries */ //------------------------------------------------- int main(void) { cin.tie(0); ios::sync_with_stdio(false); int a,b,c,d; cin>>a>b>>c>>d; cout<<max(a*b,c*d)<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:37:24: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 37 | int a,b,c,d; cin>>a>b>>c>>d; | ~~~~~~^~~~~~~~ | | | | | int | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:37:24: note: candidate: 'operator>(int, int)' (built-in) 37 | int a,b,c,d; cin>>a>b>>c>>d; | ~~~~~~^~~~~~~~ a.cc:37:24: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1329 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed: a.cc:37:31: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1497 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed: a.cc:37:31: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1673 | operator>(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:37:31: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 37 | int a,b,c,d; cin>>a>b>>c>>d; | ^ /usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 710 | operator> (__type_identity_t<basic_stri
s026764461
p03826
C
#include<stdio.h> int main(void){ int a,b,c,d,ans; csnaf("%d%d%d%d",&a,&b,&c,&d); ans=a*b>=c*d?a*b:c*d; printf("%d",ans); return 0; }
main.c: In function 'main': main.c:4:5: error: implicit declaration of function 'csnaf' [-Wimplicit-function-declaration] 4 | csnaf("%d%d%d%d",&a,&b,&c,&d); | ^~~~~
s843412968
p03826
C++
include<iostream> using namespace std; int main(){ int a,b,c,d; cin >> a >> b >> c >> d; if (a*b > c*d) cout << a*b << endl; else cout << c*d << endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> a >> b >> c >> d; | ^~~ a.cc:6:18: error: 'cout' was not declared in this scope 6 | if (a*b > c*d) cout << a*b << endl; | ^~~~ a.cc:6:33: error: 'endl' was not declared in this scope 6 | if (a*b > c*d) cout << a*b << endl; | ^~~~ a.cc:7:8: error: 'cout' was not declared in this scope 7 | else cout << c*d << endl; | ^~~~ a.cc:7:23: error: 'endl' was not declared in this scope 7 | else cout << c*d << endl; | ^~~~
s098267494
p03826
C++
#include<iostream> using namespace std; int main{ int a,b,c,d; cin >> a >> b >> c >> d; if (a*b > c*d) cout << a*b << endl; else cout << c*d << endl; return 0; }
a.cc:3:5: error: cannot declare '::main' to be a global variable 3 | int main{ | ^~~~ a.cc:4:3: error: expected primary-expression before 'int' 4 | int a,b,c,d; | ^~~ a.cc:4:3: error: expected '}' before 'int' a.cc:3:9: note: to match this '{' 3 | int main{ | ^ a.cc:5:3: error: 'cin' does not name a type 5 | cin >> a >> b >> c >> d; | ^~~ a.cc:6:3: error: expected unqualified-id before 'if' 6 | if (a*b > c*d) cout << a*b << endl; | ^~ a.cc:7:3: error: expected unqualified-id before 'else' 7 | else cout << c*d << endl; | ^~~~ a.cc:8:3: error: expected unqualified-id before 'return' 8 | return 0; | ^~~~~~ a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s821910242
p03826
C++
#include<iostream> using namespace std; int main{ int a,b,c,d; cin >> a >> b >> c >> d; if (a*b > c*d) cout << a*b << endl; else cout << c*d << endl; return 0; }
a.cc:3:5: error: cannot declare '::main' to be a global variable 3 | int main{ | ^~~~ a.cc:4:3: error: expected primary-expression before 'int' 4 | int a,b,c,d; | ^~~ a.cc:4:3: error: expected '}' before 'int' a.cc:3:9: note: to match this '{' 3 | int main{ | ^ a.cc:5:3: error: 'cin' does not name a type 5 | cin >> a >> b >> c >> d; | ^~~ a.cc:6:3: error: expected unqualified-id before 'if' 6 | if (a*b > c*d) cout << a*b << endl; | ^~ a.cc:7:3: error: expected unqualified-id before 'else' 7 | else cout << c*d << endl; | ^~~~ a.cc:8:3: error: expected unqualified-id before 'return' 8 | return 0; | ^~~~~~ a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s142436992
p03826
C++
include<iostream> using namespace std; int main{ int a,b,c,d; cin >> a >> b >> c >> d; if (a*b > c*d) cout << a*b << endl; else cout << c*d << endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc:3:5: error: cannot declare '::main' to be a global variable 3 | int main{ | ^~~~ a.cc:4:3: error: expected primary-expression before 'int' 4 | int a,b,c,d; | ^~~ a.cc:4:3: error: expected '}' before 'int' a.cc:3:9: note: to match this '{' 3 | int main{ | ^ a.cc:5:3: error: 'cin' does not name a type 5 | cin >> a >> b >> c >> d; | ^~~ a.cc:6:3: error: expected unqualified-id before 'if' 6 | if (a*b > c*d) cout << a*b << endl; | ^~ a.cc:7:3: error: expected unqualified-id before 'else' 7 | else cout << c*d << endl; | ^~~~ a.cc:8:3: error: expected unqualified-id before 'return' 8 | return 0; | ^~~~~~ a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s728724859
p03826
C++
include<iostream> using namespace std; int main(){ int a,b,c,d; cin>>a>>b>>c>>d; if(a*b>=c*d) cout<<a*b<<endl; else cout<<c*d<<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin>>a>>b>>c>>d; | ^~~ a.cc:7:5: error: 'cout' was not declared in this scope 7 | cout<<a*b<<endl; | ^~~~ a.cc:7:16: error: 'endl' was not declared in this scope 7 | cout<<a*b<<endl; | ^~~~ a.cc:9:5: error: 'cout' was not declared in this scope 9 | cout<<c*d<<endl; | ^~~~ a.cc:9:16: error: 'endl' was not declared in this scope 9 | cout<<c*d<<endl; | ^~~~
s657507088
p03826
C++
include<iostream> using namespace std; int main(){ int x=a*b,int y=c*d; if(x>=y) cout<<x<<endl; else cout<<y<<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:4:9: error: 'a' was not declared in this scope 4 | int x=a*b,int y=c*d; | ^ a.cc:4:11: error: 'b' was not declared in this scope 4 | int x=a*b,int y=c*d; | ^ a.cc:5:9: error: 'y' was not declared in this scope 5 | if(x>=y) | ^ a.cc:6:5: error: 'cout' was not declared in this scope 6 | cout<<x<<endl; | ^~~~ a.cc:6:14: error: 'endl' was not declared in this scope 6 | cout<<x<<endl; | ^~~~ a.cc:8:5: error: 'cout' was not declared in this scope 8 | cout<<y<<endl; | ^~~~ a.cc:8:14: error: 'endl' was not declared in this scope 8 | cout<<y<<endl; | ^~~~
s844986673
p03826
C++
include<iostream> using namespace std; int main(){ x=a*b,y=c*d; if(x>=y) cout<<x<<endl; else cout<<y<<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:4:3: error: 'x' was not declared in this scope 4 | x=a*b,y=c*d; | ^ a.cc:4:5: error: 'a' was not declared in this scope 4 | x=a*b,y=c*d; | ^ a.cc:4:7: error: 'b' was not declared in this scope 4 | x=a*b,y=c*d; | ^ a.cc:4:9: error: 'y' was not declared in this scope 4 | x=a*b,y=c*d; | ^ a.cc:4:11: error: 'c' was not declared in this scope 4 | x=a*b,y=c*d; | ^ a.cc:4:13: error: 'd' was not declared in this scope 4 | x=a*b,y=c*d; | ^ a.cc:6:5: error: 'cout' was not declared in this scope 6 | cout<<x<<endl; | ^~~~ a.cc:6:14: error: 'endl' was not declared in this scope 6 | cout<<x<<endl; | ^~~~ a.cc:8:5: error: 'cout' was not declared in this scope 8 | cout<<y<<endl; | ^~~~ a.cc:8:14: error: 'endl' was not declared in this scope 8 | cout<<y<<endl; | ^~~~