submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s795294780 | p00475 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define REP(i,b) FOR(i,0,b)
int a[100000];
int b[100000];
int amn=INT_MAX,amx=INT_MIN,bmn=INT_MAX,bmx=INT_MIN,n,c,d,ow=INT_MIN,oh = INT_MIN;
int main(){
scanf("%d",&n);
REP(i,n){
scanf("%d %d",&c,&d);
a[i] = c+d;
b[i] = c-d;
amn = min(amn,a[i]);
amx = max(amx,a[i]);
bmn = min(bmn,b[i]);
bmx = max(bmx,b[i]);
}
REP(i,n){
ow = max(ow,min(max(a[i]-amn,b[i]-bmn),max(amx-a[i],bmx-b[i])));
oh = max(oh,min(max(a[i]-amn,bmx-b[i]),max(amx-a[i],b[i]-bmn)));
}
printf("%d\n",min(ow,oh));
} | a.cc:8:9: error: 'INT_MAX' was not declared in this scope
8 | int amn=INT_MAX,amx=INT_MIN,bmn=INT_MAX,bmx=INT_MIN,n,c,d,ow=INT_MIN,oh = INT_MIN;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <algorithm>
+++ |+#include <climits>
3 | using namespace std;
a.cc: In function 'int main()':
a.cc:10:21: error: 'n' was not declared in this scope
10 | scanf("%d",&n);
| ^
a.cc:12:32: error: 'c' was not declared in this scope
12 | scanf("%d %d",&c,&d);
| ^
a.cc:12:35: error: 'd' was not declared in this scope
12 | scanf("%d %d",&c,&d);
| ^
a.cc:16:17: error: 'amx' was not declared in this scope; did you mean 'amn'?
16 | amx = max(amx,a[i]);
| ^~~
| amn
a.cc:17:17: error: 'bmn' was not declared in this scope; did you mean 'amn'?
17 | bmn = min(bmn,b[i]);
| ^~~
| amn
a.cc:18:17: error: 'bmx' was not declared in this scope
18 | bmx = max(bmx,b[i]);
| ^~~
a.cc:21:17: error: 'ow' was not declared in this scope
21 | ow = max(ow,min(max(a[i]-amn,b[i]-bmn),max(amx-a[i],bmx-b[i])));
| ^~
a.cc:21:51: error: 'bmn' was not declared in this scope; did you mean 'amn'?
21 | ow = max(ow,min(max(a[i]-amn,b[i]-bmn),max(amx-a[i],bmx-b[i])));
| ^~~
| amn
a.cc:21:60: error: 'amx' was not declared in this scope; did you mean 'amn'?
21 | ow = max(ow,min(max(a[i]-amn,b[i]-bmn),max(amx-a[i],bmx-b[i])));
| ^~~
| amn
a.cc:21:69: error: 'bmx' was not declared in this scope
21 | ow = max(ow,min(max(a[i]-amn,b[i]-bmn),max(amx-a[i],bmx-b[i])));
| ^~~
a.cc:22:17: error: 'oh' was not declared in this scope
22 | oh = max(oh,min(max(a[i]-amn,bmx-b[i]),max(amx-a[i],b[i]-bmn)));
| ^~
a.cc:24:27: error: 'ow' was not declared in this scope
24 | printf("%d\n",min(ow,oh));
| ^~
a.cc:24:30: error: 'oh' was not declared in this scope
24 | printf("%d\n",min(ow,oh));
| ^~
|
s694421058 | p00475 | C++ | #include <cstdio>
#include <stdc++.h>
using namespace std;
#define R for(i=0;i<n;++i)
int a[1<<17],b[1<<17],amn=1e7,amx=-1e7,bmn=1e7,bmx=-1e7,n,c,d,ow=-1e7,oh=1e7,i;
int main(){
scanf("%d",&n);
R{
scanf("%d %d",&c,&d);
a[i] = c+d;
b[i] = c-d;
amn = min(amn,a[i]);
amx = max(amx,a[i]);
bmn = min(bmn,b[i]);
bmx = max(bmx,b[i]);
}
R{
ow = max(ow,min(max(a[i]-amn,b[i]-bmn),max(amx-a[i],bmx-b[i])));
oh = max(oh,min(max(a[i]-amn,bmx-b[i]),max(amx-a[i],b[i]-bmn)));
}
printf("%d\n",min(ow,oh));
} | a.cc:2:10: fatal error: stdc++.h: No such file or directory
2 | #include <stdc++.h>
| ^~~~~~~~~~
compilation terminated.
|
s303022833 | p00475 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef pair<int,int> pi;
int n;
pi a[100005];
int solve(){
int s = 0, e = 400000;
while (s != e) {
int m = (s+e)/2;
int xl = 1e9, yl = 1e9, xh = -1e9, yh = -1e9;
for (int j=0; j<n; j++) {
if(a[j].first > m || a[j].second > m){
xl = min(xl,a[j].first);
xh = max(xh,a[j].first);
yl = min(yl,a[j].second);
yh = max(yh,a[j].second);
}
}
if(yh - yl <= m && xh - xl <= m) e = m;
else s = m+1;
}
return s;
}
int main(){
scanf("%d",&n);
for (int i=0; i<n; i++) {
int x,y;
scanf("%d %d",&x,&y);
a[i] = pi(x+y,x-y);
}
int ret = solve();
for (int i=0; i<n; i++) {
a[i].first = maxv1 - a[i].first;
}
ret = min(ret,solve());
printf("%d\n",ret);
} | a.cc: In function 'int main()':
a.cc:38:22: error: 'maxv1' was not declared in this scope
38 | a[i].first = maxv1 - a[i].first;
| ^~~~~
|
s179299726 | p00475 | C++ | //E? Nanndatte?
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
int n;
P p[100005];
int x[100005];
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
int a,b;
scanf("%d %d",&a,&b);
p[i].first=a+b;
x[i]=a+b;
p[i].second=a-b;
}
sort(p,p+n);
sort(x,x+n);
int lb=-1;
int ub=3e6;
while(ub-lb>1)
{
int mid=(lb+ub)>>1;
int le=lower_bound(x,x+n,x[n-1]-mid)-x;
int ri=upper_bound(x,x+n,x[0]+mid)-x;
ri--;
int y[2][2];
for(int i=0;i<2;i++)y[i][0]=-INF;
for(int i=0;i<2;i++)y[i][1]=INF;
if(ri<le) goto fail;
if(!le) goto succeed;
for(int i=0;i<ri;i++)
{
y[0][0]=max(y[0][0],p[i].second);
y[0][1]=min(y[0][1],p[i].second);
}
for(int i=le+1;i<n;i++)
{
y[1][0]=max(y[1][0],p[i].second);
y[1][1]=min(y[1][1],p[i].second);
}
if(y[0][0]-y[0][1]>mid || y[1][0]-y[1][1]>mid) goto fail;
int a=y[0][0];
int b=y[0][1];
int c=y[1][0];
int d=y[1][1];
vector<int>vec;
for(int i=ri;i<=le;i++)
{
vec.pb(p[i].second);
}
sort(vec.begin(),vec.end());
for(int i=-1;i<vec.size();i++)
{
int aa=a,bb=b,cc=c,dd=d;
if(i==-1)
{
aa=max(aa,vec[vec.size()-1]);
bb=min(bb,vec[0]);
if(aa-bb<=mid) goto succeed;
}
else
{
aa=max(aa,vec[vec.size()-1]);
bb=min(bb,vec[i+1]);
cc=max(cc,vec[i]);
dd=min(dd,vec[0]);
if(aa-bb<=mid && cc-dd<=mid) goto succeed;
}
}
for(int i=-1;i<vec.size();i++)
{
int aa=a,bb=b,cc=c,dd=d;
if(i==-1)
{
cc=max(cc,vec[vec.size()-1]);
dd=min(dd,vec[0]);
if(cc-dd<=mid) goto succeed;
}
else
{
cc=max(cc,vec[vec.size()-1]);
dd=min(dd,vec[i+1]);
aa=max(aa,vec[i]);
bb=min(bb,vec[0]);
if(aa-bb<=mid && cc-dd<=mid) goto succeed;
}
}
fail:;
lb=mid;
continue;
succeed:;
ub=mid;
}
printf("%d\n",ub);
} | a.cc: In function 'int main()':
a.cc:113:1: error: jump to label 'fail'
113 | fail:;
| ^~~~
a.cc:66:69: note: from here
66 | if(y[0][0]-y[0][1]>mid || y[1][0]-y[1][1]>mid) goto fail;
| ^~~~
a.cc:71:28: note: crosses initialization of 'std::vector<int> vec'
71 | vector<int>vec;
| ^~~
a.cc:70:21: note: crosses initialization of 'int d'
70 | int d=y[1][1];
| ^
a.cc:69:21: note: crosses initialization of 'int c'
69 | int c=y[1][0];
| ^
a.cc:68:21: note: crosses initialization of 'int b'
68 | int b=y[0][1];
| ^
a.cc:67:21: note: crosses initialization of 'int a'
67 | int a=y[0][0];
| ^
a.cc:113:1: error: jump to label 'fail'
113 | fail:;
| ^~~~
a.cc:54:32: note: from here
54 | if(ri<le) goto fail;
| ^~~~
a.cc:71:28: note: crosses initialization of 'std::vector<int> vec'
71 | vector<int>vec;
| ^~~
a.cc:70:21: note: crosses initialization of 'int d'
70 | int d=y[1][1];
| ^
a.cc:69:21: note: crosses initialization of 'int c'
69 | int c=y[1][0];
| ^
a.cc:68:21: note: crosses initialization of 'int b'
68 | int b=y[0][1];
| ^
a.cc:67:21: note: crosses initialization of 'int a'
67 | int a=y[0][0];
| ^
a.cc:116:1: error: jump to label 'succeed'
116 | succeed:;
| ^~~~~~~
a.cc:55:30: note: from here
55 | if(!le) goto succeed;
| ^~~~~~~
a.cc:71:28: note: crosses initialization of 'std::vector<int> vec'
71 | vector<int>vec;
| ^~~
a.cc:70:21: note: crosses initialization of 'int d'
70 | int d=y[1][1];
| ^
a.cc:69:21: note: crosses initialization of 'int c'
69 | int c=y[1][0];
| ^
a.cc:68:21: note: crosses initialization of 'int b'
68 | int b=y[0][1];
| ^
a.cc:67:21: note: crosses initialization of 'int a'
67 | int a=y[0][0];
| ^
|
s841349123 | p00475 | C++ | //Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef long long ll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
#define s(x) scanf("%d",&x)
#define rep(i,x) for(int i=0;i<x;i++)
#define geta 100000
vector<int>za[200005];
vector<int>all;
int main()
{
int n;
scanf("%d",&n);
P p[100005];
int xmi=INF,xma=-INF,ymi=INF,yma=-INF;
for(int i=0;i<n;i++)
{
int x,y;
scanf("%d %d",&x,&y);
p[i]=mp(x+y,x-y);
xmi=min(xmi,x+y);
xma=max(xma,x+y);
ymi=min(ymi,x-y);
yma=max(yma,x-y);
}
if(xma-xmi<yma-ymi)
{
for(int i=0;i<n;i++)swap(p[i].first,p[i].second);
swap(xma,yma);
swap(xmi,ymi);
}
for(int i=0;i<n;i++)
{
za[p[i].second+geta].pb(p[i].first);
all.pb(p[i].first);
}
sort(all.begin(),all.end());
for(int i=0;i<200005;i++) sort(za[i].begin(),za[i].end());
int lb=0;
int ub=xma-xmi;
int ano=yma-ymi;
while(ub-lb>1)
{
int mid=(lb+ub)>>1;
if(mid>=ano)
{
int d=upper_bound(all.begin(),all.end(),all[0]+mid)-all.begin();
if(d==all.size() || all[all.size()-1]-all[d]<=mid) ub=mid;
else lb=mid;
}
else
{
for(int i=yma+geta;i>ymi+mid+geta;i--)
{
if(za[i].empty()) continue;
if(za[i][za[i].size()-1]>xmi+mid) goto next;
}
for(int i=ymi+geta;i<yma-mid+geta;i++)
{
if(za[i].empty()) continue;
if(za[i][0]<xma-mid) goto next;
}
for(int i=yma-mid+geta;i<=ymi+mid+geta;i++)
{
if(za[i].empty()) continue;
int d=upper_bound(za[i].begin(),za[i].end(),xmi+mid)-za[i].begin();
int e=lower_bound(za[i].begin(),za[i].end(),xma-mid)-za[i].begin();
if(d<e) goto next;
}
ub=mid;
continue;
next:;
for(int i=yma+geta;i>ymi+mid+geta;i--)
{
if(za[i].empty()) continue;
if(za[i][0]<xma-mid) goto next2;
}
for(int i=ymi+geta;i<yma-mid+geta;i++)
{
if(za[i].empty()) continue;
if(za[i][za[i].size()-1]>xmi+mid) goto next2;
}
for(int i=yma-mid+geta;i<=ymi+mid+geta;i++)
{
if(za[i].empty()) continue;
int d=upper_bound(za[i].begin(),za[i].end(),xmi+mid)-za[i].begin();
int e=lower_bound(za[i].begin(),za[i].end(),xma-mid)-za[i].begin();
if(d<e) goto next2;
}
ub=mid;
continue;
next2;
lb=mid;
}
}
printf("%d\n",ub);
} | a.cc: In function 'int main()':
a.cc:113:25: error: 'next2' was not declared in this scope; did you mean 'nextup'?
113 | next2;
| ^~~~~
| nextup
a.cc:97:59: error: label 'next2' used but not defined
97 | if(za[i][0]<xma-mid) goto next2;
| ^~~~~
|
s974277294 | p00475 | C++ | //Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef long long ll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
#define s(x) scanf("%d",&x)
#define rep(i,x) for(int i=0;i<x;i++)
#define geta 200000
vector<int>za[400005];
vector<int>all;
int main()
{
int n;
scanf("%d",&n);
P p[100005];
int xmi=INF,xma=-INF,ymi=INF,yma=-INF;
for(int i=0;i<n;i++)
{
int x,y;
scanf("%d %d",&x,&y);
p[i]=mp(x+y,x-y);
xmi=min(xmi,x+y);
xma=max(xma,x+y);
ymi=min(ymi,x-y);
yma=max(yma,x-y);
}
if(xma-xmi<yma-ymi)
{
for(int i=0;i<n;i++)swap(p[i].first,p[i].second);
swap(xma,yma);
swap(xmi,ymi);
}
for(int i=0;i<n;i++)
{
za[p[i].second+geta].pb(p[i].first);
all.pb(p[i].first);
}
sort(all.begin(),all.end());
for(int i=0;i<400005;i++) sort(za[i].begin(),za[i].end());
int lb=0;
int ub=xma-xmi;
int ano=yma-ymi;
while(ub-lb>1)
{
int mid=(lb+ub)>>1;
if(mid>=ano)
{
int d=upper_bound(all.begin(),all.end(),all[0]+mid)-all.begin();
if(d==all.size() || all[all.size()-1]-all[d]<=mid) ub=mid;
else lb=mid;
}
else
{
for(int i=yma+geta;i>ymi+mid+geta;i--)
{
if(za[i].empty()) continue;
if(za[i][za[i].size()-1]>xmi+mid) goto next;
}
for(int i=ymi+geta;i<yma-mid+geta;i++)
{
if(za[i].empty()) continue;
if(za[i][0]<xma-mid) goto next;
}
for(int i=yma-mid+geta;i<=ymi+mid+geta;i++)
{
if(za[i].empty()) continue;
int d=upper_bound(za[i].begin(),za[i].end(),xmi+mid)-za[i].begin();
int e=lower_bound(za[i].begin(),za[i].end(),xma-mid)-za[i].begin();
if(d<e) goto next;
}
ub=mid;
continue;
next:;
for(int i=yma+geta;i>ymi+mid+geta;i--)
{
if(za[i].empty()) continue;
if(za[i][0]<xma-mid) goto next2;
}
for(int i=ymi+geta;i<yma-mid+geta;i++)
{
if(za[i].empty()) continue;
if(za[i][za[i].size()-1]>xmi+mid) goto next2;
}
for(int i=yma-mid+geta;i<=ymi+mid+geta;i++)
{
if(za[i].empty()) continue;
int d=upper_bound(za[i].begin(),za[i].end(),xmi+mid)-za[i].begin();
int e=lower_bound(za[i].begin(),za[i].end(),xma-mid)-za[i].begin();
if(d<e) goto next2;
}
ub=mid;
continue;
next2;
lb=mid;
}
}
printf("%d\n",ub);
} | a.cc: In function 'int main()':
a.cc:113:25: error: 'next2' was not declared in this scope; did you mean 'nextup'?
113 | next2;
| ^~~~~
| nextup
a.cc:97:59: error: label 'next2' used but not defined
97 | if(za[i][0]<xma-mid) goto next2;
| ^~~~~
|
s414605862 | p00476 | C | #include <stdio.h>
#include <string.h>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) > (b) ? (b) : (a))
#define MAX_N (100000)
typedef __int64 ll;
typedef struct {
ll val;
int pos;
} SEG;
SEG seg[1 << 18];
ll data[1 << 18], datb[1 << 18];
SEG dummy;
int seg_size;
void init(int N)
{
seg_size = 1;
while (seg_size < N){
seg_size *= 2;
}
memset(seg, -1, sizeof(seg));
}
void update(int k, int x)
{
k += seg_size - 1;
seg[k].val = x;
seg[k].pos = k - (seg_size - 1);
while (k != 0){
k = (k - 1) / 2;
if (seg[k * 2 + 2].val > seg[k * 2 + 1].val){
seg[k] = seg[k * 2 + 2];
}
else if (seg[k * 2 + 1].val > seg[k * 2 + 2].val){
seg[k] = seg[k * 2 + 1];
}
else {
seg[k] = (seg[k * 2 + 1].pos < seg[k * 2 + 2].pos) ? seg[k * 2 + 2] : seg[k * 2 + 1];
}
}
}
SEG query(int a, int b, int k, int l, int r)
{
SEG vl, vr;
if (r <= a || b <= l){
return (dummy);
}
if (a <= l && r <= b){
return (seg[k]);
}
else {
vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
}
if (vl.val > vr.val || (vl.val == vr.val && vl.pos > vr.pos)){
return (vl);
}
else {
return (vr);
}
}
void add(int a, int b, ll x, int k, int l, int r)
{
if (a <= l && r <= b){ //comletely inclusive.
data[k] += x; //add to all segmets corresponds to [l, r).
}
else if (l < b && a < r){ //some of the segments are inclusive.
datb[k] += (min(b, r) - max(a, l)) * x; //add the x to the segments that belongs to [max(a, l), min(r, b)).
add(a, b, x, k * 2 + 1, l, (l + r) / 2); //go to the left vertex.
add(a, b, x, k * 2 + 2, (l + r) / 2, r); //go to the right vertex.
}
}
ll sum(int a, int b, int k, int l, int r)
{
if (b <= l || r <= a){ //looking segment[l, r) cross with the segment [a, b).
return (0);
}
else if (a <= l && r <= b){ //completely inclusive.
return (data[k] * (r - l) + datb[k]);
}
else { //some of the segments are inclusive.
ll res;
res = (min(b, r) - max(a, l)) * data[k];
res += sum(a, b, k * 2 + 1, l, (l + r) / 2);
res += sum(a, b, k * 2 + 2, (l + r) / 2, r);
return (res);
}
}
int main(void)
{
int i, j;
int N, H;
int dmg, life;
int tail;
ll ans;
ll sumLife;
scanf("%d%d", &N, &H);
init(N);
sumLife = H;
for (i = 0; i < N - 1; i++){
scanf("%d%d", &dmg, &life);
update(i, min(life, H - sumLife));
add(i, i + 1, sumLife, 0, 0, seg_size);
sumLife -= dmg;
}
add(i, i + 1, sumLife, 0, 0, seg_size);
update(i, 0);
dummy.val = -100000, dummy.pos = -1;
life = H;
ans = 0;
tail = 0;
for (i = 0; i < N; i++){
while (sum(i, i + 1, 0, 0, seg_size) <= 0){
SEG temp;
temp = query(tail, i, 0, 0, seg_size);
//printf("%dF -> %dF\n", i + 1, temp.pos + 1);
ans++;
tail = temp.pos;
add(temp.pos, N, temp.val, 0, 0, seg_size);
for (j = temp.pos; j < N; j++){
ll t = sum(j, j + 1, 0, 0, seg_size);
if (H - t > seg[j + seg_size - 1].val){
continue;
}
update(j, min(seg[j + seg_size - 1].val, H - t));
}
}
}
printf("%d\n", ans);
return (0);
} | main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'?
8 | typedef __int64 ll;
| ^~~~~~~
| __int64_t
|
s648488331 | p00476 | C | #include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef struct {
int plus, pos;
} Dungeon;
bool operator < (const Dungeon &a, const Dungeon &b)
{
if (a.plus != b.plus){
return (a.plus < b.plus);
}
else {
return (a.pos < b.pos);
}
}
int data[1 << 18], datb[1 << 18];
void add(int a, int b, int x, int k, int l, int r)
{
if (a <= l && r <= b){ //comletely inclusive.
data[k] += x; //add to all segmets corresponds to [l, r).
}
else if (l < b && a < r){ //some of the segments are inclusive.
datb[k] += (min(b, r) - max(a, l)) * x; //add the x to the segments that belongs to [max(a, l), min(r, b)).
add(a, b, x, k * 2 + 1, l, (l + r) / 2); //go to the left vertex.
add(a, b, x, k * 2 + 2, (l + r) / 2, r); //go to the right vertex.
}
}
//*
int sum(int a, int b, int k, int l, int r)
{
if (b <= l || r <= a){ //looking segment[l, r) cross with the segment [a, b).
return (0);
}
else if (a <= l && r <= b){ //completely inclusive.
return (data[k] * (r - l) + datb[k]);
}
else { //some of the segments are inclusive.
ll res;
res = (min(b, r) - max(a, l)) * data[k];
res += sum(a, b, k * 2 + 1, l, (l + r) / 2);
res += sum(a, b, k * 2 + 2, (l + r) / 2, r);
return (res);
}
}
//*/
int main(void)
{
int N, H;
int di[100000], hi[100000];
int curLife;
scanf("%d%d", &N, &H);
for (int i = 0; i < N - 1; i++){
scanf("%d%d", &di[i], &hi[i]);
}
curLife = H;
ll ans = 0;
priority_queue<Dungeon> que;
for (int i = 0; i < N - 1; i++){
add(i, i + 1, curLife, 0, 0, 1 << 17);
Dungeon in;
curLife -= di[i];
in.plus = hi[i];
in.pos = i;
que.push(in);
while (curLife <= 0){
Dungeon heal = que.top();
que.pop();
/* O(logN)
int segMax = getMax(heal.pos, i + 1, 0, 0, 1 << 17);
//*/
//* O(NlogN)
int segMax = 0;
for (int j = heal.pos; j <= i; j++){
segMax = max(segMax, sum(j, j + 1, 0, 0, 1 << 17));
}
//*/
if (heal.plus + segMax > H){
heal.plus = H - segMax;
que.push(heal);
continue;
}
int howMany = min((-1 * curLife) / heal.plus + 1, (H - segMax) / heal.plus);
ans += howMany;
curLife += howMany * heal.plus;
add(heal.pos, i + 1, howMany * heal.plus, 0, 0, 1 << 17);
que.push(heal);
}
}
printf("%lld\n", ans);
return (0);
} | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s377909625 | p00476 | C++ | #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
//const int INF = 1e8;
using namespace std;
#define int long long
const int MAX_N = 100010;
class segTree{
public:
int n, dat[4 * MAX_N];
void init(int n_, int value, int dat_b[4 * MAX_N] = NULL){
n = 1;
while(n < n_) n *= 2;
rep(i,2 * n){
dat[i] = value;
if(dat_b != NULL) dat_b[i] = value;
}
}
void output(int a[4 * MAX_N]){
show("print");
range(i,1,n * 2) cout << (a[i] == INT_MAX ? 0 : a[i]) << ' ';
cout << endl;
}
};
class starrySky : public segTree{
private:
int query(int a, int b, int k, int l, int r){
if(b <= l || r <= a) return 0;
if(a <= l && r <= b) return dat[k] + dat_add[k];
int vl = query(a, b, k * 2, l, (l + r) / 2);
int vr = query(a, b, k * 2 + 1, (l + r) / 2, r);
return max(vl, vr) + dat_add[k];
}
void add(int a, int b, int k, int l, int r, int x){
if(b <= l || r <= a) return;
if(a <= l && r <= b){
dat_add[k] += x;
}else{
add(a, b, k * 2, l, (l + r) / 2, x);
add(a, b, k * 2 + 1, (l + r) / 2, r, x);
dat[k] = max(dat[k * 2] + dat_add[k * 2], dat[k * 2 + 1] + dat_add[k * 2 + 1]);
}
}
void init(int n_){ segTree::init(n_,0,dat_add); }
public:
int dat_add[4 * MAX_N];
starrySky(int n){ init(n); }
int query(int a, int b){ return query(a, b, 1, 0, n); }
void add(int s, int t, int x){ add(s, t, 1, 0, n, x); }
void add(int i, int x){ add(i, i + 1, 1, 0, n, x); }
};
signed main(){
long long n, h;
cin >> n >> h;
???//1-index????????°??¨
starrySky seg(n); //?????????????????????
priority_queue<pair<long long, int>> q; //??????????????????pos
long long cur = h, ans = 0;
rep(i,n - 1){
long long damage, heal;
cin >> damage >> heal;
q.push(make_pair(heal, i));
seg.add(i + 1, cur);
cur -= damage;
while(cur <= 0){
pair<long long, int> use = q.top(); q.pop();
long long maxHP = seg.query(use.second + 1, i + 2); //????????°??????????????¨??°?????§?????????????????§
if(maxHP + use.first > h){ //??????????????????????¶????????????§?????????????????????????????´
q.push(make_pair(h - maxHP, use.second));
continue;
}
long long can_use = (h - maxHP) / use.first;
long long require = ceil((-1.0 * cur + 1) / use.first);
long long used = min(can_use, require);
ans += used;
cur += used * use.first;
seg.add(use.second + 1, i + 2, used * use.first);
q.push(use);
}
}
cout << ans << endl;
} | a.cc:65:2: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
65 | ???//1-index????????°??¨
a.cc: In function 'int main()':
a.cc:65:1: error: expected primary-expression before '?' token
65 | ???//1-index????????°??¨
| ^
a.cc:65:2: error: expected primary-expression before '?' token
65 | ???//1-index????????°??¨
| ^
a.cc:65:3: error: expected primary-expression before '?' token
65 | ???//1-index????????°??¨
| ^
a.cc:66:15: error: expected primary-expression before 'seg'
66 | starrySky seg(n); //?????????????????????
| ^~~
a.cc:66:14: error: expected ':' before 'seg'
66 | starrySky seg(n); //?????????????????????
| ^~~~
| :
a.cc:66:15: error: 'seg' was not declared in this scope
66 | starrySky seg(n); //?????????????????????
| ^~~
a.cc:66:21: error: expected ':' before ';' token
66 | starrySky seg(n); //?????????????????????
| ^
| :
a.cc:66:21: error: expected primary-expression before ';' token
a.cc:66:21: error: expected ':' before ';' token
66 | starrySky seg(n); //?????????????????????
| ^
| :
a.cc:66:21: error: expected primary-expression before ';' token
|
s538504745 | p00476 | C++ | #include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
//const int INF = 1e8;
using namespace std;
#define int long long
const int MAX_N = 100010;
class segTree{
public:
int n, dat[4 * MAX_N];
void init(int n_, int value, int dat_b[4 * MAX_N] = NULL){
n = 1;
while(n < n_) n *= 2;
rep(i,2 * n){
dat[i] = value;
if(dat_b != NULL) dat_b[i] = value;
}
}
void output(int a[4 * MAX_N]){
show("print");
range(i,1,n * 2) cout << (a[i] == INT_MAX ? 0 : a[i]) << ' ';
cout << endl;
}
};
class starrySky : public segTree{
private:
int query(int a, int b, int k, int l, int r){
if(b <= l || r <= a) return 0;
if(a <= l && r <= b) return dat[k] + dat_add[k];
int vl = query(a, b, k * 2, l, (l + r) / 2);
int vr = query(a, b, k * 2 + 1, (l + r) / 2, r);
return max(vl, vr) + dat_add[k];
}
void add(int a, int b, int k, int l, int r, int x){
if(b <= l || r <= a) return;
if(a <= l && r <= b){
dat_add[k] += x;
}else{
add(a, b, k * 2, l, (l + r) / 2, x);
add(a, b, k * 2 + 1, (l + r) / 2, r, x);
dat[k] = max(dat[k * 2] + dat_add[k * 2], dat[k * 2 + 1] + dat_add[k * 2 + 1]);
}
}
void init(int n_){ segTree::init(n_,0,dat_add); }
public:
int dat_add[4 * MAX_N];
starrySky(int n){ init(n); }
int query(int a, int b){ return query(a, b, 1, 0, n); }
void add(int s, int t, int x){ add(s, t, 1, 0, n, x); }
void add(int i, int x){ add(i, i + 1, 1, 0, n, x); }
};
signed main(){
long long n, h;
cin >> n >> h;
???//1-index????????°??¨
starrySky seg(n); //?????????????????????
priority_queue<pair<long long, int>> q; //??????????????????pos
long long cur = h, ans = 0;
rep(i,n - 1){
long long damage, heal;
cin >> damage >> heal;
q.push(make_pair(heal, i));
seg.add(i + 1, cur);
cur -= damage;
while(cur <= 0){
pair<long long, int> use = q.top(); q.pop();
long long maxHP = seg.query(use.second + 1, i + 2); //????????°??????????????¨??°?????§?????????????????§
if(maxHP + use.first > h){ //??????????????????????¶????????????§?????????????????????????????´
q.push(make_pair(h - maxHP, use.second));
continue;
}
long long can_use = (h - maxHP) / use.first;
long long require = ceil((-1.0 * cur + 1) / use.first);
long long used = min(can_use, require);
ans += used;
cur += used * use.first;
seg.add(use.second + 1, i + 2, used * use.first);
q.push(use);
}
}
cout << ans << endl;
} | a.cc:65:2: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
65 | ???//1-index????????°??¨
a.cc: In function 'int main()':
a.cc:65:1: error: expected primary-expression before '?' token
65 | ???//1-index????????°??¨
| ^
a.cc:65:2: error: expected primary-expression before '?' token
65 | ???//1-index????????°??¨
| ^
a.cc:65:3: error: expected primary-expression before '?' token
65 | ???//1-index????????°??¨
| ^
a.cc:66:15: error: expected primary-expression before 'seg'
66 | starrySky seg(n); //?????????????????????
| ^~~
a.cc:66:14: error: expected ':' before 'seg'
66 | starrySky seg(n); //?????????????????????
| ^~~~
| :
a.cc:66:15: error: 'seg' was not declared in this scope
66 | starrySky seg(n); //?????????????????????
| ^~~
a.cc:66:21: error: expected ':' before ';' token
66 | starrySky seg(n); //?????????????????????
| ^
| :
a.cc:66:21: error: expected primary-expression before ';' token
a.cc:66:21: error: expected ':' before ';' token
66 | starrySky seg(n); //?????????????????????
| ^
| :
a.cc:66:21: error: expected primary-expression before ';' token
|
s256811461 | p00476 | C++ | #include <iostream>
#include <cstdio>
#include <map>
#include <deque>
using namespace std;
long long d[100000];
long long h[100000];
long long s[100000];
int main(){
long long N,H,mx;
cin >> N >> H;
mx = H;
for(int i = 0 ; i < N-1 ; i++){
cin >> d[i] >> h[i];
s[i+1] = s[i] + d[i];
}
int ans = 0;
deque<int> Q;
for(int i = 0 ; i < N-1 ; i++){
//if( i > 10 ) return 0;
//cout << "s" << i << " " << H << " " << ans << endl;
while( Q.size() && h[Q.back()] <= h[i]) Q.pop_back();
Q.push_back(i);
while( Q.size() && s[i] - s[Q.front()] > mx) Q.pop_front();
//for(int j = 0 ; j < Q.size() ; j++) cout << h[Q[j]] << " (" << Q[j] << "," << mx - (s[i]-s[Q[j]]) << ") ";cout << endl;
if( H <= d[i] ){
for(int j = 0 ; j < Q.size() ; j++){
long long heal_max = max(0ll, mx - (s[i] - s[Q[j]]) - H );
//cout << i << " " << Q[j] << " " << s[i] << " " << s[Q[j]] << " " << H << " " << heal_max << endl;
long long need = d[i] - H + 1;
long long use = min(need,heal_max) / h[Q[j]];
//cout << Q[j] << " : " << need << " <========== " << " " << heal_max << endl;
//if( use == 0 ) continue;
H += use * h[Q[j]];
//H = min(H,mx - (s[i] - s[Q[j]]));
ans += use;
if( H > d[i] ) break;
if( j+1 >= Q.size() || mx - (s[i] - s[Q[j]]) - H >= h[Q[j+1]] ){
//cout << H << " " << heal_max << endl;
ans++;
H = min( H + h[Q[j]], mx - (s[i] - s[Q[j]]) );
flag = 1;
}
if( H > d[i] ) break;
}
}
H -= d[i];
if( H <= 0 ){
cout << -1 << endl;
return 0;
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:47:41: error: 'flag' was not declared in this scope
47 | flag = 1;
| ^~~~
|
s377969445 | p00476 | C++ | //Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <deque>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef long long ll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
#define s(x) scanf("%d",&x)
#define rep(i,x) for(int i=0;i<x;i++)
int main()
{
int n;
ll maxv;
scanf("%d %lld",&n,&maxv);
ll totv=maxv;
ll totd=0LL;
deque<pair<ll,ll> >deq;
ll ret=0LL;
for(int i=0;i<n;i++)
{
ll a,b;
scanf("%lld %lld",&a,&b);
while(!deq.empty() && deq.back().first<=b) deq.pop_back();
deq.push(mp(b,totd));
totd+=a;
if(totv<totd)
{
while(totv+totd+deq.front().first-deq.front().second>maxv) deq.pop_front();
ll kai=deq.front().first;
ll prev=deq.front().second;
ret+=(maxv-(totv+totd-prev))/kai;
totv+=((maxv-(totv+totd-prev))/kai)*kai;
}
}
printf("%lld\n",ret);
} | a.cc: In function 'int main()':
a.cc:43:21: error: 'class std::deque<std::pair<long long int, long long int> >' has no member named 'push'
43 | deq.push(mp(b,totd));
| ^~~~
|
s330168889 | p00476 | C++ | //Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef long long ll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
#define s(x) scanf("%d",&x)
#define maxs 1<<18
class segtree
{
ll seg[maxs]={};
ll lazy[maxs]={};
void lazy_evaluate(int x)
{
if(x*2+2>=maxs) continue;
lazy[x*2+1]+=lazy[x];
lazy[x*2+2]+=lazy[x];
seg[x*2+1]+=lazy[x];
seg[x*2+2]+=lazy[x];
lazy[x]=0;
}
ll update(int beg,int en,int idx,int lb,int ub,int val)
{
if(ub<beg || en<lb)
{
return seg[idx];
}
if(beg<=lb && ub<=en)
{
lazy[idx]+=val;
seg[idx]+=val;
lazy_evaluate(idx);
return seg[idx];
}
if(lazy[idx])
{
lazy_evaluate(idx);
}
return seg[idx]=max(update(beg,en,idx*2+1,lb,(lb+ub)/2,val),update(beg,en,idx*2+2,(lb+ub)/2+1,ub,val));
}
ll query(int beg,int en,int idx,int lb,int ub)
{
if(ub<beg || en<lb)
{
return -1LLe12;
}
if(beg<=lb && ub<=en)
{
return seg[idx];
}
if(lazy[idx])
{
lazy_evaluate(idx);
}
return max(query(beg,en,idx*2+1,lb,(lb+ub)/2),query(beg,en,idx*2+2,(lb+ub)/2+1,ub));
}
}seg_tree;
int main()
{
int n;ll x;
scanf("%d %lld",&n,&x);
seg_tree.update(0,maxs-1,0,0,maxs-1,x);
priority_queue<pair<ll,ll> >que;
int ret=0;
for(int i=0;i<n-1;i++)
{
ll x,y;
scanf("%lld %lld",&x,&y);
que.push(mp(y,i));
for(;;)
{
if(que.empty()) break;
if(seg_tree.query(i+1,i+1,0,0,maxs-1)>x) break;
pair<ll,ll>p=que.top(); que.pop();
int v1=(x-seg_tree.query(p.second,i,0,0,maxs-1)/p.first;
int v2=(1-seg_tree.query(i+1,i+1,0,0,maxs-1)+x+p.first-1)/p.first;
if(v1>=v2)
{
ret+=v1;
seg_tree.update(p.second,maxs-1,0,0,maxs-1,v1*p.first);
}
else
{
ret+=v2;
que.pop();
seg_tree.update(p.second,maxs-1,0,0,maxs-1,v2*p.first);
}
}
seg_tree.update(i+1,maxs-1,0,0,maxs-1,-x);
}
printf("%d\n",ret);
} | a.cc: In member function 'void segtree::lazy_evaluate(int)':
a.cc:35:33: error: continue statement not within a loop
35 | if(x*2+2>=maxs) continue;
| ^~~~~~~~
a.cc: In member function 'll segtree::query(int, int, int, int, int)':
a.cc:65:33: error: unable to find numeric literal operator 'operator""LLe12'
65 | return -1LLe12;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:82:24: error: 'll segtree::update(int, int, int, int, int, int)' is private within this context
82 | seg_tree.update(0,maxs-1,0,0,maxs-1,x);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:42:12: note: declared private here
42 | ll update(int beg,int en,int idx,int lb,int ub,int val)
| ^~~~~~
a.cc:94:42: error: 'll segtree::query(int, int, int, int, int)' is private within this context
94 | if(seg_tree.query(i+1,i+1,0,0,maxs-1)>x) break;
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:61:12: note: declared private here
61 | ll query(int beg,int en,int idx,int lb,int ub)
| ^~~~~
a.cc:96:49: error: 'll segtree::query(int, int, int, int, int)' is private within this context
96 | int v1=(x-seg_tree.query(p.second,i,0,0,maxs-1)/p.first;
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:61:12: note: declared private here
61 | ll query(int beg,int en,int idx,int lb,int ub)
| ^~~~~
a.cc:96:80: error: expected ')' before ';' token
96 | int v1=(x-seg_tree.query(p.second,i,0,0,maxs-1)/p.first;
| ~ ^
| )
a.cc:97:49: error: 'll segtree::query(int, int, int, int, int)' is private within this context
97 | int v2=(1-seg_tree.query(i+1,i+1,0,0,maxs-1)+x+p.first-1)/p.first;
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:61:12: note: declared private here
61 | ll query(int beg,int en,int idx,int lb,int ub)
| ^~~~~
a.cc:101:48: error: 'll segtree::update(int, int, int, int, int, int)' is private within this context
101 | seg_tree.update(p.second,maxs-1,0,0,maxs-1,v1*p.first);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:42:12: note: declared private here
42 | ll update(int beg,int en,int idx,int lb,int ub,int val)
| ^~~~~~
a.cc:107:48: error: 'll segtree::update(int, int, int, int, int, int)' is private within this context
107 | seg_tree.update(p.second,maxs-1,0,0,maxs-1,v2*p.first);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:42:12: note: declared private here
42 | ll update(int beg,int en,int idx,int lb,int ub,int val)
| ^~~~~~
a.cc:110:32: error: 'll segtree::update(int, int, int, int, int, int)' is private within this context
110 | seg_tree.update(i+1,maxs-1,0,0,maxs-1,-x);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:42:12: note: declared private here
42 | ll update(int beg,int en,int idx,int lb,int ub,int val)
| ^~~~~~
|
s241723869 | p00477 | Java | import java.io.*;
import java.util.*;
public class TotalTimes {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int sec = 0;
for (int i = 0; i < 4; i++)
sec += Integer.parseInt(sc.nextLine());
System.out.println(sec / 60);
System.out.println(sec % 60);
}
} | Main.java:4: error: class TotalTimes is public, should be declared in a file named TotalTimes.java
public class TotalTimes {
^
1 error
|
s748154134 | p00477 | C | #include<stdio.h>
int main(){
int a,b,c,d,x,y;
scanf("%d %d %d %d",&a,&b,&c,%d);
x=(a+b+c+d)/60;
y=(a+b+c+d)%60;
printf("%d\n",x);
printf("%d\n",y);
return(0);
} | main.c: In function 'main':
main.c:4:32: error: expected expression before '%' token
4 | scanf("%d %d %d %d",&a,&b,&c,%d);
| ^
|
s139586825 | p00477 | C | #include<stdio.h>
int main(void)
{
int a,x=0,i;
for (i=0;i<4;i++)
{
scanf("%d",&a)
x=x+a;
}
a=x/60
i=x%60
printf("%d\n%d\n",a,i);
return 0;
} | main.c: In function 'main':
main.c:7:20: error: expected ';' before 'x'
7 | scanf("%d",&a)
| ^
| ;
8 | x=x+a;
| ~
main.c:10:9: error: expected ';' before 'i'
10 | a=x/60
| ^
| ;
11 | i=x%60
| ~
|
s219040604 | p00477 | C | #include<stdio.h>
int main(void)
{
int a,x=0,i;
for (i=0;i<4;i++)
{
scanf("%d",&a)
x=x+a;
}
a=x/60;
i=x%60;
printf("%d\n%d\n",a,i);
return 0;
} | main.c: In function 'main':
main.c:7:20: error: expected ';' before 'x'
7 | scanf("%d",&a)
| ^
| ;
8 | x=x+a;
| ~
|
s945578010 | p00477 | C | #include<stdio.h>
int main(void){
int a,b=0,i;
for(i=0;i<4;i++){
scanf("%d"&a);
b+=a;
}
printf("%d\n%d\n",b/60,b%60);
return 0;
} | main.c: In function 'main':
main.c:5:27: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d"&a);
| ~~~~^
| |
| char *
|
s394268586 | p00477 | C | #include <stdio.h>
#include <cstring>
int main(){
int i1[2] = {0};
int ansers[5] = {0};
int total = 1;
for(int n = 0;n < 6; n++){
scanf("%d",&total);
if(total == 0){
for(int x = 0; x < n; x++) printf("%d\n",ansers[x]);
return 0;
}
memset(i1,0,sizeof(i1));
for(int n = 0; n < 9; n++){
scanf("%d",&i1[1]);
i1[0] += i1[1];
}
ansers[n] = total - i1[0];
}
} | main.c:2:10: fatal error: cstring: No such file or directory
2 | #include <cstring>
| ^~~~~~~~~
compilation terminated.
|
s117900304 | p00477 | C | #include<stdio.h>
int main(){
int time[4];
int i;
for(i=0;i<4;i++){
scanf("%d",time[i]);
}
int x;
x = time[0]+time[1]+time[2]+time[3];
x>=60 && x<=3599;
x %= 60
int a;
a = x
x = time[0]+time[1]+time[2]+time[3];
x -=a
x /= 60
printf("#d\n",x);
printf("#d\n",a);
} | main.c: In function 'main':
main.c:11:8: error: expected ';' before 'int'
11 | x %= 60
| ^
| ;
12 | int a;
| ~~~
main.c:13:1: error: 'a' undeclared (first use in this function)
13 | a = x
| ^
main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:6: error: expected ';' before 'x'
13 | a = x
| ^
| ;
14 | x = time[0]+time[1]+time[2]+time[3];
| ~
main.c:15:6: error: expected ';' before 'x'
15 | x -=a
| ^
| ;
16 | x /= 60
| ~
|
s779919257 | p00477 | C | #include<stdio.h>
int main(void){
int time[4];
int i;
for(i=0;i<4;i++){
scanf("%d",time[i]);
}
int x;
x = time[0]+time[1]+time[2]+time[3];
x %= 60;
int a;
a = x;
y = time[0]+time[1]+time[2]+time[3];
y -= a;
y /= 60;
printf("#d\n",y);
printf("#d\n",a);
return 0;
} | main.c: In function 'main':
main.c:13:9: error: 'y' undeclared (first use in this function)
13 | y = time[0]+time[1]+time[2]+time[3];
| ^
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
|
s112309322 | p00477 | C | #include<stdio.h>
int main(void){
int time[4];
int i;
for(i=0;i<=3;i++){
scanf("%d\n",time[i]);
}
int x;
x = time[0]+time[1]+time[2]+time[3];
a = x/60;
b = x%60;
printf("%d\n",a);
printf("%d\n",b);
return 0;
} | main.c: In function 'main':
main.c:11:5: error: 'a' undeclared (first use in this function)
11 | a = x/60;
| ^
main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:5: error: 'b' undeclared (first use in this function)
12 | b = x%60;
| ^
|
s129108329 | p00477 | C | #include<stdio.h>
int main(void){
int i;
int a;
int b;
int c;
int d;
for(i=0;i<=3;i++){
scanf("%d%d%d%d",a,b,c,d);
}
int x;
x = time[0]+time[1]+time[2]+time[3];
int e,f;
e = x/60;
f = x%60;
printf("%d\n",e);
printf("%d\n",f);
return 0;
} | main.c: In function 'main':
main.c:13:9: error: 'time' undeclared (first use in this function)
13 | x = time[0]+time[1]+time[2]+time[3];
| ^~~~
main.c:2:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
1 | #include<stdio.h>
+++ |+#include <time.h>
2 |
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
13 | x = time[0]+time[1]+time[2]+time[3];
| ^~~~
|
s868660788 | p00477 | C | #include<stdio.h>
int main(void){
int a[4];
int x;
for(i=0;i<=3;i++){
scanf("%d",a[i]);
x += a[i];
}
printf("%d/n%d/n",x/60,x%60);
return 0;
} | main.c: In function 'main':
main.c:5:5: error: 'i' undeclared (first use in this function)
5 | for(i=0;i<=3;i++){
| ^
main.c:5:5: note: each undeclared identifier is reported only once for each function it appears in
|
s486540819 | p00477 | C | #include<stdio.h>
int main(void){
int a[4];
int x,i;
for(i=0;i<=3;i++){
scanf("%d",a[i]);
x += a[i];
}
printf("%d/n%d/n",x/60,x%%60);
return 0;
} | main.c: In function 'main':
main.c:9:30: error: expected expression before '%' token
9 | printf("%d/n%d/n",x/60,x%%60);
| ^
|
s359546584 | p00477 | C | #include<stdio.h>
int main(){
int a[4];
int x;i;
x = 0;
for(i=0;i<4;i++){
scanf("%d",a[i]);
x += a[i];
}
printf("%d/n%d/n",x/60,x%60);
return 0;
} | main.c: In function 'main':
main.c:4:7: error: 'i' undeclared (first use in this function)
4 | int x;i;
| ^
main.c:4:7: note: each undeclared identifier is reported only once for each function it appears in
|
s436150826 | p00477 | C | #include<stdio.h>
int main(){
int a[4];
int x,i;
x = 0;
for(i=0;i<4;i++){
scanf("%d",a[i]);
x = x+a[i];
}
printf("%d/n",&x/60);
printf("%d/n",&x%60);
return 0;
} | main.c: In function 'main':
main.c:10:17: error: invalid operands to binary / (have 'int *' and 'int')
10 | printf("%d/n",&x/60);
| ~~^
| |
| int *
main.c:11:17: error: invalid operands to binary % (have 'int *' and 'int')
11 | printf("%d/n",&x%60);
| ~~^
| |
| int *
|
s228109977 | p00477 | C | #include<stdio.h>
int main(){
int x = 0, i, t;
for(i = 0;i < 4;i++){
scanf("%d", &t);
x += t;
}
printf("%d\n%d\n", x / 60, x % 60)
} | main.c: In function 'main':
main.c:9:37: error: expected ';' before '}' token
9 | printf("%d\n%d\n", x / 60, x % 60)
| ^
| ;
10 | }
| ~
|
s462497475 | p00477 | C | #include <stdio.h>
int main()
{
int sec;
int min;
int total_sec=0, total_min=0;
int i;
for(i=0; i<4; i++){
scanf("%d", &sec);
total_sec += sec;
}
while(total_sec>=60){
total_min+++
total_sec-=60;
}
printf("%d\n%d\n", total_min, total_sec);
return 0;
} | main.c: In function 'main':
main.c:15:26: error: lvalue required as left operand of assignment
15 | total_sec-=60;
| ^~
|
s259735936 | p00477 | C | #include <stdio.h>
int main()
{
int sec;
int total_sec=0, total_min=0;
int i;
for(i=0; i<4; i++){
scanf("%d", &sec);
total_sec += sec;
}
while(total_sec>=60){
total_min+++
total_sec-=60;
}
printf("%d\n%d\n", total_min, total_sec);
return 0;
} | main.c: In function 'main':
main.c:14:26: error: lvalue required as left operand of assignment
14 | total_sec-=60;
| ^~
|
s493757081 | p00477 | C | #include <stdio.h>
int main(){
int i,sum=0,byo[4];
int hun,byo;
for(i=0;i<4;i++){
scanf("%d",&byo[i]);
sum+=byo[i];
}
hun=sum/60;
byo=sum%60;
printf("%d\n",hun);
printf("%d\n",byo);
return 0;
} | main.c: In function 'main':
main.c:5:9: error: conflicting types for 'byo'; have 'int'
5 | int hun,byo;
| ^~~
main.c:4:13: note: previous declaration of 'byo' with type 'int[4]'
4 | int i,sum=0,byo[4];
| ^~~
|
s035343426 | p00477 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,d,x,y,z,ans;
scanf(%d %d %d %d",&a,&b,&c,&d);
x=a+b+c+d;
y=x/60;
z=x%60;
printf("%d\n",y);
printf("%d\n",z);
return 0;
}
| a.cc:5:26: warning: missing terminating " character
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^
a.cc:5:26: error: missing terminating " character
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:15: error: expected primary-expression before '%' token
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^
|
s082047990 | p00477 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,d,x,y,z,ans;
scanf(%d %d %d %d",&a,&b,&c,&d);
x=a+b+c+d;
y=x/60;
z=x%60;
printf("%d\n",y);
printf("%d\n",z);
return 0;
}
| a.cc:5:26: warning: missing terminating " character
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^
a.cc:5:26: error: missing terminating " character
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:15: error: expected primary-expression before '%' token
5 | scanf(%d %d %d %d",&a,&b,&c,&d);
| ^
|
s069852653 | p00477 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main(){
int ans=0, a;
for(int i=0; i<4; ++i){
scanf(" %d", &a);
ans += a;
}
int x=ans/60;
ans-=x*60;
printf("%d\n%d\n", x, ans);3151
return 0;
} | a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before 'return'
15 | printf("%d\n%d\n", x, ans);3151
| ^
| ;
16 |
17 | return 0;
| ~~~~~~
|
s425662897 | p00477 | C++ | #include<string>
#include<cstdio>
#include<cctype>
#include<iostream>
#include <algorithm>
#include<cmath>
#include<queue>
using namespace std;
int main(){
int second[5]={0}, ans[3];
cin >>a[1]>>a[2]>>a[3]>>a[4];
ans[2]=a[1]+a[2]+a[3]+a[4];
ans[1]=ans[3]/60;
ans[2]%=60;
cout <<ans[1]<<"\n"<<ans[2]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:15: error: 'a' was not declared in this scope
12 | cin >>a[1]>>a[2]>>a[3]>>a[4];
| ^
|
s372565104 | p00477 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,x,y;
cin>>a>>b>>c>>d>>'\n';
x=(a+b+c+d)/60;
y=(a+b+c+d)%60;
cout<<x<<'\n';
cout<<y<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
6 | cin>>a>>b>>c>>d>>'\n';
| ~~~~~~~~~~~~~~~^~~~~~
| | |
| | char
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'void*' [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
a.cc:6:26: error: cannot bind rvalue '(void*)10' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
/usr/include/c++/14/istream:133:7: |
s587309172 | p00477 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,x,y;
cin>>a>>b>>c>>d>>'\n';
x=(a+b+c+d)/60;
y=(a+b+c+d)%60;
cout<<x<<'\n'<<y<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
6 | cin>>a>>b>>c>>d>>'\n';
| ~~~~~~~~~~~~~~~^~~~~~
| | |
| | char
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'void*' [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
a.cc:6:26: error: cannot bind rvalue '(void*)10' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
/usr/include/c++/14/istream:133:7: |
s376004218 | p00477 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,x,y;
cin>>a>>b>>c>>d>>'\n';
x=(a+b+c+d)/60;
y=a+b+c+-x*60;
cout<<x<<'\n'<<y<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
6 | cin>>a>>b>>c>>d>>'\n';
| ~~~~~~~~~~~~~~~^~~~~~
| | |
| | char
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'void*' [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
a.cc:6:26: error: cannot bind rvalue '(void*)10' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
/usr/include/c++/14/istream:133:7: |
s287347921 | p00477 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d>>'\n';
int x,y;
x=(a+b+c+d)/60;
y=a+b+c+d-x*60;
cout<<x<<'\n'<<y<<'\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:6:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'char')
6 | cin>>a>>b>>c>>d>>'\n';
| ~~~~~~~~~~~~~~~^~~~~~
| | |
| | char
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'char'
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'void*' [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
a.cc:6:26: error: cannot bind rvalue '(void*)10' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:26: error: invalid conversion from 'char' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
6 | cin>>a>>b>>c>>d>>'\n';
| ^~~~
| |
| char
/usr/include/c++/14/istream:133:7: |
s381483334 | p00477 | C++ | int main() {
int t,sum=0,m,s;
for(int i=1; i<=4; i++){
cin>>t;
sum+=t;
}
m=sum/60;
s=sum-60*m;
cout<<m<<endl<<s<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:17: error: 'cin' was not declared in this scope
4 | cin>>t;
| ^~~
a.cc:10:9: error: 'cout' was not declared in this scope
10 | cout<<m<<endl<<s<<endl;
| ^~~~
a.cc:10:18: error: 'endl' was not declared in this scope
10 | cout<<m<<endl<<s<<endl;
| ^~~~
|
s991522927 | p00477 | C++ | #include<iostream>
using namespace std;int a,sum;
main(){for(int i=0i<4;i++){cin>>a;sum+=a;}cout<<a/60<<endl<<a%60<<endl;} | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){for(int i=0i<4;i++){cin>>a;sum+=a;}cout<<a/60<<endl<<a%60<<endl;}
| ^~~~
a.cc: In function 'int main()':
a.cc:3:20: error: invalid operands of types '__complex__ int' and 'int' to binary 'operator<'
3 | main(){for(int i=0i<4;i++){cin>>a;sum+=a;}cout<<a/60<<endl<<a%60<<endl;}
a.cc:3:26: error: expected ';' before ')' token
3 | main(){for(int i=0i<4;i++){cin>>a;sum+=a;}cout<<a/60<<endl<<a%60<<endl;}
| ^
| ;
|
s830831108 | p00477 | C++ | #include<stdio.h>
int main(void)
{
????????int m=0, n=0, i=0, j=0;
????????int a=0;
????????for (i = 0; i < 4; i++) {
????????????????scanf("%d", &a);
????????????????m = m + a;
????????}
????????n = m % 60;
????????m = m / 60;
????????printf("%d\n%d", m, n);
????????return 0;
}
?? | a.cc: In function 'int main()':
a.cc:4:1: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:2: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:3: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:4: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:5: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:6: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:7: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:8: error: expected primary-expression before '?' token
4 | ????????int m=0, n=0, i=0, j=0;
| ^
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:4:9: error: expected ':' before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
| :
a.cc:4:9: error: expected primary-expression before 'int'
4 | ????????int m=0, n=0, i=0, j=0;
| ^~~
a.cc:5:1: error: expected primary-expression before '?' token
5 | ????????int a=0;
| ^
a.cc:5:2: error: expected primary-expression before '?' token
5 | ????????int a=0;
| ^
a.cc:5:3: error: expected primary-expression before '?' token
5 | ????????int a=0;
| ^
a.cc:5:4: error: expected primary-expression before '?' token
5 | ????????int a=0;
| ^
a.cc:5:5: error: expected primary-expression before '?' token
5 | ????????int a=0;
| ^
a.cc:5:6: error: expected primary-expression before '?' token
5 | ????????int a=0;
| ^
a.cc:5:7: error: expected primary-expression before '?' token
5 | ????????int a=0;
| ^
a.cc:5:8: error: expected primary-expression before '?' token
5 | ????????int a=0;
| ^
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int a=0;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int a=0;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int a=0;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int a=0;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int a=0;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int a=0;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int a=0;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:5:9: error: expected ':' before 'int'
5 | ????????int a=0;
| ^~~
| :
a.cc:5:9: error: expected primary-expression before 'int'
5 | ????????int a=0;
| ^~~
a.cc:6:1: error: expected primary-expression before '?' token
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:6:2: error: expected primary-expression before '?' token
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:6:3: error: expected primary-expression before '?' token
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:6:4: error: expected primary-expression before '?' token
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:6:5: error: expected primary-expression before '?' token
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:6:6: error: expected primary-expression before '?' token
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:6:7: error: expected primary-expression before '?' token
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:6:8: error: expected primary-expression before '?' token
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:9: error: expected ':' before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
| :
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:9: error: expected ':' before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
| :
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:9: error: expected ':' before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
| :
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:9: error: expected ':' before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
| :
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:9: error: expected ':' before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
| :
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:9: error: expected ':' before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
| :
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:9: error: expected ':' before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
| :
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:9: error: expected ':' before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
| :
a.cc:6:9: error: expected primary-expression before 'for'
6 | ????????for (i = 0; i < 4; i++) {
| ^~~
a.cc:6:21: error: 'i' was not declared in this scope
6 | ????????for (i = 0; i < 4; i++) {
| ^
a.cc:10:1: error: expected primary-expression before '?' token
10 | ????????n = m % 60;
| ^
a.cc:10:2: error: expected primary-expression before '?' token
10 | ????????n = m % 60;
| ^
a.cc:10:3: error: expected primary-expression before '?' token
10 | ????????n = m % 60;
| ^
a.cc:10:4: error: expected primary-expression before '?' token
10 | ????????n = m % 60;
| ^
a.cc:10:5: error: expected primary-expression before '?' token
10 | ????????n = m % 60;
| ^
a.cc:10:6: error: expected primary-expression before '?' token
10 | ????????n = m % 60;
| ^
a.cc:10:7: error: expected primary-expression before '?' token
10 | ????????n = m % 60;
| ^
a.cc:10:8: error: expected primary-expression before '?' token
10 | ????????n = m % 60;
| ^
a.cc:10:9: error: 'n' was not declared in this scope
10 | ????????n = m % 60;
| ^
a.cc:10:13: error: 'm' was not declared in this scope
10 | ????????n = m % 60;
| ^
a.cc:10:19: error: expected ':' before ';' token
10 | ????????n = m % 60;
| ^
| :
a.cc:10:19: error: expected primary-expression before ';' token
a.cc:10:19: error: expected ':' before ';' token
10 | ????????n = m % 60;
| ^
| :
a.cc:10:19: error: expected primary-expression before ';' token
a.cc:10:19: error: expected ':' before ';' token
10 | ????????n = m % 60;
| ^
| |
s767603078 | p00477 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int data[5];
for(int i = 0;i < 5;i++)cin >> data;
cout << *min_element(data,data + 3) + *min_element(data + 3,data + 5) - 50 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:31: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [5]')
6 | for(int i = 0;i < 5;i++)cin >> data;
| ~~~ ^~ ~~~~
| | |
| | int [5]
| std::istream {aka std::basic_istream<char>}
In file included 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/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
| |
| int*
a.cc:6:34: error: cannot bind rvalue '(short int)((int*)(& data))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
| |
| int*
a.cc:6:34: error: cannot bind rvalue '(short unsigned int)((int*)(& data))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: invalid conversion from 'int*' to 'int' [-fpermissive]
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
| |
| int*
a.cc:6:34: error: cannot bind rvalue '(int)((int*)(& data))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
| |
| int*
a.cc:6:34: error: cannot bind rvalue '(unsigned int)((int*)(& data))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
| |
| int*
a.cc:6:34: error: cannot bind rvalue '(long int)((int*)(& data))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
| |
| int*
a.cc:6:34: error: cannot bind rvalue '(long unsigned int)((int*)(& data))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
| |
| int*
a.cc:6:34: error: cannot bind rvalue '(long long int)((int*)(& data))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
| |
| int*
a.cc:6:34: error: cannot bind rvalue '(long long unsigned int)((int*)(& data))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:6:34: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
6 | for(int i = 0;i < 5;i++)cin >> data;
| ^~~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [5]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [5]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [5]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [5]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {ak |
s583584949 | p00477 | C++ | #include<iostream>
using namespase std;
int mian()
{
int a;
int sum=0;
int x,y;
int i;
for(i=0;i<4;i++)
{
cin >> a;
sum+=a;
}
x=sum/60;
sum%=60;
y=sum;
cout << x << endl;
cout << y << endl;
return 0;
} | a.cc:2:7: error: expected nested-name-specifier before 'namespase'
2 | using namespase std;
| ^~~~~~~~~
a.cc: In function 'int mian()':
a.cc:12:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
12 | cin >> a;
| ^~~
| 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:20:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
20 | cout << x << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:20:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
20 | cout << x << 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)
| ^~~~
|
s460103766 | p00477 | C++ | #include<iostream>
using namespace std;
int mian()
{
int a;
int sum=0;
int x,y;
int i;
for(i=0;i<4;i++)
{
cin >> a;
sum+=a;
}
x=sum/60;
sum%=60;
y=sum;
cout << x << endl;
cout << y << endl;
return 0;
} | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s753559342 | p00477 | C++ | #include <iostream>
using namespace std;
int main(){
int data[4]={};
int sum =0;
for(int i =0;i < 4;i++)
{
cin >> data[i] >> endl;
sum = data[i];
}
cout << sum/60 << endl;
cout << sum%60 << endl;
}
| a.cc: In function 'int main()':
a.cc:10:22: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
10 | cin >> data[i] >> endl;
| ~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'}
352 | operator>>(__streambuf_type* __sb);
| |
s497372107 | p00477 | C++ | a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);} | a.cc:1:1: error: 'a' does not name a type
1 | a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);}
| ^
|
s371967856 | p00477 | C++ | int a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);} | a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
1 | int a;main(i){while(~scanf("%d",&i))a+=i;printf("%d\n%d\n",a/60,a%60);}
| ^
|
s261055448 | p00477 | C++ | i;main(j){for(;~scanf("%d",&j)||!printf("%d\n%d\n",i/60,i%60);)i+=j;} | a.cc:1:1: error: 'i' does not name a type
1 | i;main(j){for(;~scanf("%d",&j)||!printf("%d\n%d\n",i/60,i%60);)i+=j;}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | i;main(j){for(;~scanf("%d",&j)||!printf("%d\n%d\n",i/60,i%60);)i+=j;}
| ^
|
s024647028 | p00477 | C++ | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);} | a.cc:1:1: error: 's' does not name a type
1 | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);}
| ^
|
s572992882 | p00477 | C++ | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);} | a.cc:1:1: error: 's' does not name a type
1 | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | s;main(t){for(;~scanf("%d",&t);s+=t);printf("%d\n%d\n",s/60,s%60);exit(0);}
| ^
|
s851198417 | p00477 | C++ | i;main(j){while(~scanf("%d",&j))i+=j;!printf("%d\n%d\n",i/60,i%60);} | a.cc:1:1: error: 'i' does not name a type
1 | i;main(j){while(~scanf("%d",&j))i+=j;!printf("%d\n%d\n",i/60,i%60);}
| ^
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
1 | i;main(j){while(~scanf("%d",&j))i+=j;!printf("%d\n%d\n",i/60,i%60);}
| ^
|
s811591884 | p00477 | C++ | main(s,i){return~scanf("%d",&i)?main(s+i):!printf("%d\n%d\n",s/60,s%60);} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(s,i){return~scanf("%d",&i)?main(s+i):!printf("%d\n%d\n",s/60,s%60);}
| ^
|
s878745321 | p00477 | C++ | int main(){int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);a+=b+c+d;printf("%d\n%d\n",a/60,a%60);} | a.cc: In function 'int main()':
a.cc:1:24: error: 'scanf' was not declared in this scope
1 | int main(){int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);a+=b+c+d;printf("%d\n%d\n",a/60,a%60);}
| ^~~~~
a.cc:1:63: error: 'printf' was not declared in this scope
1 | int main(){int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);a+=b+c+d;printf("%d\n%d\n",a/60,a%60);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main(){int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);a+=b+c+d;printf("%d\n%d\n",a/60,a%60);}
|
s330806938 | p00477 | C++ | #include<cstdio>
int main(){
int res=0,t;
for(int i=0;i<4;i++){
scanf("%d",&t);
res+=t
}
printf("%d\n%d\n",res/60,res%60);
} | a.cc: In function 'int main()':
a.cc:7:8: error: expected ';' before '}' token
7 | res+=t
| ^
| ;
8 | }
| ~
|
s437773721 | p00477 | C++ | #include<cstdio>
int main(){
int res=0,t;
for(int i=0;i<4;i++){
scanf("%d",&t);
res+=t
}
printf("%d\n%d\n",res/60,res%60);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:8: error: expected ';' before '}' token
7 | res+=t
| ^
| ;
8 | }
| ~
|
s179179998 | p00477 | C++ | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int sum = 0;
for(int i=0;i<4;i++){
sum += sc.nextInt();
}
System.out.println(sum/60);
System.out.println(sum%60);
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s243353319 | p00477 | C++ | #incloud<stdio.h>
int main(){
int a,b,c,d,sum;
scanf("%d%d%d%d",&a,&b,&c,&d);
sum = a+b+c+d;
printf("%d\n%d",sum%60,sum/60);
} | a.cc:1:2: error: invalid preprocessing directive #incloud; did you mean #include?
1 | #incloud<stdio.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:5:1: error: 'scanf' was not declared in this scope
5 | scanf("%d%d%d%d",&a,&b,&c,&d);
| ^~~~~
a.cc:7:1: error: 'printf' was not declared in this scope
7 | printf("%d\n%d",sum%60,sum/60);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | #incloud<stdio.h>
|
s490206124 | p00477 | C++ | #include "stdafx.h"
int main (){
int a,b,c,d;
scanf("%d%d%d%d", &a, &b, &c, &d);
a=a+b+c+d;
printf("%d\n%d", a/60, a%60);
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s945011429 | p00477 | C++ | int main (void){
int a,b,c,d;
scanf("%d%d%d%d", &a, &b, &c, &d);
a=a+b+c+d;
printf("%d\n%d", a/60, a%60);
} | a.cc: In function 'int main()':
a.cc:3:9: error: 'scanf' was not declared in this scope
3 | scanf("%d%d%d%d", &a, &b, &c, &d);
| ^~~~~
a.cc:5:9: error: 'printf' was not declared in this scope
5 | printf("%d\n%d", a/60, a%60);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main (void){
|
s806841576 | p00477 | C++ | #include <stdio.h>
int main(void){
int a;
int b;
int c;
int d;
int e;
int f;
int i;
int x;
scanf('%d%d%d%d',&a,&b,&c,&d);
x = a+b+c+d;
e = x/60;
f = x%60;
printf('%d\n',&e);
printf('%d\n',&f);
return 0;
} | a.cc:11:11: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
11 | scanf('%d%d%d%d',&a,&b,&c,&d);
| ^~~~~~~~~~
a.cc:15:12: warning: multi-character character constant [-Wmultichar]
15 | printf('%d\n',&e);
| ^~~~~~
a.cc:16:12: warning: multi-character character constant [-Wmultichar]
16 | printf('%d\n',&f);
| ^~~~~~
a.cc: In function 'int main()':
a.cc:11:11: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
11 | scanf('%d%d%d%d',&a,&b,&c,&d);
| ^~~~~~~~~~
| |
| int
In file included from a.cc:1:
/usr/include/stdio.h:428:42: note: initializing argument 1 of 'int scanf(const char*, ...)'
428 | extern int scanf (const char *__restrict __format, ...) __wur;
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:15:12: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
15 | printf('%d\n',&e);
| ^~~~~~
| |
| int
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:16:12: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
16 | printf('%d\n',&f);
| ^~~~~~
| |
| int
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
s173599463 | p00477 | C++ | #include <iostream>
using namespace std;
int main() {
int sum = 0;
for (int i = ; i < 4; i++) {
int x;
cin >> x;
sum += x;
}
cout << sum / 60 << endl;
cout << sum % 60 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:22: error: expected primary-expression before ';' token
6 | for (int i = ; i < 4; i++) {
| ^
|
s197938713 | p00477 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int a;
cin >>a;
int b;
cin >>b;
int c;
cin >>c;
int d;
cin >>d;
int e;
e=a+b+c+d;
int f;
f=0;
while(e=>60){
f=f+1;
e=e-60;}
cout << e<<endl;
cout << f<<endl;} | a.cc: In function 'int main()':
a.cc:17:9: error: expected primary-expression before '>' token
17 | while(e=>60){
| ^
|
s845608333 | p00477 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b, c, d;
int total = 0;
cin >> a >> b >> c >> d;
total = a + b + c + d;
int m, s
s = total % 60;
m = total / 60;
cout << m << endl << s << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:5: error: expected initializer before 's'
11 | s = total % 60;
| ^
a.cc:14:26: error: 's' was not declared in this scope
14 | cout << m << endl << s << endl;
| ^
|
s542223608 | p00477 | C++ | #include <iostream>
int main()
{
int a,b,c,d;
cin >> a >> b >> c >> d;
int sum=0;
sum=a+b+c+d;
cout << sum/60 << endl;
cout << sum%60 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> a >> b >> c >> d;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout << sum/60 << 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:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout << sum/60 << 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)
| ^~~~
|
s068425300 | p00478 | Java | import java.util.*;
class Main{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
String s,s2;
int n,de=0;
s = in.next();
n = in.nextInt();
for(int i=0;i<n;i++)
{
s2 = in.next();
int ln = s2.length();
s2 = s2 + s2;
while(ln*2-- > 0)
{
if(s2.contains(s))
{
de++;
break;
}
}
}
System.out.println(de);
}
} //Res***2Dツつウツづアツづ個づーツ参ツ考 | Main.java:15: error: unexpected type
while(ln*2-- > 0)
^
required: variable
found: value
1 error
|
s114740943 | p00478 | Java | import java.util.*;
public class MainA {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
int n = sc.nextInt();
String[] strs = new String[n];
String[] strss = new String[n];
for (int i = 0; i < n; i++) {
strs[i] = sc.next();
strss[i] = strs[i] + strs[i];
}
int r = 0;
for (int i = 0; i < n; i++)
if (strss[i].contains(str))
r++;
System.out.println(r);
sc.close();
}
} | Main.java:3: error: class MainA is public, should be declared in a file named MainA.java
public class MainA {
^
1 error
|
s057533284 | p00478 | Java | import java.io.*;
import java.util.*;
public class Ring {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
int n = Integer.parseInt(sc.nextLine()), res = 0;
for (int i = 0; i < n; i++) {
String ring = sc.nextLine();
ring += ring;
if (ring.contains(s)) {
res += 1;
continue;
}
}
System.out.println(res);
}
} | Main.java:4: error: class Ring is public, should be declared in a file named Ring.java
public class Ring {
^
1 error
|
s313411842 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char ch[11];
char *p;
int n,i;
int sum=0;
scanf("%s\n%d\n",&ch,&n);
char ring[n][21];
for(i=0;i<n;i++){
scanf("%s\n",&ring[i]);
ring[n+i]=ring[i];
}
for(i=0;i<n;i++){
if(strchr(ring[n],ch)==1)sum++;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:12:10: error: assignment to expression with array type
12 | ring[n+i]=ring[i];
| ^
main.c:15:19: error: passing argument 2 of 'strchr' makes integer from pointer without a cast [-Wint-conversion]
15 | if(strchr(ring[n],ch)==1)sum++;
| ^~
| |
| char *
In file included from main.c:2:
/usr/include/string.h:246:43: note: expected 'int' but argument is of type 'char *'
246 | extern char *strchr (const char *__s, int __c)
| ~~~~^~~
main.c:15:22: warning: comparison between pointer and integer
15 | if(strchr(ring[n],ch)==1)sum++;
| ^~
|
s650641452 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char ch[11];
int n,i;
int sum=0;
int ring[21];
int ring2[21];
scanf("%s\n%d\n",&ch,&n);
for(i=0;i<n;i++){
scanf("%s\n",&ring);
ring2 = ring;
strcat(ring,ring2);
if(strchr(ring,ch)==1)sum++;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:12:7: error: assignment to expression with array type
12 | ring2 = ring;
| ^
main.c:13:8: error: passing argument 1 of 'strcat' from incompatible pointer type [-Wincompatible-pointer-types]
13 | strcat(ring,ring2);
| ^~~~
| |
| int *
In file included from main.c:2:
/usr/include/string.h:149:39: note: expected 'char * restrict' but argument is of type 'int *'
149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
| ~~~~~~~~~~~~~~~~~^~~~~~
main.c:13:13: error: passing argument 2 of 'strcat' from incompatible pointer type [-Wincompatible-pointer-types]
13 | strcat(ring,ring2);
| ^~~~~
| |
| int *
/usr/include/string.h:149:70: note: expected 'const char * restrict' but argument is of type 'int *'
149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.c:14:11: error: passing argument 1 of 'strchr' from incompatible pointer type [-Wincompatible-pointer-types]
14 | if(strchr(ring,ch)==1)sum++;
| ^~~~
| |
| int *
/usr/include/string.h:246:34: note: expected 'const char *' but argument is of type 'int *'
246 | extern char *strchr (const char *__s, int __c)
| ~~~~~~~~~~~~^~~
main.c:14:16: error: passing argument 2 of 'strchr' makes integer from pointer without a cast [-Wint-conversion]
14 | if(strchr(ring,ch)==1)sum++;
| ^~
| |
| char *
/usr/include/string.h:246:43: note: expected 'int' but argument is of type 'char *'
246 | extern char *strchr (const char *__s, int __c)
| ~~~~^~~
main.c:14:19: warning: comparison between pointer and integer
14 | if(strchr(ring,ch)==1)sum++;
| ^~
|
s990256937 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char ch[11];
int n,i;
int sum=0;
char ring[21];
char ring2[21];
scanf("%s\n%d\n",&ch,&n);
for(i=0;i<n;i++){
scanf("%s\n",&ring);
ring2 = ring;
strcat(ring,ring2);
if(strchr(ring,ch)==1)sum++;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:12:7: error: assignment to expression with array type
12 | ring2 = ring;
| ^
main.c:14:16: error: passing argument 2 of 'strchr' makes integer from pointer without a cast [-Wint-conversion]
14 | if(strchr(ring,ch)==1)sum++;
| ^~
| |
| char *
In file included from main.c:2:
/usr/include/string.h:246:43: note: expected 'int' but argument is of type 'char *'
246 | extern char *strchr (const char *__s, int __c)
| ~~~~^~~
main.c:14:19: warning: comparison between pointer and integer
14 | if(strchr(ring,ch)==1)sum++;
| ^~
|
s494646038 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char ch[11];
int n,i;
int sum=0;
char ringa[21];
char ringb[21];
scanf("%s\n%d\n",&ch,&n);
for(i=0;i<n;i++){
scanf("%s\n",&ringa);
ringb = ringa;
strcat(ringa,ringb);
if(strchr(ringa,ch)==1)sum++;
}
printf("%d\n",sum);
return 0;
} | main.c: In function 'main':
main.c:12:7: error: assignment to expression with array type
12 | ringb = ringa;
| ^
main.c:14:17: error: passing argument 2 of 'strchr' makes integer from pointer without a cast [-Wint-conversion]
14 | if(strchr(ringa,ch)==1)sum++;
| ^~
| |
| char *
In file included from main.c:2:
/usr/include/string.h:246:43: note: expected 'int' but argument is of type 'char *'
246 | extern char *strchr (const char *__s, int __c)
| ~~~~^~~
main.c:14:20: warning: comparison between pointer and integer
14 | if(strchr(ringa,ch)==1)sum++;
| ^~
|
s011342754 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(void){
char a[11],c[11],b[21];
int i,j,n,c=0;
scanf("%s",a[11]);
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",c[11]);
for(j=0;j<20;j++){
if(j<10){
b[j]=a[j];
}
else{
b[j]=a[j-10];
}
}
if(strstr(b a){
c++;
}
}
printf("%d",&c);
return 0;
} | main.c: In function 'main':
main.c:5:19: error: conflicting types for 'c'; have 'int'
5 | int i,j,n,c=0;
| ^
main.c:4:20: note: previous declaration of 'c' with type 'char[11]'
4 | char a[11],c[11],b[21];
| ^
main.c:18:28: error: expected ')' before 'a'
18 | if(strstr(b a){
| ~ ^~
| )
main.c:18:20: error: too few arguments to function 'strstr'
18 | if(strstr(b a){
| ^~~~~~
In file included from main.c:2:
/usr/include/string.h:350:14: note: declared here
350 | extern char *strstr (const char *__haystack, const char *__needle)
| ^~~~~~
main.c:18:31: error: expected ')' before '{' token
18 | if(strstr(b a){
| ~ ^
| )
main.c:21:9: error: expected expression before '}' token
21 | }
| ^
|
s542885370 | p00478 | C | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
}}}}}printf("%d\n",s);exit(0);} | main.c:1:1: warning: data definition has no type or storage class
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int]
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
| ^
main.c:1:7: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
| ^
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int]
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
| ^~~~
main.c: In function 'main':
main.c:1:9: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:38: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
main.c:1:38: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | i,j,k,s;main(x){char a[99],b[99];for(scanf("%s%d",a,&x);x--;){scanf("%s",b);for(i=0;i<10;i++){if(a[0]==b[i]){for(k=0,j=i;1;){j++;k++;j=j>9?0:j;if(a[k]=='\0'){s++;i=11;break;}if(a[k]!=b[j])break;
| ^~~~~
main.c:1:38: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c: At top level:
main.c:2:13: error: expected declaration specifiers or '...' before string constant
2 | }}}}}printf("%d\n",s);exit(0);}
| ^~~~~~
main.c:2:20: error: expected declaration specifiers or '...' before 's'
2 | }}}}}printf("%d\n",s);exit(0);}
| ^
main.c:2:28: error: expected declaration specifiers or '...' before numeric constant
2 | }}}}}printf("%d\n",s);exit(0);}
| ^
main.c:2:31: error: expected identifier or '(' before '}' token
2 | }}}}}printf("%d\n",s);exit(0);}
| ^
|
s898167341 | p00478 | C | #include <cstdio>
#include <string.h>
int i;
int n,num=0;
int main(){
char search[10];
while(search[i]!=NULL) scanf("%c\n",&search[i]);
scanf("%d\n",&n);
for(int j=0;j<n;j++){
char array[10];
char array2[20];
scanf("%c",&array[i]);
strncat(array2,array,10);
strncpy(array2,array,10);
if (strpbrk(array2,search )!=0) num++;
{
}
}
return 0; | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s957893605 | p00478 | C | #include <stdio.h>
int main(int argc,char* argv[]) {
char searchfor[11];
int ringnum;
int i;
int count;
char ring[11];
char ringbuf[21];
scanf("%s",searchfor);
scanf("%d",&ringnum);
count=0;
for(i=0;i<ringnum;i++) {
fscanf(in,"%s",ring);
strcpy(ringbuf,ring);
strcat(ringbuf,ring);
if(strstr(ringbuf,searchfor))count++;
}
printf("%d\n",count);
return 0;
} | main.c: In function 'main':
main.c:14:24: error: 'in' undeclared (first use in this function); did you mean 'i'?
14 | fscanf(in,"%s",ring);
| ^~
| i
main.c:14:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:17: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
15 | strcpy(ringbuf,ring);
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcpy'
1 | #include <stdio.h>
+++ |+#include <string.h>
2 |
main.c:15:17: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
15 | strcpy(ringbuf,ring);
| ^~~~~~
main.c:15:17: note: include '<string.h>' or provide a declaration of 'strcpy'
main.c:16:17: error: implicit declaration of function 'strcat' [-Wimplicit-function-declaration]
16 | strcat(ringbuf,ring);
| ^~~~~~
main.c:16:17: note: include '<string.h>' or provide a declaration of 'strcat'
main.c:16:17: warning: incompatible implicit declaration of built-in function 'strcat' [-Wbuiltin-declaration-mismatch]
main.c:16:17: note: include '<string.h>' or provide a declaration of 'strcat'
main.c:17:20: error: implicit declaration of function 'strstr' [-Wimplicit-function-declaration]
17 | if(strstr(ringbuf,searchfor))count++;
| ^~~~~~
main.c:17:20: note: include '<string.h>' or provide a declaration of 'strstr'
main.c:17:20: warning: incompatible implicit declaration of built-in function 'strstr' [-Wbuiltin-declaration-mismatch]
main.c:17:20: note: include '<string.h>' or provide a declaration of 'strstr'
|
s395420731 | p00478 | C | #include<stdio.h>
#include<string.h>
int main(){
char a[11];
char b[21];
int n;
int i,j,k;
bool f,f2;
int ans=0;
scanf("%s",a);
scanf("%d",&n);
for(i=0;i<n;i++){
f=false;
scanf("%s",b);
for(j=0;j<10;j++)b[j+10]=b[j];
for(j=0;j<10;j++){
f2=true;
for(k=0;k<strlen(a);k++){
if(a[k]!=b[j+k])f2=false;
}
if(f2)f=true;
}
if(f)ans++;
}
printf("%d\n",ans);
return 0;
} | main.c: In function 'main':
main.c:8:9: error: unknown type name 'bool'
8 | bool f,f2;
| ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include<string.h>
+++ |+#include <stdbool.h>
3 | int main(){
main.c:13:19: error: 'false' undeclared (first use in this function)
13 | f=false;
| ^~~~~
main.c:13:19: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:13:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:28: error: 'true' undeclared (first use in this function)
17 | f2=true;
| ^~~~
main.c:17:28: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
s729774331 | p00478 | C | #include <stdio.h>
int main(){
char moji[11],moji2[20],moji3[11];
int n,i,j,k,kai=0;
gets(moji);
scanf("%d",&n);
for(i=0;i<n;i++){
gets(moji2);
for(j=0;moji2[j]!='\n';j++){
moji3[j]=moji2[j];
}
moji3[j]='\n';
for(k=0;moji3[k]!='\n';k++.j++){
moji2[j]=moji3[k];
}
moji2[j]='\n'
for(j=0;j<10;j++){
for(k=0;moji[k]==moji[k+j];k++){
if(moji[k]=='\n'){
kai++;
break;
}
}
if(moji[k]=='\n')break;
}
}
printf("%d\n",kai);
return 0;
} | main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets(moji);
| ^~~~
| fgets
main.c:15:27: error: request for member 'j' in something not a structure or union
15 | for(k=0;moji3[k]!='\n';k++.j++){
| ^
main.c:18:14: error: expected ';' before 'for'
18 | moji2[j]='\n'
| ^
| ;
19 | for(j=0;j<10;j++){
| ~~~
|
s781009471 | p00478 | C | #include <stdio.h>
int main(){
char moji[11]={'\0'},moji2[21]={'\0'},moji3[11]={'\0'};
int n,i,j,k,kai=0,t;
gets(moji);
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%c", &moji2[0]);
scanf("%c", &moji2[1]);
scanf("%c", &moji2[2]);
scanf("%c", &moji2[3]);
scanf("%c", &moji2[4]);
scanf("%c", &moji2[5]);
scanf("%c", &moji2[6]);
scanf("%c", &moji2[7]);
scanf("%c", &moji2[8]);
scanf("%c", &moji2[9]);
moji2[10]='\0'
for(j=0;moji2[j]!='\0';j++){
moji3[j]=moji2[j];
}
moji3[j]='\0';
for(k=0;moji3[k]!='\0';k++,j++){
moji2[j]=moji3[k];
}
moji2[j]='\0';
for(j=0;j<10;j++){
for(k=0;moji[k]==moji2[k+j];k++){
if(moji[k+1]=='\0'){
kai++;
break;
}
}
if(moji[k+1]=='\0')break;
}
}
printf("%d\n",kai);
return 0;
} | main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets(moji);
| ^~~~
| fgets
main.c:20:15: error: expected ';' before 'for'
20 | moji2[10]='\0'
| ^
| ;
21 | for(j=0;moji2[j]!='\0';j++){
| ~~~
|
s119897212 | p00478 | C | #include <stdio.h>
int main(){
char moji[11]={'\0'},moji2[21]={'\0'},moji3[11]={'\0'};
int n,i=0,j,k,f=0,kai=0,t;
scanf("%s",moji);
scanf("%d",&n);
for(i=0;i<n;i++){
f=0;
scanf("%s",moji2);
for(j=0;j<10;j++){
moji3[j]=moji2[j];
}
moji3[10]='\0';
for(k=0;moji3[k]!='\0';k++){
moji2[k+10]=moji3[k];
}
moji2[20]='\0';
for(j=0;j<10;j++){
for(k=0;moji[k]==moji2[k+j];k++){
if(moji[k+1]=='\0'){
f=1;
break;
}
}
if(moji[k+1]=='\0')break;
}
if(f==1){
kai++;
}
printf("%d\n",kai);
return 0;
} | main.c: In function 'main':
main.c:35:1: error: expected declaration or statement at end of input
35 | }
| ^
|
s089009477 | p00478 | C | #include <stdio.h>
int main(){
char moji[11]={'\0'},moji2[21]={'\0'},moji3[11]={'\0'};
int n,i=0,j,k,kai=0,t;
scanf("%s",moji);
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",moji2);
for(j=0;j<10;j++){
moji3[j]=moji2[j];
}
moji3[10]='\0';
for(k=0;moji3[k]!='\0';k++){
moji2[k+10]=moji3[k];
}
moji2[20]='\0';
for(j=0;j<10;j++){
for(k=0;moji[k]==moji2[k+j];k++){
if(moji[k+1]=='\0')break;
}
if(moji[k+1]=='\0'){
kai++;
j=10;
}
}
printf("%d\n",kai);
return 0;
} | main.c: In function 'main':
main.c:31:1: error: expected declaration or statement at end of input
31 | }
| ^
|
s851891044 | p00478 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string find;
cin >> find;
int a;
cin >> a;
int count = 0 ;
for (int i = 0; i < a; i++)
{
string ring;
cin >> ring;
int u = ring.find();
if (loc != string::npos)
count++;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:14:34: error: no matching function for call to 'std::__cxx11::basic_string<char>::find()'
14 | int u = ring.find();
| ~~~~~~~~~^~
In file included 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/bits/basic_string.h:2720:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, typename __gnu_cxx::__alloc_traits<typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_CharT>::other>::size_type> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::find(const _Tp&, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2720 | find(const _Tp& __svt, size_type __pos = 0) const
| ^~~~
/usr/include/c++/14/bits/basic_string.h:2720:9: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/basic_string.h:2691:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::find(const _CharT*, size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2691 | find(const _CharT* __s, size_type __pos, size_type __n) const
| ^~~~
/usr/include/c++/14/bits/basic_string.h:2691:7: note: candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/basic_string.h:2706:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::find(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2706 | find(const basic_string& __str, size_type __pos = 0) const
| ^~~~
/usr/include/c++/14/bits/basic_string.h:2706:7: note: candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/basic_string.h:2740:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::find(const _CharT*, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2740 | find(const _CharT* __s, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
| ^~~~
/usr/include/c++/14/bits/basic_string.h:2740:7: note: candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/basic_string.h:2758:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::find(_CharT, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2758 | find(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:2758:7: note: candidate expects 2 arguments, 0 provided
a.cc:15:21: error: 'loc' was not declared in this scope
15 | if (loc != string::npos)
| ^~~
|
s418386368 | p00478 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <limits.h>
//#include <windows.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <queue>
#include <functional>
using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef pair<llint,llint> pii;
#define mpq(T) priority_queue<T,vector<T>,greater<T> >
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define REP(i,a) for(int i = 0; i < (a); i++)
class BIT
{
private:
int s;
llint* d;
public:
BIT(int size)
{
s = size;
d = (llint*)malloc(sizeof(llint) * s);
for(int i = 0; i < s; i++)
{
d[i] = 0;
}
}
void add(int b,int x)
{
for(int i = b + 1; i <= s; i += (i & -i))
{
d[i - 1] += x;
}
}
llint sum(int b)
{
llint all = 0;
for(int i = b + 1; i > 0; i -= (i & -i))
{
all += d[i - 1];
}
return all;
}
~BIT()
{
free(d);
}
};
class unionfind
{
private:
int s;
int* o;
int* r;
public:
unionfind(int dsize)
{
s = dsize;
o = (int*)malloc(sizeof(int) * s);
r = (int*)malloc(sizeof(int) * s);
for(int i = 0; i < s; i++)
{
o[i] = i;
r[i] = 0;
}
}
int mfind(int b)
{
if(o[b] != b)
{
o[b] = mfind(o[b]);
}
return o[b];
}
void munion(int a,int b)
{
int aw = mfind(a);
int bw = mfind(b);
if(aw == bw)
{
return;
}
if(r[aw] > r[bw])
{
o[bw] = a;
}
else if(r[aw] < r[bw])
{
o[aw] = bw;
}
else
{
o[bw] = aw;
r[aw]++;
}
s--;
}
int size()
{
return s;
}
~unionfind()
{
free(o);
free(r);
}
};
template<class T> int lbound(T* d,T key,int s,int e)
{
s--;
while(e - s > 1)
{
int m = (s + e) / 2;
if(d[m] < key)
{
s = m;
}
else
{
e = m;
}
}
return e;
}
template<class T> int ubound(T* d,T key,int s,int e)
{
s--;
while(e - s > 1)
{
int m = (s + e) / 2;
if(key < d[m])
{
e = m;
}
else
{
s = m;
}
}
return e;
}
class zpress
{
private:
int ms;
pii* md;
int n;
int s;
llint* d;
int* t;
public:
zpress(int dsize = 1000000)
{
int ms = dsize;
md = (pii*)malloc(sizeof(pii) * ms);
d = (llint*)malloc(sizeof(llint) * ms);
t = (int*)malloc(sizeof(int) * ms);
n = 0;
}
void in(llint x)
{
in2(x,n);
n++;
}
void in2(llint x,int b)
{
md[b] = make_pair(x,b);
}
void syori()
{
syori2(n);
}
void syori2(int k)
{
sort(md,md + k);
llint mae = LLONG_MIN;
s = 0;
REP(i,k)
{
if(md[i].first != mae)
{
d[s] = md[i].first;
s++;
mae = md[i].first;
}
t[md[i].second] = s - 1;
}
}
llint iti(int b)
{
return t[b];
}
int size()
{
return s;
}
int first(llint x)
{
return lbound(d,x,0,s);
}
int end(llint x)
{
return ubound(d,x,0,s);;
}
~zpress()
{
free(md);
free(d);
free(t);
}
};
class xorshift
{
private:
unsigned int a,b,c,d;
public:
xorshift(unsigned int aw = 123456789,unsigned int bw = 362436069,unsigned int cw = 521288629,unsigned int dw = 88675123,unsigned int e = 97)
{
a = aw;
b = bw;
c = cw;
d = dw;
for(unsigned int i = 0; i < e; i++)
{
operator()();
}
}
unsigned int operator()()
{
unsigned int w = a ^ (a << 11);
a = b;
b = c;
c = d;
d = (d ^ (d >> 19)) ^ (w ^ (w >> 8));
return d;
}
};
llint gcd(llint a,llint b)
{
while(1)
{
llint w = a % b;
if(w == 0)
{
return b;
}
a = b;
b = w;
}
}
llint sei(llint d,llint p)
{
if(d < 0)
{
d -= ((d + 1) / p - 1) * p;
}
else
{
d %= p;
}
return d;
}
llint inv(llint a,llint p)
{
llint r0 = sei(a,p);
llint r1 = p;
llint a0 = 1;
llint b0 = 0;
llint a1 = 0;
llint b1 = 1;
while(1)
{
llint q = r0 / r1;
llint w = r0 - q * r1;
if(w == 0)
{
break;
}
r0 = r1;
r1 = w;
w = a0 - q * a1;
a0 = a1;
a1 = w;
}
return sei(a1,p);
}
template <llint P> class mod
{
private:
llint d;
public:
mod(llint a = 0)
{
d = a;
d = sei(d,P);
}
mod operator-() const
{
return mod(P - d);
}
mod operator+=(const mod& a)
{
d = d + a.d;
d = sei(d,P);
return *this;
}
mod operator-=(const mod& a)
{
return operator+=(-a);
}
mod operator*=(const mod& a)
{
d = d * a.d;
d = sei(d,P);
return *this;
}
mod operator/=(const mod& a)
{
return a * mod(inv(d,P));
}
mod operator+(const mod& a) const
{
mod w = *this;
return (w += a);
}
mod operator-(const mod& a) const
{
mod w = *this;
return (w -= a);
}
mod operator*(const mod& a) const
{
mod w = *this;
return (w *= a);
}
mod operator/(const mod& a) const
{
mod w = *this;
return (w /= a);
}
bool operator==(const mod& a) const
{
return (d == a.d);
}
bool operator!=(const mod& a) const
{
return (d != a.d);
}
operator llint() const
{
return d;
}
};
/////////////////////////////////////////////////////
FILE* fi;
FILE* fo;
void err(char* a)
{
printf("%s\n",a);
getchar();
}
llint in()
{
llint w;
fscanf(fi,"%lld",&w);
return w;
}
void ins(char* a)
{
fscanf(fi,"%s",a);
}
void out(llint a)
{
fprintf(fo,"%lld\n",a);
}
void outs(char* a)
{
fprintf(fo,"%s\n",a);
}
void func();
int main()
{
fi = stdin;
fo = stdout;
func();
return 0;
}
char s[11];
void func()
{
ins(s);
int n = in();
int l = strlen(s);
int all = 0;
REP(k,n)
{
char sw[20];
ins(sw);
REP(i,10)
{
sw[i + 10] = sw[i];
}
REP(i,20 - l)
{
bool o = true;
REP(ii,l)
{
if(sw[i + ii] != s[ii])
{
o = false;
break;
}
}
if(o)
{
all++;
break:
}
}
}
out(all);
} | a.cc: In function 'void func()':
a.cc:477:38: error: expected ';' before ':' token
477 | break:
| ^
| ;
a.cc:477:38: error: expected primary-expression before ':' token
|
s120637334 | p00478 | C++ | #include<string>
using namespace std;
string sample;
int n, counter = 0;
bool solve()
{
string ring;
cin >> ring;
for (int i = 0; i < ring.size(); i++){
if (ring[i] == sample[0]){
for (int j = 1; j < sample.size(); j++){
if (sample[j] != ((ring.size() <= i + j) ? ring[i + j - ring.size()] : ring[i + j])){
goto wrong;
}
}
return 1;
}
wrong:;
}
return 0;
}
int main()
{
cin >> sample >> n;
for (int i = 0; i < n; i++){
counter += solve();
}
cout << counter << endl;
return 0;
} | a.cc: In function 'bool solve()':
a.cc:10:9: error: 'cin' was not declared in this scope
10 | cin >> ring;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<string>
+++ |+#include <iostream>
2 | using namespace std;
a.cc: In function 'int main()':
a.cc:28:9: error: 'cin' was not declared in this scope
28 | cin >> sample >> n;
| ^~~
a.cc:28:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:9: error: 'cout' was not declared in this scope
33 | cout << counter << endl;
| ^~~~
a.cc:33:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:28: error: 'endl' was not declared in this scope
33 | cout << counter << endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<string>
+++ |+#include <ostream>
2 | using namespace std;
|
s222509308 | p00478 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string>
int main(void)
{
char str[11], ring[100][11];
int number, str_len;
scanf("%s", str);
str_len = strlen(str);
scanf("%d", &number);
for (int i = 0; i < number; i++) {
scanf("%s", ring[i]);
}
int ring_count = 0, ring_len;
for (int i = 0; i < number; i++) {
ring_len = strlen(ring[i]);
for (int j = 0; j < ring_len; j++) {
if (ring[i][j] == str[0]) {
bool success = true;
int point = 0;
for (int k = 1; k < str_len; k++) {
if (j + k < ring_len) {
if (ring[i][j + k] != str[k]) {
success = false;
break;
}
}
else {
if (ring[i][point] != str[k]) {
point++;
success = false;
break;
}
}
}
if (success == true) {
ring_count++;
break;
}
}
}
}
printf("%d\n", ring_count);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:19: error: 'strlen' was not declared in this scope
12 | str_len = strlen(str);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <string>
+++ |+#include <cstring>
4 |
|
s727028483 | p00478 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string>
int main()
{
char str[11], ring[100][11];
int number, str_len;
scanf("%s", str);
str_len = strlen(str);
scanf("%d", &number);
for (int i = 0; i < number; i++) {
scanf("%s", ring[i]);
}
int ring_count = 0, ring_len;
for (int i = 0; i < number; i++) {
ring_len = strlen(ring[i]);
for (int j = 0; j < ring_len; j++) {
if (ring[i][j] == str[0]) {
bool success = true;
int point = 0;
for (int k = 1; k < str_len; k++) {
if (j + k < ring_len) {
if (ring[i][j + k] != str[k]) {
success = false;
break;
}
}
else {
if (ring[i][point] != str[k]) {
point++;
success = false;
break;
}
}
}
if (success == true) {
ring_count++;
break;
}
}
}
}
printf("%d\n", ring_count);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:19: error: 'strlen' was not declared in this scope
12 | str_len = strlen(str);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <string>
+++ |+#include <cstring>
4 |
|
s572022043 | p00478 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main(){
int ringCount = 0;
int findCount = 0;
char targetStr[11];
char tempRing[11];
int targetStringLength;
int tempStringLength;
bool isSame = true;
cin >> targetStr >> ringCount;
targetStringLength = strlen(targetStr);
for(int i=0;i<ringCount;i++){
cin >> tempRing;
tempStringLength = strlen(tempRing);
isSame = true;
for(int j=0;j<tempStringLength;j++){
for(int k=0;k<targetStringLength;k++){
if(targetStr[k] != tempRing[(j+k)%stringLength]){
isSame = false;
break;
}
}
if(isSame){
findCount++;
break;
}
}
}
cout << findCount << '\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:21:67: error: 'stringLength' was not declared in this scope; did you mean 'tempStringLength'?
21 | if(targetStr[k] != tempRing[(j+k)%stringLength]){
| ^~~~~~~~~~~~
| tempStringLength
|
s261653369 | p00478 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string char1,ring;
cin>>char1;
int num=0;
cin>>num;
for(int i=0;i<num;i++){
cin>>ring;
ring=ring+ring;
string::size_type index=ring.find(char1);
if(index==string::npos){
num--;
}
}
cout<<num2<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:15: error: 'num2' was not declared in this scope; did you mean 'num'?
21 | cout<<num2<<endl;
| ^~~~
| num
|
s451695254 | p00478 | C++ | #include<iostream>
#include<string>
using namespace std;
string S,T;
int main(){
int n;cin>>S>>n;int c=0;
for(int i=0;i<n;i++){
cin>>T;T+=T;
int flag=0;
for(int i=0;i<T.size()-S.size()+1;i++){
if(T.substr(i,S.size())==S){flag=1;}
}
c+=flag;
}
cout<<flag<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:15: error: 'flag' was not declared in this scope
15 | cout<<flag<<endl;
| ^~~~
|
s376067793 | p00478 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string w, s;
cin >> N;
int cnt = 0;
Rep(i,N) {
cin >> s;
cnt += s.find(w) != string::npos;
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'N' was not declared in this scope
7 | cin >> N;
| ^
a.cc:9:7: error: 'i' was not declared in this scope
9 | Rep(i,N) {
| ^
a.cc:9:3: error: 'Rep' was not declared in this scope
9 | Rep(i,N) {
| ^~~
|
s918849203 | p00478 | C++ | #include <bits/stdc++.h>
using namespace std;
#define Rep(i,N) for(int i = 0;i < N;i++)
int main()
{
string w, s;
cin >> N;
int cnt = 0;
Rep(i,N) {
cin >> s;
cnt += s.find(w) != string::npos;
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'N' was not declared in this scope
7 | cin >> N;
| ^
|
s702622018 | p00478 | C++ | #include<stdio.h>
#include<string.h>
int main()
{
char a[100], b[100], str[100];
int i, j, cnt = 0, n;
scanf("%s", str);
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s", a);
strcpy(b, a)
if (strstr(b, str) != 0) {
cnt++;
}
}
printf("%d\n", cnt);
} | a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before 'if'
11 | strcpy(b, a)
| ^
| ;
12 | if (strstr(b, str) != 0) {
| ~~
|
s472668311 | p00478 | C++ | #include<stdio.h>
#include<string.h>
int main()
{
char a[100], b[100], str[100];
int i, j, cnt = 0, n;
scanf("%s", str);
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s", a);
strcpy(a, a);
if (strstr(a, str) != 0) {
cnt++;
}
}\\
printf("%d\n", cnt);
} | a.cc:16:10: error: stray '\' in program
16 | }\\
17 | printf("%d\n", cnt);
|
s323281145 | p00478 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(){
char find_str[10];
int ling_qty;
scanf("%s",&find_str);
scanf("%d",&ling_qty);
char str_buff[11];
char str_sum[20];
int find_count = 0;
for(int i = 0; i < ling_qty; i++){
scanf("%s",str_buff);
strcpy(str_sum,str_buff);
strcat(str_sum,str_buff);
if(strstr(str_sum,find_str) != NULL) find_count++;
}
printf("%d\n",find_count);
} | a.cc: In function 'int main()':
a.cc:17:5: error: 'strcpy' was not declared in this scope
17 | strcpy(str_sum,str_buff);
| ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <stdlib.h>
+++ |+#include <cstring>
3 |
a.cc:18:5: error: 'strcat' was not declared in this scope
18 | strcat(str_sum,str_buff);
| ^~~~~~
a.cc:18:5: note: 'strcat' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:19:8: error: 'strstr' was not declared in this scope
19 | if(strstr(str_sum,find_str) != NULL) find_count++;
| ^~~~~~
a.cc:19:8: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
|
s590992845 | p00478 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
#include<string>
int main()
{
string ryuta,ryutan[101];
int n,i,m,r=0;
cin>>ryuta>>n;
for(i=1;i<=n;i++)
{
cin>>ryutan[i];
}
for(i=1;i<=n;i++)
{
m=0;
m=ryutan[i].find(ryuta);
if(m>=0)
{
r++;
}
cout<<r<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:24:10: error: expected '}' at end of input
24 | }
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s982661225 | p00478 | C++ | #include<iostream>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
string rotate(string &in){
string ret=in.substr(1);
return ret+in[0];
}
bool isc(string tar,string a){
rep(i,a.size()){
if (search(a.begin(),a.end(),tar.begin(),tar.end()) != a.end())return true;
a=rotate(a);
}
return false;
}
main(){
string tar;
while(cin>>tar){
int ret=0;
int n;
cin>>n;
rep(i,n){
string tmp;
cin>>tmp;
if (isc(tar,tmp))ret++;
}
cout << ret << endl;
}
} | a.cc: In function 'bool isc(std::string, std::string)':
a.cc:13:15: error: no matching function for call to 'search(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator)'
13 | if (search(a.begin(),a.end(),tar.begin(),tar.end()) != a.end())return true;
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:2332:5: note: candidate: 'template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> _ForwardIterator1 std::search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _BinaryPredicate)'
2332 | search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
| ^~~~~~
/usr/include/c++/14/bits/stl_algobase.h:2332:5: note: candidate expects 5 arguments, 4 provided
a.cc: At global scope:
a.cc:19:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
19 | main(){
| ^~~~
|
s016409421 | p00478 | C++ | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);} | a.cc:1:1: error: 'a' does not name a type
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:17: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:41: error: 'f' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:45: error: 'b' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:47: error: 'a' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:30: error: 'scanf' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^~~~~
a.cc:1:65: error: 'strdup' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^~~~~~
a.cc:1:58: error: 'strcat' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^~~~~~
a.cc:1:1: note: 'strcat' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
+++ |+#include <cstring>
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
a.cc:1:51: error: 'strstr' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^~~~~~
a.cc:1:51: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:1:82: error: 'C' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:86: error: 'C' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:89: error: 'printf' was not declared in this scope
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | a[11],b[11],C,f;main(){for(;~scanf("%s",f++?b:a);)strstr(strcat(strdup(b),b),a)&&C++;C=!printf("%d\n",C);}
|
s796352613 | p00478 | C++ | a,C;main(b){for(;~scanf("%s",a?&b:&a);)strstr(strcat(strdup(&b),&b),&a)&&C++;C=!printf("%d\n",C);} | a.cc:1:1: error: 'a' does not name a type
1 | a,C;main(b){for(;~scanf("%s",a?&b:&a);)strstr(strcat(strdup(&b),&b),&a)&&C++;C=!printf("%d\n",C);}
| ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
1 | a,C;main(b){for(;~scanf("%s",a?&b:&a);)strstr(strcat(strdup(&b),&b),&a)&&C++;C=!printf("%d\n",C);}
| ^
|
s701827279 | p00478 | C++ | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);} | a.cc:1:1: error: 'a' does not name a type
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^
a.cc:1:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:17: error: 'a' was not declared in this scope
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^
a.cc:1:33: error: 'b' was not declared in this scope
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^
a.cc:1:20: error: 'scanf' was not declared in this scope
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^~~~~
a.cc:1:58: error: 'strdup' was not declared in this scope
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^~~~~~
a.cc:1:51: error: 'strcat' was not declared in this scope
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^~~~~~
a.cc:1:1: note: 'strcat' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
+++ |+#include <cstring>
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
a.cc:1:44: error: 'strstr' was not declared in this scope
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^~~~~~
a.cc:1:44: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:1:76: error: 'C' was not declared in this scope
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^
a.cc:1:82: error: 'printf' was not declared in this scope
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | a,b[9],C;main(){a=~scanf("%s",a?b:&a)?main(strstr(strcat(strdup(b),b),&a)&&C++):!printf("%d\n",C);}
|
s225769162 | p00478 | C++ | #include<cstdio>
#include<cstring>
int main(){
int a,res=0;
char x[20],y[40],z[20];
scanf("%s",&x);
scanf("%d",&a);
for(int i=0;i<a;i++){
scanf("%s",&y);
strcpy(z,y);
strcat(y,);
if(strstr(y,x)){
res++;
}
}
printf("%d\n",res);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:10: error: expected primary-expression before ')' token
12 | strcat(y,);
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.