submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s085644019 | p00432 | C | #include<string.h>
#include<stdio.h>
#define max(x,y) ((x>y)?x:y)
#define min(x,y) ((x<y)?x:y)
using namespace std;
int g[10003][10003];
int n,r;
int main(){
while(1){
int ans=0,ans2=0,minx=10001,miny=10001,maxx=1,maxy=1;
scanf("%d%d",&n,&r);
if(n==0 && r==0)break;
memset(g,0,sizeof(g));
for(int i=0;i<n;i++){
int x1,y1,x2,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
x1++,y1++,x2++,y2++;
minx=min(min(x1,x2),minx);
miny=min(min(y1,y2),miny);
maxx=max(max(x1,x2),maxx);
maxy=max(max(y1,y2),maxy);
g[x1][y1]+=1;
g[x2][y1]-=1;
g[x1][y2]-=1;
g[x2][y2]+=1;
}
for(int i=miny;i<=maxy;i++){
int t=0;
for(int j=minx;j<=maxx;j++){
t+=g[j][i];
g[j][i]=t;
}
}
for(int i=minx;i<=maxx;i++){
int t=0;
for(int j=miny;j<=maxy;j++){
t+=g[i][j];
g[i][j]=t;
if(g[i][j]>0){
ans++;
}
}
}
printf("%d\n",ans);
if(r==2){
for(int i=minx;i<=maxx;i++){
for(int j=miny;j<=maxy;j++){
if(g[i][j]>=1){
if(g[i-1][j]<=0)ans2++;
if(g[i+1][j]<=0)ans2++;
if(g[i][j-1]<=0)ans2++;
if(g[i][j+1]<=0)ans2++;
}
}
}
printf("%d\n",ans2);
}
}
return 0;
} | main.c:5:1: error: unknown type name 'using'
5 | using namespace std;
| ^~~~~
main.c:5:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
5 | using namespace std;
| ^~~
|
s613677969 | p00432 | C | #include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;
int g[10003][10003];
int n,r;
int main(){
while(1){
int ans=0,ans2=0,minx=10001,miny=10001,maxx=1,maxy=1;
scanf("%d%d",&n,&r);
if(n==0 && r==0)break;
memset(g,0,sizeof(g));
for(int i=0;i<n;i++){
int x1,y1,x2,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
x1++,y1++,x2++,y2++;
minx=min(x1,minx);
miny=min(y1,miny);
maxx=max(x2,maxx);
maxy=max(y2,maxy);
g[x1][y1]++;
g[x2][y1]--;
g[x1][y2]--;
g[x2][y2]++;
}
/*for(int i=miny;i<=maxy;i++){
int t=0;
for(int j=minx;j<=maxx;j++){
t+=g[j][i];
g[j][i]=t;
}
}
for(int i=minx;i<=maxx;i++){
int t=0;
for(int j=miny;j<=maxy;j++){
t+=g[i][j];
g[i][j]=t;
if(g[i][j]>0){
ans++;
}
}
}*/
printf("%d\n",ans);
/*if(r==2){
for(int i=minx;i<=maxx;i++){
for(int j=miny;j<=maxy;j++){
if(g[i][j]>=1){
if(g[i-1][j]<=0)ans2++;
if(g[i+1][j]<=0)ans2++;
if(g[i][j-1]<=0)ans2++;
if(g[i][j+1]<=0)ans2++;
}
}
}
printf("%d\n",ans2);
}*/
}
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s882026178 | p00432 | C | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int g[10003][10003];
int n,r;
int main(){
while(scanf("%d%d",&n,&r),n){
memset(g,0,sizeof(g));
int mx = 10001,Mx = 1,my = 10001,My = 1;
for(int i = 0; i < n; i++){
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
a++;b++;c++;d++;
g[a][b]++; g[a][d]--;
g[c][b]--; g[c][d]++;
mx = min(mx,a);
Mx = max(Mx,c);
my = min(my,b);
My = max(My,d);
}
for(int i = mx; i <= Mx; i++){
int t = 0;
for(int j = my; j <= My; j++){
t += g[i][j];
g[i][j] = t;
}
}
int s = 0;
for(int j = my; j <= My; j++){
int t = 0;
for(int i = mx; i <= Mx; i++){
t += g[i][j];
if(g[i][j] = t)s++;
}
}
printf("%d\n",s);
if(r==2){
int l = 0;
for(int i = mx; i <= Mx; i++){
for(int j = my; j <= My; j++){
if(g[i][j]){
l += !g[i-1][j]+!g[i+1][j]+!g[i][j-1]+!g[i][j+1];
}
}
}
printf("%d\n",l);
}
}
return 0;
} | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s835725477 | p00432 | C++ | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
using namespace std;
typedef long long ll;
#define INF 2000000000
#define LLINF 4000000000000000000
#define SIZE 10004
int mm[SIZE][SIZE];
int mo[5] = {0,1,0,-1,0};
void calc(int n,int r){
int x_1,x_2,y_1,y_2,minx=SIZE-1,maxx=0,miny=SIZE-1,maxy=0;
int ansV=0,ansL=0;
memset(mm,0,sizeof(mm));
for(int i=0;i<n;i++){
scanf("%d%d%d%d",&x_1,&y_1,&x_2,&y_2);
x_1++;
y_1++;
x_2++;
y_2++;
mm[x_1][y_1]++;
mm[x_2][y_1]--;
mm[x_1][y_2]--;
mm[x_2][y_2]++;
minx = min(minx,x_1);
miny = min(miny,y_1);
maxx = max(maxx,x_2);
maxy = max(maxy,y_2);
}
for(int i=miny;i<=maxy;i++){
for(int j=minx+1;j<=maxx;j++){
mm[j][i]+=mm[j-1][i];
}
}
for(int i=minx;i<=maxx;i++){
for(int j=miny+1;j<=maxy;j++){
mm[i][j]+=mm[i][j-1];
}
}
for(int i=minx;i<maxx;i++){
for(int j=miny;j<maxy;j++){
if(mm[i][j]>0){
ansV++;
for(int k=0;k<4;k++){
if(mm[i+mo[k]][j+mo[k+1]]==0){
ansL++;
}
}
}
}
}
printf("%d\n",ansV);
if(r==2)
printf("%d\n",ansL);
return;
}
int main(){
int n,r;
while(1){
scanf("%d%d",&n,&r);
if(n==0) break;
calc(n,r);
}
return 0;
} | a.cc: In function 'void calc(int, int)':
a.cc:26:5: error: 'memset' was not declared in this scope
26 | memset(mm,0,sizeof(mm));
| ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
10 | #include <map>
+++ |+#include <cstring>
11 |
|
s522214106 | p00432 | C++ | #include<iostream>
#include<stdio.h>
#include<list>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int short[10001][10001];
int main(){
int n,r;
int S=0;
int L=0;
int state;
while(1){
cin>>n>>r;
if(n==0&&r==0)break;
memset(map,0,sizeof(map));
int x_min=10001,x_max=0,y_min=10001,y_max=0;
int x1,y1,x2,y2;
for(int i=0;i<n;i++){
cin>>x1>>y1>>x2>>y2;
map[x1][y1]+=1;
map[x1][y2]-=1;
map[x2][y1]-=1;
map[x2][y2]+=1;
if(x_min>x1)x_min=x1;
if(y_min>y1)y_min=y1;
if(x_max<x2)x_max=x2;
if(y_max<y2)y_max=y2;
}
S=0;
L=0;
for(int h=y_min;h<=y_max;h++){
state=0;
for(int w=x_min;w<=x_max;w++){
state+=map[w][h];
map[w][h]=state;
}
}
for(int w=x_min;w<=x_max;w++){
state=0;
for(int h=y_min;h<=y_max;h++){
state+=map[w][h];
map[w][h]=state;
if(map[w][h]>0){
S++;
if(w==0)L+=2;
else if(map[w-1][h]==0)L+=2;
if(h==0)L+=2;
else if(map[w][h-1]==0)L+=2;
}
}
}
cout<<S<<endl;
if(r==2){
cout<<L<<endl;
}
}
} | a.cc:9:11: error: expected identifier before numeric constant
9 | int short[10001][10001];
| ^~~~~
a.cc:9:11: error: expected ']' before numeric constant
9 | int short[10001][10001];
| ^~~~~
| ]
a.cc:9:10: error: structured binding declaration cannot have type 'short int'
9 | int short[10001][10001];
| ^
a.cc:9:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:9:10: error: empty structured binding declaration
a.cc:9:17: error: expected initializer before '[' token
9 | int short[10001][10001];
| ^
a.cc: In function 'int main()':
a.cc:25:16: error: 'map' was not declared in this scope
25 | memset(map,0,sizeof(map));
| ^~~
a.cc:7:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
6 | #include<algorithm>
+++ |+#include <map>
7 | using namespace std;
|
s972667458 | p00432 | C++ | #include <iostream>
#include <vector>
using namespace std;
const static int MAX = 10000;
bool Sheets[MAX+2][MAX+2];
int count(int x,int y) {
int dx[4] = {-1,0,0,1};
int dy[4] = {0,1,-1,0};
int cnt = 0;
for(int d=0;d<4;d++) {
if(!Sheets[x+dx[d]][y+dy[d]])
cnt++;
}
return cnt;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n,r;
while(cin >> n >> r) {
if(n+r == 0) break;
memset(Sheets,0,sizeof(Sheets));
int x[2],y[2];
for(int i=0;i<n;i++) {
cin >> x[0] >> y[0] >> x[1] >> y[1];
for(int w=x[0]+1;w<=x[1];w++) {
for(int h=y[0]+1;h<=y[1];h++) {
Sheets[h][w] = true;
}
}
}
// calc
int length = 0;
int surface = 0;
for(int i=1;i<=MAX;i++) {
for(int j=1;j<=MAX;j++) {
if(Sheets[i][j]) {
surface++;
length += count(i,j);
}
}
}
cout << surface << endl;
if(r==2) cout << length << endl;
}
} | a.cc: In function 'int main()':
a.cc:26:5: error: 'memset' was not declared in this scope
26 | memset(Sheets,0,sizeof(Sheets));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <vector>
+++ |+#include <cstring>
3 | using namespace std;
|
s270376660 | p00432 | C++ | #include<stdio.h>
main(){
printf(" ")
} | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:3:14: error: expected ';' before '}' token
3 | printf(" ")
| ^
| ;
4 | }
| ~
|
s696704374 | p00432 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>
#include<complex>
#include<utility>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define mp make_pair
#define pb push_back
const int N = 30000;
class st{
public:
int height;
int out;//1 or -1
bool operator<(const st & a)const{
if (height != a.height)return height < a.height;
return out > a.out;
}
};
int x[N];
vector<st> inx[N];
int y[N];
vector<st> iny[N];
/*
29
29
80
45
*/
void makedata(int n,int *x1,int *x2,int *y1,int *y2,
int &px,int &py){
vector<int> xd,yd;
rep(i,n){
xd.pb(x1[i]);
xd.pb(x2[i]);
yd.pb(y1[i]);
yd.pb(y2[i]);
}
sort(ALL(xd));
sort(ALL(yd));
xd.erase(unique(ALL(xd)),xd.end());
yd.erase(unique(ALL(yd)),yd.end());
rep(i,xd.size())x[px++]=xd[i],inx[i].clear();
rep(i,yd.size())y[py++]=yd[i],iny[i].clear();
//cout <<"allx ";rep(i,px)cout << x[i]<<" ";cout << endl;
rep(i,n){
int j=lower_bound(xd.begin(),xd.end(),x1[i])-xd.begin();
while(j < px && x[j] < x2[i]){
inx[j].pb((st){y1[i],1});
inx[j].pb((st){y2[i],-1});
j++;
}
j = lower_bound(ALL(yd),y1[i])-yd.begin();
while(j < py && y[j] < y2[i]){
iny[j].pb((st){x1[i],1});
iny[j].pb((st){x2[i],-1});
j++;
}
}
}
pair<int,int> solve(int n,vector<st> *in,int *c){
int area=0;
int len=0;
rep(i,n-1){
if (in[i].size() == 0)continue;
sort(in[i].begin(),in[i].end());
int cnt=0,prev=-100;
int width;
width=c[i+1]-c[i];
rep(j,in[i].size()){
if (cnt > 0){
area+=(in[i][j].height-prev)*width;
}
//if (cnt == 0 && in[i][j].height != prev){
if (cnt == 0){
len+=width;
}
cnt+=in[i][j].out;
//if (cnt == 0 && in[i][j].height != prev){
if (cnt == 0){
len+=width;
}
prev=in[i][j].height;
}
}
return mp(area,len);
}
main(){
int n,q;
static int x1[N],y1[N],x2[N],y2[N];
while(cin>>n>>q && n){
rep(i,n){
cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
}
int px=0,py=0;
makedata(n,x1,x2,y1,y2,px,py);
pair<int,int> ansx=solve(px,inx,x);
pair<int,int> ansy= solve(py,iny,y);
cout << ansx.first << endl;
if (q == 2)cout << ansx.second+ansy.second << endl;
}
return false;
} | a.cc: In function 'void makedata(int, int*, int*, int*, int*, int&, int&)':
a.cc:53:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
53 | sort(ALL(xd));
| ^~~~
| sqrt
a.cc:55:12: error: 'unique' was not declared in this scope
55 | xd.erase(unique(ALL(xd)),xd.end());
| ^~~~~~
a.cc: In function 'std::pair<int, int> solve(int, std::vector<st>*, int*)':
a.cc:82:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
82 | sort(in[i].begin(),in[i].end());
| ^~~~
| sqrt
a.cc: At global scope:
a.cc:105:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
105 | main(){
| ^~~~
|
s209830358 | p00432 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<cmath>
#include<complex>
#include<utility>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define mp make_pair
#define pb push_back
const int N = 10010;
class st{
public:
int height;
char out;//1 or -1
//bool operator<(const st&)const;
bool st::operator<(const st & a)const{
if (height != a.height)return height < a.height;
return out > a.out;
}
};
int x[N];
vector<st> inx[N];
//int y[N];
//vector<st> iny[N];
/*
29
29
80
45
*/
void makedata(int n,int *x1,int *x2,int *y1,int *y2,
int &px,int *X,vector<st> *IN){
//vector<int> xd;
static int xd[N];
int p=0;
rep(i,n){
//xd.pb(x1[i]);
//xd.pb(x2[i]);
xd[p++]=x1[i];
xd[p++]=x2[i];
}
//sort(ALL(xd));
sort(xd,xd+p);
//xd.erase(unique(ALL(xd)),xd.end());
p=unique(xd,xd+p)-xd;
//rep(i,xd.size())X[px++]=xd[i],IN[i].clear();
rep(i,p)X[px++]=xd[i],IN[i].clear();
//cout <<"allx ";rep(i,px)cout << x[i]<<" ";cout << endl;
rep(i,n){
//int j=lower_bound(xd.begin(),xd.end(),x1[i])-xd.begin();
int j=lower_bound(xd,xd+p,x1[i])-xd;
while(j < px && x[j] < x2[i]){
IN[j].pb((st){y1[i],1});
IN[j].pb((st){y2[i],-1});
j++;
}
}
}
pair<int,int> solve(int n,vector<st> *in,int *c){
int area=0;
int len=0;
rep(i,n-1){
if (in[i].size() == 0)continue;
sort(in[i].begin(),in[i].end());
int cnt=0,prev=-100;
int width;
width=c[i+1]-c[i];
rep(j,in[i].size()){
if (cnt > 0){
area+=(in[i][j].height-prev)*width;
}
//if (cnt == 0 && in[i][j].height != prev){
if (cnt == 0){
len+=width;
}
cnt+=in[i][j].out;
//if (cnt == 0 && in[i][j].height != prev){
if (cnt == 0){
len+=width;
}
prev=in[i][j].height;
}
}
return mp(area,len);
}
main(){
int n,q;
static int x1[N],y1[N],x2[N],y2[N];
while(cin>>n>>q && n){
rep(i,n){
cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
}
int px=0,py=0;
makedata(n,x1,x2,y1,y2,px,x,inx);
pair<int,int> ansx=solve(px,inx,x);
cout << ansx.first << endl;
if (q == 2){
px=0;
makedata(n,y1,y2,x1,x2,px,x,inx);
pair<int,int> ansy= solve(px,inx,x);
cout << ansx.second+ansy.second << endl;
}
}
return false;
} | a.cc:22:6: error: extra qualification 'st::' on member 'operator<' [-fpermissive]
22 | bool st::operator<(const st & a)const{
| ^~
a.cc:102:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
102 | main(){
| ^~~~
|
s569124742 | p00432 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<cmath>
#include<complex>
#include<utility>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define mp make_pair
#define pb push_back
const int N = 10010;
class st{
public:
short beg,end;
bool operator<(const st &)const;
};
bool st::operator<(const st & a)const{
if (beg != a.beg)return beg < a.beg;
return end < a.end;
}
short isexist[N]={0};
short testcase=0;
int x[N];
st *inx[N];
int req[N];
void makedata(int n,int *x1,int *x2,int *y1,int *y2,
int &px,int *xd,vector<st> *IN){
testcase++;
rep(i,n){
isexist[x1[i]]=testcase;
isexist[x2[i]]=testcase;
}
rep(i,N)if (isexist[i]==testcase)x[px]=i,IN[px++].clear();
//cout <<"allx ";rep(i,px)cout << x[i]<<" ";cout << endl;
rep(i,px)req[i]=0;
rep(i,n){
int j=lower_bound(xd,xd+px,x1[i])-xd;
while(j < px && xd[j] < x2[i]){
//IN[j].pb((st){y1[i],y2[i]});
req[j]++;
j++;
}
}
rep(i,px)IN[i]=malloc(sizeof(st)*req[i]),req[i]=0;
rep(i,n){
int j=lower_bound(xd,xd+px,x1[i])-xd;
while(j < px && xd[j] < x2[i]){
//IN[j].pb((st){y1[i],y2[i]});
IN[j][req[j]++]=(st){y1[i],y2[i]};
j++;
}
}
}
pair<int,int> solve(int n,vector<st> *in,int *c){
int area=0;
int len=0;
rep(i,n-1){
if (req[i] == 0)continue;
sort(in[i],in[i]+req[i]);
short l=-1,h=-1;
short width;
width=c[i+1]-c[i];
rep(j,req[i]){
short &nowl=in[i][j].beg,&nowh=in[i][j].end;
//cout << nowl <<" "<< nowh <<" " << l<<" " << h << endl;
if (nowl > h){
len+=2*width;
//cout << c[i]<<" " << c[i]<<" " << nowh<<" " << nowl << endl;
area+=(nowh-nowl)*width;
}else if (nowl == h){
//cout << c[i]<<" " << c[i]<<" " << nowh<<" " << nowl << endl;
area+=(nowh-nowl)*width;
}else if (nowh > h){
//cout << c[i]<<" " << c[i]<<" " << nowh<<" " << h << endl;
area+=(nowh-h)*width;
}
l=nowl;
h=max(h,nowh);
}
}
return mp(area,len);
}
main(){
int n,q;
static int x1[N],y1[N],x2[N],y2[N];
while(cin>>n>>q && n){
rep(i,n){
cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
}
int px=0,py=0;
makedata(n,x1,x2,y1,y2,px,x,inx);
pair<int,int> ansx=solve(px,inx,x);
cout << ansx.first << endl;
if (q == 2){
px=0;
makedata(n,y1,y2,x1,x2,px,x,inx);
pair<int,int> ansy= solve(px,inx,x);
cout << ansx.second+ansy.second << endl;
}
rep(i,px)inx[i].clear();
}
return false;
} | a.cc: In function 'void makedata(int, int*, int*, int*, int*, int&, int*, std::vector<st>*)':
a.cc:55:42: error: no match for 'operator=' (operand types are 'std::vector<st>' and 'void*')
55 | rep(i,px)IN[i]=malloc(sizeof(st)*req[i]),req[i]=0;
| ^
In file included from /usr/include/c++/14/vector:72,
from a.cc:4:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = st; _Alloc = std::allocator<st>]'
210 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from 'void*' to 'const std::vector<st>&'
211 | operator=(const vector<_Tp, _Alloc>& __x)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = st; _Alloc = std::allocator<st>]'
766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note: no known conversion for argument 1 from 'void*' to 'std::vector<st>&&'
766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
| ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = st; _Alloc = std::allocator<st>]'
788 | operator=(initializer_list<value_type> __l)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note: no known conversion for argument 1 from 'void*' to 'std::initializer_list<st>'
788 | operator=(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:61:32: warning: narrowing conversion of '*(y1 + ((sizetype)(((long unsigned int)i) * 4)))' from 'int' to 'short int' [-Wnarrowing]
61 | IN[j][req[j]++]=(st){y1[i],y2[i]};
| ~~~~^
a.cc:61:38: warning: narrowing conversion of '*(y2 + ((sizetype)(((long unsigned int)i) * 4)))' from 'int' to 'short int' [-Wnarrowing]
61 | IN[j][req[j]++]=(st){y1[i],y2[i]};
| ~~~~^
a.cc: In function 'std::pair<int, int> solve(int, std::vector<st>*, int*)':
a.cc:72:21: error: no match for 'operator+' (operand types are 'std::vector<st>' and 'int')
72 | sort(in[i],in[i]+req[i]);
| ~~~~~^~~~~~~
| | |
| | int
| std::vector<st>
In file included from /usr/include/c++/14/string:48,
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_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
72 | sort(in[i],in[i]+req[i]);
| ^
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: 'std::vector<st>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3616 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: mismatched types 'const _CharT*' and 'std::vector<st>'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: 'std::vector<st>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: 'std::vector<st>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: 'std::vector<st>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: 'std::vector<st>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed:
a.cc:72:27: note: 'std::vector<st>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
72 | sort(in[i],in[i]+req[i]);
| ^
/usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
3719 | operator+(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed:
a.cc:72:27: |
s924232482 | p00432 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<cmath>
#include<complex>
#include<utility>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define mp make_pair
#define pb push_back
const int N = 10010;
class st{
public:
short beg,end;
bool operator<(const st &)const;
};
bool st::operator<(const st & a)const{
if (beg != a.beg)return beg < a.beg;
return end < a.end;
}
short isexist[N]={0};
short testcase=0;
int x[N];
vector<st> inx[N];
int req[N];
void makedata(int n,int *x1,int *x2,int *y1,int *y2,
int &px,int *xd,vector<st> *IN){
testcase++;
rep(i,n){
isexist[x1[i]]=testcase;
isexist[x2[i]]=testcase;
}
rep(i,N)if (isexist[i]==testcase)x[px]=i,IN[px++].clear();
//cout <<"allx ";rep(i,px)cout << x[i]<<" ";cout << endl;
rep(i,px)req[i]=0;
rep(i,n){
int j=lower_bound(xd,xd+px,x1[i])-xd;
while(j < px && xd[j] < x2[i]){
bool isin=false;
bool iscontinue=false;
rep(k,req[j]){
if (y1[i] <= IN[j][k].begin && IN[j][k].end <= y2[i]){
isin=true;
in[j][k].begin=y1[i];
in[j][k].end=y2[i];
break;
}
}
if (isin)req[j]++;
j++;
}
}
rep(i,px)IN[i]=vector<st>(req[i]),req[i]=0;
rep(i,n){
int j=lower_bound(xd,xd+px,x1[i])-xd;
while(j < px && xd[j] < x2[i]){
bool isin=false;
bool iscontinue=false;
rep(k,req[j]){
if (y1[i] <= IN[j][k].begin && IN[j][k].end <= y2[i]){
isin=true;
in[j][k].begin=y1[i];
in[j][k].end=y2[i];
break;
}
}
if (!isin)IN[j][req[j]++]=(st){y1[i],y2[i]};
j++;
}
}
}
pair<int,int> solve(int n,vector<st> *in,int *c){
int area=0;
int len=0;
rep(i,n-1){
if (in[i].size() == 0)continue;
sort(in[i].begin(),in[i].end());
short l=-1,h=-1;
short width;
width=c[i+1]-c[i];
rep(j,in[i].size()){
short &nowl=in[i][j].beg,&nowh=in[i][j].end;
//cout << nowl <<" "<< nowh <<" " << l<<" " << h << endl;
if (nowl > h){
len+=2*width;
//cout << c[i]<<" " << c[i]<<" " << nowh<<" " << nowl << endl;
area+=(nowh-nowl)*width;
}else if (nowl == h){
//cout << c[i]<<" " << c[i]<<" " << nowh<<" " << nowl << endl;
area+=(nowh-nowl)*width;
}else if (nowh > h){
//cout << c[i]<<" " << c[i]<<" " << nowh<<" " << h << endl;
area+=(nowh-h)*width;
}
l=nowl;
h=max(h,nowh);
}
}
return mp(area,len);
}
main(){
int n,q;
static int x1[N],y1[N],x2[N],y2[N];
while(cin>>n>>q && n){
rep(i,n){
cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
}
int px=0,py=0;
makedata(n,x1,x2,y1,y2,px,x,inx);
pair<int,int> ansx=solve(px,inx,x);
cout << ansx.first << endl;
if (q == 2){
px=0;
makedata(n,y1,y2,x1,x2,px,x,inx);
pair<int,int> ansy= solve(px,inx,x);
cout << ansx.second+ansy.second << endl;
}
rep(i,px)inx[i].clear();
}
return false;
} | a.cc: In function 'void makedata(int, int*, int*, int*, int*, int&, int*, std::vector<st>*)':
a.cc:52:31: error: '__gnu_cxx::__alloc_traits<std::allocator<st>, st>::value_type' {aka 'class st'} has no member named 'begin'; did you mean 'beg'?
52 | if (y1[i] <= IN[j][k].begin && IN[j][k].end <= y2[i]){
| ^~~~~
| beg
a.cc:54:11: error: 'in' was not declared in this scope; did you mean 'i'?
54 | in[j][k].begin=y1[i];
| ^~
| i
a.cc:72:31: error: '__gnu_cxx::__alloc_traits<std::allocator<st>, st>::value_type' {aka 'class st'} has no member named 'begin'; did you mean 'beg'?
72 | if (y1[i] <= IN[j][k].begin && IN[j][k].end <= y2[i]){
| ^~~~~
| beg
a.cc:74:11: error: 'in' was not declared in this scope; did you mean 'i'?
74 | in[j][k].begin=y1[i];
| ^~
| i
a.cc:79:42: warning: narrowing conversion of '*(y1 + ((sizetype)(((long unsigned int)i) * 4)))' from 'int' to 'short int' [-Wnarrowing]
79 | if (!isin)IN[j][req[j]++]=(st){y1[i],y2[i]};
| ~~~~^
a.cc:79:48: warning: narrowing conversion of '*(y2 + ((sizetype)(((long unsigned int)i) * 4)))' from 'int' to 'short int' [-Wnarrowing]
79 | if (!isin)IN[j][req[j]++]=(st){y1[i],y2[i]};
| ~~~~^
a.cc: At global scope:
a.cc:116:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
116 | main(){
| ^~~~
|
s208085867 | p00432 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<cmath>
#include<complex>
#include<utility>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define mp make_pair
#define pb push_back
const int N = 10010;
class st{
public:
short beg,end;
bool operator<(const st & a)const{
if (beg != a.beg)return beg < a.beg;
return end < a.end;
}
};
short isexist[N]={0};
short testcase=0;
int x[N];
vector<st> inx[N];
int req[N];
void makedata(int n,int *x1,int *x2,int *y1,int *y2,
int &px,int *xd,vector<st> *IN){
testcase++;
rep(i,n){
isexist[x1[i]]=testcase;
isexist[x2[i]]=testcase;
}
rep(i,N)if (isexist[i]==testcase)x[px]=i,IN[px++].clear();
rep(i,n){
int j=lower_bound(xd,xd+px,x1[i])-xd;
while(j < px && xd[j] < x2[i]){
bool isin=false;
rep(k,IN[j].size()){
short Y1 = y1[i],Y2=y2[i];
short &Y3=IN[j][k].beg;
short &Y4=IN[j][k].end;
if (Y4 <= Y1 || Y2 <= Y3)continue;
isin=true;
Y3=min(Y1,Y3);
Y4=max(Y2,Y4);
break;
}
if (!isin)IN[j].pb((st){y1[i],y2[i]});
j++;
}
}
}
pair<int,int> solve(int n,vector<st> *in,int *c){
int area=0;
int len=0;
rep(i,n-1){
if (in[i].size() == 0)continue;
sort(in[i].begin(),in[i].end());
short l=-1,h=-1;
short width;
width=c[i+1]-c[i];
rep(j,in[i].size()){
short &nowl=in[i][j].beg,&nowh=in[i][j].end;
if (nowl > h){
len+=2*width;
area+=(nowh-nowl)*width;
}else if (nowl == h){
area+=(nowh-nowl)*width;
}else if (nowh > h){
area+=(nowh-h)*width;
}
l=nowl;
h=max(h,nowh);
}
}
return mp(area,len);
}
main(){
int n,q;
static int x1[N],y1[N],x2[N],y2[N];
while(cin>>n>>q && n){
rep(i,n){
cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
}
int px=0,py=0;
makedata(n,x1,x2,y1,y2,px,x,inx);
pair<int,int> ansx=solve(px,inx,x);
cout << ansx.first << endl;
if (q == 2){
px=0;
makedata(n,y1,y2,x1,x2,px,x,inx);
pair<int,int> ansy= solve(px,inx,x);
cout << ansx.second+ansy.second << endl;
}
rep(i,px)inx[i].clear();
}
return false;
}
! | a.cc: In function 'void makedata(int, int*, int*, int*, int*, int&, int*, std::vector<st>*)':
a.cc:56:35: warning: narrowing conversion of '*(y1 + ((sizetype)(((long unsigned int)i) * 4)))' from 'int' to 'short int' [-Wnarrowing]
56 | if (!isin)IN[j].pb((st){y1[i],y2[i]});
| ~~~~^
a.cc:56:41: warning: narrowing conversion of '*(y2 + ((sizetype)(((long unsigned int)i) * 4)))' from 'int' to 'short int' [-Wnarrowing]
56 | if (!isin)IN[j].pb((st){y1[i],y2[i]});
| ~~~~^
a.cc: At global scope:
a.cc:88:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
88 | main(){
| ^~~~
a.cc:110:1: error: expected unqualified-id before '!' token
110 | !
| ^
|
s697977928 | p00432 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<cmath>
#include<complex>
#include<utility>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(C) (C).begin(),(C).end()
#define mp make_pair
#define pb push_back
#define fir first
#define sec second
const int N = 10010;
typedef pair<int,int> pii;
short isexist[N]={0};
short testcase=0;
int x[N];
vector<pii> inx[N];
int req[N];
void makedata(int n,int *x1,int *x2,int *y1,int *y2,
int &px,int *xd,vector<pii> *IN){
testcase++;
rep(i,n){
isexist[x1[i]]=testcase;
isexist[x2[i]]=testcase;
}
rep(i,N)if (isexist[i]==testcase)x[px]=i,IN[px++].clear();
rep(i,n){
int j=lower_bound(xd,xd+px,x1[i])-xd;
while(j < px && xd[j] < x2[i]){
bool isin=false;
rep(k,IN[j].size()){
short Y1 = y1[i],Y2=y2[i];
short &Y3=IN[j][k].fir;
short &Y4=IN[j][k].sec;
if (Y4 <= Y1 || Y2 <= Y3)continue;
isin=true;
Y3=min(Y1,Y3);
Y4=max(Y2,Y4);
break;
}
if (!isin)IN[j].pb((st){y1[i],y2[i]});
j++;
}
}
}
pair<int,int> solve(int n,vector<st> *in,int *c){
int area=0;
int len=0;
rep(i,n-1){
if (in[i].size() == 0)continue;
sort(in[i].begin(),in[i].end());
short l=-1,h=-1;
short width;
width=c[i+1]-c[i];
rep(j,in[i].size()){
short &nowl=in[i][j].fir,&nowh=in[i][j].end;
if (nowl >= h || nowh > h){
if (nowl > h)len+=2*width;
area+=(nowh-nowl)*width;
}
l=nowl;
h=max(h,nowh);
}
}
return mp(area,len);
}
main(){
int n,q;
static int x1[N],y1[N],x2[N],y2[N];
while(cin>>n>>q && n){
rep(i,n){
cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];
}
int px=0,py=0;
makedata(n,x1,x2,y1,y2,px,x,inx);
pair<int,int> ansx=solve(px,inx,x);
cout << ansx.first << endl;
if (q == 2){
px=0;
makedata(n,y1,y2,x1,x2,px,x,inx);
pair<int,int> ansy= solve(px,inx,x);
cout << ansx.second+ansy.second << endl;
}
rep(i,px)inx[i].clear();
}
return false;
} | a.cc: In function 'void makedata(int, int*, int*, int*, int*, int&, int*, std::vector<std::pair<int, int> >*)':
a.cc:14:13: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'int'
14 | #define fir first
a.cc:43:28: note: in expansion of macro 'fir'
43 | short &Y3=IN[j][k].fir;
| ^~~
a.cc:15:13: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'int'
15 | #define sec second
a.cc:44:28: note: in expansion of macro 'sec'
44 | short &Y4=IN[j][k].sec;
| ^~~
a.cc:51:27: error: 'st' was not declared in this scope; did you mean 'std'?
51 | if (!isin)IN[j].pb((st){y1[i],y2[i]});
| ^~
| std
a.cc: At global scope:
a.cc:57:34: error: 'st' was not declared in this scope; did you mean 'std'?
57 | pair<int,int> solve(int n,vector<st> *in,int *c){
| ^~
| std
a.cc:57:36: error: template argument 1 is invalid
57 | pair<int,int> solve(int n,vector<st> *in,int *c){
| ^
a.cc:57:36: error: template argument 2 is invalid
a.cc: In function 'std::pair<int, int> solve(int, int*, int*)':
a.cc:61:15: error: request for member 'size' in '*(in + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
61 | if (in[i].size() == 0)continue;
| ^~~~
a.cc:62:16: error: request for member 'begin' in '*(in + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
62 | sort(in[i].begin(),in[i].end());
| ^~~~~
a.cc:62:30: error: request for member 'end' in '*(in + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
62 | sort(in[i].begin(),in[i].end());
| ^~~
a.cc:66:17: error: request for member 'size' in '*(in + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
66 | rep(j,in[i].size()){
| ^~~~
a.cc:9:34: note: in definition of macro 'REP'
9 | #define REP(i,b,n) for(int i=b;i<n;i++)
| ^
a.cc:66:5: note: in expansion of macro 'rep'
66 | rep(j,in[i].size()){
| ^~~
a.cc:67:24: error: invalid types 'int[int]' for array subscript
67 | short &nowl=in[i][j].fir,&nowh=in[i][j].end;
| ^
a.cc:68:24: error: 'nowh' was not declared in this scope; did you mean 'nowl'?
68 | if (nowl >= h || nowh > h){
| ^~~~
| nowl
a.cc:73:15: error: 'nowh' was not declared in this scope; did you mean 'nowl'?
73 | h=max(h,nowh);
| ^~~~
| nowl
a.cc: At global scope:
a.cc:79:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
79 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:88:33: error: cannot convert 'std::vector<std::pair<int, int> >*' to 'int*'
88 | pair<int,int> ansx=solve(px,inx,x);
| ^~~
| |
| std::vector<std::pair<int, int> >*
a.cc:57:39: note: initializing argument 2 of 'std::pair<int, int> solve(int, int*, int*)'
57 | pair<int,int> solve(int n,vector<st> *in,int *c){
| ~~~~~~~~~~~~^~
a.cc:94:36: error: cannot convert 'std::vector<std::pair<int, int> >*' to 'int*'
94 | pair<int,int> ansy= solve(px,inx,x);
| ^~~
| |
| std::vector<std::pair<int, int> >*
a.cc:57:39: note: initializing argument 2 of 'std::pair<int, int> solve(int, int*, int*)'
57 | pair<int,int> solve(int n,vector<st> *in,int *c){
| ~~~~~~~~~~~~^~
|
s025913219 | p00432 | C++ | #include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int map[10003][10003];
int main(){
while(1){
int n,r,ans=0,ans2=0,minx=10001,miny=10001,maxx=0,maxy=0;
scanf("%d%d",&n,&r);
if(n==0 && r==0)break;
memset(map,0,sizeof(map));
for(int i=0;i<n;i++){
int x1,y1,x2,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
x1++,y1++,x2++,y2++;
minx=min(min(x1,x2),minx);
miny=min(min(y1,y2),miny);
maxx=max(max(x1,x2),maxx);
maxy=max(max(y1,y2),maxy);
map[x1][y1]-=1;
map[x2][y1]+=1;
map[x1][y2]+=1;
map[x2][y2]-=1;
}
mx++,my++;
for(int i=miny;i<=maxy;i++){
int t=0;
for(int j=minx;j<=maxy;j++){
t+=map[j][i];
map[j][i]=t;
}
}
for(int i=minx;i<=maxx;i++){
int t=0;
for(int j=maxy;j>=miny;j--){
t+=map[i][j];
map[i][j]=t;
if(map[i][j]>0){
ans++;
}
}
}
printf("%d\n",ans);
if(r==2){
for(int i=minx;i<=maxx;i++){
for(int j=miny;j<=maxy;j++){
if(map[i][j]>=1){
if(map[i-1][j]<=0)ans2++;
if(map[i+1][j]<=0)ans2++;
if(map[i][j-1]<=0)ans2++;
if(map[i][j+1]<=0)ans2++;
}
}
}
printf("%d\n",ans2);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:28:17: error: 'mx' was not declared in this scope; did you mean 'maxy'?
28 | mx++,my++;
| ^~
| maxy
a.cc:28:22: error: 'my' was not declared in this scope; did you mean 'maxy'?
28 | mx++,my++;
| ^~
| maxy
|
s079705399 | p00432 | C++ | #include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int map[100000][100000];
int n,r;
int main(){
while(1){
int ans=0,ans2=0,minx=10001,miny=10001,maxx=1,maxy=1;
scanf("%d%d",&n,&r);
if(n==0 && r==0)break;
memset(map,0,sizeof(map));
for(int i=0;i<n;i++){
int x1,y1,x2,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
x1++,y1++,x2++,y2++;
minx=min(min(x1,x2),minx);
miny=min(min(y1,y2),miny);
maxx=max(max(x1,x2),maxx);
maxy=max(max(y1,y2),maxy);
map[x1][y1]-=1;
map[x2][y1]+=1;
map[x1][y2]+=1;
map[x2][y2]-=1;
}
for(int i=miny;i<=maxy;i++){
int t=0;
for(int j=minx;j<=maxy;j++){
t+=map[j][i];
map[j][i]=t;
}
}
for(int i=minx;i<=maxx;i++){
int t=0;
for(int j=maxy;j>=miny;j--){
t+=map[i][j];
map[i][j]=t;
if(map[i][j]>0){
ans++;
}
}
}
printf("%d\n",ans);
if(r==2){
for(int i=minx;i<=maxx;i++){
for(int j=miny;j<=maxy;j++){
if(map[i][j]>=1){
if(map[i-1][j]<=0)ans2++;
if(map[i+1][j]<=0)ans2++;
if(map[i][j-1]<=0)ans2++;
if(map[i][j+1]<=0)ans2++;
}
}
}
printf("%d\n",ans2);
}
}
return 0;
} | /tmp/ccTmT0zt.o: in function `main':
a.cc:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccTmT0zt.o
a.cc:(.text+0x3f): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTmT0zt.o
a.cc:(.text+0x5c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTmT0zt.o
a.cc:(.text+0x66): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccTmT0zt.o
a.cc:(.text+0x2e5): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTmT0zt.o
a.cc:(.text+0x450): relocation truncated to fit: R_X86_64_PC32 against symbol `r' defined in .bss section in /tmp/ccTmT0zt.o
collect2: error: ld returned 1 exit status
|
s701549728 | p00432 | C++ | int g[10005][10005];
int n,r;
int main(){
while(1){
int ans=0,ans2=0,minx=10001,miny=10001,maxx=1,maxy=1;
scanf("%d%d",&n,&r);
if(n==0 && r==0)break;
memset(g,0,sizeof(g));
for(int i=0;i<n;i++){
int x1,y1,x2,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
x1++,y1++,x2++,y2++;
minx=min(min(x1,x2),minx);
miny=min(min(y1,y2),miny);
maxx=max(max(x1,x2),maxx);
maxy=max(max(y1,y2),maxy);
g[x1][y1]-=1;
g[x2][y1]+=1;
g[x1][y2]+=1;
g[x2][y2]-=1;
}
for(int i=miny;i<=maxy;i++){
int t=0;
for(int j=minx;j<=maxy;j++){
t+=g[j][i];
g[j][i]=t;
}
}
for(int i=minx;i<=maxx;i++){
int t=0;
for(int j=maxy;j>=miny;j--){
t+=g[i][j];
g[i][j]=t;
if(g[i][j]>0){
ans++;
}
}
}
printf("%d\n",ans);
if(r==2){
for(int i=minx;i<=maxx;i++){
for(int j=miny;j<=maxy;j++){
if(g[i][j]>=1){
if(g[i-1][j]<=0)ans2++;
if(g[i+1][j]<=0)ans2++;
if(g[i][j-1]<=0)ans2++;
if(g[i][j+1]<=0)ans2++;
}
}
}
printf("%d\n",ans2);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:17: error: 'scanf' was not declared in this scope
7 | scanf("%d%d",&n,&r);
| ^~~~~
a.cc:9:17: error: 'memset' was not declared in this scope
9 | memset(g,0,sizeof(g));
| ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
+++ |+#include <cstring>
1 | int g[10005][10005];
a.cc:14:34: error: 'min' was not declared in this scope; did you mean 'miny'?
14 | minx=min(min(x1,x2),minx);
| ^~~
| miny
a.cc:14:30: error: 'min' was not declared in this scope; did you mean 'miny'?
14 | minx=min(min(x1,x2),minx);
| ^~~
| miny
a.cc:16:34: error: 'max' was not declared in this scope; did you mean 'maxy'?
16 | maxx=max(max(x1,x2),maxx);
| ^~~
| maxy
a.cc:16:30: error: 'max' was not declared in this scope; did you mean 'maxy'?
16 | maxx=max(max(x1,x2),maxx);
| ^~~
| maxy
a.cc:40:17: error: 'printf' was not declared in this scope
40 | printf("%d\n",ans);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int g[10005][10005];
|
s985214402 | p00432 | C++ | #include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<vector>
#include<map>
using namespace std;
typedef vector<int> PP;
typedef vector<PP> P;
int n,r;
int x1[10001],x2[10001],y1[10001],y2[10001];
short int[3000][3000];
vector<int> vx;
vector<int> vy;
void zatu(){
for(int i=0;i<n;i++){
for(int j=-1;j<=1;j++){
vx.push_back(x1[i]+j);
vx.push_back(x2[i]+j);
vy.push_back(y1[i]+j);
vy.push_back(y2[i]+j);
}
}
vx.push_back(0);
vx.push_back(10000);
vy.push_back(0);
vy.push_back(10000);
sort(vx.begin(),vx.end());
sort(vy.begin(),vy.end());
vx.erase(unique(vx.begin(),vx.end()),vx.end());
vy.erase(unique(vy.begin(),vy.end()),vy.end());
for(int i=0;i<n;i++){
x1[i]=find(vx.begin(),vx.end(),x1[i])-vx.begin();
x2[i]=find(vx.begin(),vx.end(),x2[i])-vx.begin();
y1[i]=find(vy.begin(),vy.end(),y1[i])-vy.begin();
y2[i]=find(vy.begin(),vy.end(),y2[i])-vy.begin();
}
}
int main(void){
while(1){
scanf("%d%d",&n,&r);
if(n==0 && r==0)break;
vx.clear();
vy.clear();
memset(fie,0,sizeof(fie));
for(int i=0;i<n;i++)scanf("%d%d%d%d",&x1[i],&y1[i],&x2[i],&y2[i]);
zatu();
for(int i=0;i<n;i++){
fie[x1[i]][y1[i]]++;
fie[x1[i]][y2[i]]--;
fie[x2[i]][y1[i]]--;
fie[x2[i]][y2[i]]++;
}
for(int i=0;i<=vy.size();i++){
for(int j=1;j<=vx.size();j++){
fie[j][i]+=fie[j-1][i];
}
}
for(int i=0;i<=vx.size();i++){
for(int j=1;j<=vy.size();j++){
fie[j][i]+=fie[j][i-1];
}
}
long long res=0;
for(int i=0;i<vx.size();i++){
for(int j=0;j<vy.size();j++){
if(fie[j][i]>0)res+=(long long)(vx[i+1]-vx[i])*(vy[j+1]-vy[j]);
}
}
cout << res << endl;
if(r==2)cout << res << endl;
}
return 0;
} | a.cc:11:25: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
11 | int x1[10001],x2[10001],y1[10001],y2[10001];
| ^~
a.cc:12:11: error: expected identifier before numeric constant
12 | short int[3000][3000];
| ^~~~
a.cc:12:11: error: expected ']' before numeric constant
12 | short int[3000][3000];
| ^~~~
| ]
a.cc:12:10: error: structured binding declaration cannot have type 'short int'
12 | short int[3000][3000];
| ^
a.cc:12:10: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:12:10: error: empty structured binding declaration
a.cc:12:16: error: expected initializer before '[' token
12 | short int[3000][3000];
| ^
a.cc: In function 'int main()':
a.cc:47:24: error: 'fie' was not declared in this scope
47 | memset(fie,0,sizeof(fie));
| ^~~
|
s556104424 | p00432 | C++ | #include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
using namespaece std;
typedef pair<int,int> P;
#define pb push_back
#define mp make_pair
vector<P>vec[10005];
int num[10005];
int rank[10005];
int par[10005];
void init(int n)
{
for(int i=0;i<n;i++)
{
rank[i]=0;
par[i]=i;
}
}
int find(int x)
{
if(x==par[x])
{
return x;
}
else
{
return find(par[x]);
}
}
void update(int x,int y)
{
if(par[x]==par[y])
{
return ;
}
else
{
if(rank[x]<rank[y])
{
par[x]=y;
}
else
{
par[y]=x;
if(rank[x]==rank[y])
{
rank[x]++;
}
}
}
}
bool same(int a,int b)
{
return par[a]==par[b];
}
int main()
{
int n,m;
while(1)
{
int ans1=0;
int ans2=0;
scanf("%d %d",&n,&m);
for(int i=0;i<=10000;i++)
{
vec[i].resize(0);
}
if(!n && !m) break;
for(int w=0;w<n;w++)
{
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
for(int i=a;i<c;i++)
{
vec[i].pb(mp(b,d-b));
}
}
for(int i=0;i<=10000;i++)
{
if(vec[i].size())
{
memset(num,0,sizeof(num));
for(int j=0;j<vec[i].size();j++)
{
num[vec[i][j].first]=max(num[vec[i][j].first],vec[i][j].second);
}
for(int j=0;j<=10000;j++)
{
if(j!=0)
{
num[j]=max(num[j],num[j-1]+1);
}
if(num[j]!=0)
{
ans1++;
}
}
}
}
printf("%d\n",ans1);
}
} | a.cc:5:7: error: expected nested-name-specifier before 'namespaece'
5 | using namespaece std;
| ^~~~~~~~~~
a.cc:6:9: error: 'pair' does not name a type
6 | typedef pair<int,int> P;
| ^~~~
a.cc:9:1: error: 'vector' does not name a type
9 | vector<P>vec[10005];
| ^~~~~~
a.cc: In function 'int main()':
a.cc:68:11: error: 'vec' was not declared in this scope
68 | vec[i].resize(0);
| ^~~
a.cc:77:15: error: 'vec' was not declared in this scope
77 | vec[i].pb(mp(b,d-b));
| ^~~
a.cc:8:12: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
8 | #define mp make_pair
| ^~~~~~~~~
a.cc:77:25: note: in expansion of macro 'mp'
77 | vec[i].pb(mp(b,d-b));
| ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here
1132 | make_pair(_T1&& __x, _T2&& __y)
| ^~~~~~~~~
a.cc:82:18: error: 'vec' was not declared in this scope
82 | if(vec[i].size())
| ^~~
a.cc:87:44: error: 'max' was not declared in this scope; did you mean 'std::max'?
87 | num[vec[i][j].first]=max(num[vec[i][j].first],vec[i][j].second);
| ^~~
| std::max
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
a.cc:93:34: error: 'max' was not declared in this scope; did you mean 'std::max'?
93 | num[j]=max(num[j],num[j-1]+1);
| ^~~
| std::max
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
|
s657977215 | p00432 | C++ | //39
#include<iostream>
#include<algorithm>
#include<vector>
#include<utility>
using namespace std;
int main(){
for(int n,r;cin>>n>>r,n|r;){
vector<pair<short,short> >v[10000];
for(int i=0;i<n;i++){
int x,y,xx,yy;
cin>>x>>y>>xx>>yy;
for(int j=y;j<yy;j++){
v[j].push_back(make_pair(x,xx));
}
}
for(int i=0;i<10000;i++){
sort(v[i].begin(),v[i].end());
for(int j=0;j<v[i].size();j++){
int m=v[i][j].second;
int k;
for(k=j+1;k<v[i].size()&&v[i][k].first<=m;k++){
m=max(m,v[i][k].second);
}
v[i][j].second=m;
v[i].erase(v[i].begin()+j+1,v[i].begin()+k);
}
}
int a=0;
for(int i=0;i<10000;i++){
for(int j=0;j<v[i].size();j++){
a+=v[i][j].second-v[i][j].first;
}
}
cout<<a<<endl;
if(r==2){
int l=0;
bool b[2][10000]={};
for(int i=0;i<10000;i++){
l+=v[i].size()*2;
fill(b[i&1],b[(i&1)+1],false);
for(int j=0;j<v[i].size();j++){
for(int k=v[i][j].first;k<v[i][j].second;k++){
b[i&1][k]=true;
}
}
for(int j=0;j<10000;j++){
l+=b[i&1][j]^b[!(i&1)][j];
}
}
l+=count(b[1],b[2],true);
cout<<l<<endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:25:16: error: no matching function for call to 'max(int&, short int&)'
25 | m=max(m,v[i][k].second);
| ~~~^~~~~~~~~~~~~~~~~~
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:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:25:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'short int')
25 | m=max(m,v[i][k].second);
| ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:25:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
25 | m=max(m,v[i][k].second);
| ~~~^~~~~~~~~~~~~~~~~~
|
s845663084 | p00432 | C++ | include <cstdio>
#include <utility>
#include <map>
using namespace std;
int n;
short min_x1, max_x2, min_y1, max_y2;
short x1, x2, y1, y2;
map<pair<short, short>, short> *variation;
char tiles[10002][10002];
void variation_inc(short x, short y) {
short value;
map<pair<short, short>, short>::iterator location;
location = variation->find(make_pair(x, y));
if (location != variation->end()) {
value = location->second + 1;
} else {
value = 1;
}
variation->erase(make_pair(x, y));
if (value != 0) {
variation->insert(pair<pair<short, short>, short>(make_pair(x,y), value));
}
return ;
}
void variation_dec(short x, short y) {
short value;
map<pair<short, short>, short>::iterator location;
location = variation->find(make_pair(x, y));
if (location != variation->end()) {
value = location->second - 1;
} else {
value = -1;
}
variation->erase(make_pair(x, y));
if (value != 0) {
variation->insert(pair<pair<short, short>, short>(make_pair(x,y), value));
}
return ;
}
short variation_return(short x, short y) {
short value;
map<pair<short, short>, short>::iterator location;
location = variation->find(make_pair(x, y));
if (location != variation->end()) {
value = location->second;
} else {
value = 0;
}
return value;
}
void pre_process() {
short i;
short calc[2][10002];
for (i=0;i<2;i++) {
int j;
for (j=0;j<10002;j++) {
calc[i][j] = 0;
}
}
for (i=min_y1-1;i<max_y2+1;i++) {
int j;
for (j=min_x1-1;j<max_x2+1;j++) {
calc[1][j] = variation_return(j, i);
calc[1][j] += calc[1][j-1];
calc[1][j] += calc[0][j];
calc[1][j] -= calc[0][j-1];
}
for (j=min_x1;j<max_x2+1;j++) {
tiles[i][j] = ((calc[0][j] > 0) ? 1 : 0);
calc[0][j] = calc[1][j];
}
}
return;
}
int surface() {
short i;
int sum = 0;
for (i=min_y1;i<max_y2+1;i++) {
int j;
for (j=min_x1;j<max_x2+1;j++) {
if (tiles[i][j]) {
sum++;
}
}
}
return sum;
}
int perimeter() {
short i;
int sum = 0;
for (i=min_y1;i<max_y2+2;i++) {
short j;
for (j=min_x1;j<max_x2+2;j++) {
if (tiles[i][j] + tiles[i-1][j] == 1) {
sum++;
}
if (tiles[i][j] + tiles[i][j-1] == 1) {
sum++;
}
}
}
return sum;
}
int main() {
while (1) {
short i;
int r;
scanf("%d %d", &n, &r);
if (n == 0 && r ==0) return 0;
variation = new map<pair<short, short>, short>();
min_x1 = 10000;
min_y1 = 10000;
max_x2 = 0;
max_y2 = 0;
for (i=0;i<n;i++) {
scanf("%hd %hd %hd %hd", &x1, &y1, &x2, &y2);
x1++;
x2++;
y1++;
y2++;
if (min_x1 > x1) min_x1 = x1;
if (max_x2 < x2) max_x2 = x2;
if (min_y1 > y1) min_y1 = y1;
if (max_y2 < y2) max_y2 = y2;
variation_inc(x1, y1);
variation_dec(x1, y2);
variation_dec(x2, y1);
variation_inc(x2, y2);
}
for (i=0;i<10002;i++) {
short j;
for (j=0;j<10002;j++) {
tiles[i][j] = 0;
}
}
pre_process();
printf("%d\n", surface());
if (r == 2) {
printf("%d\n", perimeter());
}
delete variation;
}
} | a.cc:1:1: error: 'include' does not name a type
1 | include <cstdio>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/utility:69,
from a.cc:2:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^
/usr/include/c++/14/type_traits:1868:18: error: '_Sz' was not declared in this scope
1868 | : __select<_Sz, _List<_UInts...>>
| ^~~
/usr/include/c++/14/type_traits:1868:38: error: template argument 1 is invalid
1868 | : __select<_Sz, _List<_UInts...>>
| ^~
/usr/include/c++/14/type_traits:1859:60: error: '__size' is not a member of 'std::__make_unsigned_selector_base::_List<unsigned char, short unsigned int, unsigned int, long unsigned int, long long unsigned int>'
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~ |
s001527005 | p00432 | C++ | #include <iostream>
int main()
{
int p[10010][10010]={0};
while(1)
{
int n;
cin >> n;
break;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> n;
| ^~~
| 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
| ^~~
|
s450331805 | p00432 | C++ | #include <iostream>
using namespace std;
int main()
{
int n,r;
while(1)
{
cin >> n >> r;
int m[10010][10010];
memset(m,0,sizeof(m));
int j=0;
for(int i=0;i<n;i++)
{
int a,b,c,d;
cin >> a >> b >> c>>d;
m[i][j];
j++;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:1: error: 'memset' was not declared in this scope
10 | memset(m,0,sizeof(m));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s572655696 | p00432 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
int n,r;
while(1)
{
cin >> n >> r;
int m[10010][10010];
memset(m,0,sizeof(m));
return 0;
} | a.cc: In function 'int main()':
a.cc:13:2: error: expected '}' at end of input
13 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s866283853 | p00432 | C++ | #include <algorithm>
#include <iostream>
#include <map>
using namespace std;
typedef pair<int,int> P;
#define fi first
#define sec second
int a,b,c,d,n,r;
int le,ri,up,down;
int area,len;
map<P,int> m;
map<P,int>::iterator it;
int imos[2][10004];
int main()
{
while(1)
{
memset(imos,0,sizeof(imos));
area=0;len=0;
le=down=INF;
ri=up=1;
m.clear();
cin >> n >> r;
if(n==0&&r==0)break;
for(int i=0;i<n;i++)
{
cin >> a >> b >> c >> d;
a++;b++;c++;d++;
ri=max(ri,c);
le=min(le,a);
up=max(up,d);
down=min(down,b);
m[P(a,b)]++;
m[P(a,d)]--;
m[P(c,b)]--;
m[P(c,d)]++;
}
for(int i=le;i<=ri+1;i++)
{
for(int j=down;j<=up+1;j++)
{
imos[i%2][j]=imos[i%2][j-1];
it=m.find(P(i,j));
if(it!=m.end())imos[i%2][j]+=(*it).sec;
}
for(int j=down;j<=up+1;j++)
{
imos[i%2][j]+=imos[(i-1)%2][j];
if(imos[i%2][j]>0)area++;
if(!!imos[i%2][j-1]!=!!imos[i%2][j])len++;
if(!!imos[(i-1)%2][j]!=!!imos[i%2][j])len++;
cout << imos[i%2][j];
}
cout << endl;
}
cout << area << endl;
if(r==2)cout << len << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:9: error: 'memset' was not declared in this scope
18 | memset(imos,0,sizeof(imos));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <map>
+++ |+#include <cstring>
4 | using namespace std;
a.cc:20:17: error: 'INF' was not declared in this scope
20 | le=down=INF;
| ^~~
|
s028136751 | p00432 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
using namespace std;
typedef pair<int,int> P;
#define INF 1000000000
#define fi first
#define sec second
int a,b,c,d,n,r;
int le,ri,up,down;
int area,len;
map<P,int> *m;
map<P,int>::iterator it;
int imos[2][10004];
int main()
{
while(1)
{
memset(imos,0,sizeof(imos));
area=0;len=0;
le=down=INF;
ri=up=1;
m=new map<P,int>();
scanf("%d %d",&n,&r);
if(n==0&&r==0)break;
for(int i=0;i<n;i++)
{
scanf("%d %d %d %d",&a,&b,&c,&d);
a++;b++;c++;d++;
ri=max(ri,c);
le=min(le,a);
up=max(up,d);
down=min(down,b);
m[P(a,b)]++;
m[P(a,d)]--;
m[P(c,b)]--;
m[P(c,d)]++;
}
for(int i=le;i<=ri+1;i++)
{
for(int j=down;j<=up+1;j++)
{
imos[i%2][j]=imos[i%2][j-1];
it=m.find(P(i,j));
if(it!=m.end())imos[i%2][j]+=(*it).sec;
}
for(int j=down;j<=up+1;j++)
{
imos[i%2][j]+=imos[(i-1)%2][j];
if(imos[i%2][j]>0)area++;
if(!!imos[i%2][j-1]!=!!imos[i%2][j])len++;
if(!!imos[(i-1)%2][j]!=!!imos[i%2][j])len++;
}
}
cout << area << endl;
if(r==2)cout << len << endl;
delete m;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:36:14: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>*' and 'P' {aka 'std::pair<int, int>'})
36 | m[P(a,b)]++;
| ^
a.cc:37:14: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>*' and 'P' {aka 'std::pair<int, int>'})
37 | m[P(a,d)]--;
| ^
a.cc:38:14: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>*' and 'P' {aka 'std::pair<int, int>'})
38 | m[P(c,b)]--;
| ^
a.cc:39:14: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>*' and 'P' {aka 'std::pair<int, int>'})
39 | m[P(c,d)]++;
| ^
a.cc:46:22: error: request for member 'find' in 'm', which is of pointer type 'std::map<std::pair<int, int>, int>*' (maybe you meant to use '->' ?)
46 | it=m.find(P(i,j));
| ^~~~
a.cc:47:26: error: request for member 'end' in 'm', which is of pointer type 'std::map<std::pair<int, int>, int>*' (maybe you meant to use '->' ?)
47 | if(it!=m.end())imos[i%2][j]+=(*it).sec;
| ^~~
|
s407938390 | p00432 | C++ |
import java.util.*;
import java.lang.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
int MAX = 10005;
void run() {
Scanner sc = new Scanner(System.in);
for(;;) {
int n = sc.nextInt(), r = sc.nextInt();
if ((n|r) == 0) break;
E[] G = new E[MAX];
for (int i = 0; i < MAX;i++) G[i] = new E();
for (int i=0;i<n;i++) {
int x1 = sc.nextInt()+1, y1 = sc.nextInt()+1, x2 = sc.nextInt()+1, y2 = sc.nextInt()+1;
G[y1].add(new P(x1, x2, true));
G[y2].add(new P(x1, x2, false));
}
int a = 0, l = 0, t = 1, minx = MAX, maxx = 0;
int[][] area = new int[2][MAX];
for (E e: G) {
fill(area[t], 0);
for (P p: e) {
area[t][p.x1] += p.c ? 1: -1; area[t][p.x2] += p.c ? -1 : 1;
minx = min(minx, p.x1); maxx = max(maxx, p.x2);
}
for (int i = minx; i <= maxx; i++) {
area[t][i] += area[t][i-1] + area[1-t][i] - area[1-t][i-1];
if (area[t][i] > 0) a++;
if (((area[t][i] | area[1-t][i]) != 0 ) && area[t][i] * area[1-t][i] == 0) l++;
if (((area[t][i] | area[t][i-1]) != 0 ) && area[t][i] * area[t][i-1] == 0) l++;
}
// debug(area[t]);
t ^= 1;
}
System.out.println(a);
if (r == 2) System.out.println(l);
}
}
class E extends ArrayList<P>{};
class P {
int x1, x2; boolean c;
P(int x1, int x2, boolean c) {
this.x1 = x1;
this.x2 = x2;
this.c = c;
}
}
void debug(Object... os) {
System.out.println(deepToString(os));
}
public static void main (String[] args) throws java.lang.Exception
{
new Main().run();
}
} | a.cc:2:1: error: 'import' does not name a type
2 | import java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.lang.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.io.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import static java.util.Arrays.*;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import static java.util.Collections.*;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
7 | import static java.lang.Math.*;
| ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:47:17: error: field 'extends' has incomplete type 'E'
47 | class E extends ArrayList<P>{};
| ^~~~~~~
a.cc:47:15: note: forward declaration of 'class E'
47 | class E extends ArrayList<P>{};
| ^
a.cc:47:17: error: expected ';' at end of member declaration
47 | class E extends ArrayList<P>{};
| ^~~~~~~
| ;
a.cc:47:25: error: 'ArrayList' does not name a type
47 | class E extends ArrayList<P>{};
| ^~~~~~~~~
a.cc:50:29: error: 'boolean' does not name a type; did you mean 'bool'?
50 | int x1, x2; boolean c;
| ^~~~~~~
| bool
a.cc:51:35: error: 'boolean' has not been declared
51 | P(int x1, int x2, boolean c) {
| ^~~~~~~
a.cc:56:10: error: expected ';' after class definition
56 | }
| ^
| ;
a.cc:58:20: error: 'Object' has not been declared
58 | void debug(Object... os) {
| ^~~~~~
a.cc:58:30: error: expansion pattern 'int' contains no parameter packs
58 | void debug(Object... os) {
| ^~
a.cc:62:15: error: expected ':' before 'static'
62 | public static void main (String[] args) throws java.lang.Exception
| ^~~~~~~
| :
a.cc:62:34: error: 'String' has not been declared
62 | public static void main (String[] args) throws java.lang.Exception
| ^~~~~~
a.cc:62:43: error: expected ',' or '...' before 'args'
62 | public static void main (String[] args) throws java.lang.Exception
| ^~~~
a.cc:62:47: error: expected ';' at end of member declaration
62 | public static void main (String[] args) throws java.lang.Exception
| ^
| ;
a.cc:62:49: error: 'throws' does not name a type
62 | public static void main (String[] args) throws java.lang.Exception
| ^~~~~~
a.cc:66:2: error: expected ';' after class definition
66 | }
| ^
| ;
a.cc: In member function 'void Main::run()':
a.cc:14:17: error: 'Scanner' was not declared in this scope
14 | Scanner sc = new Scanner(System.in);
| ^~~~~~~
a.cc:16:33: error: 'sc' was not declared in this scope
16 | int n = sc.nextInt(), r = sc.nextInt();
| ^~
a.cc:17:32: error: 'r' was not declared in this scope
17 | if ((n|r) == 0) break;
| ^
a.cc:18:26: error: structured binding declaration cannot have type 'E'
18 | E[] G = new E[MAX];
| ^~
a.cc:18:26: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:18:26: error: empty structured binding declaration
a.cc:18:29: error: expected initializer before 'G'
18 | E[] G = new E[MAX];
| ^
a.cc:19:54: error: 'G' was not declared in this scope
19 | for (int i = 0; i < MAX;i++) G[i] = new E();
| ^
a.cc:19:67: error: invalid use of incomplete type 'class E'
19 | for (int i = 0; i < MAX;i++) G[i] = new E();
| ^
a.cc:47:15: note: forward declaration of 'class E'
47 | class E extends ArrayList<P>{};
| ^
a.cc:22:33: error: 'G' was not declared in this scope
22 | G[y1].add(new P(x1, x2, true));
| ^
a.cc:22:35: error: 'y1' was not declared in this scope; did you mean 'x1'?
22 | G[y1].add(new P(x1, x2, true));
| ^~
| x1
a.cc:22:53: error: 'x2' was not declared in this scope; did you mean 'x1'?
22 | G[y1].add(new P(x1, x2, true));
| ^~
| x1
a.cc:23:35: error: 'y2' was not declared in this scope
23 | G[y2].add(new P(x1, x2, false));
| ^~
a.cc:26:28: error: structured binding declaration cannot have type 'int'
26 | int[][] area = new int[2][MAX];
| ^~
a.cc:26:28: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:26:28: error: empty structured binding declaration
a.cc:26:30: error: expected initializer before '[' token
26 | int[][] area = new int[2][MAX];
| ^
a.cc:27:32: error: variable 'E e' has initializer but incomplete type
27 | for (E e: G) {
| ^
a.cc:27:35: error: 'G' was not declared in this scope
27 | for (E e: G) {
| ^
a.cc:28:38: error: 'area' was not declared in this scope
28 | fill(area[t], 0);
| ^~~~
a.cc:28:33: error: 'fill' was not declared in this scope
28 | fill(area[t], 0);
| ^~~~
a.cc:30:51: error: 'int Main::P::x1' is private within this context
30 | area[t][p.x1] += p.c ? 1: -1; area[t][p.x2] += p.c ? -1 : 1;
| ^~
a.cc:50:21: note: declared private here
50 | int x1, x2; boolean c;
| ^~
a.cc:30:60: error: 'class Main::P' has no member named 'c'
30 | area[t][p.x1] += p.c ? 1: -1; area[t][p.x2] += p.c ? -1 : 1;
| ^
a.cc:30:81: error: 'int Main::P::x2' is private within this context
30 | area[t][p.x1] += p.c ? 1: -1; area[t][p.x2] += p.c ? -1 : 1;
| ^~
a.cc:50:25: note: declared private here
50 | int x1, x2; boolean c;
| ^~
a.cc:30:90: error: 'class Main::P' has no member named 'c'
30 | area[t][p.x1] += p.c ? 1: -1; area[t][p.x2] += p.c ? -1 : 1;
| ^
a.cc:31:60: error: 'int Main::P::x1' is private within this context
31 | minx = min(minx, p.x1); maxx = max(maxx, p.x2);
| ^~
a.cc:50:21: note: declared private here
50 | int x1, x2; boolean c;
| ^~
a.cc:31:48: error: 'min' was not declared in this scope; did you mean 'main'?
31 | minx = min(minx, p.x1); maxx = max(maxx, p.x2);
| ^~~
| main
a.cc:31:84: error: 'int Main::P::x2' is private within this context
31 | minx = min(minx, p.x1); maxx = max(maxx, p.x2);
| ^~
a.cc:50:25: note: declared private here
50 | int x1, x2; boolean c;
| ^~
a.cc:31:72: error: 'max' was not declared in this scope; did you mean 'maxx'?
31 | minx = min(minx, p.x1); maxx = max(maxx, p.x2);
| ^~~
| maxx
a.cc:42:25: error: 'System' was not declared in this scope
42 | System.out.println(a);
| ^~~~~~
a.cc:43:29: error: 'r' was not declared in this scope
43 | if (r == 2) System.out.println(l);
| ^
a.cc: In constructor 'Main::P::P(int, int, int)':
a.cc:52:30: error: request for member 'x1' in '(Main::P*)this', which is of pointer type 'Main::P*' (maybe you meant to use '->' ?)
52 | this.x1 = x1;
| ^~
a.cc:53:30: error: request for member 'x2' in '(Main::P*)this', which is of pointer type 'Main::P*' (maybe you meant to use '->' ?)
53 | this.x2 = x2;
| |
s851391622 | p00432 | C++ | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <string.h>
#include <stack>
#include <list>
#include <vector>
using namespace std;
int N, R;
bool **cover;
int dx[4] = {0,1,0,-1};
int dy[4] = {-1,0,1,0};
int main(){
cover = new bool*[10002];
for(int i=0; i<10002; ++i){
cover[i] = new bool[10002];
}
for(int j=0; j<10002; ++j){
for(int i=0; i<10002; ++i){
cover[j][i] = false;
}
}
while(cin >> N >> R && N){
int a,b,c,d;
for(int k=0; k<N; ++k){
cin >> a >> b >> c >> d;
for(int j=b+1; j<d+1; ++j){
for(int i=a+1; i<c+1; ++i){
cover[j][i] = true;
}
}
}
int area_c = 0;
int len = 0;
for(int j=1; j<10001; ++j){
for(int i=1; i<10001; ++i){
if(cover[j][i] == true){
area_c++;
for(int a = 0; a<4; ++a){
int nx = i+dx[a];
int ny = j+dy[a];
if(cover[ny][nx] == false) len++;
}
}
}
}
cout << area_c << endl;
if(R==2) cout << len << endl;
}
for(int i=0; i<10001; ++i){
delete[] cover[i];
}
delete[] cover;
return 0;
}#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <string.h>
#include <stack>
#include <list>
#include <vector>
using namespace std;
int N, R;
bool **cover;
int dx[4] = {0,1,0,-1};
int dy[4] = {-1,0,1,0};
int main(){
cover = new bool*[10002];
for(int i=0; i<10002; ++i){
cover[i] = new bool[10002];
}
for(int j=0; j<10002; ++j){
for(int i=0; i<10002; ++i){
cover[j][i] = false;
}
}
while(cin >> N >> R && N){
int a,b,c,d;
for(int k=0; k<N; ++k){
cin >> a >> b >> c >> d;
for(int j=b+1; j<d+1; ++j){
for(int i=a+1; i<c+1; ++i){
cover[j][i] = true;
}
}
}
int area_c = 0;
int len = 0;
for(int j=1; j<10001; ++j){
for(int i=1; i<10001; ++i){
if(cover[j][i] == true){
area_c++;
for(int a = 0; a<4; ++a){
int nx = i+dx[a];
int ny = j+dy[a];
if(cover[ny][nx] == false) len++;
}
}
}
}
cout << area_c << endl;
if(R==2) cout << len << endl;
}
for(int i=0; i<10001; ++i){
delete[] cover[i];
}
delete[] cover;
return 0;
} | a.cc:60:2: error: stray '#' in program
60 | }#include <cstdio>
| ^
a.cc:60:3: error: 'include' does not name a type
60 | }#include <cstdio>
| ^~~~~~~
a.cc:70:5: error: redefinition of 'int N'
70 | int N, R;
| ^
a.cc:11:5: note: 'int N' previously declared here
11 | int N, R;
| ^
a.cc:70:8: error: redefinition of 'int R'
70 | int N, R;
| ^
a.cc:11:8: note: 'int R' previously declared here
11 | int N, R;
| ^
a.cc:71:8: error: redefinition of 'bool** cover'
71 | bool **cover;
| ^~~~~
a.cc:12:8: note: 'bool** cover' previously declared here
12 | bool **cover;
| ^~~~~
a.cc:72:5: error: redefinition of 'int dx [4]'
72 | int dx[4] = {0,1,0,-1};
| ^~
a.cc:13:5: note: 'int dx [4]' previously defined here
13 | int dx[4] = {0,1,0,-1};
| ^~
a.cc:73:5: error: redefinition of 'int dy [4]'
73 | int dy[4] = {-1,0,1,0};
| ^~
a.cc:14:5: note: 'int dy [4]' previously defined here
14 | int dy[4] = {-1,0,1,0};
| ^~
a.cc:74:5: error: redefinition of 'int main()'
74 | int main(){
| ^~~~
a.cc:15:5: note: 'int main()' previously defined here
15 | int main(){
| ^~~~
|
s468116778 | p00433 | Java | import java.util.Scanner;
public class Score {
public static void main(String[] args) {
int ans = 0;
for(int i=0;i<2;i++){
int sum=0;
for(int j=0;j<4;j++){
Scanner stdIn = new Scanner(System.in);
int p = stdIn.nextInt();
sum += p;
}
ans = Math.max(sum, ans);
}
System.out.println(ans);
}
} | Main.java:2: error: class Score is public, should be declared in a file named Score.java
public class Score {
^
1 error
|
s485740907 | p00433 | Java | import java.until.Scanner;
public class Main {
public static void main(String[] args) {
int a = 0;
int b = 0;
java.util.Scanner stdIn = new Scanner(System.in);
for(int i=0;i<4;i++){
int p = stdIn.nextInt();
a += p;
}
for(int i=0;i<4;i++){
int p = stdIn.nextInt();
b += p;
}
System.out.println(Math,max(a,b));
}
} | Main.java:1: error: package java.until does not exist
import java.until.Scanner;
^
Main.java:7: error: cannot find symbol
java.util.Scanner stdIn = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:16: error: cannot find symbol
System.out.println(Math,max(a,b));
^
symbol: variable Math
location: class Main
Main.java:16: error: cannot find symbol
System.out.println(Math,max(a,b));
^
symbol: method max(int,int)
location: class Main
4 errors
|
s789124150 | p00433 | Java | import java.util.Scanner;
public class q0510 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int[] a = new int[4];
int[] b = new int[4];
int sumA = 0, sumB = 0;
for(int i = 0; i < 4; i++){
a[i] = in.nextInt();
sumA += a[i];
}
for(int i = 0; i < 4; i++){
b[i] = in.nextInt();
sumB += b[i];
}
if(sumA < sumB){
System.out.println(sumB);
}
else{
System.out.println(sumA);
}
}
} | Main.java:3: error: class q0510 is public, should be declared in a file named q0510.java
public class q0510 {
^
1 error
|
s432116410 | p00433 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int sumA, sumB;
while((n = sc.nextInt()) != 0){
sumA = sumB = 0;
for(int i = 0; i < 4; i++){
sumA += sc.nextInt();
}
for(int i = 0; i < 4; i++){
sumB += sc.nextInt();
}
System.out.println(Math.max(sumA, sumB));
}
}
} | Main.java:7: error: cannot find symbol
while((n = sc.nextInt()) != 0){
^
symbol: variable n
location: class Main
1 error
|
s879723059 | p00433 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args){
int sumA = 0;
int sumB = 0;
for(int i=0;i<4;i++)sumA += stdIn.nextInt();
for(int j=0;j<4;j++)sumB += stdIn.nextInt();
if(sumA >= sumB)System.out.println(sumA);
else if(sumA < sumB)System.out.println(sumB);
}
} | Main.java:7: error: cannot find symbol
for(int i=0;i<4;i++)sumA += stdIn.nextInt();
^
symbol: variable stdIn
location: class Main
Main.java:8: error: cannot find symbol
for(int j=0;j<4;j++)sumB += stdIn.nextInt();
^
symbol: variable stdIn
location: class Main
2 errors
|
s113065055 | p00433 | C | #include<stdio.h>
int main(void)
{
int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
s=a1+a2+a3+a4;
t=b1+b2+b3+b4;
if(s<=t){
printf("%d\n",t);
}
else if(t<=s){
printf("%d\n",s);
}
return 0;
}
| main.c: In function 'main':
main.c:4:12: error: stray '\343' in program
4 | int<U+3000>a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~~~~~~~
|
s467893088 | p00433 | C | #include<stdio.h>
int main(void)
{
int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
s=a1+a2+a3+a4;
t=b1+b2+b3+b4;
if(s<t){
printf("%d\n",t);
}
else if(t<s){
printf("%d\n",s);
}
else if(s==t){
printf("%d\n",s);
}
return 0;
}
| main.c: In function 'main':
main.c:4:12: error: stray '\343' in program
4 | int<U+3000>a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~~~~~~~
|
s563895316 | p00433 | C | #include<stdio.h>
int main(void)
{
int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
s=a1+a2+a3+a4;
t=b1+b2+b3+b4;
if(s<t){
printf("%d\n",t);
}
else if(t<s){
printf("%d\n",s);
}
else if(s==t){
printf("%d\n",s);
}
return 0;
}
| main.c: In function 'main':
main.c:4:12: error: stray '\343' in program
4 | int<U+3000>a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~~~~~~~
|
s432759044 | p00433 | C | #include<stdio.h>
int a,b,i,x;
int main(){
for(i=0;i<4;i++){
scanf("%d",&x);
a+=n;
}
for(i=0;i<4;i++){
scanf("%d",&x);
b+=n;
}
if(a>b) printf("%d\n",a);
else printf("%d\n",b);
return 0;
} | main.c: In function 'main':
main.c:6:4: error: 'n' undeclared (first use in this function)
6 | a+=n;
| ^
main.c:6:4: note: each undeclared identifier is reported only once for each function it appears in
|
s333652010 | p00433 | C | #include<stdio.h>
int main(){
int a[4],i,at=0,bt=0;
for(i=0;i<3;i++){
scanf("%d",&a[i]);
at++=a[i];
}
for(i=0;i<3;i++){
scanf("%d",&a[i]);
bt++=a[i];
}
if(at<bt){
printf("%d\n",bt);
}
else{
printf("%d\n",at);
}
return(0);
} | main.c: In function 'main':
main.c:6:9: error: lvalue required as left operand of assignment
6 | at++=a[i];
| ^
main.c:10:9: error: lvalue required as left operand of assignment
10 | bt++=a[i];
| ^
|
s848385668 | p00433 | C | #include <stdio.h>
int main(){
int a,b,c,d,e,f,g
while(1){
scanf("%d %d %d %d",&a,&b,&c,&d);
scanf("%d %d %d %d",&e,&f,&g,&h);
i=a+b+c+d;
j=e+f+g+h;
if(i==j){
printf("%d\n",i);
}else if(i<j){
printf("%d\n",j);
}else if(i>j){
printf("%d\n",i);
}
}
} | main.c: In function 'main':
main.c:5:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'while'
5 | while(1){
| ^~~~~
|
s118814098 | p00433 | C | include<stdio.h>
int main(void){
int a,b,c,d,a1,b1,c1,d1;
scanf("%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&a1,&b1,&c1,&d1);
if(a+b+c+d>=a1+b1+c1+d1){printf("%d\n",a+b+c+d);}
else{printf("%d\n",a1+b1+c1+d1);}
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s074347548 | p00433 | C | include<stdio.h>
int main(void){
int a,b,c,d,a1,b1,c1,d1;
scanf("%d%d%d%d",&a,&b,&c,&d);
scanf("%d%d%d%d",&a1,&b1,&c1,&d1);
if(a+b+c+d>=a1+b1+c1+d1){printf("%d\n",a+b+c+d);}
else{printf("%d\n",a1+b1+c1+d1);}
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s588583571 | p00433 | C | include<stdio.h>
int main(void){
int a,b,c,d,a1,b1,c1,d1,an,bn;
scanf("%d%d%d%d",&a,&b,&c,&d);
scanf("%d%d%d%d",&a1,&b1,&c1,&d1);
an=a+b+c+d;
bn=a1+b1+c1+d1;
if(an>=bn){printf("%d\n",an);}
else{printf("%d\n",bn);}
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s595113051 | p00433 | C | #include<stdio.h>
int main(){]
int a[4],b[4],asum,bsum;
scanf("%d %d %d %d\n%d %d %d %d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]);
asum = a[0]+a[1]+a[2]+a[3];
bsum = b[0]+b[1]+b[2]+b[3];
if(asum>bsum)printf("%d\n",asum);else printf("%d\n",bsum);
return 0;
} | main.c: In function 'main':
main.c:2:12: error: expected statement before ']' token
2 | int main(){]
| ^
|
s463062629 | p00433 | C | #include<stdio.h>
int main(void){
int a[4]={0};
int b[4]={0};
int t1=0,t2=0;
//for(int j=0;j<2;j++){ if (i=1) scanf a[]
//for(int i=0;i<4;i++){
scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]);
scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);
//}
//}
for(int k=0;i<4;k++){
t1+=a[k];
t2+=b[k];
}
if(t1>=t2) printf("%d",t1);
else printf("%d",t2);
return 0;
} | main.c: In function 'main':
main.c:19:13: error: 'i' undeclared (first use in this function)
19 | for(int k=0;i<4;k++){
| ^
main.c:19:13: note: each undeclared identifier is reported only once for each function it appears in
|
s125915560 | p00433 | C | #include<stdio.h>
int main(void){int a[4]={0};
int b[4]={0};
int t1=0,t2=0;
int k;
scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]);
scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);
for( k=0;i<4;k++){
t1+=a[k];
t2+=b[k];
}
if(t1>=t2) printf("%d",t1);
else printf("%d",t2);
return 0;
} | main.c: In function 'main':
main.c:12:10: error: 'i' undeclared (first use in this function)
12 | for( k=0;i<4;k++){
| ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
|
s979662421 | p00433 | C | #include<stdio.h>
int main(void){int a[4]={0};
int b[4]={0};
int t1=0,t2=0;
int k;
scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]);
scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);
for( k=0;i<4;k++){
t1+=a[k];
t2+=b[k];
}
if(t1>=t2) printf("%d\n",t1);
else printf("%d\n",t2);
return 0;
} | main.c: In function 'main':
main.c:12:10: error: 'i' undeclared (first use in this function)
12 | for( k=0;i<4;k++){
| ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
|
s143760538 | p00433 | C | #include<stdio.h>
int main(void){int a[4]={0};
int b[4]={0};
int t1=0,t2=0;
int k;
scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]);
scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);
for( k=0;i<4;k++){
t1+=a[k];
t2+=b[k];
}
if(t1>=t2) printf("%d\n",t1);
else printf("%d\n",t2);
return 0;
} | main.c: In function 'main':
main.c:12:10: error: 'i' undeclared (first use in this function)
12 | for( k=0;i<4;k++){
| ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
|
s691282100 | p00433 | C | #include <stdio.h>
int main(void){
int aj,as,ar,ae,bj,bs,br,be,S,T;
scanf("%d %d %d %d", &ai,&as,&ar,&ae);
scanf("%d %d %d %d", &bi,&bs,&br,&be);
S=ai+as+ar+ae;
T=bi+bs+br+be;
if(S>=T) printf("%d",S);
else printf("%d",T);
retrun 0;
} | main.c: In function 'main':
main.c:7:23: error: 'ai' undeclared (first use in this function); did you mean 'ae'?
7 | scanf("%d %d %d %d", &ai,&as,&ar,&ae);
| ^~
| ae
main.c:7:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:23: error: 'bi' undeclared (first use in this function); did you mean 'be'?
8 | scanf("%d %d %d %d", &bi,&bs,&br,&be);
| ^~
| be
main.c:16:1: error: 'retrun' undeclared (first use in this function)
16 | retrun 0;
| ^~~~~~
main.c:16:7: error: expected ';' before numeric constant
16 | retrun 0;
| ^~
| ;
|
s119309876 | p00433 | C | #include <stdio.h>
int main(void){
int aj,as,ar,ae,bj,bs,br,be,S,T;
scanf("%d %d %d %d", &ai,&as,&ar,&ae);
scanf("%d %d %d %d", &bi,&bs,&br,&be);
S=ai+as+ar+ae;
T=bi+bs+br+be;
if(S>=T) printf("%d\n",S);
else printf("%d\n",T);
return 0;
} | main.c: In function 'main':
main.c:7:23: error: 'ai' undeclared (first use in this function); did you mean 'ae'?
7 | scanf("%d %d %d %d", &ai,&as,&ar,&ae);
| ^~
| ae
main.c:7:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:23: error: 'bi' undeclared (first use in this function); did you mean 'be'?
8 | scanf("%d %d %d %d", &bi,&bs,&br,&be);
| ^~
| be
|
s277204664 | p00433 | C | #include <stdio.h>
int main(void){
int aj,as,ar,ae,bj,bs,br,be,S,T;
scanf("%d %d %d %d", &ai,&as,&ar,&ae);
scanf("%d %d %d %d", &bi,&bs,&br,&be);
S=ai+as+ar+ae;
T=bi+bs+br+be;
if(S>=T) printf("%d\n",S);
else printf("%d\n",T);
return 0;
} | main.c: In function 'main':
main.c:7:23: error: 'ai' undeclared (first use in this function); did you mean 'ae'?
7 | scanf("%d %d %d %d", &ai,&as,&ar,&ae);
| ^~
| ae
main.c:7:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:23: error: 'bi' undeclared (first use in this function); did you mean 'be'?
8 | scanf("%d %d %d %d", &bi,&bs,&br,&be);
| ^~
| be
|
s950587133 | p00433 | C | #include <stdio.h>
int main(void){
int aj,as,ar,ae,bj,bs,br,be,S,T;
scanf("%d %d %d %d", &ai,&as,&ar,&ae);
scanf("%d %d %d %d", &bi,&bs,&br,&be);
S=ai+as+ar+ae;
T=bi+bs+br+be;
if(S>=T) printf("%d\n",S);
else printf("%d\n",T);
return 0;
} | main.c: In function 'main':
main.c:7:23: error: 'ai' undeclared (first use in this function); did you mean 'ae'?
7 | scanf("%d %d %d %d", &ai,&as,&ar,&ae);
| ^~
| ae
main.c:7:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:23: error: 'bi' undeclared (first use in this function); did you mean 'be'?
8 | scanf("%d %d %d %d", &bi,&bs,&br,&be);
| ^~
| be
|
s472748572 | p00433 | C | #include <stdio.h>
int main(void){
int j1, s1, r1, e1;
int j2, s2, r2, e2;
int sum1 = 0, sum2 = 0;
scanf("%d %d %d %d %d %d %d %d", &j1, &s1, &r1, &e1, &j2, &s2, &r2, &e2);
sum1 = j1+s1+r1+e1;
sum2 = l2+s2+r2+e2;
if (sum1 > sum2) printf("%d\n", sum1);
else printf("%d\n", sum2);
return 0;
} | main.c: In function 'main':
main.c:11:16: error: 'l2' undeclared (first use in this function); did you mean 'e2'?
11 | sum2 = l2+s2+r2+e2;
| ^~
| e2
main.c:11:16: note: each undeclared identifier is reported only once for each function it appears in
|
s440089651 | p00433 | C | #include "stdlib.h"
#include "stdafx.h"
typedef struct {
int math;
int information;
int science;
int English;
}StudentScore;
int main(void)
{
int sum1 = 0, sum2 = 0;
StudentScore StudentScore1;
StudentScore StudentScore2;
scanf("%d", &StudentScore1.math);
printf(" ");
scanf("%d", &StudentScore1.information);
printf(" ");
scanf("%d", &StudentScore1.science);
printf(" ");
scanf("%d", &StudentScore1.English);
sum1 += (StudentScore1.math + StudentScore1.information + StudentScore1.science + StudentScore1.English);
printf("\n");
scanf("%d", &StudentScore2.math);
printf(" ");
scanf("%d", &StudentScore2.information);
printf(" ");
scanf("%d", &StudentScore2.science);
printf(" ");
scanf("%d", &StudentScore2.English);
sum2 += (StudentScore2.math + StudentScore2.information + StudentScore2.science + StudentScore2.English);
if (sum1 > sum2) { return sum1;}
else { return sum2; }
} | main.c:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s588066153 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
a=[0].to_i
b=[1].to_i
c=[2].to_i
d=[3].to_i
e=[4].to_i
f=[5].to_i
g=[6].to_i
h=[7].to_i
i=[8].to_i
k=a+b+c+d
l=e+f+g+h
if (l>k) {
puts l
}
(l<k){
puts k
}
if (l=k) {
puts l
return 0;
} | main.c: In function 'main':
main.c:15:2: error: 'a' undeclared (first use in this function)
15 | a=[0].to_i
| ^
main.c:15:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:4: error: expected expression before '[' token
15 | a=[0].to_i
| ^
main.c:37:2: error: expected declaration or statement at end of input
37 | }
| ^
|
s740714323 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
int a,b,c,d
a=[0].to_i
b=[1].to_i
c=[2].to_i
d=[3].to_i
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
int e,f,g,h
e=[4].to_i
f=[5].to_i
g=[6].to_i
h=[7].to_i
int k,l
k=a+b+c+d
l=e+f+g+h
if (l>k) {
puts l
}
(l<k){
puts k
}
if (l=k) {
puts l
return 0;
} | main.c: In function 'main':
main.c:10:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a'
10 | a=[0].to_i
| ^
main.c:15:21: error: expected ';' before ')' token
15 | for(i=0;i<4;i++){
| ^
| ;
main.c:15:21: error: expected statement before ')' token
main.c:19:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'e'
19 | e=[4].to_i
| ^
main.c:32:5: error: 'l' undeclared (first use in this function)
32 | (l<k){
| ^
main.c:32:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:7: error: 'k' undeclared (first use in this function)
32 | (l<k){
| ^
main.c:32:9: error: expected ';' before '{' token
32 | (l<k){
| ^
| ;
main.c:38:2: error: expected declaration or statement at end of input
38 | }
| ^
|
s061416321 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
int a,b,c,d;
a=[0].to_i;
b=[1].to_i;
c=[2].to_i;
d=[3].to_i;
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
int e,f,g,h;
e=[4].to_i;
f=[5].to_i;
g=[6].to_i;
h=[7].to_i;
int k,l;
k=a+b+c+d;
l=e+f+g+h;
if (l>k) {
puts l;
}
(l<k){
puts k;
}
if (l=k) {
puts l;
return 0;
} | main.c: In function 'main':
main.c:10:4: error: expected expression before '[' token
10 | a=[0].to_i;
| ^
main.c:11:3: error: expected expression before '[' token
11 | b=[1].to_i;
| ^
main.c:12:3: error: expected expression before '[' token
12 | c=[2].to_i;
| ^
main.c:13:3: error: expected expression before '[' token
13 | d=[3].to_i;
| ^
main.c:19:3: error: expected expression before '[' token
19 | e=[4].to_i;
| ^
main.c:20:3: error: expected expression before '[' token
20 | f=[5].to_i;
| ^
main.c:21:3: error: expected expression before '[' token
21 | g=[6].to_i;
| ^
main.c:22:3: error: expected expression before '[' token
22 | h=[7].to_i;
| ^
main.c:30:13: error: expected ';' before 'l'
30 | puts l;
| ^~
| ;
main.c:32:9: error: expected ';' before '{' token
32 | (l<k){
| ^
| ;
main.c:38:2: error: expected declaration or statement at end of input
38 | }
| ^
|
s213805339 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
a=student_A[0]+student_A[1]+student_A[2]+student_A[3];
b=student_B[0]+student_B[1]+student_B[2]+student_B[3];
if (a<b){
puts b;
}
if (a>b){
puts a;
if (a=b) {
puts a;
}
return 0;
} | main.c: In function 'main':
main.c:13:1: error: 'a' undeclared (first use in this function)
13 | a=student_A[0]+student_A[1]+student_A[2]+student_A[3];
| ^
main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:1: error: 'b' undeclared (first use in this function)
14 | b=student_B[0]+student_B[1]+student_B[2]+student_B[3];
| ^
main.c:16:21: error: expected ';' before 'b'
16 | puts b;
| ^~
| ;
main.c:19:21: error: expected ';' before 'a'
19 | puts a;
| ^~
| ;
main.c:21:29: error: expected ';' before 'a'
21 | puts a;
| ^~
| ;
main.c:25:2: error: expected declaration or statement at end of input
25 | }
| ^
|
s776096878 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
int a,b;
a=student_A[0]+student_A[1]+student_A[2]+student_A[3];
b=student_B[0]+student_B[1]+student_B[2]+student_B[3];
if (a<b){
puts b;
}
if (a>b){
puts a;
if (a=b) {
puts a;
}
return 0;
} | main.c: In function 'main':
main.c:17:21: error: expected ';' before 'b'
17 | puts b;
| ^~
| ;
main.c:20:21: error: expected ';' before 'a'
20 | puts a;
| ^~
| ;
main.c:22:29: error: expected ';' before 'a'
22 | puts a;
| ^~
| ;
main.c:26:2: error: expected declaration or statement at end of input
26 | }
| ^
|
s707206644 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
int a,b;
a=student_A[0]+student_A[1]+student_A[2]+student_A[3];
b=student_B[0]+student_B[1]+student_B[2]+student_B[3];
if (a<b;){
puts b;
}
if (a>b;){
puts a;
if (a=b;) {
puts a;
}
return 0;
} | main.c: In function 'main':
main.c:16:16: error: expected ')' before ';' token
16 | if (a<b;){
| ~ ^
| )
main.c:17:21: error: expected ';' before 'b'
17 | puts b;
| ^~
| ;
main.c:19:16: error: expected ')' before ';' token
19 | if (a>b;){
| ~ ^
| )
main.c:20:21: error: expected ';' before 'a'
20 | puts a;
| ^~
| ;
main.c:21:24: error: expected ')' before ';' token
21 | if (a=b;) {
| ~ ^
| )
main.c:22:29: error: expected ';' before 'a'
22 | puts a;
| ^~
| ;
main.c:26:2: error: expected declaration or statement at end of input
26 | }
| ^
|
s044781057 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
int a,b;
a=student_A[0]+student_A[1]+student_A[2]+student_A[3];
b=student_B[0]+student_B[1]+student_B[2]+student_B[3];
if (a<b){
;puts b;
}
if (a>b){
;puts a;
if (a=b) {
;puts a;
}
return 0;
} | main.c: In function 'main':
main.c:17:22: error: expected ';' before 'b'
17 | ;puts b;
| ^~
| ;
main.c:20:22: error: expected ';' before 'a'
20 | ;puts a;
| ^~
| ;
main.c:22:30: error: expected ';' before 'a'
22 | ;puts a;
| ^~
| ;
main.c:26:2: error: expected declaration or statement at end of input
26 | }
| ^
|
s024638658 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
int a,b;
a=student_A[0]+student_A[1]+student_A[2]+student_A[3];
b=student_B[0]+student_B[1]+student_B[2]+student_B[3];
if (a<b){
puts "b";
}
if (a>b){
puts "a";
if (a=b) {
puts "a";
}
return 0;
} | main.c: In function 'main':
main.c:17:21: error: expected ';' before string constant
17 | puts "b";
| ^~~~
| ;
main.c:20:21: error: expected ';' before string constant
20 | puts "a";
| ^~~~
| ;
main.c:22:29: error: expected ';' before string constant
22 | puts "a";
| ^~~~
| ;
main.c:26:2: error: expected declaration or statement at end of input
26 | }
| ^
|
s313484138 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
int a,b;
a=student_A[0]+student_A[1]+student_A[2]+student_A[3];
b=student_B[0]+student_B[1]+student_B[2]+student_B[3];
if (a<b){
puts ("b");
}
if (a>b){
puts ("a");
if (a=b) {
puts ("a");
}
return 0;
| main.c: In function 'main':
main.c:25:6: error: expected declaration or statement at end of input
25 | return 0;
| ^~~~~~
main.c:25:6: error: expected declaration or statement at end of input
|
s673223664 | p00433 | C | #include <stdio.h>
int main(){
int i;
int student_A[4], student_B[4];
for(i=0;i<4;i++){
scanf("%d", &student_A[i]);
}
for(i=0;i<4;i++){
scanf("%d", &student_B[i]);
}
int a,b;
a=student_A[0]+student_A[1]+student_A[2]+student_A[3];
b=student_B[0]+student_B[1]+student_B[2]+student_B[3];
if (a<b){
puts ("b");
}
if (a>b){
puts ("a");
if (a=b) {
puts ("a");
}
return 0;
} | main.c: In function 'main':
main.c:26:9: error: expected declaration or statement at end of input
26 | }
| ^
|
s041437573 | p00433 | C | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);} | main.c:1:1: warning: data definition has no type or storage class
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
| ^
main.c:1:5: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
| ^
main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int]
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
| ^~~~
main.c: In function 'main':
main.c:1:7: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
main.c:1:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
| ^~~~~
main.c:1:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:39: error: lvalue required as left operand of assignment
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
| ^~
main.c:1:57: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | a,b,c;main(i){scanf("%d",&c);(i<5?a:b)+=c;i-8?main(i+1):printf("%d\n",a>b?a:b);}
| ^~~~~~
main.c:1:57: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:57: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:57: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s046076277 | p00433 | C | #include <stdio.h>
main(){
int a[4],b[4],s,t;
scanf("%d#include <stdio.h>
main(){
int a[4],b[4],s,t;
scanf("%d%d%d%d",&a[0],&a[1],&a[2],a[3]);
scanf("%d%d%d%d",&b[0],&b[1],&b[2],b[3]);
s=a[0]+a[1]+a[2]+a[3];
t=b[0]+b[1]+b[2]+b[3];
if(s>t) printf("%d\n",s);
else printf("%d\n",t);
}
%d%d%d",&a[0],&a[1],&a[2],a[3]);
scanf("%d%d%d%d",&b[0],&b[1],&b[2],b[3]);
s=a[0]+a[1]+a[2]+a[3];
t=b[0]+b[1]+b[2]+b[3];
if(s>t) printf("%d\n",s);
else printf("%d\n",t);
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:4:9: warning: missing terminating " character
4 | scanf("%d#include <stdio.h>
| ^
main.c:4:9: error: missing terminating " character
4 | scanf("%d#include <stdio.h>
| ^~~~~~~~~~~~~~~~~~~~~
main.c:5:7: error: expected ')' before '{' token
5 | main(){
| ^
| )
main.c:4:8: note: to match this '('
4 | scanf("%d#include <stdio.h>
| ^
main.c:14:7: warning: missing terminating " character
14 | %d%d%d",&a[0],&a[1],&a[2],a[3]);
| ^
main.c:14:7: error: missing terminating " character
14 | %d%d%d",&a[0],&a[1],&a[2],a[3]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:5:1: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
5 | main(){
| ^~~~~~
| |
| int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
428 | extern int scanf (const char *__restrict __format, ...) __wur;
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:19:25: error: expected ';' before '}' token
19 | else printf("%d\n",t);
| ^
| ;
20 | }
| ~
|
s616540437 | p00433 | C | #include <stdio.h>
main(){
int a[4],b[4],s,t;
scanf("%d#include <stdio.h>
main(){
int a[4],b[4],s,t;
scanf("%d%d%d%d",&a[0],&a[1],&a[2],a[3]);
scanf("%d%d%d%d",&b[0],&b[1],&b[2],b[3]);
s=a[0]+a[1]+a[2]+a[3];
t=b[0]+b[1]+b[2]+b[3];
if(s>t) printf("%d\n",s);
else printf("%d\n",t);
}
%d%d%d",&a[0],&a[1],&a[2],a[3]);
scanf("%d%d%d%d",&b[0],&b[1],&b[2],b[3]);
s=a[0]+a[1]+a[2]+a[3];
t=b[0]+b[1]+b[2]+b[3];
if(s>t) printf("%d\n",s);
else printf("%d\n",t);
} | main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:4:9: warning: missing terminating " character
4 | scanf("%d#include <stdio.h>
| ^
main.c:4:9: error: missing terminating " character
4 | scanf("%d#include <stdio.h>
| ^~~~~~~~~~~~~~~~~~~~~
main.c:5:7: error: expected ')' before '{' token
5 | main(){
| ^
| )
main.c:4:8: note: to match this '('
4 | scanf("%d#include <stdio.h>
| ^
main.c:14:7: warning: missing terminating " character
14 | %d%d%d",&a[0],&a[1],&a[2],a[3]);
| ^
main.c:14:7: error: missing terminating " character
14 | %d%d%d",&a[0],&a[1],&a[2],a[3]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:5:1: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
5 | main(){
| ^~~~~~
| |
| int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
428 | extern int scanf (const char *__restrict __format, ...) __wur;
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:19:25: error: expected ';' before '}' token
19 | else printf("%d\n",t);
| ^
| ;
20 | }
| ~
|
s853501561 | p00433 | C | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;} | main.c:1:1: warning: data definition has no type or storage class
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'S' [-Wimplicit-int]
main.c:1:6: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int]
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^~~~
main.c: In function 'main':
main.c:1:8: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^~~~~
main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:44: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^~~~~~
main.c:1:44: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:44: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:44: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:59: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration]
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax'
+++ |+#include <math.h>
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
main.c:1:59: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch]
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^~~~
main.c:1:59: note: include '<math.h>' or provide a declaration of 'fmax'
main.c:1:73: error: expected ')' before 'S'
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ~ ^
| )
main.c:1:83: error: expected expression before '}' token
1 | S[2],i;main(a){for(;~scanf("%d",&a);++i-8||printf("%.f\n",fmax(*S,S[1]))S[i/4]+=a;}
| ^
|
s336978959 | p00433 | C | main(){
int i,a,b,c;
for(a=b=i=0;i<8;i++)
scanf("%d",&c),i<4?a+=c:b+=c;
printf("%d\n",(a>b)?a:b);
} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){
| ^~~~
main.c: In function 'main':
main.c:4:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | scanf("%d",&c),i<4?a+=c:b+=c;
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(){
main.c:4:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | scanf("%d",&c),i<4?a+=c:b+=c;
| ^~~~~
main.c:4:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:42: error: lvalue required as left operand of assignment
4 | scanf("%d",&c),i<4?a+=c:b+=c;
| ^~
main.c:5:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
5 | printf("%d\n",(a>b)?a:b);
| ^~~~~~
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s636705560 | p00433 | C | main(i,a,b,c){for(a=b=i=0;i<8;i++)scanf("%d",&c),i<4?a+=c:b+=c;printf("%d\n",(a>b)?a:b);} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(i,a,b,c){for(a=b=i=0;i<8;i++)scanf("%d",&c),i<4?a+=c:b+=c;printf("%d\n",(a>b)?a:b);}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:35: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(i,a,b,c){for(a=b=i=0;i<8;i++)scanf("%d",&c),i<4?a+=c:b+=c;printf("%d\n",(a>b)?a:b);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(i,a,b,c){for(a=b=i=0;i<8;i++)scanf("%d",&c),i<4?a+=c:b+=c;printf("%d\n",(a>b)?a:b);}
main.c:1:35: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(i,a,b,c){for(a=b=i=0;i<8;i++)scanf("%d",&c),i<4?a+=c:b+=c;printf("%d\n",(a>b)?a:b);}
| ^~~~~
main.c:1:35: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:60: error: lvalue required as left operand of assignment
1 | main(i,a,b,c){for(a=b=i=0;i<8;i++)scanf("%d",&c),i<4?a+=c:b+=c;printf("%d\n",(a>b)?a:b);}
| ^~
main.c:1:64: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(i,a,b,c){for(a=b=i=0;i<8;i++)scanf("%d",&c),i<4?a+=c:b+=c;printf("%d\n",(a>b)?a:b);}
| ^~~~~~
main.c:1:64: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:64: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:64: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s262795352 | p00433 | C | int main() {
int i , j , in , sum[2] = {0};
for ( i = 0; i < 2; i++ ) {
for ( j = 0; j < 4; j++ ) {
scanf("%d",&in);
sum[i] += in;
}
}
if ( sum[0] => sum[1] )
printf("%d\n",sum[0]);
else
printf("%d\n",sum[1]);
return 0;
} | main.c: In function 'main':
main.c:6:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf("%d",&in);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main() {
main.c:6:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
6 | scanf("%d",&in);
| ^~~~~
main.c:6:25: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:22: error: expected expression before '>' token
10 | if ( sum[0] => sum[1] )
| ^
main.c:11:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
11 | printf("%d\n",sum[0]);
| ^~~~~~
main.c:11:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
13 | printf("%d\n",sum[1]);
| ^~~~~~
main.c:13:17: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s942205754 | p00433 | C | #include <stdio.h>
int main() {
int i=0 , j=0 , in , sum[2]={0};
while ( i < 2 ) {
while ( j < 4 ) {
scanf("%d",&in);
sum[i]+=in;
}
}
if ( sum[0] >= sum[1] )
printf("%d\n",sum[0);
else
printf("%d\n",sum[1]);
return 0;
} | main.c: In function 'main':
main.c:12:36: error: expected ']' before ')' token
12 | printf("%d\n",sum[0);
| ^
| ]
|
s616328032 | p00433 | C | #include <stdio.h>
int main() {
int i=0 , j=0 , in , sum[2]={0};
while ( i < 2 ) {
while ( j < 4 ) {
scanf("%d",&in);
sum[i]+=in;
j++;
}
i++;
}
if ( sum[0] >= sum[1] )
printf("%d\n",sum[0);
else
printf("%d\n",sum[1]);
return 0;
} | main.c: In function 'main':
main.c:14:36: error: expected ']' before ')' token
14 | printf("%d\n",sum[0);
| ^
| ]
|
s344992773 | p00433 | C | #include <stdio.h>
int main() {
int i=0 , j=0 , in , sum[2]={0};
while ( i < 2 ) {
while ( j < 4 ) {
scanf("%d",&in);
sum[i]+=in;
j++;
}
i++;
}
if ( sum[0] >= sum[1] ) {
printf("%d\n",sum[0);
} else {
printf("%d\n",sum[1]);
}
return 0;
} | main.c: In function 'main':
main.c:14:36: error: expected ']' before ')' token
14 | printf("%d\n",sum[0);
| ^
| ]
|
s119217937 | p00433 | C | #include <stdio.h>
int main(void) {
int aone,bone;
int asum,bsum;
int i;
asum=bsum=0;
for(i=0;i<4;i++) {
scanf("%d"&aone);
asum+=aone;
}
for(i=0;i<4;i++) {
scanf("%d",&bone);
bsum+=bone;
}
printf("%d\n",asum>bsum?asum:bsum);
return 0;
} | main.c: In function 'main':
main.c:9:27: error: invalid operands to binary & (have 'char *' and 'int')
9 | scanf("%d"&aone);
| ~~~~^
| |
| char *
|
s674856256 | p00433 | C | #include <iostream>
using namespace std;
int main() {
cin >> a1 >> a2 >> a3 >> a4 >> b1 >> b2 >> b3 >> b4;
atot = a1 + a2 + a3 + a4;
btot = b1 + b2 + b3 + b4;
if( atot > btot)
cout << atot << endl;
else
cout << btot << endl;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s362774981 | p00433 | C | ////////////////////////////
//情報オリンピック過去問////
//Score ////
//AOJ 0510 ////
////////////////////////////
/*
*設問解説
*情報・数学・理科・英語のAさんBさんの合計得点
*のうち大きい方を出力
*同点の場合は、どちらか片方を出力
*/
include<stdio.h>
int main(){
int aa,ab,ac,ad;
int ba,bb,bc,bd;
int asum,bsum,abmax;
scanf("%d %d %d %d",&aa,&ab,&ac,&ad);
scanf("%d %d %d %d",&ba,&bb,&bc,&bd);
asum=aa+ab+ac+ad; bsum=ba+bb+bc+bd;
if(asum>=bsum){
abmax=asum;
}else{
abmax=bsum;
}
printf("%d",abmax);
return 0;
}
//end
/////////////////////////////////////////////
//解き方 //
// intで四科目おく //
// intでaとbの得点を置く //
// intで最高点を置く //
// ifでabの大小を考えて //
// 最高点に代入 //
// 最高点をprintfで出力 //
// 簡単! //
///////////////////////////////////////////// | main.c:14:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
14 | include<stdio.h>
| ^
|
s193210808 | p00433 | C | ////////////////////////////
//情報オリンピック過去問////
//Score ////
//AOJ 0510 ////
////////////////////////////
/*
*設問解説
*情報・数学・理科・英語のAさんBさんの合計得点
*のうち大きい方を出力
*同点の場合は、どちらか片方を出力
*/
include<stdio.h>
int main(){
int aa,ab,ac,ad;
int ba,bb,bc,bd;
int asum,bsum,abmax;
scanf("%d %d %d %d",&aa,&ab,&ac,&ad);
scanf("%d %d %d %d",&ba,&bb,&bc,&bd);
asum=aa+ab+ac+ad; bsum=ba+bb+bc+bd;
if(asum => bsum){
abmax=asum;
}else{
abmax=bsum;
}
printf("%d",abmax);
return 0;
}
//end
/////////////////////////////////////////////
//解き方 //
// intで四科目おく //
// intでaとbの得点を置く //
// intで最高点を置く //
// ifでabの大小を考えて //
// 最高点に代入 //
// 最高点をprintfで出力 //
// 簡単! //
///////////////////////////////////////////// | main.c:14:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
14 | include<stdio.h>
| ^
|
s699880015 | p00433 | C | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);} | main.c:1:1: warning: data definition has no type or storage class
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:6: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);}
| ^
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);}
| ^~~~
main.c: In function 'main':
main.c:1:8: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);}
main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);}
| ^~~~~
main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:34: error: 't' undeclared (first use in this function)
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);}
| ^
main.c:1:34: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:55: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=t);i=!printf("%d\n",*s>x?*s:x);}
| ^~~~~~
main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:55: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s461942576 | p00433 | C | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);} | main.c:1:1: warning: data definition has no type or storage class
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:6: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);}
| ^
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);}
| ^~~~
main.c: In function 'main':
main.c:1:8: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);}
main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);}
| ^~~~~
main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:34: error: 't' undeclared (first use in this function)
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);}
| ^
main.c:1:34: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:55: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | s[2],i;main(x){for(;~scanf("%d",&t);x=s[i++/4]+=x);i=!printf("%d\n",*s>x?*s:x);}
| ^~~~~~
main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:55: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s022968132 | p00433 | C | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);} | main.c:1:1: warning: data definition has no type or storage class
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:6: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ^
main.c:1:8: error: return type defaults to 'int' [-Wimplicit-int]
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ^~~~
main.c: In function 'main':
main.c:1:8: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ^~~~~
main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:55: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ^~~~~~
main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:55: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:70: error: implicit declaration of function 'maxf' [-Wimplicit-function-declaration]
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ^~~~
main.c:1:80: error: expected ')' before ';' token
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ~ ^
| )
main.c:1:81: error: expected ';' before '}' token
1 | s[2],i;main(x){for(;~scanf("%d",&x);x=s[i++/4]+=x);i=!printf("%.f\n",maxf(*s,x);}
| ^
| ;
|
s604471494 | p00433 | C | #include<stdio.h>
#include<stdlib.h>
int main(){
int a1,b1,c1,d1,a2,b2,c2,d2,s,t;
scanf("%d %d %d %d",&a1,&b1,&c1,&d1);
scanf("%d %d %d %d",&a2,&b2,&c2,&d2);
s=a1+b1+c1+d1;
t=a2+b2+c2+d2;
if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
return 0;
}
else if(s == t){
printf("S=(T)");
}
else if(s > t){
printf("%d",s);
}
else{
printf("%d",t);
}
return 0;
} | main.c: In function 'main':
main.c:13:24: error: 'a3' undeclared (first use in this function); did you mean 'a2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| a2
main.c:13:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:32: error: 'a4' undeclared (first use in this function); did you mean 'a2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| a2
main.c:13:56: error: 'b3' undeclared (first use in this function); did you mean 'b2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| b2
main.c:13:64: error: 'b4' undeclared (first use in this function); did you mean 'b2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| b2
|
s533883577 | p00433 | C | #include<stdio.h>
#include<stdlib.h>
int main(){
int a1,b1,c1,d1,a2,b2,c2,d2,s,t;
scanf("%d %d %d %d",&a1,&b1,&c1,&d1);
scanf("%d %d %d %d",&a2,&b2,&c2,&d2);
s=a1+b1+c1+d1;
t=a2+b2+c2+d2;
if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
return 0;
}
else if(s == t){
printf("S=(T)");
}
else if(s > t){
printf("%d",s);
}
else{
printf("%d",t);
}
return 0;
} | main.c: In function 'main':
main.c:13:24: error: 'a3' undeclared (first use in this function); did you mean 'a2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| a2
main.c:13:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:32: error: 'a4' undeclared (first use in this function); did you mean 'a2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| a2
main.c:13:56: error: 'b3' undeclared (first use in this function); did you mean 'b2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| b2
main.c:13:64: error: 'b4' undeclared (first use in this function); did you mean 'b2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| b2
|
s358648730 | p00433 | C | #include<stdio.h>
#include<stdlib.h>
int main(){
int a1,b1,c1,d1,a2,b2,c2,d2,s,t;
scanf("%d %d %d %d",&a1,&b1,&c1,&d1);
scanf("%d %d %d %d",&a2,&b2,&c2,&d2);
s=a1+b1+c1+d1;
t=a2+b2+c2+d2;
if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
return 0;
}
else if(s == t){
printf("%d",s);
}
else if(s > t){
printf("%d",s);
}
else{
printf("%d",t);
}
return 0;
} | main.c: In function 'main':
main.c:13:24: error: 'a3' undeclared (first use in this function); did you mean 'a2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| a2
main.c:13:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:32: error: 'a4' undeclared (first use in this function); did you mean 'a2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| a2
main.c:13:56: error: 'b3' undeclared (first use in this function); did you mean 'b2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| b2
main.c:13:64: error: 'b4' undeclared (first use in this function); did you mean 'b2'?
13 | if(0>a1 || 0>a2 || 0>a3 || 0>a4 || 0>b1 || 0>b2 || 0>b3 || 0>b4 || 100<a1 || 100<a2 || 100<a3 || 100< a4 || 100<b1 || 100<b2 || 100<b3 || 100<b4){
| ^~
| b2
|
s676167369 | p00433 | C++ | #include<stdio.h>
int main(void)
{
int x1,x2,x3,x4,y1,y2,y3,y4,x,y;
scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4)
x=x1+x2+x3+x4;
y=y1+y2+y3+y4;
if(x>y){
printf("d\n",x);
}
else{
printf("d\n",y);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:73: error: expected ';' before 'x'
5 | scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4)
| ^
| ;
6 | x=x1+x2+x3+x4;
| ~
|
s270582008 | p00433 | C++ | #include<stdio.h>
int main(void)
{
int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
s=a1+a2+a3+a4;
t=b1+b2+b3+b4;
if(s<=t){
printf("%d\n",t);
}
else if(t<=s){
printf("%d\n",s);
}
return 0;
}
| a.cc:4:9: error: extended character is not valid in an identifier
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc: In function 'int main()':
a.cc:4:9: error: 'int\U00003000a1' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~~~~~~
a.cc:4:17: error: 'a2' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:20: error: 'a3' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:23: error: 'a4' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:26: error: 'b1' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:29: error: 'b2' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:32: error: 'b3' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:35: error: 'b4' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:38: error: 's' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc:4:40: error: 't' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc:5:42: error: 'a1' was not declared in this scope
5 | scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
| ^~
|
s819640481 | p00433 | C++ | #include<stdio.h>
int main(void)
{
int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
s=a1+a2+a3+a4;
t=b1+b2+b3+b4;
if(s<=t){
printf("%d\n",t);
}
else if(t<=s){
printf("%d\n",s);
}
return 0;
}
| a.cc:4:9: error: extended character is not valid in an identifier
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc: In function 'int main()':
a.cc:4:9: error: 'int\U00003000a1' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~~~~~~
a.cc:4:17: error: 'a2' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:20: error: 'a3' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:23: error: 'a4' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:26: error: 'b1' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:29: error: 'b2' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:32: error: 'b3' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:35: error: 'b4' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:38: error: 's' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc:4:40: error: 't' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc:5:42: error: 'a1' was not declared in this scope
5 | scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
| ^~
|
s673120418 | p00433 | C++ | #include<stdio.h>
int main(void)
{
int x1,x2,x3,x4,y1,y2,y3,y4,s,t;
scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4);
s=x1+x2+x3+x4;
t=y1+y2+y3+y4;
if(s>t){
printf("d\n",s);
}
else if(s=t){
pritnf("%d=%d\n",s,t);
}
else{
printf("d\n",y);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:17: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
12 | pritnf("%d=%d\n",s,t);
| ^~~~~~
| printf
a.cc:15:30: error: 'y' was not declared in this scope
15 | printf("d\n",y);
| ^
|
s032036531 | p00433 | C++ | #include<stdio.h>
int main(void)
{
int x1,x2,x3,x4,y1,y2,y3,y4,s,t;
scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4);
s=x1+x2+x3+x4;
t=y1+y2+y3+y4;
if(s>t){
printf("d\n",s);
}
else if(s==t){
pritnf("%d=%d\n",s,t);
}
else{
printf("d\n",y);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:17: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
12 | pritnf("%d=%d\n",s,t);
| ^~~~~~
| printf
a.cc:15:30: error: 'y' was not declared in this scope
15 | printf("d\n",y);
| ^
|
s042192235 | p00433 | C++ | #include<stdio.h>
int main(void)
{
int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
s=a1+a2+a3+a4;
t=b1+b2+b3+b4;
if(s<t){
printf("%d\n",t);
}
else if(t<s){
printf("%d\n",s);
}
else if(s==t){
printf("%d\n",s);
}
return 0;
}
| a.cc:4:9: error: extended character is not valid in an identifier
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc: In function 'int main()':
a.cc:4:9: error: 'int\U00003000a1' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~~~~~~
a.cc:4:17: error: 'a2' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:20: error: 'a3' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:23: error: 'a4' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:26: error: 'b1' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:29: error: 'b2' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:32: error: 'b3' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:35: error: 'b4' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^~
a.cc:4:38: error: 's' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc:4:40: error: 't' was not declared in this scope
4 | int a1,a2,a3,a4,b1,b2,b3,b4,s,t;
| ^
a.cc:5:42: error: 'a1' was not declared in this scope
5 | scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
| ^~
|
s236680015 | p00433 | C++ | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int a[2] = { 0 };
for (i = 0; i < 2; i++) {
int a, b, c, d;
cin >> a >> b >> c >> d;
a[i] += a + b + c + d;
}
cout << max(a[0], a[1]) << endl;
}
| a.cc: In function 'int main()':
a.cc:6:14: error: 'i' was not declared in this scope
6 | for (i = 0; i < 2; i++) {
| ^
|
s700442185 | p00433 | C++ | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int a[2] = { 0 };
for (int i = 0; i < 2; i++) {
int a, b, c, d;
cin >> a >> b >> c >> d;
a[i] += a + b + c + d;
}
cout << max(a[0], a[1]) << endl;
}
| a.cc: In function 'int main()':
a.cc:9:18: error: invalid types 'int[int]' for array subscript
9 | a[i] += a + b + c + d;
| ^
|
s761823675 | p00433 | C++ | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int a[2] = { 0 };
for (int i = 0; i < 2; i++) {
int a, b, c, d;
cin >> a >> b >> c >> d;
a[i] += (a + b + c + d);
}
cout << max(a[0], a[1]) << endl;
}
| a.cc: In function 'int main()':
a.cc:9:18: error: invalid types 'int[int]' for array subscript
9 | a[i] += (a + b + c + d);
| ^
|
s417417734 | p00433 | C++ | using namespace std;
int main(){
int answer;
int s = 0, t = 0;
int ibuf;
for (int i = 0; i < 4; i++) {
cin >> ibuf;
s += ibuf;
}
for (int i = 0; i < 4; i++) {
cin >> ibuf;
t += ibuf;
}
answer = max(s, t);
cout << answer << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:17: error: 'cin' was not declared in this scope
11 | cin >> ibuf;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:15:17: error: 'cin' was not declared in this scope
15 | cin >> ibuf;
| ^~~
a.cc:15:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:18: error: 'max' was not declared in this scope
19 | answer = max(s, t);
| ^~~
a.cc:21:9: error: 'cout' was not declared in this scope
21 | cout << answer << endl;
| ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:27: error: 'endl' was not declared in this scope
21 | cout << answer << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s075186605 | p00433 | C++ | #include<iostream>
using namespace std;
int sum1=0,sum2=0;
for(int i=0;i<4;i++){
cin>>a;
sum1+=a;
}
for(int i=0;i<4;i++){
cin>>a;
sum2+=sum2;
}
if(sum1>sum2)cout<<sum1;
else if(sum1<sum2)cout<<sum2;
else cout<<sum1;
return 0;
} | a.cc:4:9: error: expected unqualified-id before 'for'
4 | for(int i=0;i<4;i++){
| ^~~
a.cc:4:21: error: 'i' does not name a type
4 | for(int i=0;i<4;i++){
| ^
a.cc:4:25: error: 'i' does not name a type
4 | for(int i=0;i<4;i++){
| ^
a.cc:8:1: error: expected unqualified-id before 'for'
8 | for(int i=0;i<4;i++){
| ^~~
a.cc:8:13: error: 'i' does not name a type
8 | for(int i=0;i<4;i++){
| ^
a.cc:8:17: error: 'i' does not name a type
8 | for(int i=0;i<4;i++){
| ^
a.cc:12:9: error: expected unqualified-id before 'if'
12 | if(sum1>sum2)cout<<sum1;
| ^~
a.cc:13:9: error: expected unqualified-id before 'else'
13 | else if(sum1<sum2)cout<<sum2;
| ^~~~
a.cc:14:9: error: expected unqualified-id before 'else'
14 | else cout<<sum1;
| ^~~~
a.cc:16:1: error: expected unqualified-id before 'return'
16 | return 0;
| ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s504774445 | p00433 | C++ | #include<iostream>
using namespace std;
int main(){
int sum1=0,sum2=0;
for(int i=0;i<4;i++){
cin>>a;
sum1+=a;
}
for(int i=0;i<4;i++){
cin>>a;
sum2+=sum2;
}
if(sum1>sum2)cout<<sum1;
else if(sum1<sum2)cout<<sum2;
else cout<<sum1;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:14: error: 'a' was not declared in this scope
6 | cin>>a;
| ^
a.cc:10:14: error: 'a' was not declared in this scope
10 | cin>>a;
| ^
|
s945478939 | p00433 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int ans = 0;
for(int i=0;i<2;i++){
int sum=0;
for(int j=0;j<4;j++){
Scanner stdIn = new Scanner(System.in);
int p = stdIn.nextInt();
sum += p;
}
ans = Math.max(sum, ans);
}
System.out.println(ans);
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s204790266 | p00433 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int a[8];
for (int i=0; i<8; ++i) cin >> a[i];
cout << max(accumulate(a, a+4, 0), accumulate(a+4, a+8, 0)) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'accumulate' was not declared in this scope
9 | cout << max(accumulate(a, a+4, 0), accumulate(a+4, a+8, 0)) << endl;
| ^~~~~~~~~~
|
s562459058 | p00433 | C++ | #include<iostream>
#include<algorhithm>
using namespace std;
int main {
int A,B,a,b
for(i=0;i<4;i++) {
cin << a;
A += a;
}
for(i=0;i<4;i++) {
cin << b;
B += b;
}
A>B? cout << A : cout << B;
} | a.cc:2:9: fatal error: algorhithm: No such file or directory
2 | #include<algorhithm>
| ^~~~~~~~~~~~
compilation terminated.
|
s467754287 | p00433 | C++ | #include<iostream>
using namespace std;
int main {
int A,B,a,b
for(i=0;i<4;i++) {
cin << a;
A += a;
}
for(i=0;i<4;i++) {
cin << b;
B += b;
}
A>B? cout << A : cout << B;
} | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main {
| ^~~~
a.cc:5:5: error: expected primary-expression before 'int'
5 | int A,B,a,b
| ^~~
a.cc:5:5: error: expected '}' before 'int'
a.cc:4:10: note: to match this '{'
4 | int main {
| ^
a.cc:6:13: error: 'i' does not name a type
6 | for(i=0;i<4;i++) {
| ^
a.cc:6:17: error: 'i' does not name a type
6 | for(i=0;i<4;i++) {
| ^
a.cc:10:5: error: expected unqualified-id before 'for'
10 | for(i=0;i<4;i++) {
| ^~~
a.cc:10:13: error: 'i' does not name a type
10 | for(i=0;i<4;i++) {
| ^
a.cc:10:17: error: 'i' does not name a type
10 | for(i=0;i<4;i++) {
| ^
a.cc:14:5: error: 'A' does not name a type
14 | A>B? cout << A : cout << B;
| ^
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s918425202 | p00433 | C++ | #include<iostream>
using namespace std;
int main {
int S,T,a,b;
for(i=0;i<4;i++) {
cin << a;
S += a;
}
for(i=0;i<4;i++) {
cin << b;
T += b;
}
S>T? cout << S : cout << T;
} | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main {
| ^~~~
a.cc:5:5: error: expected primary-expression before 'int'
5 | int S,T,a,b;
| ^~~
a.cc:5:5: error: expected '}' before 'int'
a.cc:4:10: note: to match this '{'
4 | int main {
| ^
a.cc:6:5: error: expected unqualified-id before 'for'
6 | for(i=0;i<4;i++) {
| ^~~
a.cc:6:13: error: 'i' does not name a type
6 | for(i=0;i<4;i++) {
| ^
a.cc:6:17: error: 'i' does not name a type
6 | for(i=0;i<4;i++) {
| ^
a.cc:10:5: error: expected unqualified-id before 'for'
10 | for(i=0;i<4;i++) {
| ^~~
a.cc:10:13: error: 'i' does not name a type
10 | for(i=0;i<4;i++) {
| ^
a.cc:10:17: error: 'i' does not name a type
10 | for(i=0;i<4;i++) {
| ^
a.cc:14:5: error: 'S' does not name a type
14 | S>T? cout << S : cout << T;
| ^
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s432724306 | p00433 | C++ | #include<iostream>
using namespace std;
int main {
int S,T,a,b,i;
for(i=0;i<4;i++) {
cin << a;
S += a;
}
for(i=0;i<4;i++) {
cin << b;
T += b;
}
S>T ? cout << S : cout << T;
} | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main {
| ^~~~
a.cc:5:5: error: expected primary-expression before 'int'
5 | int S,T,a,b,i;
| ^~~
a.cc:5:5: error: expected '}' before 'int'
a.cc:4:10: note: to match this '{'
4 | int main {
| ^
a.cc:6:5: error: expected unqualified-id before 'for'
6 | for(i=0;i<4;i++) {
| ^~~
a.cc:6:13: error: 'i' does not name a type
6 | for(i=0;i<4;i++) {
| ^
a.cc:6:17: error: 'i' does not name a type
6 | for(i=0;i<4;i++) {
| ^
a.cc:10:5: error: expected unqualified-id before 'for'
10 | for(i=0;i<4;i++) {
| ^~~
a.cc:10:13: error: 'i' does not name a type
10 | for(i=0;i<4;i++) {
| ^
a.cc:10:17: error: 'i' does not name a type
10 | for(i=0;i<4;i++) {
| ^
a.cc:14:5: error: 'S' does not name a type
14 | S>T ? cout << S : cout << T;
| ^
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.