submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s992570757 | p03678 | C++ | #include <bits/stdc++.h>
#define b 31ll
#define mod 1004535809ll
#define ll long long
using namespace std;
char s[400005];
ll l[1005],fib[1005][27],ans[27];
ll has[400005],m[400005],lo,hi;
int len,t;
inline ll get(int l,int r)
{if (l>r) return 0;
ll ret=(has[r]-has[l-1]*m[r-l+1])%mod;
return (ret<0?ret+mod:ret);
}
inline void add(ll p,int pos)
{if (pos==0)
{for (int i=1;i<=p;i++)
{ans[s[i]-'a']++;}
return;
}
if (p>=l[pos-1])
{for (int i=0;i<26;i++) ans[i]+=fib[pos-1][i];
add(p-l[pos-1],pos-2);
return;
}
add(p,pos-1);
}
inline void del(ll p,int pos)
{if (pos==0)
{for (int i=1;i<=p;i++)
{ans[s[i]-'a']--;}
return;
}
if (p>=l[pos-1])
{for (int i=0;i<26;i++) ans[i]-=fib[pos-1][i];
del(p-l[pos-1],pos-2);
return;
}
del(p,pos-1);
}
int main (){
int i,j,las;
gets(s+1);len=strlen(s+1);
scanf ("%lld%lld",&lo,&hi);
m[0]=1ll;len>>=1;
for (i=1;i<=len;i++)
{m[i]=m[i-1]*b%mod;
has[i]=has[i-1]*b+(s[i]-'0');
has[i]%=mod;
}
for (i=1;i<=len;i++)
{if (get(1,len-i)==get(i+1,len))
{t=i;break;}
}
l[0]=len;l[1]=len+t;
for (i=1;i<=len;i++)
{fib[0][s[i]-'a']++;
fib[1][s[i]-'a']++;
}
for (i=1;i<=t;i++)
{fib[1][s[i]-'a']++;}
for (i=2;l[i-2]+l[i-1]<=2ll*hi;i++)
{for (j=0;j<26;j++)
{fib[i][j]=fib[i-1][j]+fib[i-2][j];}
l[i]=l[i-1]+l[i-2];
las=i;
}
add(hi,las);del(lo-1,las);
for (i=0;i<26;i++)
{printf ("%lld ",ans[i]);}
return 0;
} | a.cc: In function 'int main()':
a.cc:43:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
43 | gets(s+1);len=strlen(s+1);
| ^~~~
| getw
|
s238717995 | p03678 | C++ | #include<bits/stdc++.h>
using namespace std;
char st[500010];
int go[500010][26],next[500010],w,len;
long long work(long long r,int ch)
{
if (r<=len) return go[r][ch];
long long n1=go[len/2][ch],n2=go[w][ch],l1=len/2,l2=w;
while (l1+l2<=r)
{
long long tmp=l1;l1+=l2;l2=tmp;
tmp=n1;n1+=n2;n2=tmp;
}
return n1+work(r-l1,ch);
}
int main()
{
scanf("%s\n",st+1);len=strlen(st+1);
for (int i=1;i<=len;i++)
{
for (int j=0;j<26;j++) go[i][j]=go[i-1][j];
go[i][st[i]-'a']++;
}
next[0]=-1;
for (int i=1;i<=len;i++)
{
int t=next[i-1];
while ((t!=-1)&&(st[t+1]!=st[i])) t=next[t];
next[i]=t+1;
}
w=next[len];
while (w>=len/2) w=next[w];
w=len/2-w;
long long l,r;scanf("%lld%lld",&l,&r);
for (int i=0;i<26;i++) printf("%lld ",work(r,i)-work(l-1,i));
} | a.cc: In function 'int main()':
a.cc:24:9: error: reference to 'next' is ambiguous
24 | next[0]=-1;
| ^~~~
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 [500010]'
4 | int go[500010][26],next[500010],w,len;
| ^~~~
a.cc:27:23: error: reference to 'next' is ambiguous
27 | int t=next[i-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 [500010]'
4 | int go[500010][26],next[500010],w,len;
| ^~~~
a.cc:28:53: error: reference to 'next' is ambiguous
28 | while ((t!=-1)&&(st[t+1]!=st[i])) t=next[t];
| ^~~~
/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 [500010]'
4 | int go[500010][26],next[500010],w,len;
| ^~~~
a.cc:29:17: error: reference to 'next' is ambiguous
29 | next[i]=t+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 [500010]'
4 | int go[500010][26],next[500010],w,len;
| ^~~~
a.cc:31:11: error: reference to 'next' is ambiguous
31 | w=next[len];
| ^~~~
/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 [500010]'
4 | int go[500010][26],next[500010],w,len;
| ^~~~
a.cc:32:28: error: reference to 'next' is ambiguous
32 | while (w>=len/2) w=next[w];
| ^~~~
/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 [500010]'
4 | int go[500010][26],next[500010],w,len;
| ^~~~
|
s461725710 | p03678 | C++ | #include<bits/stdc++.h>
#define N 200005
#define LL long long
#define ULL unsigned LL
using namespace std;
LL l,r,a[26],b[26],f[95][27],F[95];
int n; char A[N];
ULL H[N],S[N];
ULL hash(int l,int r){ return H[r]-H[l-1]*S[r-l+1];}
void calc(LL r,int v,LL *a)
{
int i,j;
if(n%v==0){
for(i=1;i<=n&&i<=r;i++) a[A[i]-'a']++;
if(r>=n){
r-=n;
for(i=1;i<=v;i++)
a[A[i]-'a']+=r/v+(r%v>=i);
}
}
else{
memset(f,0,sizeof(f));
for(i=1;i<=v;i++) f[0][A[i]-'a']++;
for(i=1;i<=n;i++) f[1][A[i]-'a']++;
F[0]=v,F[1]=n;
for(i=2;i<=90;i++){
F[i]=F[i-1]+F[i-2];
for(j=0;j<26;j++)
f[i][j]=f[i-1][j]+f[i-2][j];
if(F[i]>r) break;
}
while(i){
if(r>=F[i]){
for(j=0;j<26;j++) a[j]+=f[i][j];
r-=F[i];
}
i--;
}
for(i=1;i<=r;i++) a[A[i]-'a']++;
}
}
int main()
{
int i;
scanf("%s",A+1);
n=strlen(A+1)/2;
cin>>l>>r;
S[0]=1;
for(i=1;i<=n;i++)
H[i]=H[i-1]*173+A[i],S[i]=S[i-1]*173;
for(i=1;i<=n;i++)
if(hash(i+1,n)==hash(1,n-i))
break;
calc(r,i,a);
calc(l-1,i,b);
for(i=0;i<26;i++)
printf("%lld ",a[i]-b[i]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:52:20: error: reference to 'hash' is ambiguous
52 | if(hash(i+1,n)==hash(1,n-i))
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
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,
from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:9:5: note: 'long long unsigned int hash(int, int)'
9 | ULL hash(int l,int r){ return H[r]-H[l-1]*S[r-l+1];}
| ^~~~
a.cc:52:33: error: reference to 'hash' is ambiguous
52 | if(hash(i+1,n)==hash(1,n-i))
| ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:9:5: note: 'long long unsigned int hash(int, int)'
9 | ULL hash(int l,int r){ return H[r]-H[l-1]*S[r-l+1];}
| ^~~~
|
s472251268 | p03678 | C++ | for (int i=1;i<sz;i++)
{
if (z[i]+i==sz && sz%i==0)
{
z_func(i);g=i;
for (int j=1;j<i;j++)
{
if (z[j]+j==i) g=0;
}
break;
}
}
if (g)
{
cnt[s[0]-'a'][0]=1;
for (int i=1;i<g;i++)
{
for (int j=0;j<26;j++)
{
if (j==s[i]-'a') cnt[j][i]=cnt[j][i-1]+1;
else cnt[j][i]=cnt[j][i-1];
}
}
for (int i=0;i<26;i++)
{
printf("%lld ",query(r,i)-query(l-1,i));
}
return 0;
} | a.cc:1:1: error: expected unqualified-id before 'for'
1 | for (int i=1;i<sz;i++)
| ^~~
a.cc:1:14: error: 'i' does not name a type
1 | for (int i=1;i<sz;i++)
| ^
a.cc:1:19: error: 'i' does not name a type
1 | for (int i=1;i<sz;i++)
| ^
a.cc:13:9: error: expected unqualified-id before 'if'
13 | if (g)
| ^~
|
s893574502 | p03678 | 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=200005;
const int maxm=30;
const int H=31;
ll l,r;
int n,len,len2;
string s;
int cnt[maxn][maxm];
int hash[maxn],power[maxn],z[maxn];
ll ans[maxm];
void Z_algorithm(){
z[0]=0;
int L=0,R=0;
REP(i,n-1){
if(R<=i){
for(int j=0;i+j<n;j++)
if(s[j]==s[i+j])z[i]++;
else break;
if(z[i])L=i,R=i+z[i]-1;
}
else{
if(i>L&&i<R&&z[i-l]<=r-i)z[i]=z[i-l];
else{
z[i]=r-i;
for(int j=r-i;i+j<n;j++)
if(s[j]==s[i+j])z[i]++;
else break;
if(z[i])L=i,R=i+z[i]-1;
}
}
}
}
bool same(int pos){
int k1=hash[pos-1],k2=hash[n-1]-hash[n-1-pos]*power[pos];
return k1==k2;
}
inline vector<ll>add_vector(vector<ll>a,vector<ll>b){
rep(i,26)b[i]+=a[i];
return b;
}
ll solve(ll l_len,vector<ll>L,ll r_len,vector<ll>R,ll rest,vector<ll>&Ans){
if(l_len+r_len<=rest){
vector<ll>sum=add_vector(L,R);
ll x=solve(l_len+r_len,sum,l_len,L,rest,Ans);
rest=x;
}
if(l_len<=rest){
Ans=add_vector(Ans,L);
rest-=l_len;
}
return rest;
}
int main(){
ios::sync_with_stdio(false);
cin>>s>>l>>r;
l--;r--;
s=s.substr(0,s.size()/2);
n=s.size();
rep(i,n){
rep(j,26){
if(s[i]-'a'==j)cnt[i][j]=!i?1:cnt[i-1][j]+1;
else cnt[i][j]=!i?0:cnt[i-1][j];
}
}
hash[0]=s[0]-'a';power[0]=1;
REP(i,n-1)hash[i]=hash[i-1]*H+s[i]-'a',power[i]=power[i-1]*H;
REP(i,n-1)if(same(i))len=max(len,i);
// Z_algorithm();
// REP(i,n-1)if(z[i]+i==n)len2=max(len2,i);
if(len==0){
rep(j,26){
ans[j]+=(ll)cnt[n-1][j]*(r/(ll)n)+(ll)cnt[r%(ll)n][j];
if(l-1>=0)ans[j]-=(ll)cnt[n-1][j]*((l-1)/(ll)n)+(ll)cnt[(l-1)%(ll)n][j];
}
rep(j,26)cout<<ans[j]<<' ';
return 0;
}
else{
len=n-len;
vector<ll>L(maxm),R(maxm);
rep(i,26)L[i]=cnt[len-1][i];
rep(i,26)R[i]=cnt[n-1][i]-cnt[len-1][i];
vector<ll>Ans1(maxm),Ans2(maxm);
ll x1=solve(len,L,n-len,R,r+1,Ans1);
ll x2=solve(len,L,n-len,R,l,Ans2);
rep(i,26){
ans[i]+=Ans1[i]-Ans2[i];
if(x1>=1)ans[i]+=(ll)cnt[x1-1][i];
if(x2>=1)ans[i]-=(ll)cnt[x2-1][i];
}
rep(i,26)cout<<ans[i]<<" ";
return 0;
}
} | a.cc: In function 'bool same(int)':
a.cc:90:16: error: reference to 'hash' is ambiguous
90 | int k1=hash[pos-1],k2=hash[n-1]-hash[n-1-pos]*power[pos];
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
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:2:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:62:5: note: 'int hash [200005]'
62 | int hash[maxn],power[maxn],z[maxn];
| ^~~~
a.cc:91:20: error: 'k2' was not declared in this scope; did you mean 'k1'?
91 | return k1==k2;
| ^~
| k1
a.cc: In function 'int main()':
a.cc:126:9: error: reference to 'hash' is ambiguous
126 | hash[0]=s[0]-'a';power[0]=1;
| ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:62:5: note: 'int hash [200005]'
62 | int hash[maxn],power[maxn],z[maxn];
| ^~~~
a.cc:127:19: error: reference to 'hash' is ambiguous
127 | REP(i,n-1)hash[i]=hash[i-1]*H+s[i]-'a',power[i]=power[i-1]*H;
| ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:62:5: note: 'int hash [200005]'
62 | int hash[maxn],power[maxn],z[maxn];
| ^~~~
a.cc:127:27: error: reference to 'hash' is ambiguous
127 | REP(i,n-1)hash[i]=hash[i-1]*H+s[i]-'a',power[i]=power[i-1]*H;
| ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:62:5: note: 'int hash [200005]'
62 | int hash[maxn],power[maxn],z[maxn];
| ^~~~
|
s567088609 | p03678 | 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 repd(i,n) for(int (i)=n-1;(i)>=0;i--)
#define REPD(i,n) for(int (i)=n;(i)>0;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=200005;
const int Maxm=30;
const int Hash=31;
int n,match;
string s;
ll l,r;
int hash[Maxn],power[Maxn];
int cnt[Maxn][Maxm];
ll ans[Maxm];
vector<ll>L,R;
bool same(int pos){
int k1=hash[pos-1],k2=hash[n-1]-hash[n-1-pos]*power[pos];
return k1==k2;
}
vector<ll> add_ans(vector<ll>a,vector<ll>b){
rep(i,26)a[i]+=b[i];
return a;
}
pair<ll,vector<ll> > solve(ll l_len,vector<ll>L,ll r_len,vector<ll>R,ll rest){
vector<ll>res(26);
if(l_len+r_len<=rest){
vector<ll>sum=add_ans(L,R);
pair<ll,vector<ll> >ret=solve(l_len+r_len,sum,l_len,L,rest);
rest=ret.fi;
res=add_ans(res,ret.se);
}
if(l_len<=rest){
res=add_ans(res,L);
rest-=l_len;
}
return mk(rest,res);
}
int main(){
ios::sync_with_stdio(false);
cin>>s>>l>>r;
l--;r--;
s=s.substr(0,s.size()/2);
n=sz(s);
hash[0]=s[0]-'a';power[0]=1;
REP(i,n-1)hash[i]=hash[i-1]*Hash+s[i]-'a',power[i]=power[i-1]*Hash;
REP(i,n-1)if(same(i))match=max(match,i);
rep(i,n){
rep(j,26){
if(j==s[i]-'a')cnt[i][j]=!i?1:cnt[i-1][j]+1;
else cnt[i][j]=!i?0:cnt[i-1][j];
}
}
if(match==0){
rep(i,26){
ans[i]+=(ll)cnt[n-1][i]*(ll)(r/(ll)n)+(ll)cnt[r%(ll)n][i];
if((l-1)>=0)ans[i]-=(ll)cnt[n-1][i]*(ll)((l-1)/(ll)n)+(ll)cnt[(l-1)%(ll)n][i];
}
rep(i,26)cout<<ans[i]<<" ";
return 0;
}
else{
L.resize(26);R.resize(26);
rep(i,26)R[i]=cnt[match-1][i];
rep(i,26)L[i]=cnt[n-1][i]-cnt[match-1][i];
pair<ll,vector<ll> >ans_R=solve(n-match,L,match,R,r);
pair<ll,vector<ll> >ans_L=solve(n-match,L,match,R,l-1);
rep(i,26){
ans[i]+=ans_R.se[i]+cnt[ans_R.fi][i];
ans[i]-=ans_L.se[i]+cnt[ans_L.fi][i];
}
rep(i,26)cout<<ans[i]<<" ";
return 0;
}
}
/*
vgxgpuamkvgxgvgxgpuamkvgxg
1 1000000000000000000
*/ | a.cc: In function 'bool same(int)':
a.cc:69:16: error: reference to 'hash' is ambiguous
69 | int k1=hash[pos-1],k2=hash[n-1]-hash[n-1-pos]*power[pos];
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
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:2:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:63:5: note: 'int hash [200005]'
63 | int hash[Maxn],power[Maxn];
| ^~~~
a.cc:70:20: error: 'k2' was not declared in this scope; did you mean 'k1'?
70 | return k1==k2;
| ^~
| k1
a.cc: In function 'int main()':
a.cc:100:9: error: reference to 'hash' is ambiguous
100 | hash[0]=s[0]-'a';power[0]=1;
| ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:63:5: note: 'int hash [200005]'
63 | int hash[Maxn],power[Maxn];
| ^~~~
a.cc:101:19: error: reference to 'hash' is ambiguous
101 | REP(i,n-1)hash[i]=hash[i-1]*Hash+s[i]-'a',power[i]=power[i-1]*Hash;
| ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:63:5: note: 'int hash [200005]'
63 | int hash[Maxn],power[Maxn];
| ^~~~
a.cc:101:27: error: reference to 'hash' is ambiguous
101 | REP(i,n-1)hash[i]=hash[i-1]*Hash+s[i]-'a',power[i]=power[i-1]*Hash;
| ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
59 | struct hash;
| ^~~~
a.cc:63:5: note: 'int hash [200005]'
63 | int hash[Maxn],power[Maxn];
| ^~~~
|
s356820727 | p03678 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
const int maxn = 200009;
char s[maxn]; int Next[maxn], n, m;
LL l, r, w[26];
void solve(LL k){
if (k <= n){
for (int i=0; i<k; i++) w[s[i]-'a']++;
return;
}
LL S = 1, T = 0, _s = 0, _t = 1;
while (S*n + T*m < k) { S += _s; T += _t; _s = S - _s; _t = T - _t; }
solve(k - _s*n - _t*m);
for (int i=0; i<n; i++) w[s[i]-'a'] += _s;
for (int i=0; i<m; i++) w[s[i]-'a'] += _t;
}
int main(){
gets(s); scanf("%lld%lld", &l, &r);
n = strlen(s)/2;
int k = 0; Next[0] = 0;
for (int i=1; i<n; i++){
while (k && s[k] != s[i]) k = Next[k-1];
if (s[k] == s[i]) k++; Next[i] = k;
}
m = n-Next[n-1];
solve(l-1); for (int i=0; i<26; i++) w[i] = -w[i];
solve(r); for (int i=0; i<26; i++) printf("%lld ", w[i]);
return 0;
} | a.cc: In function 'int main()':
a.cc:24:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
24 | gets(s); scanf("%lld%lld", &l, &r);
| ^~~~
| getw
|
s686519780 | p03678 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
#define N 200006
using namespace std;
char s[N];long long f[106],g[106][26],a[26],l,r,x;
int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
inline int read()
{
int x=0,c=getchar(),f=1;while(c<'0'||c>'9')f=(c=='-'?-f:f),c=getchar();
while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+c-48,c=getchar();return f>0?x:-x;
}
void print(long long x)
{
if(x>9)print(x/10);putchar(x%10+48);
}
void SA()
{
for(int i=1;i<=n;i++)cntA[(int)s[i]]++;
for(int i=1;i<N;i++)cntA[i]+=cntA[i-1];
for(int i=n;i;i--)sa[cntA[(int)s[i]]--]=i;
rank[sa[1]]=1;
for(int i=2;i<=n;i++){
rank[sa[i]]=rank[sa[i-1]];
if(s[sa[i]]!=s[sa[i-1]])rank[sa[i]]++;
}
for(int l=1;rank[sa[n]]!=n;l<<=1){
for(int i=0;i<N;i++)cntA[i]=cntB[i]=0;
for(int i=1;i<=n;i++){
cntA[A[i]=rank[i]]++;
cntB[B[i]=(i+l<=n?rank[i+l]:0)]++;
}
for(int i=1;i<N;i++)cntA[i]+=cntA[i-1],cntB[i]+=cntB[i-1];
for(int i=n;i;i--)tsa[cntB[B[i]]--]=i;
for(int i=n;i;i--)sa[cntA[A[tsa[i]]]--]=tsa[i];
rank[sa[1]]=1;
for(int i=2;i<=n;i++){
rank[sa[i]]=rank[sa[i-1]];
if(A[sa[i]]!=A[sa[i-1]]||B[sa[i]]!=B[sa[i-1]])rank[sa[i]]++;
}
}
int tot=0;
for(int i=1;i<=n;i++){
if(tot)tot--;
while(s[i+tot]==s[sa[rank[i]-1]+tot])tot++;
height[rank[i]]=tot;
}
p=n;int mi=N;
for(int i=rank[1];i>=2;i--){
mi=min(mi,height[i]);
if(mi==n-sa[i-1]+1)p=min(p,sa[i-1]-1);
}mi=N;
for(int i=rank[1]+1;i<=n;i++){
mi=min(mi,height[i]);
if(mi==n-sa[i]+1)p=min(p,sa[i]-1);
}
}
void wk(int w,int F)
{
if(x==0)return;
if(f[w]>x)
if(w>2){wk(w-1,F);if(x)wk(w-2,F);}
else{for(int i=1;i<=x;i++)a[s[i]-97]+=F;x=0;}
else{for(int i=0;i<26;i++)a[i]+=F*g[w][i];x-=f[w];}
}
int main()
{
scanf("%s",s+1);
n=strlen(s+1)/2;scanf("%lld%lld",&l,&r);SA();
for(int i=1;i<=p;i++)v[s[i]-97]++;
if(n%p==0){
if(r<=n)for(int i=l;i<=r;i++)a[s[i]-97]++;
else{
if(l<=n)for(int i=l;i<=n;i++)a[s[i]-97]++;
else for(int i=(l-n)%p;i<=p;i++)a[s[i]-97]++;
r-=n;for(int i=1;i<=r%p;i++)a[s[i]-97]++;
for(int i=0;i<26;i++)a[i]+=1LL*v[i]*(r/p-(l<=n?0:(l-n-1)/p+1));
}
}else{
f[1]=n;f[2]=n+p;
for(int i=1;i<=n;i++)g[1][s[i]-97]=++g[2][s[i]-97];
for(int i=0;i<26;i++)g[2][i]+=v[i];
for(t=3;f[t-1]<r;t++){
f[t]=f[t-1]+f[t-2];
for(int i=0;i<26;i++)g[t][i]+=g[t-1][i]+g[t-2][i];
}t--;
x=r;wk(t,1);if(l>1)x=l-1,wk(t,-1);
}
for(int i=0;i<25;i++)printf("%lld ",a[i]);printf("%lld\n",a[25]);
} | a.cc: In function 'void SA()':
a.cc:22:9: error: reference to 'rank' is ambiguous
22 | rank[sa[1]]=1;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from a.cc:3:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:24:17: error: reference to 'rank' is ambiguous
24 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:24:29: error: reference to 'rank' is ambiguous
24 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:25:41: error: reference to 'rank' is ambiguous
25 | if(s[sa[i]]!=s[sa[i-1]])rank[sa[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:27:21: error: reference to 'rank' is ambiguous
27 | for(int l=1;rank[sa[n]]!=n;l<<=1){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:30:35: error: reference to 'rank' is ambiguous
30 | cntA[A[i]=rank[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:31:43: error: reference to 'rank' is ambiguous
31 | cntB[B[i]=(i+l<=n?rank[i+l]:0)]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:36:17: error: reference to 'rank' is ambiguous
36 | rank[sa[1]]=1;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:38:25: error: reference to 'rank' is ambiguous
38 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:38:37: error: reference to 'rank' is ambiguous
38 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:39:71: error: reference to 'rank' is ambiguous
39 | if(A[sa[i]]!=A[sa[i-1]]||B[sa[i]]!=B[sa[i-1]])rank[sa[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:45:38: error: reference to 'rank' is ambiguous
45 | while(s[i+tot]==s[sa[rank[i]-1]+tot])tot++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:46:24: error: reference to 'rank' is ambiguous
46 | height[rank[i]]=tot;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:49:19: error: reference to 'rank' is ambiguous
49 | for(int i=rank[1];i>=2;i--){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:53:19: error: reference to 'rank' is ambiguous
53 | for(int i=rank[1]+1;i<=n;i++){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:7:33: note: 'int rank [200006]'
7 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
|
s351884529 | p03678 | C++ | #include <bits/stdc++.h>
#define N 200006
using namespace std;
char s[N];long long f[106],g[106][26],a[26],l,r,x;
int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
inline int read()
{
int x=0,c=getchar(),f=1;while(c<'0'||c>'9')f=(c=='-'?-f:f),c=getchar();
while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+c-48,c=getchar();return f>0?x:-x;
}
void print(long long x)
{
if(x>9)print(x/10);putchar(x%10+48);
}
void SA()
{
for(int i=1;i<=n;i++)cntA[(int)s[i]]++;
for(int i=1;i<N;i++)cntA[i]+=cntA[i-1];
for(int i=n;i;i--)sa[cntA[(int)s[i]]--]=i;
rank[sa[1]]=1;
for(int i=2;i<=n;i++){
rank[sa[i]]=rank[sa[i-1]];
if(s[sa[i]]!=s[sa[i-1]])rank[sa[i]]++;
}
for(int l=1;rank[sa[n]]!=n;l<<=1){
for(int i=0;i<N;i++)cntA[i]=cntB[i]=0;
for(int i=1;i<=n;i++){
cntA[A[i]=rank[i]]++;
cntB[B[i]=(i+l<=n?rank[i+l]:0)]++;
}
for(int i=1;i<N;i++)cntA[i]+=cntA[i-1],cntB[i]+=cntB[i-1];
for(int i=n;i;i--)tsa[cntB[B[i]]--]=i;
for(int i=n;i;i--)sa[cntA[A[tsa[i]]]--]=tsa[i];
rank[sa[1]]=1;
for(int i=2;i<=n;i++){
rank[sa[i]]=rank[sa[i-1]];
if(A[sa[i]]!=A[sa[i-1]]||B[sa[i]]!=B[sa[i-1]])rank[sa[i]]++;
}
}
int tot=0;
for(int i=1;i<=n;i++){
if(tot)tot--;
while(s[i+tot]==s[sa[rank[i]-1]+tot])tot++;
height[rank[i]]=tot;
}
p=n;int mi=N;
for(int i=rank[1];i>=2;i--){
mi=min(mi,height[i]);
if(mi==n-sa[i-1]+1)p=min(p,sa[i-1]-1);
}mi=N;
for(int i=rank[1]+1;i<=n;i++){
mi=min(mi,height[i]);
if(mi==n-sa[i]+1)p=min(p,sa[i]-1);
}
}
void wk(int w,int F)
{
if(x==0)return;
if(f[w]>x)
if(w>2){wk(w-1,F);if(x)wk(w-2,F);}
else{for(int i=1;i<=x;i++)a[s[i]-97]+=F;x=0;}
else{for(int i=0;i<26;i++)a[i]+=F*g[w][i];x-=f[w];}
}
int main()
{
scanf("%s",s+1);
n=strlen(s+1)/2;scanf("%lld%lld",&l,&r);SA();
for(int i=1;i<=p;i++)v[s[i]-97]++;
if(n%p==0){
if(r<=n)for(int i=l;i<=r;i++)a[s[i]-97]++;
else{
if(l<=n)for(int i=l;i<=n;i++)a[s[i]-97]++;
else for(int i=(l-n)%p;i<=p;i++)a[s[i]-97]++;
r-=n;for(int i=1;i<=r%p;i++)a[s[i]-97]++;
for(int i=0;i<26;i++)a[i]+=1LL*v[i]*(r/p-(l<=n?0:(l-n-1)/p+1));
}
}else{
f[1]=n;f[2]=n+p;
for(int i=1;i<=n;i++)g[1][s[i]-97]=++g[2][s[i]-97];
for(int i=0;i<26;i++)g[2][i]+=v[i];
for(t=3;f[t-1]<r;t++){
f[t]=f[t-1]+f[t-2];
for(int i=0;i<26;i++)g[t][i]+=g[t-1][i]+g[t-2][i];
}t--;
x=r;wk(t,1);if(l>1)x=l-1,wk(t,-1);
}
for(int i=0;i<25;i++)printf("%lld ",a[i]);printf("%lld\n",a[25]);
} | a.cc: In function 'void SA()':
a.cc:20:9: error: reference to 'rank' is ambiguous
20 | rank[sa[1]]=1;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
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,
from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:22:17: error: reference to 'rank' is ambiguous
22 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:22:29: error: reference to 'rank' is ambiguous
22 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:23:41: error: reference to 'rank' is ambiguous
23 | if(s[sa[i]]!=s[sa[i-1]])rank[sa[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:25:21: error: reference to 'rank' is ambiguous
25 | for(int l=1;rank[sa[n]]!=n;l<<=1){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:28:35: error: reference to 'rank' is ambiguous
28 | cntA[A[i]=rank[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:29:43: error: reference to 'rank' is ambiguous
29 | cntB[B[i]=(i+l<=n?rank[i+l]:0)]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:34:17: error: reference to 'rank' is ambiguous
34 | rank[sa[1]]=1;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:36:25: error: reference to 'rank' is ambiguous
36 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:36:37: error: reference to 'rank' is ambiguous
36 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:37:71: error: reference to 'rank' is ambiguous
37 | if(A[sa[i]]!=A[sa[i-1]]||B[sa[i]]!=B[sa[i-1]])rank[sa[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:43:38: error: reference to 'rank' is ambiguous
43 | while(s[i+tot]==s[sa[rank[i]-1]+tot])tot++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:44:24: error: reference to 'rank' is ambiguous
44 | height[rank[i]]=tot;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:47:19: error: reference to 'rank' is ambiguous
47 | for(int i=rank[1];i>=2;i--){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:51:19: error: reference to 'rank' is ambiguous
51 | for(int i=rank[1]+1;i<=n;i++){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
|
s638573192 | p03678 | C++ | #include <bits/stdc++.h>
#define N 200006
using namespace std;
char s[N];long long f[106],g[106][26],a[26],l,r,x;
int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
inline int read()
{
int x=0,c=getchar(),f=1;while(c<'0'||c>'9')f=(c=='-'?-f:f),c=getchar();
while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+c-48,c=getchar();return f>0?x:-x;
}
void print(long long x)
{
if(x>9)print(x/10);putchar(x%10+48);
}
void SA()
{
for(int i=1;i<=n;i++)cntA[s[i]]++;
for(int i=1;i<N;i++)cntA[i]+=cntA[i-1];
for(int i=n;i;i--)sa[cntA[s[i]]--]=i;
rank[sa[1]]=1;
for(int i=2;i<=n;i++){
rank[sa[i]]=rank[sa[i-1]];
if(s[sa[i]]!=s[sa[i-1]])rank[sa[i]]++;
}
for(int l=1;rank[sa[n]]!=n;l<<=1){
for(int i=0;i<N;i++)cntA[i]=cntB[i]=0;
for(int i=1;i<=n;i++){
cntA[A[i]=rank[i]]++;
cntB[B[i]=(i+l<=n?rank[i+l]:0)]++;
}
for(int i=1;i<N;i++)cntA[i]+=cntA[i-1],cntB[i]+=cntB[i-1];
for(int i=n;i;i--)tsa[cntB[B[i]]--]=i;
for(int i=n;i;i--)sa[cntA[A[tsa[i]]]--]=tsa[i];
rank[sa[1]]=1;
for(int i=2;i<=n;i++){
rank[sa[i]]=rank[sa[i-1]];
if(A[sa[i]]!=A[sa[i-1]]||B[sa[i]]!=B[sa[i-1]])rank[sa[i]]++;
}
}
int tot=0;
for(int i=1;i<=n;i++){
if(tot)tot--;
while(s[i+tot]==s[sa[rank[i]-1]+tot])tot++;
height[rank[i]]=tot;
}
p=n;int mi=N;
for(int i=rank[1];i>=2;i--){
mi=min(mi,height[i]);
if(mi==n-sa[i-1]+1)p=min(p,sa[i-1]-1);
}mi=N;
for(int i=rank[1]+1;i<=n;i++){
mi=min(mi,height[i]);
if(mi==n-sa[i]+1)p=min(p,sa[i]-1);
}
}
void wk(int w,int F)
{
if(x==0)return;
if(f[w]>x)
if(w>2){wk(w-1,F);if(x)wk(w-2,F);}
else{for(int i=1;i<=x;i++)a[s[i]-97]+=F;x=0;}
else{for(int i=0;i<26;i++)a[i]+=F*g[w][i];x-=f[w];}
}
int main()
{
scanf("%s",s+1);
n=strlen(s+1)/2;scanf("%lld%lld",&l,&r);SA();
for(int i=1;i<=p;i++)v[s[i]-97]++;
if(n%p==0){
if(r<=n)for(int i=l;i<=r;i++)a[s[i]-97]++;
else{
if(l<=n)for(int i=l;i<=n;i++)a[s[i]-97]++;
else for(int i=(l-n)%p;i<=p;i++)a[s[i]-97]++;
r-=n;for(int i=1;i<=r%p;i++)a[s[i]-97]++;
for(int i=0;i<26;i++)a[i]+=1LL*v[i]*(r/p-(l<=n?0:(l-n-1)/p+1));
}
}else{
f[1]=n;f[2]=n+p;
for(int i=1;i<=n;i++)g[1][s[i]-97]=++g[2][s[i]-97];
for(int i=0;i<26;i++)g[2][i]+=v[i];
for(t=3;f[t-1]<r;t++){
f[t]=f[t-1]+f[t-2];
for(int i=0;i<26;i++)g[t][i]+=g[t-1][i]+g[t-2][i];
}t--;
x=r;wk(t,1);if(l>1)x=l-1,wk(t,-1);
}
for(int i=0;i<25;i++)printf("%lld ",a[i]);printf("%lld\n",a[25]);
} | a.cc: In function 'void SA()':
a.cc:20:9: error: reference to 'rank' is ambiguous
20 | rank[sa[1]]=1;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
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,
from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:22:17: error: reference to 'rank' is ambiguous
22 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:22:29: error: reference to 'rank' is ambiguous
22 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:23:41: error: reference to 'rank' is ambiguous
23 | if(s[sa[i]]!=s[sa[i-1]])rank[sa[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:25:21: error: reference to 'rank' is ambiguous
25 | for(int l=1;rank[sa[n]]!=n;l<<=1){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:28:35: error: reference to 'rank' is ambiguous
28 | cntA[A[i]=rank[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:29:43: error: reference to 'rank' is ambiguous
29 | cntB[B[i]=(i+l<=n?rank[i+l]:0)]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:34:17: error: reference to 'rank' is ambiguous
34 | rank[sa[1]]=1;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:36:25: error: reference to 'rank' is ambiguous
36 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:36:37: error: reference to 'rank' is ambiguous
36 | rank[sa[i]]=rank[sa[i-1]];
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:37:71: error: reference to 'rank' is ambiguous
37 | if(A[sa[i]]!=A[sa[i-1]]||B[sa[i]]!=B[sa[i-1]])rank[sa[i]]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:43:38: error: reference to 'rank' is ambiguous
43 | while(s[i+tot]==s[sa[rank[i]-1]+tot])tot++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:44:24: error: reference to 'rank' is ambiguous
44 | height[rank[i]]=tot;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:47:19: error: reference to 'rank' is ambiguous
47 | for(int i=rank[1];i>=2;i--){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
a.cc:51:19: error: reference to 'rank' is ambiguous
51 | for(int i=rank[1]+1;i<=n;i++){
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:5:33: note: 'int rank [200006]'
5 | int n,p,t,v[26],height[N],sa[N],rank[N],tsa[N],cntA[N],cntB[N],A[N],B[N];
| ^~~~
|
s925099667 | p03678 | C++ | #include <bits/stdc++.h>
using namespace std;
#define times(n, i) uptil(0, n, i)
#define rtimes(n, i) downto((n) - 1, 0, i)
#define upto(f, t, i) for(int _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i) for(int _##i = (t), i = (f); i < _##i; i++)
#define downto(f, t, i) for(int _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(int _##i = (t), i = (f); i > _##i; i--)
typedef long double ld;
#define long long long
#if defined(EBUG) && !defined(ONLINE_JUDGE)
#define debug true
#define ln << endl
#else
#define debug false
#define ln << '\n'
#endif
#define tb << '\t'
#define sp << ' '
const int MOD = 1e9+7;
namespace sa {
constexpr unsigned sINT = sizeof(int);
inline void induced_sort(const int* const s, int n1, int* const sa, int** const bucref, int** const bucref1,
const int* const is_stype, const int* const lcount, int C, const int* lms, int clms) {
int n = n1 - 1;
memcpy(bucref1, bucref, sizeof(int*) * (C + 1));
rtimes(clms, l) {
int/*s.i*/j = lms[l];
*--bucref1[s[j]+1] = j;
}
memcpy(bucref1, bucref, sizeof(int*) * (C + 1));
times(n1, a) if(sa[a] > 0) {
int/*s.i*/t = sa[a]-1;
if(is_stype[t]) continue;
*bucref1[s[t]]++ = t;
}
times(C, c) {
int* d = bucref[c] + lcount[c];
memset(d, -1, sINT * (bucref[c+1] - d));
}
memcpy(bucref1, bucref + 1, sizeof(int*) * C);
rtimes(n1, a) if(sa[a] > 0) {
int/*s.i*/t = sa[a]-1;
if(!is_stype[t]) continue;
*--bucref1[s[t]] = t;
}
sa[0] = n;
}
/* c[i] i# i[a] a[c] a[c]*/
void sa_is(const int* const s, int n1, int* const sa, int** const bucref, int** const bucref1,
/* a#[c] i[l] l[i](L:0,S\LMS:-1) i[l]*/
int* const lcount, int* const lms, int* const invlms1, int* const lms_sorted, int C) {
int n = n1 - 1;
if(debug) { times(n, j) assert(s[j] != 0); assert(s[n] == 0); }
switch(n) {
case 0: sa[0]=0; return; case 1: sa[0]=1; sa[1]=0; return;
case 2: sa[0]=2; if(s[0] < s[1]) { sa[1]=0; sa[2]=1; } else { sa[1]=1; sa[2]=0; } return;
case 3: sa[0]=3;
int a = s[0]-s[1], b = s[1]-s[2], c = s[2]-s[0];
if(a > 0) {
if(c > 0) { sa[1]=1; sa[2]=0; sa[3]=2; return; }
if(b < 0) { sa[1]=1; sa[2]=2; sa[3]=0; return; }
} else if(b < 0) { sa[1]=0; sa[2]=1; sa[3]=2; return; }
if(a < 0)
if(c > 0) { sa[1]=0; sa[2]=2; sa[3]=1; return; }
else { sa[1]=2; sa[2]=0; sa[3]=1; return; }
sa[1]=2; sa[2]=1; sa[3]=0; return;
}
times(n1, j) ++bucref[s[j]+1];
bucref[0] = sa;
times(C, c) bucref[c+1] += (unsigned int)bucref[c] / sINT;
/********* check S-Type or L-Type *********/
invlms1[n] = -1;
rtimes(n, j) invlms1[j] = s[j] != s[j+1] ? -(s[j] < s[j+1]) : invlms1[j+1];
times(n1, j) if(!invlms1[j]) ++lcount[s[j]]; // LType
/********* list up LMS *********/
int/*l*/clms = 0;
upto(1, n, j) if(!invlms1[j-1] && invlms1[j]) { // j-1: LType, j: SType
lms[clms] = j;
++clms;
invlms1[j] = clms;
++j; //: LS[?]
}
/********* rough induced sort *********/
induced_sort(s, n1, sa, bucref, bucref1, invlms1, lcount, C, lms, clms);
int lsi = 0;
times(n1, a) if(sa[a] >= 0 && invlms1[sa[a]] > 0 /*LMS*/) lms_sorted[lsi++] = sa[a];
// assert(lsi == clms);
/********* SA-IS LMS-suffix *********/
int lq = 0;
int* const/*lms.c[l]*/lms_syms = sa;
times(clms, l) {
int j = lms_sorted[l], m1 = invlms1[j];
if(l > 1) {
int i = lms_sorted[l-1];
if(lms[m1] - j == lms[invlms1[i]] - i) {
int k = lms[m1] - j;
++lq;
upto(0, k, h) if(s[j+h] != s[i+h]) { --lq; break; }
}
}
lms_syms[m1-1] = l - lq;
}
int* const bc = bucref[C];
int*/*l[e]*/lms_sa = sa + n1;
sa_is(lms_syms, clms, lms_sa, bucref + C, bucref1, lcount + C,
lms + clms, invlms1 + n1, lms_sorted + clms, clms - lq);
bucref[C] = bc;
/********* strict induced sort *********/
memset(sa, -1, n1 * sINT); // fill(sa, sa + n1, -1);
times(clms, e) lms_sa[e] = lms[lms_sa[e]];
/* now lms_sa is: i[e] */
induced_sort(s, n1, sa, bucref, bucref1, invlms1, lcount, C, lms_sa, clms);
}
bool inited = false;
int *saG, **brG, **br1G, *lcG, *lmsG, *il1G, *lsoG;
void init(int N1, int C) { // memory used: (8.5N+3C+3)*4bytes
if(inited) return; inited = true;
saG = new int[N1*2]; brG = new int*[C+N1+1]; br1G = new int*[max(N1/2,C)+1];
lcG = new int[C+N1+1]; lmsG = new int[N1]; il1G = new int[N1*2]; lsoG = new int[N1];
}
void is_k(const int* const s, int n1, int c) {
bool gs = false;
if(n1 * 3 < c) {
gs = n1 < 50;
if(!gs) {
int b = s[n1/3 + 1], a = 0;
times(n1, i) a += s[i] == b;
gs = a < n1 / a;
}
}
if(debug) assert(inited);
if(gs) {
times(n1, i) saG[i] = i;
sort(saG, saG + n1, [&](int i, int j) {
if(i == j) return false;
while(s[i] == s[j]) { ++i; ++j; }
return s[i] < s[j];
});
} else {
memset(saG, -1, n1*2*sINT); memset(brG, 0, (n1+c+1)*sINT); memset(lcG, 0, (n1+c+1)* sINT);
sa_is(s, n1, saG, brG, br1G, lcG, lmsG, il1G, lsoG, c);
}
}
void done() { inited = false; if(debug) cerr << "WARNING: void sa::done() does nothing." << endl; }
}
int s[200005], N;
map<long, array<long, 26>> c;
signed main() { // long: 64bit
if(!debug) {
cin.tie(0);
ios::sync_with_stdio(0);
}
string S; cin >> S;
N = S.size();
long L, R; cin >> L >> R;
sa::init(N + 1, 27);
times(N, i) {
s[i] = S[i] - 'a' + 1;
}
s[N] = 0;
sa::is_k(s, N + 1, 27);
long p0;
times(N+1, i) if(sa::saG[i] == 0) {
while(i >= 0 && sa::saG[--i] <= N / 2);
if(i >= 0)
p0 = sa::saG[i];
else
p0 = N;
break;
}
if(debug) cout << p0 ln;
times(26, i) c[0][i] = 0;
times(N, j) times(26, i) {
c[-j-1][i] = c[-j][i] + (S[j] == 'a' + i);
}
{
long p2 = p0, q2 = N, p1 = p2 + q2 / 2, q1 = p2 * 2;
times(26, i) {
c[-p1][i] = c[-p2][i] + c[-q2][i] / 2;
c[-q1][i] = c[-p2][i] * 2;
}
while(q1 < R) {
long p = p1 + p2, q = q1 + q2;
times(26, i) {
c[-p][i] = c[-p1][i] + c[-p2][i];
c[-q][i] = c[-q1][i] + c[-q2][i];
}
p2 = p1; p1 = p;
q2 = q1; q1 = q;
}
}
if(debug) {
for(const auto& x: c) {
cout << x.first tb;
times(26, i) cout << x.second[i] sp;
cout ln;
}
}
long l[26], r[26];
times(26, i) l[i] = r[i] = 0;
if(debug) cout << "L\n";
while(L > 0) {
auto x = c.lower_bound(-L);
L += x->first;
times(26, i) l[i] += x->second[i];
if(debug) {
cout << L tb;
times(26, i) cout << l[i] sp;
cout ln;
}
}
if(debug) cout << "R\n";
++R;
while(R > 0) {
auto x = c.lower_bound(-R);
R += x->first;
times(26, i) r[i] += x->second[i];
if(debug) {
cout << R tb;
times(26, i) cout << r[i] sp;
cout ln;
}
}
times(26, i) {
if(i) cout sp;
cout << r[i] - l[i];
}
cout ln;
return 0;
}
| a.cc: In function 'void sa::sa_is(const int*, int, int*, int**, int**, int*, int*, int*, int*, int)':
a.cc:81:32: error: cast from 'int*' to 'unsigned int' loses precision [-fpermissive]
81 | times(C, c) bucref[c+1] += (unsigned int)bucref[c] / sINT;
| ^~~~~~~~~~~~~~~~~~~~~~~
|
s943604047 | p03678 | C++ | #include <bits/stdc++.h>
using namespace std;
#define times(n, i) uptil(0, n, i)
#define rtimes(n, i) downto((n) - 1, 0, i)
#define upto(f, t, i) for(int _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i) for(int _##i = (t), i = (f); i < _##i; i++)
#define downto(f, t, i) for(int _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(int _##i = (t), i = (f); i > _##i; i--)
typedef long double ld;
#define long long long
#if defined(EBUG) && !defined(ONLINE_JUDGE)
#define debug true
#define ln << endl
#else
#define debug false
#define ln << '\n'
#endif
#define tb << '\t'
#define sp << ' '
const int MOD = 1e9+7;
namespace sa {
constexpr unsigned sINT = sizeof(int);
inline void induced_sort(const int* const s, int n1, int* const sa, int** const bucref, int** const bucref1,
const int* const is_stype, const int* const lcount, int C, const int* lms, int clms) {
int n = n1 - 1;
memcpy(bucref1, bucref, sizeof(int*) * (C + 1));
rtimes(clms, l) {
int/*s.i*/j = lms[l];
*--bucref1[s[j]+1] = j;
}
memcpy(bucref1, bucref, sizeof(int*) * (C + 1));
times(n1, a) if(sa[a] > 0) {
int/*s.i*/t = sa[a]-1;
if(is_stype[t]) continue;
*bucref1[s[t]]++ = t;
}
times(C, c) {
int* d = bucref[c] + lcount[c];
memset(d, -1, sINT * (bucref[c+1] - d));
}
memcpy(bucref1, bucref + 1, sizeof(int*) * C);
rtimes(n1, a) if(sa[a] > 0) {
int/*s.i*/t = sa[a]-1;
if(!is_stype[t]) continue;
*--bucref1[s[t]] = t;
}
sa[0] = n;
}
/* c[i] i# i[a] a[c] a[c]*/
void sa_is(const int* const s, int n1, int* const sa, int** const bucref, int** const bucref1,
/* a#[c] i[l] l[i](L:0,S\LMS:-1) i[l]*/
int* const lcount, int* const lms, int* const invlms1, int* const lms_sorted, int C) {
int n = n1 - 1;
if(debug) { times(n, j) assert(s[j] != 0); assert(s[n] == 0); }
switch(n) {
case 0: sa[0]=0; return; case 1: sa[0]=1; sa[1]=0; return;
case 2: sa[0]=2; if(s[0] < s[1]) { sa[1]=0; sa[2]=1; } else { sa[1]=1; sa[2]=0; } return;
case 3: sa[0]=3;
int a = s[0]-s[1], b = s[1]-s[2], c = s[2]-s[0];
if(a > 0) {
if(c > 0) { sa[1]=1; sa[2]=0; sa[3]=2; return; }
if(b < 0) { sa[1]=1; sa[2]=2; sa[3]=0; return; }
} else if(b < 0) { sa[1]=0; sa[2]=1; sa[3]=2; return; }
if(a < 0)
if(c > 0) { sa[1]=0; sa[2]=2; sa[3]=1; return; }
else { sa[1]=2; sa[2]=0; sa[3]=1; return; }
sa[1]=2; sa[2]=1; sa[3]=0; return;
}
times(n1, j) ++bucref[s[j]+1];
bucref[0] = sa;
times(C, c) bucref[c+1] += (int)bucref[c] / sINT;
/********* check S-Type or L-Type *********/
invlms1[n] = -1;
rtimes(n, j) invlms1[j] = s[j] != s[j+1] ? -(s[j] < s[j+1]) : invlms1[j+1];
times(n1, j) if(!invlms1[j]) ++lcount[s[j]]; // LType
/********* list up LMS *********/
int/*l*/clms = 0;
upto(1, n, j) if(!invlms1[j-1] && invlms1[j]) { // j-1: LType, j: SType
lms[clms] = j;
++clms;
invlms1[j] = clms;
++j; //: LS[?]
}
/********* rough induced sort *********/
induced_sort(s, n1, sa, bucref, bucref1, invlms1, lcount, C, lms, clms);
int lsi = 0;
times(n1, a) if(sa[a] >= 0 && invlms1[sa[a]] > 0 /*LMS*/) lms_sorted[lsi++] = sa[a];
// assert(lsi == clms);
/********* SA-IS LMS-suffix *********/
int lq = 0;
int* const/*lms.c[l]*/lms_syms = sa;
times(clms, l) {
int j = lms_sorted[l], m1 = invlms1[j];
if(l > 1) {
int i = lms_sorted[l-1];
if(lms[m1] - j == lms[invlms1[i]] - i) {
int k = lms[m1] - j;
++lq;
upto(0, k, h) if(s[j+h] != s[i+h]) { --lq; break; }
}
}
lms_syms[m1-1] = l - lq;
}
int* const bc = bucref[C];
int*/*l[e]*/lms_sa = sa + n1;
sa_is(lms_syms, clms, lms_sa, bucref + C, bucref1, lcount + C,
lms + clms, invlms1 + n1, lms_sorted + clms, clms - lq);
bucref[C] = bc;
/********* strict induced sort *********/
memset(sa, -1, n1 * sINT); // fill(sa, sa + n1, -1);
times(clms, e) lms_sa[e] = lms[lms_sa[e]];
/* now lms_sa is: i[e] */
induced_sort(s, n1, sa, bucref, bucref1, invlms1, lcount, C, lms_sa, clms);
}
bool inited = false;
int *saG, **brG, **br1G, *lcG, *lmsG, *il1G, *lsoG;
void init(int N1, int C) { // memory used: (8.5N+3C+3)*4bytes
if(inited) return; inited = true;
saG = new int[N1*2]; brG = new int*[C+N1+1]; br1G = new int*[max(N1/2,C)+1];
lcG = new int[C+N1+1]; lmsG = new int[N1]; il1G = new int[N1*2]; lsoG = new int[N1];
}
void is_k(const int* const s, int n1, int c) {
bool gs = false;
if(n1 * 3 < c) {
gs = n1 < 50;
if(!gs) {
int b = s[n1/3 + 1], a = 0;
times(n1, i) a += s[i] == b;
gs = a < n1 / a;
}
}
if(debug) assert(inited);
if(gs) {
times(n1, i) saG[i] = i;
sort(saG, saG + n1, [&](int i, int j) {
if(i == j) return false;
while(s[i] == s[j]) { ++i; ++j; }
return s[i] < s[j];
});
} else {
memset(saG, -1, n1*2*sINT); memset(brG, 0, (n1+c+1)*sINT); memset(lcG, 0, (n1+c+1)* sINT);
sa_is(s, n1, saG, brG, br1G, lcG, lmsG, il1G, lsoG, c);
}
}
void done() { inited = false; if(debug) cerr << "WARNING: void sa::done() does nothing." << endl; }
}
int s[200005], N;
map<long, array<long, 26>> c;
signed main() { // long: 64bit
if(!debug) {
cin.tie(0);
ios::sync_with_stdio(0);
}
string S; cin >> S;
N = S.size();
long L, R; cin >> L >> R;
sa::init(N + 1, 27);
times(N, i) {
s[i] = S[i] - 'a' + 1;
}
s[N] = 0;
sa::is_k(s, N + 1, 27);
long p0;
times(N+1, i) if(sa::saG[i] == 0) {
while(i >= 0 && sa::saG[--i] <= N / 2);
if(i >= 0)
p0 = sa::saG[i];
else
p0 = N;
break;
}
if(debug) cout << p0 ln;
times(26, i) c[0][i] = 0;
times(N, j) times(26, i) {
c[-j-1][i] = c[-j][i] + (S[j] == 'a' + i);
}
{
long p2 = p0, q2 = N, p1 = p2 + q2 / 2, q1 = p2 * 2;
times(26, i) {
c[-p1][i] = c[-p2][i] + c[-q2][i] / 2;
c[-q1][i] = c[-p2][i] * 2;
}
while(q1 < R) {
long p = p1 + p2, q = q1 + q2;
times(26, i) {
c[-p][i] = c[-p1][i] + c[-p2][i];
c[-q][i] = c[-q1][i] + c[-q2][i];
}
p2 = p1; p1 = p;
q2 = q1; q1 = q;
}
}
if(debug) {
for(const auto& x: c) {
cout << x.first tb;
times(26, i) cout << x.second[i] sp;
cout ln;
}
}
long l[26], r[26];
times(26, i) l[i] = r[i] = 0;
if(debug) cout << "L\n";
while(L > 0) {
auto x = c.lower_bound(-L);
L += x->first;
times(26, i) l[i] += x->second[i];
if(debug) {
cout << L tb;
times(26, i) cout << l[i] sp;
cout ln;
}
}
if(debug) cout << "R\n";
++R;
while(R > 0) {
auto x = c.lower_bound(-R);
R += x->first;
times(26, i) r[i] += x->second[i];
if(debug) {
cout << R tb;
times(26, i) cout << r[i] sp;
cout ln;
}
}
times(26, i) {
if(i) cout sp;
cout << r[i] - l[i];
}
cout ln;
return 0;
}
| a.cc: In function 'void sa::sa_is(const int*, int, int*, int**, int**, int*, int*, int*, int*, int)':
a.cc:81:32: error: cast from 'int*' to 'int' loses precision [-fpermissive]
81 | times(C, c) bucref[c+1] += (int)bucref[c] / sINT;
| ^~~~~~~~~~~~~~
|
s975823782 | p03679 | C++ | x,a,b = map(int,input().split())
if b < a:
print('delicious')
elif b <= x:
pritn('safe')
elif b > x:
print('dangerous') | a.cc:4:9: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
4 | print('delicious')
| ^~~~~~~~~~~
a.cc:6:9: warning: multi-character character constant [-Wmultichar]
6 | pritn('safe')
| ^~~~~~
a.cc:8:9: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
8 | print('dangerous')
| ^~~~~~~~~~~
a.cc:1:1: error: 'x' does not name a type
1 | x,a,b = map(int,input().split())
| ^
|
s098987024 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (ll i = m; i < (n); i++)
using ll = long long;
using pii = pair<int, int>;
using Vi = vector<int>;
int main() {
int x,a,b;
cin >> x>>a>>b;
if(b<=a){
cout << "delicious" << endl;
}
else if(b<=a+x){
cout << "safe" << endl;
}
else{
coiut << "dangerous" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:21:5: error: 'coiut' was not declared in this scope
21 | coiut << "dangerous" << endl;
| ^~~~~
|
s502110915 | p03679 | C++ | #include <bits/stdc++.h>
#include <numeric>
#include <algorithm>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int n; cin >> n;
vector<int> a(n);
REP(i, n) cin >> a[i];
int m = 0, tugi = 0, ans = 1;
while (m < n) {
if (a[tugi] == 2) {
cout << ans << endl;
return 0;
}
tugi = a[tugi];
if (tugi = 1) {
cout << -1 << endl;
return 0;
}
t
m++;
ans++;
}
cout << -1 << endl;
} | a.cc: In function 'int main()':
a.cc:27:17: error: 't' was not declared in this scope
27 | t
| ^
|
s310881591 | p03679 | C++ | #include <bits/stdc++.h>
#include <numeric>
#include <algorithm>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int n; cin >> n;
vector<int> a(n);
REP(i, n) cin >> a[i];
int m = 0, tugi = 0, ans = 1;
while (m < n) {
if (a[tugi] == 2) {
cout << ans << endl;
return 0;
}
tugi = a[tugi];
if (tugi = 1) {
cout << -1 << endl;
}
t
m++;
ans++;
}
cout << -1 << endl;
} | a.cc: In function 'int main()':
a.cc:26:17: error: 't' was not declared in this scope
26 | t
| ^
|
s885776304 | p03679 | C | #include<stdio.h>
int main()
{
int x,a,b;
scanf("%d %d %d",&x,&a,&b);
if (−a + b <= 0)
printf(”delicious”);
else if (−a + b <= x)
printf(”safe”);
else
printf (”dangerous\n”);
return 0;
}
| main.c: In function 'main':
main.c:7:7: error: stray '\342' in program
7 | if (<U+2212>a + b <= 0)
| ^~~~~~~~
main.c:8:12: error: stray '\342' in program
8 | printf(<U+201D>delicious<U+201D>);
| ^~~~~~~~
main.c:8:22: error: stray '\342' in program
8 | printf(<U+201D>delicious<U+201D>);
| ^~~~~~~~
main.c:8:13: error: 'delicious' undeclared (first use in this function)
8 | printf(”delicious”);
| ^~~~~~~~~
main.c:8:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:12: error: stray '\342' in program
10 | else if (<U+2212>a + b <= x)
| ^~~~~~~~
main.c:11:12: error: stray '\342' in program
11 | printf(<U+201D>safe<U+201D>);
| ^~~~~~~~
main.c:11:17: error: stray '\342' in program
11 | printf(<U+201D>safe<U+201D>);
| ^~~~~~~~
main.c:11:13: error: 'safe' undeclared (first use in this function)
11 | printf(”safe”);
| ^~~~
main.c:14:13: error: stray '\342' in program
14 | printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
main.c:14:23: error: stray '\' in program
14 | printf (”dangerous\n”);
| ^
main.c:14:14: error: 'dangerous' undeclared (first use in this function)
14 | printf (”dangerous\n”);
| ^~~~~~~~~
main.c:14:23: error: expected ')' before 'n'
14 | printf (”dangerous\n”);
| ~ ^~
| )
main.c:14:25: error: stray '\342' in program
14 | printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
|
s345510136 | p03679 | C | #include<stdio.h>
int main()
{
int x,a,b;
scanf(”%d %d %d”, &x,&a,&b);
if (−a + b <= 0)printf(”delicious\n”);
else if (−a + b <= x)printf(”safe\n”);
else printf (”dangerous\n”);
return 0;
}
| main.c: In function 'main':
main.c:6:9: error: stray '\342' in program
6 | scanf(<U+201D>%d %d %d<U+201D>, &x,&a,&b);
| ^~~~~~~~
main.c:6:10: error: expected expression before '%' token
6 | scanf(”%d %d %d”, &x,&a,&b);
| ^
main.c:6:18: error: stray '\342' in program
6 | scanf(<U+201D>%d %d %d<U+201D>, &x,&a,&b);
| ^~~~~~~~
main.c:8:7: error: stray '\342' in program
8 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:8:26: error: stray '\342' in program
8 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:8:36: error: stray '\' in program
8 | if (−a + b <= 0)printf(”delicious\n”);
| ^
main.c:8:27: error: 'delicious' undeclared (first use in this function)
8 | if (−a + b <= 0)printf(”delicious\n”);
| ^~~~~~~~~
main.c:8:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:36: error: expected ')' before 'n'
8 | if (−a + b <= 0)printf(”delicious\n”);
| ~ ^~
| )
main.c:8:38: error: stray '\342' in program
8 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:9:12: error: stray '\342' in program
9 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:9:31: error: stray '\342' in program
9 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:9:36: error: stray '\' in program
9 | else if (−a + b <= x)printf(”safe\n”);
| ^
main.c:9:32: error: 'safe' undeclared (first use in this function)
9 | else if (−a + b <= x)printf(”safe\n”);
| ^~~~
main.c:9:36: error: expected ')' before 'n'
9 | else if (−a + b <= x)printf(”safe\n”);
| ~ ^~
| )
main.c:9:38: error: stray '\342' in program
9 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:10:16: error: stray '\342' in program
10 | else printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
main.c:10:26: error: stray '\' in program
10 | else printf (”dangerous\n”);
| ^
main.c:10:17: error: 'dangerous' undeclared (first use in this function)
10 | else printf (”dangerous\n”);
| ^~~~~~~~~
main.c:10:26: error: expected ')' before 'n'
10 | else printf (”dangerous\n”);
| ~ ^~
| )
main.c:10:28: error: stray '\342' in program
10 | else printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
|
s651459911 | p03679 | C | #include<stdio.h>
int main()
{
intx,a,b;
scanf(”%d%d%d”, &x, &a, &b);
if (−a + b <= 0)printf(”delicious\n”);
else if (−a + b <= x)printf(”safe\n”);
else printf (”dangerous\n”);
}
| main.c: In function 'main':
main.c:4:1: error: 'intx' undeclared (first use in this function); did you mean 'int'?
4 | intx,a,b;
| ^~~~
| int
main.c:4:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:6: error: 'a' undeclared (first use in this function)
4 | intx,a,b;
| ^
main.c:4:8: error: 'b' undeclared (first use in this function)
4 | intx,a,b;
| ^
main.c:6:9: error: stray '\342' in program
6 | scanf(<U+201D>%d%d%d<U+201D>, &x, &a, &b);
| ^~~~~~~~
main.c:6:10: error: expected expression before '%' token
6 | scanf(”%d%d%d”, &x, &a, &b);
| ^
main.c:6:16: error: stray '\342' in program
6 | scanf(<U+201D>%d%d%d<U+201D>, &x, &a, &b);
| ^~~~~~~~
main.c:8:7: error: stray '\342' in program
8 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:8:26: error: stray '\342' in program
8 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:8:36: error: stray '\' in program
8 | if (−a + b <= 0)printf(”delicious\n”);
| ^
main.c:8:27: error: 'delicious' undeclared (first use in this function)
8 | if (−a + b <= 0)printf(”delicious\n”);
| ^~~~~~~~~
main.c:8:36: error: expected ')' before 'n'
8 | if (−a + b <= 0)printf(”delicious\n”);
| ~ ^~
| )
main.c:8:38: error: stray '\342' in program
8 | if (<U+2212>a + b <= 0)printf(<U+201D>delicious\n<U+201D>);
| ^~~~~~~~
main.c:9:12: error: stray '\342' in program
9 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:9:22: error: 'x' undeclared (first use in this function)
9 | else if (−a + b <= x)printf(”safe\n”);
| ^
main.c:9:31: error: stray '\342' in program
9 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:9:36: error: stray '\' in program
9 | else if (−a + b <= x)printf(”safe\n”);
| ^
main.c:9:32: error: 'safe' undeclared (first use in this function)
9 | else if (−a + b <= x)printf(”safe\n”);
| ^~~~
main.c:9:36: error: expected ')' before 'n'
9 | else if (−a + b <= x)printf(”safe\n”);
| ~ ^~
| )
main.c:9:38: error: stray '\342' in program
9 | else if (<U+2212>a + b <= x)printf(<U+201D>safe\n<U+201D>);
| ^~~~~~~~
main.c:10:16: error: stray '\342' in program
10 | else printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
main.c:10:26: error: stray '\' in program
10 | else printf (”dangerous\n”);
| ^
main.c:10:17: error: 'dangerous' undeclared (first use in this function)
10 | else printf (”dangerous\n”);
| ^~~~~~~~~
main.c:10:26: error: expected ')' before 'n'
10 | else printf (”dangerous\n”);
| ~ ^~
| )
main.c:10:28: error: stray '\342' in program
10 | else printf (<U+201D>dangerous\n<U+201D>);
| ^~~~~~~~
|
s916021678 | p03679 | C | #include<stdio .h>
int main()
{
intx,a,b;
scanf(”%d%d%d”, &x, &a, &b);
if (−a + b <= 0)printf(”delicious\n”);
else if (−a + b <= x)printf(”safe\n”);
else printf (”dangerous\n”);
}
| main.c:1:9: fatal error: stdio .h: No such file or directory
1 | #include<stdio .h>
| ^~~~~~~~~~
compilation terminated.
|
s148861242 | p03679 | C | #include<stdio .h> int main()
{
intx,a,b;
scanf(”%d%d%d”, &x, &a, &b);
if (−a + b <= 0)printf(”delicious\n”); else if (−a + b <= x)printf(”safe\n”); else printf (”dangerous\n”);
} | main.c:1:20: warning: extra tokens at end of #include directive
1 | #include<stdio .h> int main()
| ^~~
main.c:1:9: fatal error: stdio .h: No such file or directory
1 | #include<stdio .h> int main()
| ^~~~~~~~~~
compilation terminated.
|
s209607150 | p03679 | C++ |
#include <bits/stdc++.h>
using namespace std;v
int main(){
int X, A, B;
cin >> X >>A >>B;
if( B < A ){
cout << "delicious" <<endl;
}
else if( B < A+X ){
cout << "safe" <<endl;
}
else
cout << "dangerous" <<endl;
} | a.cc:4:21: error: 'v' does not name a type
4 | using namespace std;v
| ^
|
s078744187 | p03679 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int a,b,c;
cin >> a >> b >> c;
if(c<=b)cout << "delicious";
else if((a+b)=>c)cout << "safe";
else cout << "dangelous";
}
| a.cc: In function 'int main()':
a.cc:10:17: error: expected primary-expression before '>' token
10 | else if((a+b)=>c)cout << "safe";
| ^
|
s297344101 | p03679 | C++ | #include <iostream>
using napespace std;
int main () {
int X, A, B;
cin >> X >> A >> B;
if (X >= A && X >= B) {
cout << "delicious";
}
else if (X >= A && X < B) {
cout << "safe";
}
else {
cout << "dangerous";
}
}
| a.cc:3:7: error: expected nested-name-specifier before 'napespace'
3 | using napespace 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 >> X >> A >> B;
| ^~~
| 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:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout << "delicious";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout << "safe";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:15:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
15 | cout << "dangerous";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s649908085 | p03679 | C++ | #include <iostream>
int main()
{
int x, a, b;
cin >> x >> a >> b;
if (a > b) {
cout << "delicious" << endl;
}
else if(x+a>b){
cout << "safe" << endl;
}
else {
cout << "dangerous" << endl;
}
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> x >> a >> b;
| ^~~
| 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:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout << "delicious" << 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:40: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout << "delicious" << 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:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | cout << "safe" << 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:35: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout << "safe" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:14:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
14 | cout << "dangerous" << 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:14:40: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
14 | cout << "dangerous" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s870232963 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, A, B;
cin >> X >> A >> B;
if (−A + B <= 0) {
cout << "delicious" << endl;
}
else if (−A + B <= X) {
cout << "safe" << endl;
}
else {
cout << "dangerous" << endl;
}
}
| a.cc:8:7: error: extended character − is not valid in an identifier
8 | if (−A + B <= 0) {
| ^
a.cc:11:12: error: extended character − is not valid in an identifier
11 | else if (−A + B <= X) {
| ^
a.cc: In function 'int main()':
a.cc:8:7: error: '\U00002212A' was not declared in this scope
8 | if (−A + B <= 0) {
| ^~
|
s265288432 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, A, B;
cin >> X >> A >> B;
if (−a + b <= 0) {
cout << "delicious" << endl;
}
else if (−a + b <= x) {
cout << "safe" << endl;
}
else {
cout << "dangerous" << endl;
}
}
| a.cc:8:7: error: extended character − is not valid in an identifier
8 | if (−a + b <= 0) {
| ^
a.cc:11:12: error: extended character − is not valid in an identifier
11 | else if (−a + b <= x) {
| ^
a.cc: In function 'int main()':
a.cc:8:7: error: '\U00002212a' was not declared in this scope
8 | if (−a + b <= 0) {
| ^~
a.cc:8:12: error: 'b' was not declared in this scope
8 | if (−a + b <= 0) {
| ^
a.cc:11:22: error: 'x' was not declared in this scope
11 | else if (−a + b <= x) {
| ^
|
s007789819 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, A, B;
cin >> X >> A >> B;
if (B >= A) {
cout << "delicious" << endl;
}
else if (B >= (X + A)) {
cout << "dangerous" << endl;
}
else {
cout << "safe" << endl;
}
| a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s943407428 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, A, B;
cin >> X >> A >> B;
if (B > A) {
cout << "delicious" << endl;
}
else if (B > X + A && X < -A + B) {
cout << "dangerous" << endl;
}
else {
cout << "safe" << endl;
}
| a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s548294712 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
unsigned long long int x,a,b;
cin>>x>>a>>b;
if((a+b)==x){
cout<<"delicious"<<endl;
}
else{
if(abs(a-b)<x){
cout<<"safe"<<endl;
}
else if(abs(a-b)>x){
cout<<"dangerous"<<endl;
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: call of overloaded 'abs(long long unsigned int)' is ambiguous
10 | if(abs(a-b)<x){
| ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
a.cc:13:20: error: call of overloaded 'abs(long long unsigned int)' is ambiguous
13 | else if(abs(a-b)>x){
| ~~~^~~~~
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
|
s898890053 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, A, B, C;
cin >> X >> A >> B;
C = X + A;
if(A > B) {
cout << "delicious" << end;
}
else if(C > B) {
cout << "Safe" << endl;
}
else {
cout << "dangerous" << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:25: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
8 | cout << "delicious" << 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 |
s079470196 | p03679 | C | #i n cl u d e <s t d i o . h>
i n t main ( )
{
i n t x , a , b ;
scanf(”%d%d%d ” , &x , &a , &b ) ;
i f (−a + b <= 0 )
p r i n t f ( ” d e l i c i o u s \n ” ) ;
e l s e i f (−a + b <= x )
p r i n t f ( ” s a f e \n ” ) ;
e l s e
p r i n t f ( ” d an ge r ou s \n ” ) ;
} | main.c:1:2: error: invalid preprocessing directive #i; did you mean #if?
1 | #i n cl u d e <s t d i o . h>
| ^
| if
main.c:2:1: error: unknown type name 'i'
2 | i n t main ( )
| ^
main.c:2:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 't'
2 | i n t main ( )
| ^
main.c:2:5: error: unknown type name 't'
main.c:5:7: error: stray '\342' in program
5 | scanf(<U+201D>%d%d%d <U+201D> , &x , &a , &b ) ;
| ^~~~~~~~
main.c:5:15: error: stray '\342' in program
5 | scanf(<U+201D>%d%d%d <U+201D> , &x , &a , &b ) ;
| ^~~~~~~~
main.c:6:6: error: stray '\342' in program
6 | i f (<U+2212>a + b <= 0 )
| ^~~~~~~~
main.c:7:17: error: stray '\342' in program
7 | p r i n t f ( <U+201D> d e l i c i o u s \n <U+201D> ) ;
| ^~~~~~~~
main.c:7:37: error: stray '\' in program
7 | p r i n t f ( ” d e l i c i o u s \n ” ) ;
| ^
main.c:7:40: error: stray '\342' in program
7 | p r i n t f ( <U+201D> d e l i c i o u s \n <U+201D> ) ;
| ^~~~~~~~
main.c:8:14: error: stray '\342' in program
8 | e l s e i f (<U+2212>a + b <= x )
| ^~~~~~~~
main.c:9:17: error: stray '\342' in program
9 | p r i n t f ( <U+201D> s a f e \n <U+201D> ) ;
| ^~~~~~~~
main.c:9:27: error: stray '\' in program
9 | p r i n t f ( ” s a f e \n ” ) ;
| ^
main.c:9:30: error: stray '\342' in program
9 | p r i n t f ( <U+201D> s a f e \n <U+201D> ) ;
| ^~~~~~~~
main.c:11:17: error: stray '\342' in program
11 | p r i n t f ( <U+201D> d an ge r ou s \n <U+201D> ) ;
| ^~~~~~~~
main.c:11:34: error: stray '\' in program
11 | p r i n t f ( ” d an ge r ou s \n ” ) ;
| ^
main.c:11:37: error: stray '\342' in program
11 | p r i n t f ( <U+201D> d an ge r ou s \n <U+201D> ) ;
| ^~~~~~~~
|
s371230070 | p03679 | C | #include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(b-a<=0)printf("delicious\n");
else if(b-a<=x)printf("safe\n");
else printf("dangerous\n");
return 0;
}
| main.c: In function 'main':
main.c:8:22: error: 'x' undeclared (first use in this function)
8 | else if(b-a<=x)printf("safe\n");
| ^
main.c:8:22: note: each undeclared identifier is reported only once for each function it appears in
|
s384807665 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int X,A,B;
cin>>X>>A>>B;
int V;
V = B-A;
if(V=<0){
cout<<"delicious"<<endl;
}else if(V=<X){
cout<<"safe"<<endl;
}else{
cout<<"dangerous"<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:9: error: expected primary-expression before '<' token
9 | if(V=<0){
| ^
a.cc:11:15: error: expected primary-expression before '<' token
11 | }else if(V=<X){
| ^
|
s321218585 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int x,a,b;
cin >> x >> a >> b;
if(a>=b){
cout << "delicious" << endl;
}else if(a+b>=c){
cout << "safe" << endl;
}else{
cout << "dangerous" << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:17: error: 'c' was not declared in this scope
8 | }else if(a+b>=c){
| ^
|
s488293229 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int a,b,c;
cin>>a>>b>>c;
string ans;
if(b=>c)ans="delicious";
else if(b-c<=a)ans="safe";
else ans="dangerous";
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:6: error: expected primary-expression before '>' token
9 | if(b=>c)ans="delicious";
| ^
|
s090727542 | p03679 | C++ | #include<iostream>
using namespace std;
int main(){
int x,a,b; cin>>x>>a>>b;
if(a>=b) cout<<"delicious"<<endl;
else{
if(b-a=x) cout<<"safe"<<endl;
else cout<<"dangerous"<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:9: error: lvalue required as left operand of assignment
7 | if(b-a=x) cout<<"safe"<<endl;
| ~^~
|
s097183500 | p03679 | C++ | #include<iostream>
using naamespace std;
int main(){
int x,a,b; cin>>x>>a>>b;
if(a>=b) cout<<"delicious"<<endl;
else{
if(b-a=x) cout<<"safe"<<endl;
else cout<<"dangerous"<<endl;
}
}
| a.cc:2:7: error: expected nested-name-specifier before 'naamespace'
2 | using naamespace std;
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:14: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | int x,a,b; cin>>x>>a>>b;
| ^~~
| 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:5:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
5 | if(a>=b) cout<<"delicious"<<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:5:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | if(a>=b) cout<<"delicious"<<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:7:9: error: lvalue required as left operand of assignment
7 | if(b-a=x) cout<<"safe"<<endl;
| ~^~
a.cc:7:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | if(b-a=x) cout<<"safe"<<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:7:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | if(b-a=x) cout<<"safe"<<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:8:10: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | else cout<<"dangerous"<<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:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | else cout<<"dangerous"<<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s363051075 | p03679 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int x=sc.nextInt(),a=sc.nextInt(),b-sc.nextInt();
if(b-a<=0){
System.out.println("delicious");
}else if(b-a<=x){
System.out.println("safe");
}else{
System.out.println("dangerous");
}
}
}
| Main.java:7: error: ';' expected
int x=sc.nextInt(),a=sc.nextInt(),b-sc.nextInt();
^
1 error
|
s567073780 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i= (a); i < (b); ++i)
typedef long long ll;
typedef pair<int,int> P;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main() { int X, A, B;
cin >> X >> A >> B;
if(A-B>=0){
puts("delicious");
}else if(A-B+X=>0){
puts("safe");
}else{
puts("dangerous");
}
}
| a.cc: In function 'int main()':
a.cc:14:20: error: expected primary-expression before '>' token
14 | }else if(A-B+X=>0){
| ^
|
s621665163 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int x,a,b;
cin x >> a >> b;
if(a>=b){
cout << "delicious" << endl;
return 0;
} else if (a+x>=b){
cout << "safe" << endl;
return 0;
}
cout << "dangerous" << endl;
}
| a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'x'
6 | cin x >> a >> b;
| ^~
| ;
|
s161645827 | p03679 | Java | import java.util.*;
public class Expired {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
sc.close();
if(b<=a) {
System.out.println("delicious");
}else if(b<=a+x) {
System.out.println("safe");
}else {
System.out.println("dangerous");
}
}
}
| Main.java:3: error: class Expired is public, should be declared in a file named Expired.java
public class Expired {
^
1 error
|
s271929136 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int x,a,b;
cin>>x>>a>>b;
int p=b-a;
if(p<=0){
cout<<"delicious"<<endl;
}
else if(p<=x){
cout<<"safe"<<endl;
}
else{
cout<<"dangerous"<<endl;
}
}
#include <bits/stdc++.h>
using namespace std;
int main() {
int x,a,b;
cin>>x>>a>>b;
int p=b-a;
if(p<=0){
cout<<"delicious"<<endl;
}
else if(p<=x){
cout<<"safe"<<endl;
}
else{
cout<<"dangerous"<<endl;
}
}
| a.cc:23:5: error: redefinition of 'int main()'
23 | int main() {
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main() {
| ^~~~
|
s543103854 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int x,a,b;
cin >> x >> a >> b;
int y = a-b;
if (y >= 0) {
cout << "delicious" << endl;
} else if (b-a <= x) {
cout << "safe" << endl;
} else {
cout << "dengerous" << endl;
} | a.cc: In function 'int main()':
a.cc:13:4: error: expected '}' at end of input
13 | }
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s459083384 | p03679 | C++ | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <map>
using ll = long long;
using namespace std;
int main() {
int X,A,B; cin >> X >> A >> B;
if(B-A <= 0){
cout << "delicious" << endl;
} else if(B-A =< X){
cout << "safe" << endl;
} else {
cout << "dangerous" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:19:20: error: expected primary-expression before '<' token
19 | } else if(B-A =< X){
| ^
|
s786094078 | p03679 | C++ | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <map>
using ll = long long;
using namespace std;
int main() {
int X,A,B; cin >> X >> A >> B;
if(A>=B){
cout << "delicious" << endl;
} else if(B-A =< X){
cout << "safe" << endl;
} else {
cout << "dangerous" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:19:20: error: expected primary-expression before '<' token
19 | } else if(B-A =< X){
| ^
|
s142584106 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if (A < B) {
cout << "dangerous" << endl;
} else if (A >= B && A => (B + C)) {
cout << "delicious" << endl;
} else if (A >= B && A < (B + C)) {
cout << "safe" << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:27: error: expected primary-expression before '>' token
10 | } else if (A >= B && A => (B + C)) {
| ^
|
s077692092 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
if (A < B) {
cout << "dangerous" << endl;
} else if (A >= B && A => B + C) {
cout << "delicious" << endl;
} else if (A >= B && A <= B + C) {
cout << "safe" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:10:27: error: expected primary-expression before '>' token
10 | } else if (A >= B && A => B + C) {
| ^
|
s467405168 | p03679 | C++ | //#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v) \
cout << #v << ":"; \
for (auto x : v) \
{ \
cout << x << ' '; \
} \
cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
if (a < b)
{
a = b;
return 1;
}
return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
if (b < a)
{
a = b;
return 1;
}
return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
ll x,a,b;
cin>>x>>a>>b;
b-=a;
if(b=<0)cout<<"delicious"<<"\n";
else if(x>=b)cout<<"safe"<<"\n";
else cout<<"dangerous"<<"\n";
}
| a.cc: In function 'int main()':
a.cc:56:10: error: expected primary-expression before '<' token
56 | if(b=<0)cout<<"delicious"<<"\n";
| ^
|
s022918900 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
int a;
int b;
cin >> x;
cin >> a;
cin >> b;
int day = b - a;
if (day = x){
cout << "safe" << endl;
}
else if (day > x){
cout << "delicious" << endl;
}
else if (day < x){
cout << "dangerous" << endl;
}
| a.cc: In function 'int main()':
a.cc:24:4: error: expected '}' at end of input
24 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s317309907 | p03679 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
ll X,A,B;
cin>>X>A>>B;
if(B<=A){
cout<<"delicious"<<endl;
}
else if(B-A<=X){
cout<<"safe"<<endl;
}
else{
cout<<"dangerous"<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:8:9: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long long int')
8 | cin>>X>A>>B;
| ~~~~~~^~~~~
| | |
| | long long int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:8:9: note: candidate: 'operator>(int, long long int)' (built-in)
8 | cin>>X>A>>B;
| ~~~~~~^~~~~
a.cc:8:9: 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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
8 | cin>>X>A>>B;
| ^
/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:8:13: 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>'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long long int'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long long int'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
8 | cin>>X>A>>B;
| ^
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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
8 | cin>>X>A>>B;
| ^
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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | cin>>X>A>>B;
| ^
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:8:13: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | cin>>X>A>>B;
| ^
/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:8:13: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | cin>>X>A>>B;
| ^
/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_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:8:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long long int'
8 | cin>>X>A>>B;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, |
s924573322 | p03679 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
ll X,A,B;
cin>>X,A,B;
if(B<=A){
cout<<"delicious"<<endl;
}
else if(B-A<=X){
cout<<"safe"<<endl;
}
else{
cout<<"dangerous"<<endl;
} | a.cc: In function 'int main()':
a.cc:17:4: error: expected '}' at end of input
17 | }
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s772761211 | p03679 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <utility>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1e9 + 7
#define INF 1e9
#define SENTINEL 2e9
#define PIE 3.14159265358979323
template <class T>
inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}
template <class T>
inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template <class T>
inline T GCD(T a, T b){if (b == 0) return a; else return GCD(b, a % b);}
template <class T>
inline T LCM(T a, T b) {return (a * b) / GCD(a, b);}
int main(){
int x, a, b;
cin >> x >> a >> b;
int c = b - a;
if (c =< 0)
cout << "delicious" << endl;
else if (c > x)
cout << "dangerous" << endl;
else
cout << "safe" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:36:12: error: expected primary-expression before '<' token
36 | if (c =< 0)
| ^
|
s316959750 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B,X;
cin>>A>>B>>X;
if(B-A>X){
cout<<"dangerous"<<endl;
}
else lf(B>A &&B-A<=X){
cout<<"safe"<<endl;
}
else {
cout<<"delicious"<<endl;
}
} | a.cc: In function 'int main()':
a.cc:10:8: error: 'lf' was not declared in this scope
10 | else lf(B>A &&B-A<=X){
| ^~
a.cc:13:3: error: 'else' without a previous 'if'
13 | else {
| ^~~~
|
s162736488 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
cin x,a,b;
cin >> x >> a >> b;
if(b-a<0) {
cout << "delicious" << endl;
}
else if(b-a>=0 && b-a < x ){
cout << "safe" << endl;
}
else {
cout << "dangerous" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:5:6: error: expected ';' before 'x'
5 | cin x,a,b;
| ^~
| ;
a.cc:6:10: error: 'x' was not declared in this scope
6 | cin >> x >> a >> b;
| ^
a.cc:6:15: error: 'a' was not declared in this scope
6 | cin >> x >> a >> b;
| ^
a.cc:6:20: error: 'b' was not declared in this scope
6 | cin >> x >> a >> b;
| ^
|
s237818551 | p03679 | C | #include<stdio.h>
int main(void)
{
int x,a,b;
scanf("%d%d%d",&x,&a,&b);
if(a<=b)
printf("delicious\n");
else if(b-a<=x)
printf("safe\n");
else
printf("dangerous\n")
return 0;
}
| main.c: In function 'main':
main.c:12:26: error: expected ';' before 'return'
12 | printf("dangerous\n")
| ^
| ;
13 | return 0;
| ~~~~~~
|
s449227276 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int X,A,B;
cin >> X >> A >> B;
if (A >= B){
cout << "delicious" << endl;
}
else if (B - A <= X){
cout << "safe" << endl;
}
else {
cout < "dangerous" << endl;
}
} | a.cc: In function 'int main()':
a.cc:14:24: error: invalid operands of types 'const char [10]' and '<unresolved overloaded function type>' to binary 'operator<<'
14 | cout < "dangerous" << endl;
| ~~~~~~~~~~~~^~~~~~~
|
s664058449 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for ( int i = 0; i < (int)(n); i++ )
int main( void )
{
ll x,a,b;
cin >> x >> a >> b;
if ( -a + b =< 0 )
cout << "delicious" << endl;
else if ( -a + b >= x )
cout << "safe" << endl;
else
cout << "dangerous" << endl;
}
| a.cc: In function 'int main()':
a.cc:11:18: error: expected primary-expression before '<' token
11 | if ( -a + b =< 0 )
| ^
|
s699742629 | p03679 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int x,a,b;
cin >> x >> a >> b;
if((b-a)x) cout << "safe" << endl;
else if((b-a)==x) cout << "delicous" << endl;
else cout << "dangerous" << endl;
} | a.cc: In function 'int main()':
a.cc:10:13: error: expected ')' before 'x'
10 | if((b-a)x) cout << "safe" << endl;
| ~ ^
| )
|
s921647537 | p03679 | C++ | #include<stdio.h>
int main() {
int x , a , b;
scanf(”%d%d%d” , &x , &a , &b);
if (−a + b <= 0) printf (”delicious\n”);
else if (−a + b <= x) printf (”safe\n”);
else printf (”dangerous\n”);
}
| a.cc:4:9: error: extended character ” is not valid in an identifier
4 | scanf(”%d%d%d” , &x , &a , &b);
| ^
a.cc:4:15: error: extended character ” is not valid in an identifier
4 | scanf(”%d%d%d” , &x , &a , &b);
| ^
a.cc:5:7: error: extended character − is not valid in an identifier
5 | if (−a + b <= 0) printf (”delicious\n”);
| ^
a.cc:5:28: error: extended character ” is not valid in an identifier
5 | if (−a + b <= 0) printf (”delicious\n”);
| ^
a.cc:5:38: error: stray '\' in program
5 | if (−a + b <= 0) printf (”delicious\n”);
| ^
a.cc:5:39: error: extended character ” is not valid in an identifier
5 | if (−a + b <= 0) printf (”delicious\n”);
| ^
a.cc:6:12: error: extended character − is not valid in an identifier
6 | else if (−a + b <= x) printf (”safe\n”);
| ^
a.cc:6:33: error: extended character ” is not valid in an identifier
6 | else if (−a + b <= x) printf (”safe\n”);
| ^
a.cc:6:38: error: stray '\' in program
6 | else if (−a + b <= x) printf (”safe\n”);
| ^
a.cc:6:39: error: extended character ” is not valid in an identifier
6 | else if (−a + b <= x) printf (”safe\n”);
| ^
a.cc:7:16: error: extended character ” is not valid in an identifier
7 | else printf (”dangerous\n”);
| ^
a.cc:7:26: error: stray '\' in program
7 | else printf (”dangerous\n”);
| ^
a.cc:7:27: error: extended character ” is not valid in an identifier
7 | else printf (”dangerous\n”);
| ^
a.cc: In function 'int main()':
a.cc:4:9: error: '\U0000201d' was not declared in this scope
4 | scanf(”%d%d%d” , &x , &a , &b);
| ^
a.cc:4:11: error: 'd' was not declared in this scope
4 | scanf(”%d%d%d” , &x , &a , &b);
| ^
a.cc:4:15: error: 'd\U0000201d' was not declared in this scope
4 | scanf(”%d%d%d” , &x , &a , &b);
| ^~
a.cc:5:7: error: '\U00002212a' was not declared in this scope
5 | if (−a + b <= 0) printf (”delicious\n”);
| ^~
a.cc:5:28: error: '\U0000201ddelicious' was not declared in this scope
5 | if (−a + b <= 0) printf (”delicious\n”);
| ^~~~~~~~~~
a.cc:6:33: error: '\U0000201dsafe' was not declared in this scope
6 | else if (−a + b <= x) printf (”safe\n”);
| ^~~~~
a.cc:7:16: error: '\U0000201ddangerous' was not declared in this scope
7 | else printf (”dangerous\n”);
| ^~~~~~~~~~
|
s712786097 | p03679 | 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(){
ll x,a,b;
cin >> x >> a >> b;
int c = b-a;
if(c <= 0){
puts("delicious");
else if(x >= c){
puts("safe");
}
else{
puts("dangerous");
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:3: error: expected '}' before 'else'
13 | else if(x >= c){
| ^~~~
a.cc:11:13: note: to match this '{'
11 | if(c <= 0){
| ^
|
s119747176 | p03679 | C++ | #include <iostream>
int main()
{
int x, a, b;
cout << x << a << b;
if (−a + b <= 0 ) cout >> "d e l i c i o u s" >> endl;
elseif (−a + b <= x ) cout >> "safe" >> endl;
else cout >> "dangerous" >> endl;
}
| a.cc:7:13: error: extended character − is not valid in an identifier
7 | if (−a + b <= 0 ) cout >> "d e l i c i o u s" >> endl;
| ^
a.cc:8:17: error: extended character − is not valid in an identifier
8 | elseif (−a + b <= x ) cout >> "safe" >> endl;
| ^
a.cc: In function 'int main()':
a.cc:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
6 | cout << x << a << b;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:7:13: error: '\U00002212a' was not declared in this scope
7 | if (−a + b <= 0 ) cout >> "d e l i c i o u s" >> endl;
| ^~
a.cc:7:58: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | if (−a + b <= 0 ) cout >> "d e l i c i o u s" >> 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:8:17: error: '\U00002212a' was not declared in this scope
8 | elseif (−a + b <= x ) cout >> "safe" >> endl;
| ^~
a.cc:8:9: error: 'elseif' was not declared in this scope
8 | elseif (−a + b <= x ) cout >> "safe" >> endl;
| ^~~~~~
a.cc:9:9: error: 'else' without a previous 'if'
9 | else cout >> "dangerous" >> endl;
| ^~~~
a.cc:9:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | else cout >> "dangerous" >> endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s319647599 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long int;
#define INF 20000000000000000;
int main(void){
int x, a, b;
cin >> x >> a >> b;
if(a > b) cout << "delicious" << endl;
else if(b - a = x) cout << "safe" << endl;
else cout << "dangerous" << endl;
} | a.cc: In function 'int main()':
a.cc:12:13: error: lvalue required as left operand of assignment
12 | else if(b - a = x) cout << "safe" << endl;
| ~~^~~
|
s985402417 | p03679 | C++ | #include<iostream>
using namespace std;
int main(void)
{
int x,a,b; cin>>x>>a>>b;
if(a>=b){puts("delicious");}
else if(b-a=<x){puts("safe");}
else{puts("dangerous");}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before '<' token
10 | else if(b-a=<x){puts("safe");}
| ^
|
s476327937 | p03679 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c;cin >>a >> b>> c;
if(c - b > a) cout << "dangerous" << endl;
else if(c - b =< 0) cout << "delicious" << endl;
else cout << "safe" << endl;
} | a.cc: In function 'int main()':
a.cc:6:18: error: expected primary-expression before '<' token
6 | else if(c - b =< 0) cout << "delicious" << endl;
| ^
|
s247702785 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
x = c - b;
if(x > a)
cout << "dangerous" << endl;
else if(b >= c)
cout << "delicious" << endl;
else
cout << "safe" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:5: error: 'x' was not declared in this scope
10 | x = c - b;
| ^
|
s497026148 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for(int i=0;i<c;++i)
int main(){
int x,y,z;
cin >> x >> y >> z;
if(y+z>x&&z-y<=x){
cout << "safe" << endl;
}else if(y+z<=x&&z-y<x){
cout << "delicious" << endl;
}
if(y+z>x&&z-y>x)
cout << "dangerous" << endl;
}
return 0;
} | a.cc:15:1: error: expected unqualified-id before 'return'
15 | return 0;
| ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s900835106 | p03679 | C++ | #include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18
#define PI 3.14159265358979
using namespace std;
int main(void){
ll x, a, b;
cin >> x >> a >> b;
if (b <= a){
cout << "delicious" << endl;
}
else if (b - a <= x){
cout << "safe" << endl;
}
else
cout << dangerous << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:13: error: 'dangerous' was not declared in this scope
20 | cout << dangerous << endl;
| ^~~~~~~~~
|
s595108103 | p03679 | C++ | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
const int INF= 1e9+5;
typedef long long ll;
int main(){
int x,a,b;
cin<<x<<a<<b;
if(x+a<b)cout<<"dangerous"<<endl;
else if(b<=a)cout<<"delicious"<<endl;
else cout<<"safe"<<endl;
} | a.cc: In function 'int main()':
a.cc:10:6: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
10 | cin<<x<<a<<b;
| ~~~^~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:10:6: note: candidate: 'operator<<(int, int)' (built-in)
10 | cin<<x<<a<<b;
| ~~~^~~
a.cc:10:6: 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:3:
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
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:10:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
10 | cin<<x<<a<<b;
| ^~~
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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<x<<a<<b;
| ^
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<x<<a<<b;
| ^
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<x<<a<<b;
| ^
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<x<<a<<b;
| ^
/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:10:8: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<x<<a<<b;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _T |
s332166058 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int X,A,B;
cin >> X >> A >> B;
if(B-A <= 0){
cout << "delicious" << endl;
}
else(B-A <= X){
cout << "safe" << endl;
}
else{
cout << "dangerous" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '{' token
10 | else(B-A <= X){
| ^
| ;
a.cc:13:5: error: 'else' without a previous 'if'
13 | else{
| ^~~~
|
s833576876 | p03679 | C++ | #include<iostream>
int main(){
int a, b, x;
std::cin >> a >> b >> x;
if(a - b <= 0)
std::cout << "delicious" << std::endl;
else if(a - b <= k)
std::cout << "safe" << std::endl;
else
std::cout << "dangerous" << std::endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:20: error: 'k' was not declared in this scope
8 | else if(a - b <= k)
| ^
|
s281609124 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ll x, a, b;
cin>>x>>a>>b;
if(−a + b <= 0)
cout<<"delicious";
else if(-a + b <= x)
cout<<"safe";
else
cout<<"dangerous";
return 0;
} | a.cc:8:12: error: extended character − is not valid in an identifier
8 | if(−a + b <= 0)
| ^
a.cc: In function 'int main()':
a.cc:8:12: error: '\U00002212a' was not declared in this scope
8 | if(−a + b <= 0)
| ^~
|
s906335007 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int x,a,b;
cin >> x >>a >> b;
if (x+a>=b)
cout << "delicious";
else
cout << "dangerous";
}
}
| a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s498229835 | p03679 | C++ | #include <stdio.h>
#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
int main()
{
int X, A, B;
cin >> X >> A >> B;
if (A - B >0)
cout << "delicious" << endl;
else if (B - A < =X)
cout << "safe" << endl;
else
cout << "dangerous" << endl;
} | a.cc: In function 'int main()':
a.cc:15:26: error: expected primary-expression before '=' token
15 | else if (B - A < =X)
| ^
|
s454034405 | p03679 | C++ | #inlcude <bits/stdc++.h>
using namespace std;
int main(){
int x, a, b;
cin >> x >> a >> b;
if(a > b)
cout << "delicious" << endl;
else if(a+b > x)
cout << "dangerous" << endl;
else
cout << "safe" << endl;
return 0;
}
| a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <bits/stdc++.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> x >> a >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #inlcude <bits/stdc++.h>
a.cc:9:9: error: 'cout' was not declared in this scope
9 | cout << "delicious" << endl;
| ^~~~
a.cc:9:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:32: error: 'endl' was not declared in this scope
9 | cout << "delicious" << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #inlcude <bits/stdc++.h>
a.cc:11:5: error: 'cout' was not declared in this scope
11 | cout << "dangerous" << endl;
| ^~~~
a.cc:11:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:28: error: 'endl' was not declared in this scope
11 | cout << "dangerous" << endl;
| ^~~~
a.cc:11:28: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:13:9: error: 'cout' was not declared in this scope
13 | cout << "safe" << endl;
| ^~~~
a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:27: error: 'endl' was not declared in this scope
13 | cout << "safe" << endl;
| ^~~~
a.cc:13:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s903342390 | p03679 | C++ | #inlcude <bit/std++.h>
using namespace std;
int main(){
int x, a, b;
cin >> x >> a >> b;
if(a > b)
cout << "delicious" << endl;
else if(a+b > x)
cout << "dangerous" << endl;
else
cout << "safe" << endl;
return 0;
}
| a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <bit/std++.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> x >> a >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #inlcude <bit/std++.h>
a.cc:9:9: error: 'cout' was not declared in this scope
9 | cout << "delicious" << endl;
| ^~~~
a.cc:9:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:32: error: 'endl' was not declared in this scope
9 | cout << "delicious" << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #inlcude <bit/std++.h>
a.cc:11:5: error: 'cout' was not declared in this scope
11 | cout << "dangerous" << endl;
| ^~~~
a.cc:11:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:28: error: 'endl' was not declared in this scope
11 | cout << "dangerous" << endl;
| ^~~~
a.cc:11:28: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:13:9: error: 'cout' was not declared in this scope
13 | cout << "safe" << endl;
| ^~~~
a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:27: error: 'endl' was not declared in this scope
13 | cout << "safe" << endl;
| ^~~~
a.cc:13:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s020987444 | p03679 | C++ | #inlcude <iostream>
using namespace std;
int main(){
int x, a, b;
cin >> x >> a >> b;
if(a > b)
cout << "delicious" << endl;
else if(a+b > x)
cout << "dangerous" << endl;
else
cout << "safe" << endl;
return 0;
} | a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude <iostream>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> x >> a >> b;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #inlcude <iostream>
a.cc:10:9: error: 'cout' was not declared in this scope
10 | cout << "delicious" << endl;
| ^~~~
a.cc:10:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:32: error: 'endl' was not declared in this scope
10 | cout << "delicious" << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #inlcude <iostream>
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout << "dangerous" << endl;
| ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:28: error: 'endl' was not declared in this scope
12 | cout << "dangerous" << endl;
| ^~~~
a.cc:12:28: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:14:9: error: 'cout' was not declared in this scope
14 | cout << "safe" << endl;
| ^~~~
a.cc:14:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:27: error: 'endl' was not declared in this scope
14 | cout << "safe" << endl;
| ^~~~
a.cc:14:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s249299268 | p03679 | C++ | x,a,b=map(int,input().split())
if b<=a:
print("delicious")
elif b<=a+x:
print("safe")
else:
print("dangerous")
| a.cc:1:1: error: 'x' does not name a type
1 | x,a,b=map(int,input().split())
| ^
|
s195454437 | p03679 | C++ | #include<iostream>
using namespace std;
int main(){
int x,a,b;
cin>>x>>a>>b;
if (b>x+a)cout<< "dangerous"<<endl;
else if (b>a) cout<<"safe"<<endl;
else cout<<"delicious"<<endl;
}j | a.cc:12:2: error: 'j' does not name a type
12 | }j
| ^
|
s471674723 | p03679 | Java | import java.util.Scanner;
public class Problem14 {
public static void main(String[] args) {
int x, a, b;
Scanner input = new Scanner(System.in);
x = input.nextInt();
a = input.nextInt();
b = input.nextInt();
int BestByDate = a + a;
int EatingDate = a + b;
int Date = EatingDate - BestByDate;
if(EatingDate <= BestByDate){
System.out.println("delicios");
}
else if(EatingDate <= BestByDate + x ){
System.out.println("safe");
}
else{
System.out.println("dangerous");
}
}
}
| Main.java:3: error: class Problem14 is public, should be declared in a file named Problem14.java
public class Problem14 {
^
1 error
|
s003332193 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int x,a,b;
cin >> x >> a >> b;
if(b-a=x){
cout << "safe" << endl;
}else if(b-a>x){
cout << "dangerous" << endl;
}else{
cout << "delicious" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:7: error: lvalue required as left operand of assignment
6 | if(b-a=x){
| ~^~
|
s453535149 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int x,a,b;
cin >> x >> a >> b;
if(b-a=x){
cout << "safe" << endl;
}else if(b-a>x){
cout << "dangerous" << endl;
}else{
cout << "delicious" << endl;
}
| a.cc: In function 'int main()':
a.cc:6:7: error: lvalue required as left operand of assignment
6 | if(b-a=x){
| ~^~
a.cc:12:2: error: expected '}' at end of input
12 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s667184174 | p03679 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int X = sc.nextInt();
int A = sc.nextInt();
int B = sc.nextInt();
if(B-A <= X && A-B>=0){
System.out.ptintln("delicious");
} else if(B-A <= X){
System.out.ptintln("safe");
} else{
System.out.ptintln("dangerous");
}
}
} | Main.java:12: error: cannot find symbol
System.out.ptintln("delicious");
^
symbol: method ptintln(String)
location: variable out of type PrintStream
Main.java:14: error: cannot find symbol
System.out.ptintln("safe");
^
symbol: method ptintln(String)
location: variable out of type PrintStream
Main.java:16: error: cannot find symbol
System.out.ptintln("dangerous");
^
symbol: method ptintln(String)
location: variable out of type PrintStream
3 errors
|
s681367906 | p03679 | C++ | ///....DH....///
#include <bits/stdc++.h>
#define task "Built"
#define fi(a) freopen(a, "r", stdin)
#define fo(a) freopen(a, "w", stdout)
#define pii pair<int, int>
#define ft first
#define sd second
#define mp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define reset(a, x) memset(a, x, sizeof(a))
#define For(i, s, n, m) for(int i = s; i <= n; i += m)
#define Ford(i, s, n, m) for(int i = s; i >= n; i -= m)
using namespace std;
template <typename R, typename D> inline void Min(R &a, D b) {
if(a>b)
a=b;
}
template <typename D, typename R> inline void Max(D &a, R b) {
if(a<b)
a=b;
}
/** MOD **/ const long long mod = 1e9 + 7;
/** size of array **/ const int maxn = 200005;
/** PI **/ const double M_PI = 3.14159265358979323846;
struct edge {
int x, y, w;
bool operator < (const edge &P) {
return w < P.w;
}
} a[maxn], b[maxn];
int cnt, n, res, p[maxn];
bool cmpx (edge P, edge Q) {
return P.x < Q.x;
}
bool cmpy (edge P, edge Q) {
return P.y < Q.y;
}
int Find(int u) {
if(u == p[u])
return u;
return p[u] = Find(p[u]);
}
int dsu(edge e) {
int x = Find(e.x);
int y = Find(e.y);
if(x == y)
return 0;
p[x] = y;
return e.w;
}
main() {
ios_base::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
cin >> n;
for(int i = 1; i <= n; i++) {
cin >> a[i].x >> a[i].y;
a[i].w = i;
}
sort(a + 1, a + n + 1, cmpx);
for(int i = 1; i < n; i++) {
b[++cnt].x = a[i].w;
b[cnt].y = a[i + 1].w;
b[cnt].w = min(abs(a[i].x - a[i + 1].x), abs(a[i].y - a[i + 1].y));
}
sort(a + 1, a + n + 1, cmpy);
for(int i = 1; i < n; i++) {
b[++cnt].x = a[i].w;
b[cnt].y = a[i + 1].w;
b[cnt].w = min(abs(a[i].x - a[i + 1].x), abs(a[i].y - a[i + 1].y));
}
sort(b + 1, b + cnt + 1);
for(int i = 1; i <= n; i++)
p[i] = i;
for(int i = 1; i <= cnt; i++) {
res += dsu(b[i]);
}
cout << res;
}
//6 8 3 4 9 12 19 18 1 13 5 7 6 -> 8
| In file included from /usr/include/c++/14/cmath:47,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114,
from a.cc:2:
a.cc:34:42: error: expected unqualified-id before numeric constant
34 | /** PI **/ const double M_PI = 3.14159265358979323846;
| ^~~~
a.cc:67:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
67 | main() {
| ^~~~
|
s057181220 | p03679 | C++ | /*
──────────────────────────────────────
─▄▄▄───────────▄▄▄▄▄▄▄────────────────
█▀░▀█──────▄▀▀▀░░░░░░░▀▀▄▄────────────
█░░░░█───▄▀░░░░░░░░░░░░░░░▀▄───────▄▄▄
█▄░░░▀▄▄▀░░██░░░░░░░░░░░░░░▀█────█▀▀░█
─█░░░░█▀░░░▀░░░░░░░░██░░░░░░▀█─▄█░░░░█
─▀█░░▄█░░░░░░░▄▄▄░░░░▀░░░░░░░███░░░░█▀
──█▄░█░░░░░▄███████▄░░░░░░░░░█▀░░░░▄▀─
──▀█░█░░░░▄██████████░░░░░░░▄█░░░░▄▀──
───███░░░░███████████░░░░░░▄█░░░░█▀───
────█░░░░░██████████▀░░░░░░█░░░░█▀────
────█░░░░░░▀███████▀░░░░░░░█▄▄▄▀──────
────█░░░░░░░░▀▀▀▀░░░░░░░░░░░▀█────────
────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
────█░░░░░░░░░░░░░░░░░░░░░░░░█────────
──────────────────────────────────────
*/
#include <bits/stdc++.h>
#define int long long
#define ii pair<int, int>
#define jj pair<int, pair< int , int > >
#define f first
#define s second
using namespace std ;
void TIME();
int n;
struct Tnode
{
int x, y, id;
};
Tnode A[100010];
struct Tnode1
{
int rt1, rt2, val;
Tnode1(int _rt1,int _rt2,int _val)
{
rt1 = _rt1;
rt2 = _rt2;
val = _val;
}
};
bool cmp(Tnode1 a, Tnode1 b)
{
return a.val < b.val;
}
bool xcmp(Tnode a, Tnode b)
{
return a.x < b.x;
}
bool ycmp(Tnode a, Tnode b)
{
return a.y < b.y;
}
vector <Tnode1> Canh;
int pa[100010];
int val[100010];
int root(int u)
{
if(pa[u] == u) return u;
return pa[u] = root(pa[u]);
}
bool DSU(int x, int y)
{
// cout <<".";
x = root(x);
y = root(y);
if(x == y)
{
return 0;
}
if(val[x] < val[y])
{
swap(x, y);
}
val[x] += val[y];
pa[y] = x;
return 1;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0) ; cout.tie(0);
// freopen("D_build.inp","r",stdin);
// freopen("D_build.inp","w",stdout);
// freopen("D_build.out","w",stdout);
cin >> n;
for(int i = 1, x, y ; i <= n ; i ++)
{
cin >> x >> y;
A[i].x = x;
A[i].y = y;
A[i].id = i;
}
sort(A+1,A+1+n,xcmp);
for(int i = 2 ; i <= n ; i ++)
{
Canh.push_back(Tnode1(A[i-1].id,A[i].id, min( abs(A[i-1].x-A[i].x),abs(A[i-1].y- A[i].y)))) ;
}
sort(A+1,A+1+n,ycmp);
for(int i = 2 ; i <= n ; i ++)
{
Canh.push_back(Tnode1(A[i-1].id,A[i].id,min(abs(A[i-1].x-A[i].x), abs(A[i-1].y-A[i].y))));
}
sort(Canh.begin(), Canh.end(), cmp);
int Ans = 0;
for(int i = 1 ; i <= n ; i ++)
{
val[i] = 1;
pa[i] = i;
}
// for(int i = 0 ; i < Canh.size() ; i ++)
// {
// cout << Canh[i].rt1 <<" "<< Canh[i].rt2 <<" " << Canh[i].val << endl;
// }
for(int i = 0 ; i < Canh.size() ; i ++)
{
Tnode1 Res = Canh[i];
//cout <<".";
if(DSU(Res.rt1, Res.rt2))
{
Ans += Res.val;
}
}
cout << Ans;
return 0;
}
void TIME()
{
cerr << "Time elapsed : " << clock() * 1000 / CLOCKS_PER_SEC << "ms\n";
}
| cc1plus: error: '::main' must return 'int'
|
s378565071 | p03679 | C++ | #include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <limits.h>
#include <cmath>
#include <queue>
#include <map>
#include <iomanip>
#include <random>
#include <fstream>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.14159265358979323846
#define MOD 1000000007
using namespace std;
using ll = long long;
const int MAX = 1000000;
ll fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
// 二項係数計算
long long COM(int n, int k){
if (n < k) return 0;
if (n < 0 || k < 0) return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll gcd(ll a, ll b)
{
ll r;
while ((r = a % b))
{
a = b;
b = r;
}
return b;
}
template <class T> struct cord{
T x,y;
};
template <class T> double dist(cord<T> a, cord<T> b){
T dx=a.x-b.x;
T dy=a.y-b.y;
return sqrt(dx*dx+dy*dy);
}
int main()
{
//cout << fixed << setprecision(10);
int x,a,b; cin >> x >> a >> b;
if (B<=A){cout << "delicious";}
else if (B<=A+X){cout << "safe";}
else {cout << "dangerous";}
return 0;
}
| a.cc: In function 'int main()':
a.cc:70:7: error: 'B' was not declared in this scope
70 | if (B<=A){cout << "delicious";}
| ^
a.cc:70:10: error: 'A' was not declared in this scope
70 | if (B<=A){cout << "delicious";}
| ^
a.cc:71:17: error: 'X' was not declared in this scope
71 | else if (B<=A+X){cout << "safe";}
| ^
|
s483144331 | p03679 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define ll long long
using namespace std;
int main(){
int x,a,b;
cin>>x>>a>>b;
if(a>b){
cout<<"deliciout";
}else if(x+a=>b){
cout<<"safe";
}else{
cout<<"dangerous";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:16: error: expected primary-expression before '>' token
14 | }else if(x+a=>b){
| ^
|
s139346501 | p03679 | C++ | #include <bits/stdc++.h>
#define rep(var,cnt) for(int (var)=0; (var)<(int)(cnt); ++(var))
#define Rep(var,init,cnt) for(int (var)=(init); (var)<(cnt); ++(var))
#define ran(var,vec) for(auto &(var):(vec))
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define SORT(v) sort(all(v))
#define RSORT(v) sort(rall(v))
#define SUM(v) accumulate(all(v),0)
#define tget(tp,idx) get<idx>(tp)
#define TF(flag) (flag)?1:0
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using ti = tuple<int,int,int>;
using tl = tuple<ll,ll,ll>;
template<typename T>
using vec = vector<T>;
template<typename T>
using mat = vector<vec<T>>;
template<typename T>
using cub = vector<mat<T>>;
template<typename T>
using val = valarray<T>;
template<typename T>
using pq = priority_queue<T>;
template<typename T>
using rpq = priority_queue<T,vec<T>,greater<T>>;
template<typename T1,typename T2>
ostream &operator<<(ostream &os, const pair<T1,T2> &p){
os<<"P("<<p.first<<", "<<p.second<<") ";
return os;
}
template<typename T1,typename T2>
istream &operator>>(istream &is, pair<T1,T2> &p){
is>>p.first>>p.second;
return is;
}
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
cout<<"V{";
for(int i=0; i<(int)v.size(); ++i){
os<<v[i]<<(i+1!=v.size()?" ":"");
}
cout<<"}";
return os;
}
template<typename T>
istream &operator>>(istream &is, vector<T> &v){
for(T &in:v) is>>in;
return is;
}
template<typename T>
ostream &operator<<(ostream &os, const valarray<T> &v){
cout<<"V{";
for(int i=0; i<(int)v.size(); ++i){
os<<v[i]<<(i+1!=v.size()?" ":"");
}
cout<<"}";
return os;
}
template<typename T>
istream &operator>>(istream &is, valarray<T> &v){
for(T &in:v) is>>in;
return is;
}
// Usual Template End ================================================
// Template End ======================================================
constexpr int MOD=1e9+7;
int main(void){
int a,b,c; cin>>a>>b>>c;
if(c-b<0) cout<<"delicious"<<endl;
else if(c-b<=x) cout<<"safe"<<endl;
else cout<<"dangerous"<<endl;
}
| a.cc: In function 'int main()':
a.cc:88:16: error: 'x' was not declared in this scope
88 | else if(c-b<=x) cout<<"safe"<<endl;
| ^
|
s331638233 | p03679 | C++ | #include <stdlib.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}
int main() {
long long a,b,c;
cin>>a>>b>>c;
if(b-c>=0){
cout<<"delicious"<<endl;
}
else{
if(b-c<0&&x>=b-c){
cout<<"safe"<<endl;
}
else{
cout<<"dangerous"<<endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:17:15: error: 'x' was not declared in this scope
17 | if(b-c<0&&x>=b-c){
| ^
|
s916586232 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
long int x, a, b;
cin >> x >> >> a >> b;
if(b<=a){cout << "delicious" << endl;}
else if(b<=a+x){cout << "safe" << endl;}
else{cout << "dangerous" << endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before '>>' token
7 | cin >> x >> >> a >> b;
| ^~
|
s382691391 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
long int x, a, b;
cin x >> >> a >> b;
if(b<=a){cout << "delicious" << endl;}
else if(b<=a+x){cout << "safe" << endl;}
else{cout << "dangerous" << endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'x'
7 | cin x >> >> a >> b;
| ^~
| ;
|
s060491962 | p03679 | C++ | data = input().split(" ")
for i in range(3):
data[i] = int(data[i])
a = data[0] + data[1] - data[2]
if data[2] <= data[1]:
print("delicious")
elif a >= 0:
print("safe")
else:
print("dangerous") | a.cc:1:1: error: 'data' does not name a type
1 | data = input().split(" ")
| ^~~~
|
s093807599 | p03679 | Java | import java.util.*;
public class Main{
public static void main(Sting[] args){
Scanner sc = new Scanner(System.in);
int X = sc.nextInt();
int A = sc.nextInt();
int B = sc.nextInt();
int date = B - A;
if(date <= 0){
System.out.println("delicious");
}else if(date <= X){
System.out.println("safe");
}else{
System.out.println("danger");
}
}
} | Main.java:4: error: cannot find symbol
public static void main(Sting[] args){
^
symbol: class Sting
location: class Main
1 error
|
s348682980 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int X,A,B;
cin >> X >> A >> B;
string k = "safe";//safe dangerous
if(B - A <= 0)
{
k = "delicious";
}
else if(B - A > X)
{
k = "dangerous"
}
cout << k << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:32: error: expected ';' before '}' token
14 | k = "dangerous"
| ^
| ;
15 | }
| ~
|
s547201262 | p03679 | C++ | #include<stdio .h> int main()
{
intx,a,b;
scanf(”%d%d%d”, &x, &a, &b);
if (−a + b <= 0)printf(”delicious\n”);
else if (−a + b <= x)printf(”safe\n”); else printf (”dangerous\n”);
} | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include<stdio .h> int main()
| ^~~
a.cc:1:9: fatal error: stdio .h: No such file or directory
1 | #include<stdio .h> int main()
| ^~~~~~~~~~
compilation terminated.
|
s021138198 | p03679 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n,m,p;
cin>>n>>m>>p;
if(m>n&&p<n||n<m&&p>n)
{
cout<<"safe"<<endl;
}
if(n>=m&&n>=p)
{
cout<<"delicious"<<endl;
}
if(n<m&&P>n)
{
cout<<"dangerous"<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:15:12: error: 'P' was not declared in this scope
15 | if(n<m&&P>n)
| ^
|
s313220968 | p03679 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (b - a < 0) {
cout << "delicious" << endl;
return 0;
}
if (b - a <=x)
cout << "safe" << endl;
else
cout << "dangerous" << endl;
} | a.cc: In function 'int main()':
a.cc:10:15: error: 'x' was not declared in this scope
10 | if (b - a <=x)
| ^
|
s311665247 | p03679 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
using namespace std;
int main()
{
int x, a, b;
cin >>x >> a >> b;
if (-a + b <= 0)
{
cout << "delicious" << endl;
}
else if (-a + b <= X)
{
cout << "safe" << endl;
}
else
{
cout << "dangerous" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:24: error: 'X' was not declared in this scope
17 | else if (-a + b <= X)
| ^
|
s391393960 | p03679 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
using namespace std;
int main()
{
int x, a, b;
cin << x << a << b;
if (-a + b <= 0)
{
cout << "delicious" << endl;
}
else if (-a + b <= X)
{
cout << "safe" << endl;
}
else
{
cout << "dangerous" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
12 | cin << x << a << b;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:12:9: note: candidate: 'operator<<(int, int)' (built-in)
12 | cin << x << a << b;
| ~~~~^~~~
a.cc:12:9: 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/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << x << a << b;
| ^
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:12:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
12 | cin << x << a << b;
| ^~~
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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << x << a << b;
| ^
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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << x << a << b;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << x << a << b;
| ^
/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/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:12:12: required from here
12 | cin << x << a << b;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
In file included from a.cc:5:
/usr/include/c++/14/iomanip:84:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Resetiosflags)'
84 | operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:84:5: note: template argument deduction/substitution failed:
a.cc:12:12: note: 'std::istream' {aka |
s078287223 | p03679 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
using namespace std;
int main()
{
int x, a, b;
cin << a << b << c;
if (-a + b <= 0)
{
cout << "delicious" << endl;
}
else if (-a + b <= X)
{
cout << "safe" << endl;
}
else
{
cout << "dangerous" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
12 | cin << a << b << c;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:12:9: note: candidate: 'operator<<(int, int)' (built-in)
12 | cin << a << b << c;
| ~~~~^~~~
a.cc:12:9: 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/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << a << b << c;
| ^
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:12:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
12 | cin << a << b << c;
| ^~~
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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << a << b << c;
| ^
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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << a << b << c;
| ^
/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:12:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
12 | cin << a << b << c;
| ^
/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/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:12:12: required from here
12 | cin << a << b << c;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
In file included from a.cc:5:
/usr/include/c++/14/iomanip:84:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Resetiosflags)'
84 | operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:84:5: note: template argument deduction/substitution failed:
a.cc:12:12: note: 'std::istream' {aka |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.