submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s003397866 | p00455 | C++ | #include<iostream>
using namespace std;
typedef struct time{
int h;
int m;
int s;
};
int main(void){
time s[3],t[3];
int st,tt,zt;
for(int i = 0; i < 3; i++){
cin >> s[i].h >> s[i].m >> s[i].s >> t[i].h >> t[i].m >> t[i].s;
}
for (int i = 0; i < 3; i++){
st = s[i].s + s[i].m * 60 + s[i].... | a.cc:5:1: warning: 'typedef' was ignored in this declaration
5 | typedef struct time{
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:13:13: error: expected ';' before 's'
13 | time s[3],t[3];
| ^~
| ;
a.cc:17:24: error: 's' was not declared in this scope
17 | ... |
s250748806 | p00455 | C++ | //============================================================================
// Name : timecard.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include ... | a.cc: In function 'int main()':
a.cc:48:18: error: expected '}' at end of input
48 | return 0;
| ^
a.cc:12:12: note: to match this '{'
12 | int main() {
| ^
|
s582733532 | p00456 | Java | import java.util.Scanner;
class Main {
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int w=0, k=0;
int ws[] = new int[10], ks[] = new int[10];
for(int i=0; i<10; i++)
ws[i] = in.nextInt();
for(int i=0; i<10; i++)
ks[i] = in.nextInt();
A... | Main.java:13: error: cannot find symbol
Arrays.sort(ks);
^
symbol: variable Arrays
location: class Main
Main.java:14: error: cannot find symbol
Arrays.sort(ws);
^
symbol: variable Arrays
location: class Main
2 errors
|
s018991889 | p00456 | Java | import java.util.Scanner;
class Main {
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int w=0, k=0;
int ws[] = new int[10], ks[] = new int[10];
for(int i=0; i<10; i++)
ws[i] = in.nextInt();
for(int i=0; i<10; i++)
ks[i] = in.nextInt();
A... | Main.java:13: error: cannot find symbol
Arrays.sort(ks);
^
symbol: variable Arrays
location: class Main
Main.java:14: error: cannot find symbol
Arrays.sort(ws);
^
symbol: variable Arrays
location: class Main
2 errors
|
s356881432 | p00456 | C | #include<stdio.h>
int main(void)
{
int w[10],k[10],l,maxw=0,maxk=0,q,m,p,i;
for(l=0;l<10;l++){
scanf("%d",&w[l]);
}
for(l=0;l<10;l++){
for(p=l+1;p<10;p++){
if(w[l]<w[p]){
q=w[p];
w[p]=w[l];
w[l]=q;
}
}
}
for (l=0;l<10;l++){
scanf("%d",&k[l]);
}
for (l=0;l<10;l++){
for(p=l+1;p<10;p++){
... | main.c: In function 'main':
main.c:34:9: error: expected declaration or statement at end of input
34 | return 0;
| ^~~~~~
|
s220751821 | p00456 | C | #include<stdio.h>
int main(void)
{
int w[10],k[10],l,maxw=0,maxk=0,q,m,p,i;
for(l=0;l<10;l++){
scanf("%d",&w[l]);
}
for(l=0;l<10;l++){
for(p=l+1;p<10;p++){
if(w[l]<w[p]){
q=w[p];
w[p]=w[l];
w[l]=q;
}
}
}
for (l=0;l<10;l++){
scanf("%d",&k[l]);
}
for (l=0;l<10;l++){
for(p=l+1;p<10;p++){
... | main.c: In function 'main':
main.c:34:9: error: expected declaration or statement at end of input
34 | return 0;
| ^~~~~~
|
s673867288 | p00456 | C | #include <stdio.h>
#define swap(a, b) {int tmp = a; a = b; b = tmp;}
int main(void)
{
int w[10];
int k[10];
int max[3] = {0};
int i, j, k;
for (i = 0; i < 10; i++){
scanf("%d", w + i);
}
for (i = 0; i < 9; i++){
for (j = 0; j < 9 - i; j++){
if (w[j] > w[j + 1]){
swap(w[j], w[j + 1]);
}
}
}
... | main.c: In function 'main':
main.c:10:19: error: conflicting types for 'k'; have 'int'
10 | int i, j, k;
| ^
main.c:8:13: note: previous declaration of 'k' with type 'int[10]'
8 | int k[10];
| ^
|
s972060894 | p00456 | C | #include<stdio.h>
int main(void)
{
int i,a,max1=0,max2=0,max3=0;
int k,w;
for(i=0;i<10;i++){
scanf("%d",&a);
if(max1<a){
max3=max2;
max2=max1;
max1=a;
}else if(max2<a){
max3=max2;
max2=a;
}else if(max3<a){
max3=a;
}
w=w+max2+max1+max3;
max1=0;
max2=0;
max3=0;
for(i=0;i<10;i++){
scanf("%d",&a);
if(max1<a){
max3=max2... | main.c: In function 'main':
main.c:42:1: error: expected declaration or statement at end of input
42 | }
| ^
main.c:42:1: error: expected declaration or statement at end of input
|
s442106502 | p00456 | C | #include<stdio.h>
int main(){
int w[10],k[10],i=0,n,pre,wsum,ksum;
for(i=0;i<20;i++){
scanf("%d\n",&w[i]);
}
for(i=0;i<20;i++){
scanf("%d\n",&k[i]);
}
for(n=9;n>1;n--){
for(i=0;i<n;i++){
if(w[n-i]<w[n-i-1]){
w[n-i]=pre;
w[n-i]=w[n-i-1];
w[n-i-1]=pre;
}
}
for(n=9;n>1;n--){
for(i=0;i<n;i++){
if(k[n-i]<k[n-i-1]){
k[n-i]=... | main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
33 | }
| ^
|
s524729520 | p00456 | C | #include<stdio.h>
int main(){
int w[10],k[10],i,n,pre,wsum,ksum;
for(i=0;i<10;i++){
scanf("%d\n",&w[i]);
}
for(i=0;i<10;i++){
scanf("%d\n",&k[i]);
}
for(n=9;n>1;n--){
for(i=0;i<n;i++){
if(w[n-i]<w[n-i-1]){
w[n-i]=pre;
w[n-i]=w[n-i-1];
w[n-i-1]=pre;
}
}
for(n=9;n>1;n--){
for(i=0;i<n;i++){
if(k[n-i]<k[n-i-1]){
k[n-i]=pr... | main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
33 | }
| ^
|
s627355818 | p00456 | C | #include<stdio.h>
int main(){
int w[10],k[10],i,n,pre,wsum,ksum;
for(i=0;i<10;i++){
scanf("%d\n",&w[i]);
}
for(i=0;i<10;i++){
scanf("%d\n",&k[i]);
}
for(n=9;n>1;n--){
for(i=0;i<n;i++){
if(w[n-i]<w[n-i-1]){
pre=w[n-i];
w[n-i]=w[n-i-1];
w[n-i-1]=pre;
}
}
for(n=9;n>1;n--){
for(i=0;i<n;i++){
if(k[n-i]<k[n-i-1]){
pre=k[n-i... | main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
33 | }
| ^
|
s808804114 | p00456 | C | #include<stdio.h>
int main(){
int w[10],k[10],i,n,pre,wsum,ksum;
for(i=0;i<10;i++){
scanf("%d\n",&w[i]);
}
for(i=0;i<10;i++){
scanf("%d\n",&k[i]);
}
for(n=9;n>1;n--){
for(i=0;i<n;i++){
if(w[n-i]<w[n-i-1]){
pre=w[n-i];
w[n-i]=w[n-i-1];
w[n-i-1]=pre;
}
}
for(n=9;n>1;n--){
for(i=0;i<n;i++){
if(k[n-i]<k[n-i-1]){
pre=k[n-i... | main.c: In function 'main':
main.c:32:1: error: expected declaration or statement at end of input
32 | }
| ^
main.c:32:1: error: expected declaration or statement at end of input
|
s893819327 | p00456 | C | #include<stdio.h>
int main(){
int w[10],k[10],i,j,tmp,ksum,wsum;
for(i=0;i<10;i++){
scanf("%d\n",&w[i]);
}
for(i=0;i<10;i++){
scanf("%d\n",&k[i]);
}
for (i = 0; i < n - 1; i++) {
for (j = n - 1; j > i; j--) {
if (w[j - 1] < w[j]) {
tmp = w[j];
w[j] = w[j - 1];
w[j - 1]= tmp;
}
if (k[j - 1] < k[j]) {
tmp = k[j]... | main.c: In function 'main':
main.c:10:17: error: 'n' undeclared (first use in this function)
10 | for (i = 0; i < n - 1; i++) {
| ^
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
|
s257831855 | p00456 | C | #include<stdio.h>
#include<stdlib.h>
int compare_int(const void *a,const void *b){
return *(int*)a - *(int*)b;
}
int main(void){
int w[10];
int k[10];
int sum_w,sum_k;
int i;
for(i = 0;i < 10;i++){
scanf("%d",&w[i]);
}
for(i = 0;i < 10;i++){
scanf("%d",&k[i]);
}
qsort(w,10,sizeof(int),compare_int);
qso... | main.c: In function 'main':
main.c:20:17: error: invalid suffix "sizeof" on floating constant
20 | qsort(k,10.sizeof(int),compare_int);
| ^~~~~~~~~
main.c:20:27: error: expected expression before 'int'
20 | qsort(k,10.sizeof(int),compare_int);
| ... |
s839054908 | p00456 | C | ww#include <stdio.h>
int main(){
int i,j,ws[10],ks[10],koukan;
for(i=0;i<10;i++){
scanf("%d",&ws[i]);
}
for(i=0;i<10;i++){
scanf("%d",&ks[i]);
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(j==9)break;
if(ws[j]>ws[j+1]){
koukan=ws[j];
ws[j]=ws[j+1];
ws[j+1]=koukan;
}
if... | main.c:1:3: error: stray '#' in program
1 | ww#include <stdio.h>
| ^
main.c:1:1: error: unknown type name 'ww'
1 | ww#include <stdio.h>
| ^~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | ww#include <stdio.h>
| ^
|
s428954523 | p00456 | C | #include <stdio.h>
int max(int data[]){
int i,mm=0;
for(i=0,i<10,i++){
if(data[mm]<data[i]) mm=i;
}
return mm;
}
main(){
int a[10],b[10],j,k,x,y,amax[3],bmax[3],aa=0,bb=0;
for(j=0,j<10,j++){
scanf("%d",&a[j]);
}
for(k=0,k<10,k++){
scanf("%d",&b[k]);
}
for(x=0,x<3,x++){
aa=max(a);... | main.c: In function 'max':
main.c:5:19: error: expected ';' before ')' token
5 | for(i=0,i<10,i++){
| ^
| ;
main.c:5:19: error: expected expression before ')' token
main.c: At top level:
main.c:11:1: error: return type defaults to 'int' [-Wimplicit-int]
11 | main... |
s368952127 | p00456 | C | #include <stdio.h>
int max(int data[],int n){
int i,mm=0;
for(i=0,i<n,i++){
if(data[mm]<data[i]) mm=i;
}
return mm;
}
main(){
int a[10],b[10],j,k,x,y,amax[3],bmax[3],aa=0,bb=0;
for(j=0,j<10,j++){
scanf("%d",&a[j]);
}
for(k=0,k<10,k++){
scanf("%d",&b[k]);
}
for(x=0,x<3,x++){
aa=max(a... | main.c: In function 'max':
main.c:5:18: error: expected ';' before ')' token
5 | for(i=0,i<n,i++){
| ^
| ;
main.c:5:18: error: expected expression before ')' token
main.c: At top level:
main.c:11:1: error: return type defaults to 'int' [-Wimplicit-int]
11 | main(){... |
s461403399 | p00456 | C | #include <stdio.h>
#include <stdlib.h>
int main(void) {
int w[10],k[10];
int i,j,p,q,t,s;
int wsum=0,ksum=0,swap;
for(i=0;i<10;i++) {
scanf("%d\n",&w[i]);
}
for(t=0;t<10;t++){
for(j=0;j<10;j++){
if (w[j]>w[j+1]) {
swap=w[j];
w[j]=w[j+1];
w[j+1]=swap;
}
}
}
wsum=w[9]+w[8]+w[7];
for(p=0;... | main.c: In function 'main':
main.c:36:24: error: 'fpout' undeclared (first use in this function)
36 | fclose(fpout);
| ^~~~~
main.c:36:24: note: each undeclared identifier is reported only once for each function it appears in
|
s756679914 | p00456 | C | #include<stdio.h>
#include<functional>
#include<algorithm>
using namespace std;
int main()
{
int i, a[11], b[11],x=0,y=0;
for (i = 0; i < 10; i++){
scanf("%d", &a[i]);
}
for (i = 0; i < 10; i++){
scanf("%d", &b[i]);
}
sort(a, a + 10, greater<int>());
sort(b, b + 10, greater<int>());
for (i = 0; i <= 2; i++)... | main.c:2:9: fatal error: functional: No such file or directory
2 | #include<functional>
| ^~~~~~~~~~~~
compilation terminated.
|
s823395506 | p00456 | C | int main(){
int set[20];
int ans1[10],ans2[10];
int i,j,temp1,temp2;
for(i=0;i<20;i++){
scanf("%d",&set[i]);
}
for(i=0;i<10;i++){
ans1[i]=set[i];
}
for(i=0;i<10;i++){
ans2[i]=set[10+i];
}
temp1=0,temp2=0
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(ans1[j]>ans1[i]){
ans1[j]=temp1;
ans1[j]=ans1[i];
ans1[i]=temp1;
}
if(ans2[... | main.c: In function 'main':
main.c:6:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf("%d",&set[i]);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(){
main.c:6:1: warning: incompatible ... |
s180526267 | p00456 | C | #include <stdio.h>
int main(){
int dataarray[20];
int i,j,answer1,answer2,temp;
for(i=0;i<20;i++){
scanf("%d",&dataarray[i]);
}
for(i=0;i<10;i++){
for(j=i;j<10;j++){
if(dataarray[j]>dataarray[i]{
temp=dataarray[j];
dataarray[j]=dataarray[i];
dataarray[i]=temp;
}
if(dataarray[j+10]>dataarray[i+10]{
temp=dataarray[j+10];... | main.c: In function 'main':
main.c:10:29: error: expected ')' before '{' token
10 | if(dataarray[j]>dataarray[i]{
| ~ ^
| )
main.c:25:1: error: expected expression before '}' token
25 | }
| ^
main.c:25:1: error: expected declaration or statem... |
s614112305 | p00456 | C++ | #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
int main(){
int ws=0,ks=0;
int data;
rep(i,10){cin>>data;ws+=data};
rep(i,10){cin>>data;ks+=data);
cout<< ws << " " <<ks << endl;
} | a.cc: In function 'int main()':
a.cc:9:37: error: expected ';' before '}' token
9 | rep(i,10){cin>>data;ws+=data};
| ^
| ;
a.cc:10:37: error: expected ';' before ')' token
10 | rep(i,10){cin>>data;ks+=data);
... |
s572785769 | p00456 | C++ | include<iostream>
#include<algorithm>
using namespace std;
int main(){
int W[10],K[10];
int ans_W=0,ans_K=0;
for(int i=0;i<10;i++){
cin >> W[i];
}
for(int i=0;i<10;i++){
cin >> K[i];
}
sort(W,W+10,greater<int>());
sort(K,K+10,greater<int>());
for(int i=0;i<3;i++){
ans_W += W[i];
ans_K... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g... |
s291231484 | p00456 | C++ | #include<iostream>
using namespace std;
int main(){
int a[10],b[10];
for(int i=0;i<10;i++){
cin>>a[i];
}
for(int i=0;i<10;i++){
cin>>b[i];
}
sort(a,a+10);
sort(b,b+10);
cout << a[8]+a[9]+a[7] << endl;
cout << b[8]+b[9]+b[7] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(a,a+10);
| ^~~~
| short
|
s827214613 | p00456 | C++ | #include<iostream>
using namespace std;
int main(){
int a[10],b[10];
for(int i=0;i<10;i++){
cin>>a[i];
}
for(int i=0;i<10;i++){
cin>>b[i];
}
sort(a,a+10);
sort(b,b+10);
cout << a[8]+a[9]+a[7] << endl;
cout << b[8]+b[9]+b[7] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(a,a+10);
| ^~~~
| short
|
s731720510 | p00456 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main () {
int m, W[10], T[i], i;
for(i=0;i<10;i++) {
cin >> W[i];
m = max(m,W[i]);
}
cout << m << " ";
for(i=0;i<10;i++) {
cin >> T[i];
m=max(m,T[i]);
}
cout << m << endl;
} | a.cc: In function 'int main()':
a.cc:6:21: error: 'i' was not declared in this scope
6 | int m, W[10], T[i], i;
| ^
a.cc:13:16: error: 'T' was not declared in this scope
13 | cin >> T[i];
| ^
|
s972995786 | p00456 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main () {
int m=0, W[10], T[10], i;
for(i=0;i<10;i++) {
cin >> W[i];
}
sort(W,10);
for(i=7;i<10;i++)
m += W[i];
cout << m << " ";
for(i=0;i<10;i++) {
cin >> T[i];
}
sort(T,10);
for(i=7;i<10... | a.cc: In function 'int main()':
a.cc:10:9: error: no matching function for call to 'sort(int [10], int)'
10 | sort(W,10);
| ~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIt... |
s007406490 | p00456 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <limits.h>
//#include <windows.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <queue>
#include <functional>
using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef ... | a.cc: In function 'void func()':
a.cc:462:13: error: no matching function for call to 'sort(int [10])'
462 | sort(w);
| ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:9:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIt... |
s603436993 | p00456 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <limits.h>
//#include <windows.h>
#include <iostream>
#include <algorithm>
#include <set>
#include <queue>
#include <functional>
using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef ... | a.cc: In function 'void func()':
a.cc:462:13: error: no matching function for call to 'sort(int [10])'
462 | sort(w);
| ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:9:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIt... |
s212411074 | p00456 | C++ | #include<iostream>
using namespace std;
int main(){
int N[11]={},W[11]={},x;
int Ns=0;Ws=0;
for(int i=0;i<9;i++)
{cin>>x;N[i]=x;}
for(int i=0;i<9;i++)
{cin>>x;W[i]=x;}
for(int i=0;i<9;i++)
{for(int j=9;j>j;j--)
{if(N[j]>N[j-1]){int t=N[j];N[j]=N[j-1];N[j-1]=t;}
if(W[j]>W[j-1]){int t=W[j];W[j]=W[j-1];W[j-1]=t;}
}
}
fo... | a.cc: In function 'int main()':
a.cc:6:10: error: 'Ws' was not declared in this scope; did you mean 'Ns'?
6 | int Ns=0;Ws=0;
| ^~
| Ns
|
s421414526 | p00456 | C++ | #include<iostream>
using namespace std;
int main(){
int N[11]={},W[11]={},x;
int Ns=0;Ws=0;
for(int i=0;i<9;i++)
{cin>>x;N[i]=x;}
for(int i=0;i<9;i++)
{cin>>x;W[i]=x;}
for(int i=0;i<9;i++)
{for(int j=9;j>j;j--)
{if(N[j]>N[j-1]){int t=N[j];N[j]=N[j-1];N[j-1]=t;}
if(W[j]>W[j-1]){int t=W[j];W[j]=W[j-1];W[j-1]=t;}
}
}
fo... | a.cc: In function 'int main()':
a.cc:6:10: error: 'Ws' was not declared in this scope; did you mean 'Ns'?
6 | int Ns=0;Ws=0;
| ^~
| Ns
|
s156663806 | p00456 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int a[20];
for (int i = 0;i <= 19;i++){
cin >> a[i];
}
int w = 0;int k = 0;
for(int i = 3;i <= 9;i++){
int p = a[i];
for(int ii =0;ii <= 2;ii++){
if(p > a[ii]){
swap(a[ii],p);
}
}
}
w = a[0] + a[1] + a[2];
for(int i = 13;i <=... | a.cc: In function 'int main()':
a.cc:29:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
29 | cout >> w >>" " >> k >> endl;
| ~~~~ ^~ ~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:29:7: note... |
s801714616 | p00456 | C++ | #include <iostream>
#include <set>
using namespace std;
int main()
{
set<int> a;
int h = 0;
int hh = 0;
for (int b = 0; b < 10; b++)
{
int c;
cin >> c;
a.insert(-c);
}
set<int>::iterator it = a.begin();
for (int g = 0; g < 3; g++)
{
h -= *it;
*it++;
}
set<int> aa;
int h = 0;
for (int bb = 0; bb ... | a.cc: In function 'int main()':
a.cc:23:13: error: redeclaration of 'int h'
23 | int h = 0;
| ^
a.cc:8:13: note: 'int h' previously declared here
8 | int h = 0;
| ^
a.cc:24:35: error: 'b' was not declared in this scope; did you mean 'bb'?
24 | for (i... |
s879958193 | p00456 | C++ | #include <iostream>
#include <set>
using namespace std;
int main()
{
set<int> a;
int h = 0;
int hh = 0;
for (int b = 0; b < 10; b++)
{
int c;
cin >> c;
a.insert(-c);
}
set<int>::iterator it = a.begin();
for (int g = 0; g < 3; g++)#include <iostream>
#include <set>
using namespace std;
int main()
{
set<... | a.cc:17:36: error: stray '#' in program
17 | for (int g = 0; g < 3; g++)#include <iostream>
| ^
a.cc: In function 'int main()':
a.cc:17:37: error: 'include' was not declared in this scope
17 | for (int g = 0; g < 3; g++)#include <iostream>
| ... |
s206653745 | p00456 | C++ | #include <iostream>
#include <set>
using namespace std;
int main()
{
set<int> a;
int h = 0;
int hh = 0;
for (int b = 0; b < 10; b++)
{
int c;
cin >> c;
a.insert(-c);
}
set<int>::iterator it = a.begin();
for (int g = 0; g < 3; g++)
{
h -= *it;
*it++;
}
set<int> aa;
int h = 0;
for (int bb = 0; bb ... | a.cc: In function 'int main()':
a.cc:23:13: error: redeclaration of 'int h'
23 | int h = 0;
| ^
a.cc:8:13: note: 'int h' previously declared here
8 | int h = 0;
| ^
|
s576258761 | p00456 | C++ | #include <iostream>
#include <set>
using namespace std;
int main()
{
set<int> a;
int h = 0;
int hh = 0;
for (int b = 0; b < 10; b++)
{
int c;
cin >> c;
a.insert(-c);
}
set<int>::iterator it = a.begin();
for (int g = 0; g < 3; g++)
{
h -= *it;
*it++;
}
set<int> aa;
int h = 0;
for (int bb = 0; bb ... | a.cc: In function 'int main()':
a.cc:23:13: error: redeclaration of 'int h'
23 | int h = 0;
| ^
a.cc:8:13: note: 'int h' previously declared here
8 | int h = 0;
| ^
|
s461032577 | p00456 | C++ | #include <cstdio>
#include <iostream>
#include <array>
#include <algorithm>
using namespace std;
int main() {
array<array<int,10>,2> ar;
for(int i = 0; 2 > i; i++){
for(int j = 0; 10 > j; j++){
scanf("%d\n", &ar[i][j]);
}
sort(ar[i].begin(), ar[i].end(), [](int a, int b){return a > b;});
}
printf("%d %d\n... | a.cc: In function 'int main()':
a.cc:15:27: error: 'accumulate' was not declared in this scope
15 | printf("%d %d\n", accumulate(ar[0].begin(), ar[0].begin()+3, 0), accumulate(ar[1].begin(), ar[1].begin()+3, 0));
| ^~~~~~~~~~
|
s821793414 | p00456 | C++ | #include <bits/stdc++.h>
#define range(i, a, n) for(int (i) = (a); (i) < (n); (i)++)
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
using namespace std;
int main(void){
vector<int> a(10), b(10);
for(auto & e : a) cin >> e;
for(auto & e : b) cin >> e;
sort(begin(a), end(a), grater<int>());
sor... | a.cc: In function 'int main()':
a.cc:10:28: error: 'grater' was not declared in this scope
10 | sort(begin(a), end(a), grater<int>());
| ^~~~~~
a.cc:10:35: error: expected primary-expression before 'int'
10 | sort(begin(a), end(a), grater<int>());
| ... |
s224586912 | p00456 | C++ | #include<iostream>
using namespace std;
int x[10][2],sum[2],c,d;
int main(){
for(int i=0;i<20;i++){cin>>x[i%10][i/10];}
for(int i=9999;i>=0;i--){if(c>=3){break;}
for(int j=0;j<10;j++){if(x[j][0]==i){c++;sum[0]+=x[j][0]}}}
for(int i=9999;i>=0;i--){if(d>=3){break;}
for(int j=0;j<10;j++){if(x[j][1]==i){d++;sum[1]+=x[j][1]... | a.cc: In function 'int main()':
a.cc:7:57: error: expected ';' before '}' token
7 | for(int j=0;j<10;j++){if(x[j][0]==i){c++;sum[0]+=x[j][0]}}}
| ^
| ;
a.cc:9:57: error: expected ';' before '}... |
s372600175 | p00456 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a[10];
int b[10];
cin>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]>>a[6]>>a[7]>>a[8]>>a[9]>>a[10];
cin>>b[1]>>b[2]>>b[3]>>b[4]>>b[5]>>b[6]>>b[7]>>b[8]>>b[9]>>b[10];
sort(a,a+10);
sort(b,b+10);
int c=a[10]+a[9]+a[8];
int d=b[10]+b[9]+b[8];
co... | a.cc: In function 'int main()':
a.cc:20:18: error: expected '}' at end of input
20 | return 0;
| ^
a.cc:8:11: note: to match this '{'
8 | int main(){
| ^
|
s557935531 | p00456 | C++ | #include <algorithm>
using namespace std;
int main()
{
int w[10], k[10], ans1, ans2;
for (int i = 0; i < 10; i++){
scanf("%d", &w[i]);
}
for (int i = 0; i < 10; i++){
scanf("%d", &k[i]);
}
sort(w, w+10);
sort(k, k+10);
ans1 = w[9] + w[8] + w[7];
ans2 = k[9] + k[8] + k[7];
printf("%d %d\n", an... | a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf' was not declared in this scope
9 | scanf("%d", &w[i]);
| ^~~~~
a.cc:12:17: error: 'scanf' was not declared in this scope
12 | scanf("%d", &k[i]);
| ^~~~~
a.cc:22:9: error: 'printf... |
s105841926 | p00456 | C++ | #include<cstdio>
#include<string>
#include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> a;
vector<int> b;
for(int i=0;i<10;i++){
int c;
cin>>c;
a.push_back(c);
}
for(int i=0;i<10;i++){
int c;
cin>>c;
b.push_back(c);
}
sort(a.begin(), a.end());
sort(b.begin(), b... | a.cc: In function 'int main()':
a.cc:26:9: error: 'sort' was not declared in this scope; did you mean 'short'?
26 | sort(a.begin(), a.end());
| ^~~~
| short
|
s755941803 | p00456 | C++ | #include <cstdio>
using namespace std;
int main()
{
int w[3],x;
for(int j=0;j<2;j++){
memset(w,0,sizeof(w));
for(int i=0;i<10;i++){
scanf("%d",&x);
if(x>w[0]){w[2]=w[1]; w[1]=w[0]; w[0]=x}
else if(x>w[1]) {w[2]=w[1]; w[1]=x;}
else if(x>w[2]) w[2]=x;
}
printf("%d\n",w[0]+w[1]+w[2]);
}
} | a.cc: In function 'int main()':
a.cc:7:2: error: 'memset' was not declared in this scope
7 | memset(w,0,sizeof(w));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <cstdio>
+++ |+#include <cstring>
2 | using n... |
s725432131 | p00456 | C++ | #include <cstdio>
using namespace std;
int main()
{
int w[3],x;
for(int j=0;j<2;j++){
memset(w,0,sizeof(w));
for(int i=0;i<10;i++){
scanf("%d",&x);
if(x>w[0]){w[2]=w[1]; w[1]=w[0]; w[0]=x;}
else if(x>w[1]) {w[2]=w[1]; w[1]=x;}
else if(x>w[2]) w[2]=x;
}
printf("%d\n",w[0]+w[1]+w[2]);
}
} | a.cc: In function 'int main()':
a.cc:7:2: error: 'memset' was not declared in this scope
7 | memset(w,0,sizeof(w));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <cstdio>
+++ |+#include <cstring>
2 | using n... |
s949804964 | p00456 | C++ | #include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
int w[3],x;
for(int j=0;j<2;j++){
memset(w,0,sizeof(w));
for(int i=0;i<10;i++){
scanf("%d",&x);
if(x>w[0]){w[2]=w[1]; w[1]=w[0]; w[0]=x;}
else if(x>w[1]) {w[2]=w[1]; w[1]=x;}
else if(x>w[2]) w[2]=x;
}
printf("%d\n",w[0]+w[1]+w[2]);
}
} | a.cc: In function 'int main()':
a.cc:8:2: error: 'memset' was not declared in this scope
8 | memset(w,0,sizeof(w));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstdlib>
+++ |+#include <cstring>
3 | using ... |
s043761417 | p00456 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
char h[3]={ ,\n};
int main()
{
int w[3],x;
for(int j=0;j<2;j++){
memset(w,0,sizeof(w));
for(int i=0;i<10;i++){
scanf("%d",&x);
if(x>w[0]){w[2]=w[1]; w[1]=w[0]; w[0]=x;}
else if(x>w[1]) {w[2]=w[1]; w[1]=x;}
else if(x>w[2]) w[2]=x;
}
pri... | a.cc:5:14: error: stray '\' in program
5 | char h[3]={ ,\n};
| ^
a.cc:5:13: error: expected primary-expression before ',' token
5 | char h[3]={ ,\n};
| ^
a.cc:5:15: error: 'n' was not declared in this scope
5 | char h[3]={ ,\n};
| ^
|
s767722427 | p00456 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
vector<int> a(10);
vector<int> b(10);
for(int i=0;i<10;i++){
cin >> a[i];
}
for(int i=0;i<10;i++){
cin >> b[i];
}
vector<int> c=reverse(a.begin(),a.end());
vector<int> d=reverse(a.begin(),a.end());
sort(c.begin(),c.end());
cout << c[0] + c[1] + c... | a.cc: In function 'int main()':
a.cc:14:30: error: conversion from 'void' to non-scalar type 'std::vector<int>' requested
14 | vector<int> c=reverse(a.begin(),a.end());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:15:30: error: conversion from 'void' to non-scalar type 'std::vector<int>' req... |
s806251133 | p00456 | C++ | 23
23
20
15
15
14
13
9
7
6
25
19
17
17
16
13
12
11
9
5 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 23
| ^~
|
s003438824 | p00456 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;
//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Downloa... | a.cc: In function 'int main()':
a.cc:14:32: error: expected ')' before ';' token
14 | vector<int>v(10;)
| ~ ^
| )
a.cc:14:33: error: expected primary-expression before ')' token
14 | vector<int>v(10;)
| ... |
s140440185 | p00456 | C++ | #include <cstdio>
#include <vector>
using namespace std;
int main(){
vector<int> w, k;
for (int i = 0; i < 10; i++){
int x;
scanf("%d", &x);
w.push_back(x);
}
for (int i = 0; i < 10; i++){
int x;
scanf("%d", &x);
k.push_back(x);
}
sort(w.begin(), w.end());
sort(k.begin(), k.end());
printf("%d %d... | a.cc: In function 'int main()':
a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'short'?
18 | sort(w.begin(), w.end());
| ^~~~
| short
|
s947238870 | p00456 | C++ | #include <stdio.h>
#define N 10
int main(void){
int wScores[N];
int kScores[N];
int wBests,kBests;
for (int i=0;i<N;i++) scanf("%d",&wScores[i]);
for (int i=0;i<N;i++) scanf("%d",&kScores[i]);
wBests=0; kBests=0;
for (int i=0;i<3;i++){
int max, p;
max = 0;
for (int j=0;j<N;j++){
if (wScores[j] > m... | a.cc: In function 'int main()':
a.cc:50:42: error: expected '}' at end of input
50 | printf("%d %d\n",wBests, kBests);
| ^
a.cc:5:15: note: to match this '{'
5 | int main(void){
| ^
|
s165522552 | p00456 | C++ | #include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;
int main(){
int A = 0, B = 0;
int buf;
for (int a = 0; a < 10, a++){
scanf("%d", &buf);
A += buf;
}
for (int a = 0; a < 10, a++){
scanf("%d", &buf);
B += buf;
}
printf("%d %d\n", A, B);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:36: error: expected ';' before ')' token
9 | for (int a = 0; a < 10, a++){
| ^
| ;
a.cc:13:36: error: expected ';' before ')' token
13 | for (int a = 0; a < 10, a++){
| ... |
s654351141 | p00456 | C++ | #include<iostream>
#Include<algorithm>
using namespace std;
int a[10], b[10];
int main(){
for(int i = 0;i < 10;i++){
cin >> a[i];
}
sort(a, a + 10);
for(int i = 0;i < 10;i++){
cin >> b[i];
}
sort(b, b + 10);
cout << a[9] + a[8] + a[7] << " " << b[9] + b[8] + b[7] << endl;
return 0;
} | a.cc:2:2: error: invalid preprocessing directive #Include; did you mean #include?
2 | #Include<algorithm>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(a, a + 10);
| ^~~~
| ... |
s881487280 | p00456 | C++ | #include <bits/stdc++.h>
using namespace std;
#define Rep(i,N) for(int i = 0;i < N;i++)
int main()
{
int data[10];
int sum[2];
Rep(p,2) {
Rep(i,10)cin >> data[i];
sort(data, data + 10,greater<int> );
sum[p] = accumulate(data, data + 3,0);
}
cout << sum[0] << " " << sum[1] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:39: error: expected primary-expression before ')' token
10 | sort(data, data + 10,greater<int> );
| ^
|
s990217922 | p00456 | C++ | a = gets.to_i
b = gets.to_i
c = gets.to_i
d = gets.to_i
e = gets.to_i
f = gets.to_i
g = gets.to_i
h = gets.to_i
i = gets.to_i
j = gets.to_i
k = gets.to_i
l = gets.to_i
m = gets.to_i
n = gets.to_i
o = gets.to_i
p = gets.to_i
q = gets.to_i
r = gets.to_i
s = gets.to_i
t = gets.to_i
print("#{a+b+c+d+e+f+g+h+i+j} ")
print... | a.cc:1:1: error: 'a' does not name a type
1 | a = gets.to_i
| ^
|
s874570998 | p00456 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int P[2];
for(int i = 0; i < 2; i++){
vector<int> point(10);
for(int j = 0; j < 10; j++){
cin >> point[j];
}
sort(point.begin(), point.end());
point[0] + point[1] + point[2];
}
cout << p[0] <<... | a.cc: In function 'int main()':
a.cc:16:11: error: 'p' was not declared in this scope
16 | cout << p[0] << " " << P[1] << endl;
| ^
|
s676599333 | p00456 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int P[2];
for(int i = 0; i < 2; i++){
vector<int> point(10);
for(int j = 0; j < 10; j++){
cin >> point[j];
}
sort(point.rbegin(), point.rend(), );
P[i] = point[0] + point[1] + point[2];
}
cout... | a.cc: In function 'int main()':
a.cc:13:40: error: expected primary-expression before ')' token
13 | sort(point.rbegin(), point.rend(), );
| ^
|
s293519448 | p00456 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> w(10);
vector<int> k(10);
int w1=0;
int w2=0;
int w3=0;
for(int i=0;i<10;++i)
cin>>w[i];
for(int i=0;i<10;++i)
cin>>k[i];
int temp;
for(int i=0;i<10;++i){
if(w1>w[i]){
w1=w[i];
temp=i;
}
}
for(int i=0;i<10;++i)... | a.cc: In function 'int main()':
a.cc:84:12: error: 'k1' was not declared in this scope; did you mean 'w1'?
84 | if(k1>k[i]){
| ^~
| w1
a.cc:91:12: error: 'k2' was not declared in this scope; did you mean 'w2'?
91 | if(k2>k[i]){
| ^~
| ... |
s040048515 | p00456 | C++ | using namespace std;
int main(){
int p[10];
for(int i=0;i<2;i++){
for(int j=0;j<10;j++)cin>>p[j];
sort(p,p+10);
if(i)cout<<" ";
cout<<p[7]+p[8]+p[9];
}
cout<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:38: error: 'cin' was not declared in this scope
5 | for(int j=0;j<10;j++)cin>>p[j];
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#... |
s315391888 | p00456 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main()
{
int a;
// int w[10] = {0};
// int k[10] = {0};
vector<int> w(10);
vector<int> k(10);
for(int i = 0; i < 10; i++){
cin >> w[i];
}
for(int i = 0; i < 10; i++){
cin >> k[i];
}
sort(w.begin(), w.end());
sort(k.begin(), k.end());
... | a.cc: In function 'int main()':
a.cc:23:9: error: 'sort' was not declared in this scope; did you mean 'short'?
23 | sort(w.begin(), w.end());
| ^~~~
| short
|
s242696000 | p00456 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int a;
vector<int> vc;
for(int i=0 ; i<10 ; ++i ){
cin >> a;
vc.push_back( a );
}
sort( vc.begin() , vc.end() );
cout << vc[9]+vc[8]+vc[7] << " ";
vc.clear();
for(int i=0 ; i<10 ; ++i ){
cin >> a;
vc.push_back( a );
}
sort( vc.beg... | a.cc: In function 'int main()':
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort( vc.begin() , vc.end() );
| ^~~~
| short
|
s987731756 | p00456 | C++ | #include <stdio.h>
#include <stdlib.h>
int d0,d1,d2,d3,dmax,x,y;
int board[92][92];
int Search(x,y){
if(board[x][y]==0) return 0;
board[x][y]=0;
d0=Search((x-1),y);
dmax=d0;
d1=Search((x+1),y);
if(dmax<d1) dmax=d1;
d2=Search(x,(y-1));
if(dmax<d2) dmax=d2;
d3=Search(x,(y+1));
if(dmax<d3) dmax=d3;
bo... | a.cc:8:15: error: expression list treated as compound expression in initializer [-fpermissive]
8 | int Search(x,y){
| ^
a.cc:8:16: error: expected ',' or ';' before '{' token
8 | int Search(x,y){
| ^
a.cc: In function 'int main()':
a.cc:41:41: error: 'Search' cannot be u... |
s486797231 | p00456 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> w(10);
vector<int> k(10);
for(int i=0; i<10; i++){
cin >> w[i];
}
for(int i=0; i<10; i++){
cin >> k[i];
}
sort(w.begin(), w.end(), greater<int>());
sort(k.begin(), k.end(), greater<int>... | a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
17 | sort(w.begin(), w.end(), greater<int>());
| ^~~~
| short
|
s581512662 | p00456 | C++ | #include <cstdi>
#include <cstdlib>
using namespace std;
int main() {
int w[10],k[10];
int i,j,p,q,t,s;
int wsum=0,ksum=0,swap;
for(i=0;i<10;i++) {
scanf("%d\n",&w[i]);
}
for(t=0;t<10;t++){
for(j=0;j<10;j++){
if (w[j]>w[j+1]) {
swap=w[j];
w[j]=w[j+1];
w[j+1]=swap;
}
}
}
wsum=w[9]+w[8]+... | a.cc:1:10: fatal error: cstdi: No such file or directory
1 | #include <cstdi>
| ^~~~~~~
compilation terminated.
|
s538238663 | p00456 | C++ | #include <vector>
#include <iostream>
using namespace std;
int main(){
vector<int> w, k;
int b;
for (int i = 0; i < 10; i++){
cin >> b;
w.push_back(b);
}
for (int i = 0; i < 10; i++){
cin >> b;
k.push_back(b);
}
sort(w.begin(), w.end(), greater<int>());
sort(k.begin(), k.end(), gre... | a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
17 | sort(w.begin(), w.end(), greater<int>());
| ^~~~
| short
|
s099285208 | p00456 | C++ | #include<iostream>
using namespace std;
int main(void){
int ans1=0,ans2=0,a[10],b[10];
for(int i=0;i<10;i++) cin>> a[i];
for(int i=0;i<10;i++) cin >> b[i];
sort(a,a+10);
sort(b,b+10);
for(int i=7;i<=9;i++){
ans1 +=a[i];
ans2 +=b[i];
}cout << ans1<< " " << ans2<< endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'sort' was not declared in this scope; did you mean 'short'?
7 | sort(a,a+10);
| ^~~~
| short
|
s921865191 | p00456 | C++ | #include <stdio.h>
int main(){
int a=0,b=0,c=0,s;
int i,j;
for(i=0,i<10,i++){
scanf("%d \n",&s);
if(s>a){
c=b;
b=a;
a=s;
}
else if(s>b){
c=b;
b=s;
}
else if(s>c){
c = s;
}
}
printf("%d ",a+b+c);
a=0; b=0; c=0;
for(i=0,i<10,i++){
scanf("%d \n",&s);
if(s>a){
c=b;
b=a;
... | a.cc: In function 'int main()':
a.cc:6:25: error: expected ';' before ')' token
6 | for(i=0,i<10,i++){
| ^
| ;
a.cc:22:12: error: expected ')' before ';' token
22 | a=0; b=0; c=0;
| ^
| )
a.cc:6:12: note... |
s739489902 | p00456 | C++ | #include <stdio.h>
void swap(int *a,int *b){
int tmp;
tmp = *a;
*a=*b;
*b=tmp;
return;
}
int main(){
int i,n,k[10],w[10],K,W;
K=W=0;
for(i=0;i<10;i++){
scanf("%d",&n);
w[i]=n;
}
for(i=0;i<10;i++){
scanf("%d",&n);
k[i]=n;
}
for(i=0;i<3;i++){
for(int j=i+1;j<10;j++) if(k[i... | a.cc: In function 'int main()':
a.cc:21:57: error: invalid conversion from 'int' to 'int*' [-fpermissive]
21 | for(int j=i+1;j<10;j++) if(k[i]<k[j]) swap(&k[i],k[j]);
| ~~~^
| |
| ... |
s524608197 | p00456 | C++ | #include <iostream>
using namespace std;
int main(){
int sum[2] = {0};
for(int i = 0; i < 2; i++){
int x[10];
for(int j = 0; j < 10; j++){
cin >> x[j];
}
sort(x, x + 10);
sum[i] += x[9] + x[8] + x[7];
}
cout << sum[0] << " " << sum[1] << endl;
} | a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(x, x + 10);
| ^~~~
| short
|
s310040713 | p00457 | C | #include <stdio.h>
int chain(int chara[],int i,int j,int n){
int count1,count2,c,k,m;
count1 = count2 = 0;
chara[i] = j;
for(c = i;chara[i] == chara[i+1] && i < n-1 ;c++){
count1++;
}
for(c = i;chara[i] == chara[i-1] && i > 0 ;c--){
count2++;
}
if(count1 + count2 < 3) return 0;
else {
fo... | main.c: In function 'chain':
main.c:19:22: error: expected ';' before 'while'
19 | m = count1 + count2
| ^
| ;
20 |
21 | while(1){
| ~~~~~
main.c: At top level:
main.c:36:5: error: expected identifier or '(' before 'if'
36 | ... |
s514047752 | p00457 | C++ | Unacceptable submission | a.cc:1:1: error: 'Unacceptable' does not name a type
1 | Unacceptable submission
| ^~~~~~~~~~~~
|
s854407190 | p00457 | C++ | #include <cstdio>
#include <algorithm>
#define INF (500000)
using namespace std;
int array[20000];
int main()
{
int N;
while (scanf("%d", &N), N){
memset(array, 0, sizeof(array));
for (int i = 1; i <= N; i++){
scanf("%d", &array[i]);
}
int mini = INF;
for (int i = 1; i <= N; i++){
for (int ... | a.cc: In function 'int main()':
a.cc:12:24: error: reference to 'array' is ambiguous
12 | memset(array, 0, sizeof(array));
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
fr... |
s481017836 | p00457 | C++ | include<iostream>
#include<vector>
using namespace std;
struct block{
int color, many;
};
int main()
{
while(true){
int n;
cin >> n;
if(!n) break;
vector<block> line;
vector<block>::iterator p;
int max = 0;
for(int i = 0; i < n; i++){
int in;
cin >> in;
p = line.end(... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_... |
s394720541 | p00457 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
#pragma warning(disable : 4996)
using namespace std;
int main()
{
while (true)
{
int N, A; unsigned MAX = 15000;
vector<int> D;
scanf("%d", &N);
for (int i = 0; i < N; i++)
{
scanf("%d", &A);
D.push_back(A);
}
for (int i = 0; i < N; ... | a.cc: In function 'int main()':
a.cc:76:50: error: no matching function for call to 'min(std::vector<int>::size_type, unsigned int&)'
76 | MAX = min(E.size(), MAX);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/... |
s473124715 | p00457 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
#pragma warning(disable : 4996)
using namespace std;
int main()
{
while (true)
{
int N, A; unsigned MAX = 15000;
vector<int> D;
scanf("%d", &N);
for (int i = 0; i < N; i++)
{
scanf("%d", &A);
D.push_back(A);
}
for (int i = 0; i < N; ... | a.cc: In function 'int main()':
a.cc:76:50: error: no matching function for call to 'min(std::vector<int>::size_type, unsigned int&)'
76 | MAX = min(E.size(), MAX);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/... |
s294794195 | p00457 | C++ | #include<cstdio>
#include<algorithm>
main(){
while(true){
int x[15000],n,i,j,k,l,m,y[15000],b,c,d,p[15000],minx;
scanf("%d", &n);
if(n==0){break;}
for(i=0;i<n;i++){scanf("%d", &y[i]);p[i] = x[i] = y[i];}
c=0;d=0;m=n;d=m;
minx=99999;
for(i=0;i<n;i++){
for(j=1;j<=3;j++){
if(i>=1 && (y[i-1]!=j && y[i+1]!=j)){goto z;}
p[i]... | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:30:6: error: 'min' was not declared in this scope; did you mean 'std::min'?
30 | minx=min(minx,m);x[i]=y[i];
| ^~~
| std::min
In file included ... |
s219775154 | p00457 | C++ | #include<cstdio>
#include<algorithm>
main(){
while(true){
int x[11000],n,i,j,k,l,m,y[11000],b,c,d,p[11000],minx;
scanf("%d", &n);
if(n==0){break;}
for(i=0;i<n;i++){scanf("%d", &y[i]);p[i]=x[i]=y[i];}
c=0;d=0;m=n;d=m;
minx=99999;
for(i=0;i<n;i++){
for(j=1;j<=3;j++){
if(i>=1&&y[i-1]!=j&&y[i+1]!=j)){goto z;}
p[i]=x[i]=j;b... | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:13:31: error: expected primary-expression before ')' token
13 | if(i>=1&&y[i-1]!=j&&y[i+1]!=j)){goto z;}
| ^
|
s883056371 | p00457 | C++ | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;
//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Downloa... | a.cc: In function 'int getans(std::vector<int>&, std::vector<int>&)':
a.cc:38:47: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>'
38 | return num+1 + getans(vector<int>(l.begin(), l.begin() + a+1), vector<int>(r.begin() + b, r.... |
s809815618 | p00457 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
char chain[10000];
int ccount(int a, int b, int cnt){
if (chain[a] != chain[b])return cnt;
int len = 0;
int i, j;
for (i = a; chain[a] == chain[i]; i--, len++);
for (j = b; chain[b] == chain[j]; j++, len++);
if (len < 4)return cnt;
return ccount(i, j, c... | a.cc: In function 'int main()':
a.cc:23:22: error: expected unqualified-id before 'default'
23 | char default = chain[i];
| ^~~~~~~
a.cc:31:28: error: expected primary-expression before 'default'
31 | chain[i] = default;
| ... |
s720137342 | p00457 | C++ | #include<cstdio>
#include<algorithm>
using namespace std;
int n;
char chain[10000];
int ccount(int a, int b, int cnt){
if (chain[a] != chain[b])return cnt;
int len = 0;
int i, j;
for (i = a; chain[a] == chain[i]; i--, len++);
for (j = b; chain[b] == chain[j]; j++, len++);
if (len < 4)return cnt;
return ccount(... | a.cc: In function 'int main()':
a.cc:20:17: error: 'memset' was not declared in this scope
20 | memset(chain, 0, sizeof(chain));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<algorithm... |
s975974315 | p00457 | C++ | #include <stdio.h>
#include <algorithm>
#define INF 123456789
int N, A[11234];
int memo_A[11234];
int bound[11234][3][2];
int ans = INF;
int how_same(int num, int color) {
int s1 = 0, s2 = 0;
for (int i = num + 1; i < N; ++i) {
if (A[i] == color) { ++s1; }
else if (A[i] != -1) {
bound[num][color][0] = i - 1;... | a.cc: In function 'int main()':
a.cc:53:17: error: 'memset' was not declared in this scope
53 | memset(bound, 0, sizeof(bound));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorith... |
s957952448 | p00457 | C++ | #include<stdio.h>
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
using namespace std;
int p[10000]={0},o[10000]={0};
int X(int x){
int e,z,u,t=0,k,g=0,w;
for(e=0;e<x;e++){
u=0;
w=0;
if(o[e]!=0){
for(z=e;z<x;z++){
if(o[e]==o[z])u++;
else if(o[z]==0)w++;
else break;
}
if(u>=4){
... | a.cc: In function 'int X(int)':
a.cc:28:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
28 | int main(){
| ^~
a.cc:28:9: note: remove parentheses to default-initialize a variable
28 | int main(){
| ^~
| --
a.cc:28:9: note: or re... |
s424842869 | p00457 | C++ | #include<stdio.h>
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
using namespace std;
int p[10000]={0},f[10000]={0},o[10000]={0};
/*int X(int x){
int e,z,u,t=0,k,g=0,w;
for(e=0;e<x;e++){
u=0;
w=0;
if(o[e]!=0){
for(z=e;z<x;z++){
if(o[e]==o[z])u++;
else if(o[z]==0)w++;
else br... | a.cc: In function 'int main()':
a.cc:52:1: error: 't' was not declared in this scope
52 | t=1;
| ^
a.cc:56:11: error: 'x' was not declared in this scope
56 | for(e=0;e<x;e++){
| ^
a.cc:73:49: error: 'g' was not declared in this scope
73 | m=min(m,g)... |
s333409373 | p00457 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
#define col first
#define cn second
typedef pair<int, int> PR;
pair<int, int> puyo[10000+10] , tmp;
int sum;
int chek(int , /*PR[10000 + 10],*/ int ,int,int);
int main()
{
int n;
int pn=0;
int a;
int i;
int sa=0;
while (cin >> n, n != 0)
{
... | a.cc: In function 'int main()':
a.cc:107:1: error: a function-definition is not allowed here before '{' token
107 | {
| ^
a.cc:120:2: error: expected '}' at end of input
120 | }
| ^
a.cc:19:1: note: to match this '{'
19 | {
| ^
|
s221286456 | p00457 | C++ | 5000
1
1
2
3
1
2
2
1
1
2
2
3
3
2
3
3
1
3
1
2
1
2
3
1
2
3
1
1
2
2
2
3
3
2
3
2
2
1
2
3
3
1
3
3
2
3
2
3
2
2
2
1
1
3
2
2
2
3
3
2
1
2
1
3
2
1
2
1
1
2
2
2
1
2
2
3
2
2
2
3
2
3
3
3
1
2
2
3
1
3
2
1
2
1
3
3
2
2
2
3
1
1
3
3
3
2
1
3
2
1
1
2
2
1
2
1
2
1
1
2
2
1
3
3
2
1
2
3
2
1
2
3
1
2
1
2
1
3
3
3
1
2
3
1
3
2
3
1
2
2
2
3
2
3
3
1
1
2... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5000
| ^~~~
|
s973291971 | p00457 | C++ | #include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n;i>=0;i--)
#define INF 100000005
#define MAX 100001
#define dmp make_pair
#define dpb push_back
#define fi first
#define se second
using namespace std;
//__gcd(a,b), _... | a.cc: In function 'int main()':
a.cc:39:15: error: expected primary-expression before ')' token
39 | while(){
| ^
|
s672362287 | p00457 | C++ | #include<iostream>
#include<vector>
using namespace std;
int check(vector<int> c)
{
bool f=1;
int cnt,i,j;
vector<int>::iterator it,it2;
while(f){
cnt=f=0;
it=it2=c.begin();
for(it++;it!=c.end();it++){
if(*it==*it2){
cnt++;
}else if(cnt>=3){
for(;cnt>=0;cnt--){
it--;
it2=it;
c... | a.cc: In function 'int main()':
a.cc:39:9: error: 'INT_MAX' was not declared in this scope
39 | min=INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include<vector>
+++ |+#include <climits>
3 | usin... |
s046055131 | p00457 | C++ | #include<cstdio>
#include<vector>
#include<algorithm>
#include<stack>
using namespace std;
#define PII pair<int,int>
int x[10020];
int N;
vector< PII > S;
void pa(){
for(int i = 0; i < N; i++){
printf("%s",x[i]==1?"Ô":x[i]==2?"Â":"©");
}puts("");
}
int func(){
int now = 1;
int ret = 0;
PII t;
for(int... | a.cc: In function 'int func()':
a.cc:34:44: error: 'class std::vector<std::pair<int, int> >' has no member named 'top'
34 | }else if(S.top().first == x[i] && S.top().second + now > 3){
| ^~~
a.cc:34:69: error: 'class std::vector<std::pa... |
s679535822 | p00457 | C++ | <?php
class AOJ0534 {
var $T;
var $TC;
var $L;
var $LC;
public function init() {
$L = &$this->L;
$LC = &$this->LC;
$T = &$this->T;
$TC = &$this->TC;
$in = file_get_contents('/dev/stdin');
$L = explode( "\n", trim($in) );
$LC = count($... | a.cc:14:33: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
14 | $in = file_get_contents('/dev/stdin');
| ^~~~~~~~~~~~
a.cc:51:45: error: empty character constant
51 | $s = preg_replace( $regexp, '', $s );
| ... |
s660517343 | p00457 | C++ |
class P
attr_accessor :color, :size
def initialize(color=0, size=0)
@color = color
@size = size
end
end
# [Pair] -> [Pair]
def compless1(v)
res = [v[0]]
v[1..(-1)].each do |e|
if e.color == res[-1].color
res[-1].size += e.size
else
res << e
end
end
res
end
# [Int] -> ... | a.cc:5:5: error: stray '@' in program
5 | @color = color
| ^
a.cc:6:5: error: stray '@' in program
6 | @size = size
| ^
a.cc:10:3: error: invalid preprocessing directive #[
10 | # [Pair] -> [Pair]
| ^
a.cc:14:5: error: too many decimal points in number
14 | v[1..(-1)... |
s523075829 | p00458 | Java | d
| Main.java:1: error: reached end of file while parsing
?
^
1 error
|
s455270992 | p00458 | Java | import java.util.*;
public class Main {
static int n, m, ans;
static int[] dx = {0,0,-1,1}, dy = {-1,1,0,0};
static boolean[][] map, check;
public static void dfs (int y, int x, int step) {
max[y][x] = step;
check[y][x] = true;
boolean f = true;
for (int i = 0; i < dx.length; i++) {
int nextX = x + dx... | Main.java:10: error: cannot find symbol
max[y][x] = step;
^
symbol: variable max
location: class Main
Main.java:36: error: cannot find symbol
max = new int[n][m];
^
symbol: variable max
location: class Main
2 errors
|
s775075376 | p00458 | Java | import java.io.*;
public class Main2 {
static int n, m;
static int[] dx = {0,0,-1,1}, dy = {-1,1,0,0};
static boolean[][] map, check;
public static int dfs(int y, int x) {
int ret = 0;
for (int d = 0 ; d < 4 ; d++) {
int nextX = x + dx[d];
int nextY = y + dy[d];
if (0 <= nextX && nextX < m &&
0 ... | Main.java:2: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
^
1 error
|
s193466809 | p00458 | C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int InputIce[90][90];
int Ice[92][92];
int way=0;
int height; //???
int width; //?¨?
int count=0,count_z=0;
void Check(int a,int b,int count_z){
//a:height,b:width
//?????????count++??????
count_z++;
//????????????
Ice[a][b]=0;
if(I... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s153646286 | p00458 | C | #include <stdio.h>
long tyousa(int,long,int,int,int*);
int main(void) {
int map[92*92];
int mapbak[92*92];
int tate;
int yoko;
int x;
int y;
int i;
long result;
long resultbuf;
while(1) {
scanf("%d",&yoko);
scanf("%d",&tate);
if(yoko==0 && tate==0)break;
for(y=0;y<92;y++) {
for(x=0;x<92;x++) {
... | main.c: In function 'main':
main.c:29:24: error: 'fp' undeclared (first use in this function)
29 | fclose(fp);
| ^~
main.c:29:24: note: each undeclared identifier is reported only once for each function it appears in
|
s419156862 | p00458 | C | int X,Y,T[90][90],r;
int R(int x,int y,int d){
if(0<=x&&x<X&&0<=y&&y<Y&&T[y][x]){
T[y][x]=0;
R(x-1,y);
R(x+1,y);
R(x,y-1);
R(x,y+1);
T[y][x]=1;
}else if(r<d)r=d;
}
main(){
int i,j;
for(;scanf("%d%d",&X,&Y),X;printf("%d\n",r)){
for(j=0;j<Y;j++)for(i=0;i<X;i++)scanf("%d",T[j]+i);
for(r=j=0;j<Y;j++)for... | main.c: In function 'R':
main.c:5:17: error: too few arguments to function 'R'
5 | R(x-1,y);
| ^
main.c:2:5: note: declared here
2 | int R(int x,int y,int d){
| ^
main.c:6:17: error: too few arguments to function 'R'
6 | R(x+1,y);
| ... |
s947272451 | p00458 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int v[90][90];int memo[90][90];int a;
void dfs(int x,int y,int count){
a=max(a,count);
memo[x][y]=3;
//cout<<x<<""<<y<<"count "<<count<<endl;
if(v[x-1][y]==1&&memo[x-1][y]!=3){//上
dfs(x-1,y,count+1);
}
if... | a.cc: In function 'int main()':
a.cc:46:25: error: 'memset' was not declared in this scope
46 | memset(memo,0,sizeof(memo));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #inclu... |
s720086177 | p00458 | C++ | 目
/*#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int a[10],b[10];
for(int i=0;i<10;i++)cin>>a[i];
for(int i=0;i<10;i++)cin>>b[i];
sort(a,a+10);sort(b,b+10);
cout<<a[9]+a[8]+a[7]<<" "<<b[9]+b[8]+b[7]<<endl;
return 0;
}*/
//3問目
/*#include<iostream>
#... | a.cc:1:1: error: '\U000076ee' does not name a type
1 | 目
| ^~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:72:
/usr/... |
s860628641 | p00458 | C++ | #include<cstdio>
#include<queue>
#include<algorithm>
#include<iostream>
using namespace std;
int field[92][92] = { };
int vx[4] = { 1, -1, 0, 0 };
int vy[4] = { 0, 0, 1, -1 };
int ans = 0,ANSW=0;
int dfs(int X, int Y, int n){
if (field[X][Y]==0)return n;
field[X][Y] = 0;
for (int i = 0; i < 4; i++){
ans = max(a... | a.cc: In function 'int main()':
a.cc:26:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
26 | scanf_s("%d%d", &l, &m);
| ^~~~~~~
| scanf
|
s196693258 | p00458 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int map[100][100];
int n, m;
int maxi;
void Search(int y, int x, int d)
{
maxi = max(maxi, d);
map[y][x] = 0;
// bool f = false;
for (int i = 0; i < 4; i++){
if (map[y + dy[i]][x + d... | a.cc: In function 'int main()':
a.cc:33:17: error: 'memset' was not declared in this scope
33 | memset(map, 0, sizeof(map));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.