submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s649283514
p00488
C
#include<stdio.h> #include<stdlib.h> int main(){ int a[3],b[2],Ans=0,amin=0,bmin=0; scanf("%d",&a[0]); amin=a[0]; scanf("%d",&a[1]); if(amin>a[1])amin=a[1]; scanf("%d",&a[2]); if(amin>a[2])amin=a[2]; scanf("%d",&b[0]); scanf("%d",&b[1]); bmin=min(b[0],b[1]); Ans=amin+bmin-50; printf("%d\n",Ans); return 0; }
main.c: In function 'main': main.c:15:14: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration] 15 | bmin=min(b[0],b[1]); | ^~~ | main
s086846517
p00488
C
#include <stdio.h> int main(void) { int pasta[3]; int juice[2]; int minPasta; int minJuice; int i; pastaMin = 2001; for (i = 0; i < 3; i++){ scanf("%d", &pasta[i]); if (pastaMin < pasta[i]){ pastaMin = pasta[i]; } } juiceMin = 2001; for (i = 0; i < 2; i++){ scanf("%d", &juice[i]); if (juiceMin < juice[i]){ juiceMin = juice[i]; } } printf("%d\n", pastaMin + juiceMin - 50); return (0); }
main.c: In function 'main': main.c:11:5: error: 'pastaMin' undeclared (first use in this function); did you mean 'pasta'? 11 | pastaMin = 2001; | ^~~~~~~~ | pasta main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in main.c:19:5: error: 'juiceMin' undeclared (first use in this function); did you mean 'juice'? 19 | juiceMin = 2001; | ^~~~~~~~ | juice
s137438223
p00488
C
#include <cstdio> #include <vector> #include <algorithm> using namespace std; vector<int> read(int n) { vector<int> v(n); for (int i = 0; i < n; ++i) scanf("%d\n", &v[i]); sort(v.begin(), v.end()); return v; } int main() { const vector<int> pasta = read(3); const vector<int> juice = read(2); const int res = pasta[0] + juice[0] - 50; printf("%d\n", res); return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s770729864
p00488
C
#include <stdio.h> int main () { int p1,p2,p3,p4,p5; int pm,jm; scanf (" %d%d%d%d%d",&p1,&p2,&p3,&4,&5); if (p1>p2||p3>p2) &#160; &#160; pm=p2; else if (p2>p3||p1>p3) &#160; &#160; pm=p3; else&#160; &#160; &#160; pm=p1; if (p4>p5) &#160; &#160; jm=p5; else&#160; &#160; &#160;&#160;jm=p4; printf("%d",pm+jm); return 0; }
main.c: In function 'main': main.c:8:34: error: lvalue required as unary '&' operand 8 | scanf (" %d%d%d%d%d",&p1,&p2,&p3,&4,&5); | ^ main.c:8:37: error: lvalue required as unary '&' operand 8 | scanf (" %d%d%d%d%d",&p1,&p2,&p3,&4,&5); | ^ main.c:11:2: error: stray '#' in program 11 | &#160; &#160; pm=p2; | ^ main.c:11:1: error: lvalue required as unary '&' operand 11 | &#160; &#160; pm=p2; | ^ main.c:11:9: error: stray '#' in program 11 | &#160; &#160; pm=p2; | ^ main.c:11:8: error: lvalue required as unary '&' operand 11 | &#160; &#160; pm=p2; | ^ main.c:12:1: error: 'else' without a previous 'if' 12 | else if (p2>p3||p1>p3) | ^~~~ main.c:13:2: error: stray '#' in program 13 | &#160; &#160; pm=p3; | ^ main.c:13:1: error: lvalue required as unary '&' operand 13 | &#160; &#160; pm=p3; | ^ main.c:13:9: error: stray '#' in program 13 | &#160; &#160; pm=p3; | ^ main.c:13:8: error: lvalue required as unary '&' operand 13 | &#160; &#160; pm=p3; | ^ main.c:14:1: error: 'else' without a previous 'if' 14 | else&#160; | ^~~~ main.c:14:6: error: stray '#' in program 14 | else&#160; | ^ main.c:14:5: error: lvalue required as unary '&' operand 14 | else&#160; | ^ main.c:15:2: error: stray '#' in program 15 | &#160; &#160; pm=p1; | ^ main.c:15:1: error: lvalue required as unary '&' operand 15 | &#160; &#160; pm=p1; | ^ main.c:15:9: error: stray '#' in program 15 | &#160; &#160; pm=p1; | ^ main.c:15:8: error: lvalue required as unary '&' operand 15 | &#160; &#160; pm=p1; | ^ main.c:18:2: error: stray '#' in program 18 | &#160; &#160; jm=p5; | ^ main.c:18:1: error: lvalue required as unary '&' operand 18 | &#160; &#160; jm=p5; | ^ main.c:18:9: error: stray '#' in program 18 | &#160; &#160; jm=p5; | ^ main.c:18:8: error: lvalue required as unary '&' operand 18 | &#160; &#160; jm=p5; | ^ main.c:19:1: error: 'else' without a previous 'if' 19 | else&#160; | ^~~~ main.c:19:6: error: stray '#' in program 19 | else&#160; | ^ main.c:19:5: error: lvalue required as unary '&' operand 19 | else&#160; | ^ main.c:20:2: error: stray '#' in program 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:1: error: lvalue required as unary '&' operand 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:9: error: stray '#' in program 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:8: error: lvalue required as unary '&' operand 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:15: error: stray '#' in program 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:14: error: lvalue required as unary '&' operand 20 | &#160; &#160;&#160;jm=p4; | ^
s924282393
p00488
C
#include <stdio.h> int main () { int p1,p2,p3,p4,p5; int pm,jm; scanf (" %d%d%d%d%d",&p1,&p2,&p3,&4,&5); if (p1>p2||p3>p2) &#160; &#160; pm=p2; else if (p2>p3||p1>p3) &#160; &#160; pm=p3; else&#160; &#160; &#160; pm=p1; if (p4>p5) &#160; &#160; jm=p5; else&#160; &#160; &#160;&#160;jm=p4; printf("%d",pm+jm); return (0); }
main.c: In function 'main': main.c:8:34: error: lvalue required as unary '&' operand 8 | scanf (" %d%d%d%d%d",&p1,&p2,&p3,&4,&5); | ^ main.c:8:37: error: lvalue required as unary '&' operand 8 | scanf (" %d%d%d%d%d",&p1,&p2,&p3,&4,&5); | ^ main.c:11:2: error: stray '#' in program 11 | &#160; &#160; pm=p2; | ^ main.c:11:1: error: lvalue required as unary '&' operand 11 | &#160; &#160; pm=p2; | ^ main.c:11:9: error: stray '#' in program 11 | &#160; &#160; pm=p2; | ^ main.c:11:8: error: lvalue required as unary '&' operand 11 | &#160; &#160; pm=p2; | ^ main.c:12:1: error: 'else' without a previous 'if' 12 | else if (p2>p3||p1>p3) | ^~~~ main.c:13:2: error: stray '#' in program 13 | &#160; &#160; pm=p3; | ^ main.c:13:1: error: lvalue required as unary '&' operand 13 | &#160; &#160; pm=p3; | ^ main.c:13:9: error: stray '#' in program 13 | &#160; &#160; pm=p3; | ^ main.c:13:8: error: lvalue required as unary '&' operand 13 | &#160; &#160; pm=p3; | ^ main.c:14:1: error: 'else' without a previous 'if' 14 | else&#160; | ^~~~ main.c:14:6: error: stray '#' in program 14 | else&#160; | ^ main.c:14:5: error: lvalue required as unary '&' operand 14 | else&#160; | ^ main.c:15:2: error: stray '#' in program 15 | &#160; &#160; pm=p1; | ^ main.c:15:1: error: lvalue required as unary '&' operand 15 | &#160; &#160; pm=p1; | ^ main.c:15:9: error: stray '#' in program 15 | &#160; &#160; pm=p1; | ^ main.c:15:8: error: lvalue required as unary '&' operand 15 | &#160; &#160; pm=p1; | ^ main.c:18:2: error: stray '#' in program 18 | &#160; &#160; jm=p5; | ^ main.c:18:1: error: lvalue required as unary '&' operand 18 | &#160; &#160; jm=p5; | ^ main.c:18:9: error: stray '#' in program 18 | &#160; &#160; jm=p5; | ^ main.c:18:8: error: lvalue required as unary '&' operand 18 | &#160; &#160; jm=p5; | ^ main.c:19:1: error: 'else' without a previous 'if' 19 | else&#160; | ^~~~ main.c:19:6: error: stray '#' in program 19 | else&#160; | ^ main.c:19:5: error: lvalue required as unary '&' operand 19 | else&#160; | ^ main.c:20:2: error: stray '#' in program 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:1: error: lvalue required as unary '&' operand 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:9: error: stray '#' in program 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:8: error: lvalue required as unary '&' operand 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:15: error: stray '#' in program 20 | &#160; &#160;&#160;jm=p4; | ^ main.c:20:14: error: lvalue required as unary '&' operand 20 | &#160; &#160;&#160;jm=p4; | ^
s610545852
p00488
C
#include <stdio.h> int main () { int pa,pb,pc; //入力されたパスタ価格三つ int ja,jb; //入力された飲料価格二つ int pm,jm; //求めた最小値二つ scanf ("%d%d%d%d%d",&pa,&pb,&pc,&ja,&jb); //入力の読み込み if ( pa >= pb && pc >= pb ) //パスタの最小 pm = pb; else if ( pb >= pc || pa >= pc ) pm = pc; else pm = pa; if ( ja >= jb ) //飲料の最小値を算出 jm = ja; else jm = jb; printf("%d", pm + jm ); //出力 return (0); } //end
main.c: In function 'main': main.c:12:36: error: stray '\343' in program 12 | if ( pa >= pb && pc >= pb )<U+3000>//<U+30D1><U+30B9><U+30BF><U+306E><U+6700><U+5C0F> | ^~~~~~~~ main.c:19:24: error: stray '\343' in program 19 | if ( ja >= jb )<U+3000>//<U+98F2><U+6599><U+306E><U+6700><U+5C0F><U+5024><U+3092><U+7B97><U+51FA> | ^~~~~~~~ main.c:24:32: error: stray '\343' in program 24 | printf("%d", pm + jm );<U+3000>//<U+51FA><U+529B> | ^~~~~~~~
s976863550
p00488
C
#include <stdio.h> int main () { int pa,pb,pc; int ja,jb; int pm,jm; scanf ("%d%d%d%d%d",&pa,&pb,&pc,&ja,&jb); if ( pa >= pb && pc >= pb ){ pm = pb; }else if ( pb >= pc || pa >= pc ){ pm = pc; }else pm = pa; } if ( ja >= jb ){ jm = ja; }else jm = jb; } printf("%d", pm + jm ); return (0); }
main.c:20:9: error: expected identifier or '(' before 'if' 20 | if ( ja >= jb ){ | ^~ main.c:22:18: error: expected identifier or '(' before 'else' 22 | }else | ^~~~ main.c:24:27: error: expected identifier or '(' before '}' token 24 | } | ^ main.c:26:16: error: expected declaration specifiers or '...' before string constant 26 | printf("%d", pm + jm ); | ^~~~ main.c:26:22: error: unknown type name 'pm' 26 | printf("%d", pm + jm ); | ^~ main.c:28:9: error: expected identifier or '(' before 'return' 28 | return (0); | ^~~~~~ main.c:30:1: error: expected identifier or '(' before '}' token 30 | } | ^
s050388335
p00488
C
#include<stdio.h> void min(int x,int y){ return (x < y) x : y; int main(void){ int a,b,c,d,e; scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); printf("%d\n",min(a,min(b,c))+min(d,e)-50); return 0; }
main.c: In function 'min': main.c:3:15: error: 'return' with a value, in function returning void [-Wreturn-mismatch] 3 | return (x < y) x : y; | ~~~^~~~ main.c:2:6: note: declared here 2 | void min(int x,int y){ | ^~~ main.c:3:19: error: expected ';' before 'x' 3 | return (x < y) x : y; | ^~ | ; main.c: In function 'main': main.c:7:25: error: invalid use of void expression 7 | printf("%d\n",min(a,min(b,c))+min(d,e)-50); | ^~~~~~~~ main.c:7:35: error: void value not ignored as it ought to be 7 | printf("%d\n",min(a,min(b,c))+min(d,e)-50); | ^~~~~~~~ main.c: In function 'min': main.c:9:1: error: expected declaration or statement at end of input 9 | } | ^
s240836905
p00488
C
#include<stdio.h> void min(int x,int y){ return (x < y) ? x : y; } int main(void){ int a,b,c,d,e; scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); printf("%d\n",min(a,min(b,c))+min(d,e)-50); return 0; }
main.c: In function 'min': main.c:3:24: error: 'return' with a value, in function returning void [-Wreturn-mismatch] 3 | return (x < y) ? x : y; | ~~~~~~~~~~~~^~~ main.c:2:6: note: declared here 2 | void min(int x,int y){ | ^~~ main.c: In function 'main': main.c:8:25: error: invalid use of void expression 8 | printf("%d\n",min(a,min(b,c))+min(d,e)-50); | ^~~~~~~~ main.c:8:35: error: void value not ignored as it ought to be 8 | printf("%d\n",min(a,min(b,c))+min(d,e)-50); | ^~~~~~~~
s667613389
p00488
C
#include<stdio.h> iny main(void){ int a[3],b[2],c,i; for(i=0;i<3;i++){ scanf("%d",&a[i]); } for(i=0;i<2;i++){ scanf("%d",&b[i]); } if(a[0]>=a[1]){ c=a[0]; a[0]=a[1]; a[1]=c; } if(a[1]>=a[2]){ c=a[1]; a[1]=a[2]; a[2]=c; } if(b[0]>=b[1]){ c=b[0]; b[0]=b[1]; b[1]=c; } printf("%d\n"a[0]+b[0]-50); }
main.c:2:1: error: unknown type name 'iny'; did you mean 'int'? 2 | iny main(void){ | ^~~ | int main.c: In function 'main': main.c:25:18: error: expected ')' before 'a' 25 | printf("%d\n"a[0]+b[0]-50); | ~ ^ | )
s783424185
p00488
C
#include<stdio.h> int main(){ int p[3],j[2],minp,minj; scanf("%d",p[0]); minp=p[0]; scanf("%d",p[1]); if(minp>p[1])minp=p[1]; scanf("%d",p[2]); if(minp>p[2])minp=p[2]; scanf("%d",j[0]); minj=j[0]; scanf("%d",j[1]); if(minj>j[1])minj=j[1]; printf("%d\n"minp+minj-50); return 0; }
main.c: In function 'main': main.c:16:14: error: expected ')' before 'minp' 16 | printf("%d\n"minp+minj-50); | ~ ^~~~ | )
s459113858
p00488
C
#include<stdio.h> int main(){ int p[3],j[2],minp,minj; scanf("%d",p[0]); minp=p[0]; scanf("%d",p[1]); if(minp>p[1])minp=p[1]; scanf("%d",p[2]); if(minp>p[2])minp=p[2]; scanf("%d",j[0]); minj=j[0]; scanf("%d",j[1]); if(minj>j[1])minj=j[1]; printf("%d\n",minp+minj-50); return 0; }
main.c:1:19: warning: extra tokens at end of #include directive 1 | #include<stdio.h> int main(){ int p[3],j[2],minp,minj; scanf("%d",p[0]); minp=p[0]; scanf("%d",p[1]); if(minp>p[1])minp=p[1]; scanf("%d",p[2]); if(minp>p[2])minp=p[2]; scanf("%d",j[0]); minj=j[0]; scanf("%d",j[1]); if(minj>j[1])minj=j[1]; printf("%d\n",minp+minj-50); return 0; } | ^~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s508596216
p00488
C++
#include<stdio.h> int main(void) { int a,b,c,d,e,m,n,ans; scanf("%d %d %d %d %d",&a,&b,&c,&d,&e); if(a<=b&&a<=){ m=a-25; } else if(b<=a&&b<=c){ m=b-25; } else{ m=c-25; } if(d<=e){ n=d-25; } else{ n=e-25; } ans=m+n; printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:6:21: error: expected primary-expression before ')' token 6 | if(a<=b&&a<=){ | ^
s013703862
p00488
C++
#include <iostream> #include <vector> int main(){ int buffer; int pasta_min,juice_min; std::vector<int> pasta; std::vector<int> juice; for(int i=0;i<3;i++){ std::cout >> buffer; pasta.push_back(buffer); } for(i=0;i<2;i++){ std::cout >> buffer; juice.push_back(buffer); } pasta_min = *std::min_element(pasta.begin(), pasta.end()); juice_min = *std::min_element(juice.begin(), juice.end()); std::cout << pasta_min+juice_min-50 << std::endl; }
a.cc: In function 'int main()': a.cc:11:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 11 | std::cout >> buffer; | ~~~~~~~~~ ^~ ~~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:11:13: note: candidate: 'operator>>(int, int)' (built-in) 11 | std::cout >> buffer; | ~~~~~~~~~~^~~~~~~~~ a.cc:11:13: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:11:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | std::cout >> buffer; | ^~~~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:11:8: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 11 | std::cout >> buffer; | ~~~~~^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:11:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:11:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:11:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:11:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:11:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:11:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:11:16: required from here 11 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:14:5: error: 'i' was not declared in this scope 14 | for(i=0;i<2;i++){ | ^ a.cc:15:13: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 15 | std::cout >> buffer; | ~~~~~~~~~ ^~ ~~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:15:13: note: candidate: 'operator>>(int, int)' (built-in) 15 | std::cout >> buffer; | ~~~~~~~~~~^~~~~~~~~ a.cc:15:13: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:15:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 15 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:15:8: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 15 | std::cout >> buffer; | ~~~~~^~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:15:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 15 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:15:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:15:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | std::cout >> buffer; | ^~~~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution f
s089968691
p00488
C++
#include <iostream> #include <vector> int main(){ int buffer; int pasta_min,juice_min; std::vector<int> pasta; std::vector<int> juice; for(int i=0;i<3;i++){ std::cin >> buffer; pasta.push_back(buffer); } for(i=0;i<2;i++){ std::cin >> buffer; juice.push_back(buffer); } pasta_min = *std::min_element(pasta.begin(), pasta.end()); juice_min = *std::min_element(juice.begin(), juice.end()); std::cout << pasta_min+juice_min-50 << std::endl; }
a.cc: In function 'int main()': a.cc:14:5: error: 'i' was not declared in this scope 14 | for(i=0;i<2;i++){ | ^ a.cc:18:19: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? 18 | pasta_min = *std::min_element(pasta.begin(), pasta.end()); | ^~~~~~~~~~~ | tuple_element a.cc:19:19: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? 19 | juice_min = *std::min_element(juice.begin(), juice.end()); | ^~~~~~~~~~~ | tuple_element
s686892621
p00488
C++
#include <iostream> #include <vector> #include <algorithm> int main(){ int buffer; int pasta_min,juice_min; std::vector<int> pasta; std::vector<int> juice; for(int i=0;i<3;i++){ std::cin >> buffer; pasta.push_back(buffer); } for(i=0;i<2;i++){ std::cin >> buffer; juice.push_back(buffer); } pasta_min = *std::min_element(pasta.begin(), pasta.end()); juice_min = *std::min_element(juice.begin(), juice.end()); std::cout << pasta_min+juice_min-50 << std::endl; }
a.cc: In function 'int main()': a.cc:15:5: error: 'i' was not declared in this scope 15 | for(i=0;i<2;i++){ | ^
s884304813
p00488
C++
#include <stdio.h> int main(){ int a,b,c,d,e; scanf("%d", &a); scanf("%d", &b); scanf("%d", &c); scanf("%d", &d); scanf("%d", &e); if((a<=b)&&(a<=c)) { int f=a; } else if(b<=c) { int f=b; } else int f=c; if(d<=e) int g=d; else int g=e; int h=f+g-50; printf("%d\n", h); return 0; }
a.cc: In function 'int main()': a.cc:24:7: error: 'f' was not declared in this scope 24 | int h=f+g-50; | ^ a.cc:24:9: error: 'g' was not declared in this scope 24 | int h=f+g-50; | ^
s054794195
p00488
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a[3]; int b[2]; Int m=10000; for(int i=0;i<3;i++){ cin>>a[i]; } for(int i=0;i<2;i++){ cin>>b[i]; } for(int i=0;i<3;i++){ for(int j=0;j<2;j++){ m=min(m,a[i]+b[j]-50); } } cout<<m<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'Int' was not declared in this scope; did you mean 'int'? 7 | Int m=10000; | ^~~ | int a.cc:16:13: error: 'm' was not declared in this scope 16 | m=min(m,a[i]+b[j]-50); | ^ a.cc:19:11: error: 'm' was not declared in this scope 19 | cout<<m<<endl; | ^
s660550586
p00488
C++
#include<iostream> using namespace std; int main() { int a,b,c,d,e; int MAX_p,MAX_q; cin>>a>>b>>c>>d>>e; if(a>=b&&a>=c) { MAX_p=a; } else if(b>=a&&b>=c) { MAX_p=b; } else { MAX_p=c; } if(d>=e) { MAX_q=d; } else { MAX_q=e; }
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s444968135
p00488
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Collections; import java.util.LinkedList; public class Main { public static void main(String[] args) { Main main = new Main(); main.lunchMinimumValueCalculation(); return; } //昼食の代金の最小値を求める private void lunchMinimumValueCalculation() { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); //標準入力 LinkedList<Integer> pastaPriceList = new LinkedList<Integer>(); LinkedList<Integer> juicePriceList = new LinkedList<Integer>(); try { for (int i = 0; i < 3; i++) { String inputStr = bufferedReader.readLine(); pastaPriceList.add(Integer.parseInt(inputStr)); } for (int i = 0; i < 2; i++) { String inputStr = bufferedReader.readLine(); juicePriceList.add(Integer.parseInt(inputStr)); } Collections.sort(pastaPriceList); Collections.sort(juicePriceList); int pastaPriceNum = pastaPriceList.get(0); int juicePriceNum = juicePriceList.get(0); System.out.println((pastaPriceNum + juicePriceNum) - 50); } catch (IOException e) { // TODO 自動生成された catch ブロック e.printStackTrace(); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ 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.io.InputStreamReader; | ^~~~~~ 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.util.Collections; | ^~~~~~ 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 java.util.LinkedList; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: expected unqualified-id before 'public' 8 | public class Main { | ^~~~~~
s509966484
p00488
C++
#include <iostream> #include <Algorithm> using namespace std; int main(void){ int A, B, C, D, E; cin >> A >> B >> C >> D >> E; cout << min(D,E)+min(A,min(B,C))-50 << endl; }
a.cc:2:10: fatal error: Algorithm: No such file or directory 2 | #include <Algorithm> | ^~~~~~~~~~~ compilation terminated.
s233677907
p00488
C++
#include<iostream> using namespace std; int main(){ int pasta[3], juice[2]; for(int i=0; i<3; i++){ cin >> pasta[i]; } for(int i=0; i<2; i++){ cin >> juice[i]; } sort(pasta, pasta+3); sort(juice, juice+2); cout << pasta[0] + juice[0] - 50 << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(pasta, pasta+3); | ^~~~ | short
s100283455
p00488
C++
/* JOI テ」ツδ妥」ツつケテ」ツつソテ・ツコツ療」ツ?ァテ」ツ?ッテッツシツ古」ツδゥテ」ツδウテ」ツδ?」ツ?ョテ」ツ?甘」ツ?凖」ツ?凖」ツつ?」ツδ妥」ツつケテ」ツつソテ」ツ?ィテヲツ青セテ」ツつ甘」ツ?淌」ツ?ヲテ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?ョテ」ツつサテ」ツδε」ツδ暗」ツδ。テ」ツδ凝」ツδ・テ」ツδシテ」ツ?古・ツ・ツスティツゥツ陛」ツ?ァテ」ツ?づ」ツつ凝ッツシツ偲」ツ?禿」ツ?ョテ」ツつサテ」ツδε」ツδ暗」ツδ。テ」ツδ凝」ツδ・テ」ツδシテ」ツつ津ヲツウツィテヲツ鳴?」ツ?凖」ツつ凝」ツ?ィテ」ツ?催」ツ?ッテッツシツ古」ツ?敕」ツ?ョテヲツ猟・テ」ツ?ョ 3 テァツィツョテゥツ。ツ榲」ツ?ョテ」ツδ妥」ツつケテ」ツつソテ」ツ?ィ 2 テァツィツョテゥツ。ツ榲」ツ?ョテ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?凝」ツつ?1 テ」ツ?、テ」ツ?堙」ツ?、テゥツ?クテ」ツ?カテッツシツ偲」ツδ妥」ツつケテ」ツつソテ」ツ?ィテ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?ョテ・ツ?、テヲツョツオテ」ツ?ョテ・ツ青暗ィツィツ暗」ツ?凝」ツつ?50 テ・ツ??」ツつ津・ツシツ陛」ツ??」ツ?淌ゥツ?妥ゥツ。ツ催」ツ?古、ツサツ」テゥツ?妥」ツ?ィテ」ツ?ェテ」ツつ凝ッツシツ? テ」ツ?づ」ツつ凝ヲツ猟・テ」ツ?ョテ」ツδ妥」ツつケテ」ツつソテ」ツ?ィテ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?ョテ・ツ?、テヲツョツオテ」ツ?古、ツクツ偲」ツ?暗」ツつ嘉」ツつ古」ツ?淌」ツ?ィテ」ツ?催ッツシツ古」ツ?敕」ツ?ョテヲツ猟・テ」ツ?ョテ」ツつサテ」ツδε」ツδ暗」ツδ。テ」ツδ凝」ツδ・テ」ツδシテ」ツ?ョテ、ツサツ」テゥツ?妥」ツ?ョテヲツ慊?・ツーツ湘・ツ?、テ」ツつ津ヲツアツづ」ツつ?」ツつ凝」ツδ療」ツδュテ」ツつーテ」ツδゥテ」ツδ?」ツつ津、ツスツ愿ヲツ按静」ツ?崚」ツつ暗ッツシツ? */ #include <stdio.h> int main(void){ int pasta = 2000, juice = 2000, input; // テ」ツδ妥」ツつケテ」ツつソテ」ツ?ョテ・ツ?・テ・ツ環? for (int i = 0; i < 3; i++){ scanf_s("%d", &input); if (input < pasta){ pasta = input; } } // テ」ツつクテ」ツδ・テ」ツδシテ」ツつケテ」ツ?ョテ・ツ?・テ・ツ環? for (int i = 0; i < 2; i++){ scanf_s("%d", &input); if (input < juice){ juice = input; } } // テ・ツ?コテ・ツ環? printf("%d\n", pasta + juice - 50); return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d", &input); | ^~~~~~~ | scanf a.cc:21:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 21 | scanf_s("%d", &input); | ^~~~~~~ | scanf
s297387067
p00488
C++
#include <iostream> #include <string> #include <algorithm> #include <stack> #include <queue> using namespace std; int main() { int a,b,c,d,e,f,g,h; cin>>a; cin>>b; cin>>c; cin>>d; cin>>e; if(e<d) { f=e-50; if(a<b) { if(a<c){cout<<a+f<<endl;} else{cout<<c+f<<endl;} } else { if(b<c){cout<<b+f<<endl;} else{cout<<c+f<<endl;} } } else { f=d-50; if(a<b) { if(a<c){cout<<a+f<<endl;} else{cout<<c+f<<endl;} } else { if(b<c){cout<<b+f<<endl;} else{cout<<c+f<<endl;} } } getchar 0; }
a.cc: In function 'int main()': a.cc:46:12: error: expected ';' before numeric constant 46 | getchar 0; | ^~ | ;
s991536913
p00488
C++
#include<iostream> using namespace std; int main(){ cin >> a >> b >> c >> d >>e; if (99<a<1000) if (99<b<1000) if (99<c<1000) if (99<d<1000) if (99<e<1000) if (a<b<c) { cout <<a+min(d,e)-50<<endl; } else if (a<c<b) { cout <<a+min(d,e)-50<<endl; } else if (b<a<c ) { cout <<b+min(d,e)-50<<endl; } else if (b<c<a ) { cout <<b+min(d,e)-50<<endl; } else if (c<a<b ) { cout <<c+min(d,e)-50<<endl; } else if(c<b<a) { cout <<c+min(d,e)-50<<endl; } else if (a=b<c) { cout <<a+min(d,e)-50<<endl; } else if (a=b>c) { cout <<c+min(d,e)-50<<endl; } else if (a=c<b) { cout <<a+min(d,e)-50<<endl; } else if (a=c>b) { cout <<b+min(d,e)-50<<endl; } else if (b=c<a) { cout <<b+min (d,e)-50<<endl; } else if (b=c>a) { cout <<a+min(d,e)-50<<endl; } else if (a=b=c) { cout <<a+min(d,e)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: 'a' was not declared in this scope 9 | cin >> a >> b >> c >> d >>e; | ^ a.cc:9:21: error: 'b' was not declared in this scope 9 | cin >> a >> b >> c >> d >>e; | ^ a.cc:9:26: error: 'c' was not declared in this scope 9 | cin >> a >> b >> c >> d >>e; | ^ a.cc:9:31: error: 'd' was not declared in this scope 9 | cin >> a >> b >> c >> d >>e; | ^ a.cc:9:35: error: 'e' was not declared in this scope 9 | cin >> a >> b >> c >> d >>e; | ^
s459577594
p00488
C++
#include<iostream> using namespace std; int main(){ int a,b,c,d,e,f.g; cin>>a>>b>>c>>d>>e; if(a>b){ if(b>c){ f=c; } if(b<c){ f=b; } } else{ if(a<c){ f=a; } if(a>c){ f=c; } } if(d<e){ g=d; } if(d>e){ g=e; } cout<<f+g-50; return 0; }
a.cc: In function 'int main()': a.cc:5:16: error: expected initializer before '.' token 5 | int a,b,c,d,e,f.g; | ^ a.cc:9:1: error: 'f' was not declared in this scope 9 | f=c; | ^ a.cc:12:1: error: 'f' was not declared in this scope 12 | f=b; | ^ a.cc:17:1: error: 'f' was not declared in this scope 17 | f=a; | ^ a.cc:20:1: error: 'f' was not declared in this scope 20 | f=c; | ^ a.cc:25:1: error: 'g' was not declared in this scope 25 | g=d; | ^ a.cc:29:1: error: 'g' was not declared in this scope 29 | g=e; | ^ a.cc:31:7: error: 'f' was not declared in this scope 31 | cout<<f+g-50; | ^ a.cc:31:9: error: 'g' was not declared in this scope 31 | cout<<f+g-50; | ^
s716794588
p00488
C++
#include <iostream> #include <stdio.h> using namespace std; int main() { int pa, pb, pc, ja jb; int pm, jm; scanf("%d%d%d%d%d", &pa, &pb, &pc, &ja, &jb); pm = min(pa,pb,pc); jm = min(ja,jb); printf("%d\n", pm+jm-50); return 0; }
a.cc: In function 'int main()': a.cc:6:28: error: expected initializer before 'jb' 6 | int pa, pb, pc, ja jb; | ^~ a.cc:8:45: error: 'ja' was not declared in this scope; did you mean 'jm'? 8 | scanf("%d%d%d%d%d", &pa, &pb, &pc, &ja, &jb); | ^~ | jm a.cc:8:50: error: 'jb' was not declared in this scope; did you mean 'jm'? 8 | scanf("%d%d%d%d%d", &pa, &pb, &pc, &ja, &jb); | ^~ | jm In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:9:10: required from here 9 | pm = min(pa,pb,pc); | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s806410020
p00488
C++
#include<iostream> #include<vector> #include<algorithm> #include<math.h> #include<stdlib.h> #include<cstdlib> using namespace std; int main() { int a, b, c, d, e; cin >> a >> b >> c >> d >> e; cout << (min((min(a, b), c) + min(d, e) - 50) << endl; }
a.cc: In function 'int main()': a.cc:12:20: warning: ignoring return value of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result] 12 | cout << (min((min(a, b), c) + min(d, e) - 50) << endl; | ~~~^~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: declared here 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:12:15: error: no matching function for call to 'min(int)' 12 | cout << (min((min(a, b), c) + min(d, e) - 50) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: template argument deduction/substitution failed: a.cc:12:15: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 12 | cout << (min((min(a, b), c) + min(d, e) - 50) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate expects 2 arguments, 1 provided a.cc:12:56: error: expected ')' before ';' token 12 | cout << (min((min(a, b), c) + min(d, e) - 50) << endl; | ~ ^ | )
s873413803
p00488
C++
#include<iostream> int main() { int pasta[3]; int juise[2]; int min1=INFINITY, min2=INFINITY; for (int i = 0; i < 3; ++i){ std::cin >> pasta[i]; if (pasta[i] < min1)min1 = pasta[i]; } for (int i = 0; i < 2; ++i) { std::cin >> juise[i]; if (juise[i] < min2)min2 = juise[i]; } std::cout << min1 + min2-50 << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:5:18: error: 'INFINITY' was not declared in this scope 5 | int min1=INFINITY, min2=INFINITY; | ^~~~~~~~ a.cc:10:76: error: 'min2' was not declared in this scope; did you mean 'min1'? 10 | for (int i = 0; i < 2; ++i) { std::cin >> juise[i]; if (juise[i] < min2)min2 = juise[i]; } | ^~~~ | min1 a.cc:11:29: error: 'min2' was not declared in this scope; did you mean 'min1'? 11 | std::cout << min1 + min2-50 << std::endl; | ^~~~ | min1
s912605358
p00488
C++
#include<stdio.h> int main() { int a, a_min =2001, b, b_min = 2001; for (int i = 1; i <= 3; i++) { scanf("%d", &a); if (a < a_min) { a_min = a; } } for(int i=1;i<=2;i++){ scanf("%d", &b); if (b < b_min) { b_min = b; } } printf("%d\n", a_min + b_min-50; }
a.cc: In function 'int main()': a.cc:18:40: error: expected ')' before ';' token 18 | printf("%d\n", a_min + b_min-50; | ~ ^ | )
s825688257
p00488
C++
#include<iostream> #include<cstdio> using namespace std; int main(){ int min=2000,min2=2000,pasta,drink; for(int cnt=0;cnt<5;cnt++){ if(cnt<3){ cin << pasta; if(min>pasta){ min=pasta; } } else{ cin << drink; if(min2>drink){ min2=drink; } } } printf("%d\n",min+min2-50); }
a.cc: In function 'int main()': a.cc:8:29: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 8 | cin << pasta; | ~~~ ^~ ~~~~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:8:29: note: candidate: 'operator<<(int, int)' (built-in) 8 | cin << pasta; | ~~~~^~~~~~~~ a.cc:8:29: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << pasta; | ^~~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:8:25: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 8 | cin << pasta; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << pasta; | ^~~~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:8:32: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << pasta; | ^~~~~ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:8:11: required from here 8 | cin <<
s068875185
p00488
C++
#include<iostream> using namespace std; int main(void){ int a[5000], b, c, g = 0, h = 0, i, g1[5000]={0}, g2[5000]={0}; for(i=0;i<3;i++){ cin >> a[i]; } cin >> b >> c; for(i=0;i<3;i++){ g1[i] = a[i] + b - 50; g2[i] = a[i] + c - 50; } if(g1[0] < g1[1]){ g = g1[0]; } else{ g = g1[1]; } if(g > g1[2]){ g = g1[2]; } if(g2[0] < g2[1]) h = g2[0]; } else{ h = g2[1]; } if(h > g2[2]){ h = g2[2]; } if(g < h){ cout << g; } else{ cout << h << endl; } return 0; }
a.cc:24:9: error: expected unqualified-id before 'else' 24 | else{ | ^~~~ a.cc:27:9: error: expected unqualified-id before 'if' 27 | if(h > g2[2]){ | ^~ a.cc:30:9: error: expected unqualified-id before 'if' 30 | if(g < h){ | ^~ a.cc:33:9: error: expected unqualified-id before 'else' 33 | else{ | ^~~~ a.cc:36:9: error: expected unqualified-id before 'return' 36 | return 0; | ^~~~~~ a.cc:37:1: error: expected declaration before '}' token 37 | } | ^
s653744206
p00488
C++
#include <iostream> using namespace std; int main(){ int p1; int p2; int p3; int j1; int j2; cin >> p1 >> p2 >> p3 >> j1 >> j2; int p = min({ p1, p2, p3 }); int j = min({ j1, j2 }); cout << p + j - 50<< endl; return 0; }
a.cc: In function 'int main()': a.cc:12:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 12 | int p = min({ p1, p2, p3 }); | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided a.cc:13:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 13 | int j = min({ j1, j2 }); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided
s799460206
p00488
C++
#include <iostream> using namespace std; int main(){ int p1; int p2; int p3; int j1; int j2; cin >> p1 >> p2 >> p3 >> j1 >> j2; int p = min({ p1, p2, p3 }); int j = min({ j1, j2 }); cout << p + j - 50<< endl; return 0; }
a.cc: In function 'int main()': a.cc:13:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 13 | int p = min({ p1, p2, p3 }); | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided a.cc:14:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 14 | int j = min({ j1, j2 }); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided
s841564875
p00488
C++
#include <iostream> using namespace std; int main(){ int p1; int p2; int p3; int j1; int j2; cin >> p1 >> p2 >> p3 >> j1 >> j2; int p = min({ p1, min(p2, p3) }); int j = min({ j1, j2 }); cout << p + j - 50<< endl; getchar(); getchar(); return 0; }
a.cc: In function 'int main()': a.cc:13:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 13 | int p = min({ p1, min(p2, p3) }); | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided a.cc:14:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 14 | int j = min({ j1, j2 }); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided
s378042484
p00488
C++
#include <iostream> using namespace std; int main(){ int p1; int p2; int p3; int j1; int j2; cin >> p1 >> p2 >> p3 >> j1 >> j2; int p = min({ p1, min(p2, p3) }); int j = min({ j1, j2 }); cout << p + j - 50<< endl; return 0; }
a.cc: In function 'int main()': a.cc:13:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 13 | int p = min({ p1, min(p2, p3) }); | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided a.cc:14:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 14 | int j = min({ j1, j2 }); | ~~~^~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided
s473812576
p00488
C++
#include <bits/stdc++.h> using namespace std; int main() { int data; int minv; int sum = 0; for(int i = 0;i < 3;i++) { minv = INT_MIN; cin >> data; minv = min(data,minv); } sum += minv; int a,b; cin >> a >> b; if(a < b)cout << minv + a - 50 << endl; else cout << minv + b - 50 << endl;] return 0; }
a.cc: In function 'int main()': a.cc:17:38: error: expected primary-expression before ']' token 17 | else cout << minv + b - 50 << endl;] | ^
s878053724
p00488
C++
#include <bits/stdc++.h> using namespace std; int main() { int data; int minv; for(int i = 0;i < 3;i++) { minv = INT_MAX; cin >> data; minv = min(data,minv); } int a,b; cin >> a >> b; if(a < b)cout << minv + a - 50 << endl; else cout << minv + b - 50 << endl;] return 0; }
a.cc: In function 'int main()': a.cc:15:38: error: expected primary-expression before ']' token 15 | else cout << minv + b - 50 << endl;] | ^
s868931975
p00488
C++
#include<iostream> using namespace std; int p1, p2, p3, j1, j2; int main(){ cin >> p1 >> p2 >> p3 >> j1 >> j2; cout << min(min(p1, p2), p3) + min(j1, j2) - 50 << endl; return ; }
a.cc:3:17: warning: built-in function 'j1' declared as non-function [-Wbuiltin-declaration-mismatch] 3 | int p1, p2, p3, j1, j2; | ^~ a.cc: In function 'int main()': a.cc:7:1: error: return-statement with no value, in function returning 'int' [-fpermissive] 7 | return ; | ^~~~~~
s188499463
p00488
C++
#include <stdio.h> int main(){ int a,b,temp; scanf("%d",&a); scanf("%d",&temp): if(temp<a)a=temp; scanf("%d",&temp): if(temp<a)a=temp; b=a; scanf("%d",&a); scanf("%d",&temp): if(temp<a)a=temp; printf("%d\n",a+b-50); }
a.cc: In function 'int main()': a.cc:5:18: error: expected ';' before ':' token 5 | scanf("%d",&temp): | ^ | ; a.cc:7:18: error: expected ';' before ':' token 7 | scanf("%d",&temp): | ^ | ; a.cc:11:18: error: expected ';' before ':' token 11 | scanf("%d",&temp): | ^ | ;
s757472269
p00488
C++
#include<iostream> using namespace std; int p1,p2,p3,j1,j2; int main(){ cin>>p1>>p2>>p3>>j1>>j2>>; cout<<min(min(p1,p2),p3)+ min(j1,j2) - 50<<endl; return 0; }
a.cc:3:14: warning: built-in function 'j1' declared as non-function [-Wbuiltin-declaration-mismatch] 3 | int p1,p2,p3,j1,j2; | ^~ a.cc: In function 'int main()': a.cc:5:30: error: expected primary-expression before ';' token 5 | cin>>p1>>p2>>p3>>j1>>j2>>; | ^
s500405786
p00488
C++
#include<iostream> using namespace std; int i, n, pA, pB, ta= 0, tB= 0; int main(){ while(cin >> n) { if(n == 0) {break; } for (i=1; i<=n; i++) { cin >> pA>>pB; if (pA >pB) { tA += pA +pB; } else { if (pA<pB) { tB += pA +pB; } else { tA += pA; tB += pB; } } } cout << tA << " "<< tB << endl; tA = 0; tB = 0; } return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 'tA' was not declared in this scope; did you mean 'ta'? 10 | tA += pA +pB; | ^~ | ta a.cc:15:21: error: 'tA' was not declared in this scope; did you mean 'ta'? 15 | tA += pA; | ^~ | ta a.cc:20:18: error: 'tA' was not declared in this scope; did you mean 'ta'? 20 | cout << tA << " "<< tB << endl; | ^~ | ta
s086991168
p00488
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int A,B,C,D,E; cin>>A>>B>>C>>D>>E; cout<<(min({A,B,C})+min(D,E)-50)<<endl; }a
a.cc:8:2: error: 'a' does not name a type 8 | }a | ^
s402766586
p00488
C++
#include<iostream> using namespace std; int main(){ int a,b,c,d,e; int A; cin>>a>>b>>c>>d>>e; if(a>b&&b>c){ A+=c; } else if(b>c&&c>a){ A+=a; } else if(c>a&&a>b){ A+=b; } if(d>e){ A+=e; } else if(d<e){ A+=d; } cout<<A<<endl;> return 0; }
a.cc: In function 'int main()': a.cc:23:23: error: expected primary-expression before '>' token 23 | cout<<A<<endl;> | ^ a.cc:24:9: error: expected primary-expression before 'return' 24 | return 0; | ^~~~~~
s600353624
p00488
C++
/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
s400710725
p00488
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a, b, c, d, e; cin>>a>>b>>c>>d>>e; if(a > b) swap(a,b) if(b > c) swap(b,c) if(a > b) swap(a,b) if(d > e) swap(d,e) cout<<a+d-50<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:24: error: expected ';' before 'if' 7 | if(a > b) swap(a,b) | ^ | ; 8 | if(b > c) swap(b,c) | ~~
s377875278
p00488
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x; int y; int z; int a; int b; cin>>x>>y>>z>>a>>b; int p = x+a-50; int q = x+b-50; int r = y+a-50; int s = y+b-50; int t = z+a-50; int u = z+b-50; int min; int k={p,q,r,s,t,u}; for(int i=0;i<k;i++){ min = min(min,k[i]); } cout<<min<<endl; return 0; }
a.cc: In function 'int main()': a.cc:19:8: error: scalar object 'k' requires one element in initializer 19 | int k={p,q,r,s,t,u}; | ^ a.cc:21:23: error: 'min' cannot be used as a function 21 | min = min(min,k[i]); | ^
s916292421
p00488
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <cstring> #include <cctype> #include <cmath> #include <stack> #include <queue> #include <vector> #include <set> #include <map> #include <list> #include <stdio.h> #include <string.h> #include <cstdlib> #include <math.h> #include <bitset> #define INF 2000000000 using namespace std; int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1}; #define ll long long #define PL pair<long long, long long> #define P pair<int,int> #define mk make_pair #define en endl; #define WHITE 0 #define BLACK 2 #define GRAY 1 #define RE return 0; #define HERE cout<<" "<<"HERE"<<en int main(){ int p1,p2,p3; cin>>p1>>p2>>p3; int p=min(p1,p2,p3); int j1,j2; cin>>j1>>j2; int j=min(j1,j2); cout<<j+p-50<<en }
In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]': a.cc:36:12: required from here 36 | int p=min(p1,p2,p3); | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function 284 | if (__comp(__b, __a)) | ~~~~~~^~~~~~~~~~
s865346398
p00488
C++
#include <stdio.h> int main(){ int a[3], b[2], c[2], answer; scanf("%d%d%d%d%d",&a[0],&a[1],&a[2],&b[0],&b[1]); if (a[0]>a[1]){ c[0] = a[1]; } else{ c[0] = a[0]; } if (c[0]>a[2]){ c[0] = a[2]; } if (b[0]>b[1]){ c[1] = b[1]; } else{ c[1] = b[0]; } answer = c[0] + c[1] - 50; printf("%d\n",answer); char i[1000]; gets(i); gets(i); return 0; }
a.cc: In function 'int main()': a.cc:26:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 26 | gets(i); | ^~~~ | getw
s141858216
p00488
C++
a,b,c,d;main(e){scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);a=!printf("%d\n",d<e?d:e+fmin(a>b?a:b,c));}
a.cc:1:1: error: 'a' does not name a type 1 | a,b,c,d;main(e){scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);a=!printf("%d\n",d<e?d:e+fmin(a>b?a:b,c));} | ^ a.cc:1:13: error: expected constructor, destructor, or type conversion before '(' token 1 | a,b,c,d;main(e){scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);a=!printf("%d\n",d<e?d:e+fmin(a>b?a:b,c));} | ^
s832866012
p00488
C++
#include <iostream> using namespace std; void main(){ int pa,pb,pc,ja,jb,ans=0; cin >> pa >> pb >> pc >> ja >> jb; if(pa < pb){ ans += (pa < pc) ? pa : pc; }else{ ans += (pb < pc) ? pb : pc; } ans += (ja < jb) ? ja : jb; cout << ans-50 << endl; }
a.cc:4:1: error: '::main' must return 'int' 4 | void main(){ | ^~~~
s655218626
p00488
C++
#include <stdio.h> int main(){ int a,b,A=9999,B=9999; for(int i=0;i<3;i++)scanf("%d",&a),A=min(A,a); for(int i=0;i<2;i++)scanf("%d",&b),B=min(B,b); printf("%d\n",A+B-50); }
a.cc: In function 'int main()': a.cc:5:38: error: 'min' was not declared in this scope; did you mean 'main'? 5 | for(int i=0;i<3;i++)scanf("%d",&a),A=min(A,a); | ^~~ | main a.cc:6:38: error: 'min' was not declared in this scope; did you mean 'main'? 6 | for(int i=0;i<2;i++)scanf("%d",&b),B=min(B,b); | ^~~ | main
s554609059
p00488
C++
#include <stdio.h> #include <algorithm> int main(){ int a,b,A=9999,B=9999; for(int i=0;i<3;i++)scanf("%d",&a),A=min(A,a); for(int i=0;i<2;i++)scanf("%d",&b),B=min(B,b); printf("%d\n",A+B-50); }
a.cc: In function 'int main()': a.cc:6:38: error: 'min' was not declared in this scope; did you mean 'std::min'? 6 | for(int i=0;i<3;i++)scanf("%d",&a),A=min(A,a); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ a.cc:7:38: error: 'min' was not declared in this scope; did you mean 'std::min'? 7 | for(int i=0;i<2;i++)scanf("%d",&b),B=min(B,b); | ^~~ | std::min /usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~
s984180919
p00488
C++
#include<stdio.h> #include<stdlib.h> int main(void){ int p=10000; int ju=10000; for(int i = 0; i < 3; i++){ int t; scanf("%d", &t); p = min(p,t); } for(int i = 0; i < 2; i++){ int t; scanf("%d", &t); ju = min(ju,t); } printf("%d\n", ju+p-50); return 0; }
a.cc: In function 'int main()': a.cc:11:21: error: 'min' was not declared in this scope; did you mean 'main'? 11 | p = min(p,t); | ^~~ | main a.cc:17:22: error: 'min' was not declared in this scope; did you mean 'main'? 17 | ju = min(ju,t); | ^~~ | main
s452129932
p00488
C++
#include <stdio.h> main() { int a,b,c,d,e; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); scanf("%d",&d); scanf("%d",&e); int m,n; if (a<b) if (a>c) m = c; else m = a; else if (b>c) m = c; else m = b; if (d<e) n = d; else n = e; int S; S = m + n - 50; printf("%d",S\n"); }
a.cc:22:22: error: stray '\' in program 22 | printf("%d",S\n"); | ^ a.cc:22:24: warning: missing terminating " character 22 | printf("%d",S\n"); | ^ a.cc:22:24: error: missing terminating " character 22 | printf("%d",S\n"); | ^~~ 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:22:22: error: expected ')' before 'n' 22 | printf("%d",S\n"); | ~ ^~ | )
s830801515
p00488
C++
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner in = new Scanner(System.in); int a=0,b=0,c; for(int i = 0;i < 3;i++){ c=in.nextInt(); if(i == 0) a = c; else{ if(a > c){ a = c; } } } for(int i = 0;i < 2;i++){ c=in.nextInt(); if(i == 0) b = c; else{ if(b > c){ b = c; } } } c = a + b - 50; System.out.println(c); } }
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:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s569815504
p00489
Java
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int a[] = new int[100]; for(int i = 1; i <= n*(n-1)/2; i++){ int team1 = in.nextInt(); int team2 = in.nextInt(); int point1 = in.nextInt(); int point2 = in.nextInt(); if(point1 > point2){ a[team1] += 3; continue; }else if(point1 < point2){ a[team2] += 3; continue; }else if(point1 == point2){ a[team1] += 1; a[team2] += 1; } } for(int j = 1; j <= n; j++){ int an = n; for(int k = 1; k <= n; k++){ if(j == k){ continue; }else if(a[j] >= a[k]){ an--; } } System.out.println(an); } } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s815985764
p00489
Java
public class soccer { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int tokuten[] = new int[N+1];//得点の配列 for(int i = 0;i<N*(N-1)/2;i++){//Nチームあるときの試合数まで繰り返す int a = sc.nextInt(); int b = sc.nextInt(); int a1 = sc.nextInt(); int b1 = sc.nextInt(); if (a1 > b1){//aが勝った場合 tokuten[a] += 3; }else if (a1 < b1){//bが勝った場合 tokuten[b] += 3; }else{//同点の場合 tokuten[a] += 1; tokuten[b] += 1; } } for(int i = 1; i < N+1; i++){ int length = 1; for(int j = 0; j < N+1; j++){ if(tokuten[i] < tokuten[j]) length += 1; } System.out.println(length); } } }
Main.java:1: error: class soccer is public, should be declared in a file named soccer.java public class soccer { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class soccer Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class soccer 3 errors
s099532896
p00489
Java
import java.util.*; public class soccer { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int tokuten[] = new int[N+1];//得点の配列 for(int i = 0;i<N*(N-1)/2;i++){//Nチームあるときの試合数まで繰り返す int a = sc.nextInt(); int b = sc.nextInt(); int a1 = sc.nextInt(); int b1 = sc.nextInt(); if (a1 > b1){//aが勝った場合 tokuten[a] += 3; }else if (a1 < b1){//bが勝った場合 tokuten[b] += 3; }else{//同点の場合 tokuten[a] += 1; tokuten[b] += 1; } } for(int i = 1; i < N+1; i++){ int length = 1; for(int j = 0; j < N+1; j++){ if(tokuten[i] < tokuten[j]) length += 1; } System.out.println(length); } } }
Main.java:3: error: class soccer is public, should be declared in a file named soccer.java public class soccer { ^ 1 error
s964038014
p00489
Java
import java.util.*; public class soccer { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int tokuten[] = new int[N+1];//得点の配列 for(int i = 0;i<N*(N-1)/2;i++){//Nチームあるときの試合数まで繰り返す int a = sc.nextInt(); int b = sc.nextInt(); int a1 = sc.nextInt(); int b1 = sc.nextInt(); if (a1 > b1){//aが勝った場合 tokuten[a] += 3; }else if (a1 < b1){//bが勝った場合 tokuten[b] += 3; }else{//同点の場合 tokuten[a] += 1; tokuten[b] += 1; } } for(int i = 1; i < N+1; i++){ int length = 1; for(int j = 0; j < N+1; j++){ if(tokuten[i] < tokuten[j]) length += 1; } System.out.println(length); } } }
Main.java:3: error: class soccer is public, should be declared in a file named soccer.java public class soccer { ^ 1 error
s986406397
p00489
Java
import java.util.*; public class soccer { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int tokuten[] = new int[N+1 for(int i = 0;i<N*(N-1)/2;i++){ int a = sc.nextInt(); int b = sc.nextInt(); int a1 = sc.nextInt(); int b1 = sc.nextInt(); if (a1 > b1){ tokuten[a] += 3; }else if (a1 < b1){ tokuten[b] += 3; }else{ tokuten[a] += 1; tokuten[b] += 1; } } for(int i = 1; i < N+1; i++){ int length = 1; for(int j = 0; j < N+1; j++){ if(tokuten[i] < tokuten[j]) length += 1; } System.out.println(length); } } }
Main.java:10: error: ']' expected int tokuten[] = new int[N+1 ^ 1 error
s818716566
p00489
Java
import java.util.*; public Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int i, j, c; int [] a = new int[n + 1]; for(i = 0; i < n * (n - 1) / 2;i++){ int k = sc.nextInt(); int l = sc.nextInt(); int p = sc.nextInt(); int q = sc.nextInt(); if (p > q){ a[k] = a[k] + 3; } else if(p < q){ a[l] = a[l] + 3; } else{ a[k] = a[k] + 1; a[l] = a[l] + 1; } } for(i = 1; i < n + 1; i++){ c = 1; for(j = 0; j < n + 1; j++){ if(a[i] < a[j]) c = c + 1; } System.out.println(c); } } }
Main.java:2: error: class, interface, enum, or record expected public Main { ^ Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) Main.java:33: error: class, interface, enum, or record expected } ^ 3 errors
s459554610
p00489
Java
import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) { new aoj0566().run(); } class R implements Comparable<R>{ int id, p; public R(int id) { this.id = id; } public int compareTo(R o) { return o.p - p; } } void run(){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] res = new int[n]; R[] r = new R[n]; for(int i = 0; i < n; i++)r[i] = new R(i); for(int i = 0; i < n * (n - 1) / 2; i++){ int s = scan.nextInt() - 1, t = scan.nextInt() - 1, ps = scan.nextInt(), pt = scan.nextInt(); if(ps < pt)r[t].p += 3; else if(pt < ps)r[s].p += 3; else{ r[s].p++; r[t].p++; } } Arrays.sort(r); int v = 1; res[r[0].id] = 1; for(int i = 1; i < n; i++){ if(r[i].p != r[i - 1].p)v = i + 1; res[r[i].id] = v; } for(int x:res)System.out.println(x); } }
Main.java:7: error: cannot find symbol new aoj0566().run(); ^ symbol: class aoj0566 location: class Main 1 error
s991649182
p00489
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner s = new Scanner(System.in); while(s.hasNext()){ int num = s.nextInt(); int[][] data = new int[num][2]; for(int i=0 ; i<num ; i++) data[i][1] = i+1; for(int i=0 ; i<num*(num-1)/2 ; i++){ int[] a = new int[4]; for(int j=0 ; j<4 ; j++) a[j] = s.nextInt(); if(a[2]>a[3]) data[a[0]-1][0]+=3; if(a[2]<a[3]) data[a[1]-1][0]+=3; else{ data[a[0]-1][0]+=3; data[a[1]-1][0]+=1; } } Arrays.sort(data,0); for(int i=0 ; i<num ; i++){ System.out.println(data[i][1]); } } } }
Main.java:25: error: no suitable method found for sort(int[][],int) Arrays.sort(data,0); ^ method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable (cannot infer type-variable(s) T#1 (argument mismatch; int cannot be converted to Comparator<? super T#1>)) method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable (cannot infer type-variable(s) T#2 (actual and formal argument lists differ in length)) where T#1,T#2 are type-variables: T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>) T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>) Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s558859966
p00489
Java
package SD; import java.util.Scanner; public class aoj0566 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int N= sc.nextInt(); int game=N*(N-1)/2; int point[] =new int[N]; for(int i=0;i<game;i++){ int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int d=sc.nextInt(); if(c<d){ point[b-1]=point[b-1]+3; }else if(c>d){ point[a-1]=point[a-1]+3; }else if(c==d){ point[a-1]=point[a-1]+1; point[b-1]=point[b-1]+1; } } int rnk[]=new int[N]; for(int i=0;i<N;i++){ rnk[i]=1; for(int j=0;j<N;j++){ if(point[i]<point[j]){ rnk[i]=rnk[i]+1; } } } for(int i=0; i<N;i++){ System.out.println(rnk[i]); } } }
Main.java:3: error: class aoj0566 is public, should be declared in a file named aoj0566.java public class aoj0566 { ^ 1 error
s807294962
p00489
Java
import java.util.Scanner; public class aoj0566 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int N= sc.nextInt(); int game=N*(N-1)/2; int point[] =new int[N]; for(int i=0;i<game;i++){ int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int d=sc.nextInt(); if(c<d){ point[b-1]=point[b-1]+3; }else if(c>d){ point[a-1]=point[a-1]+3; }else if(c==d){ point[a-1]=point[a-1]+1; point[b-1]=point[b-1]+1; } }//ここまで得点計算 int rnk[]=new int[N]; for(int i=0;i<N;i++){ rnk[i]=1; for(int j=0;j<N;j++){ if(point[i]<point[j]){ rnk[i]=rnk[i]+1; } } } for(int i=0; i<N;i++){ System.out.println(rnk[i]); } } }
Main.java:2: error: class aoj0566 is public, should be declared in a file named aoj0566.java public class aoj0566 { ^ 1 error
s021032542
p00489
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a, b, c, d; int [] x = new int[n]; int [] y = new int[n]; int n = sc.nextInt(); for(int i = 0; i < n*(n-1)/2; i++){ a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); d = sc.nextInt(); if(c>d) x[a] += 3; else if(c<d) x[b] += 3; else{ x[a] += 1; x[b] += 1; } } for(int i = 1; i <= n; i++) for(int k = 1; k <= n; k++) if(x[i]<x[k]) y[j] ++; for(int k = 1; k <= n; k++) System.out.println(y[k] + 1); } }
Main.java:6: error: cannot find symbol int [] x = new int[n]; ^ symbol: variable n location: class Main Main.java:7: error: cannot find symbol int [] y = new int[n]; ^ symbol: variable n location: class Main Main.java:23: error: cannot find symbol if(x[i]<x[k]) y[j] ++; ^ symbol: variable j location: class Main 3 errors
s929674448
p00489
Java
package homework; import java.util.Scanner; public class AOJ10018 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i, a, b, c, d; int n = sc.nextInt(); int [] x = new int[n+1]; int [] y = new int[n+1]; for(i = 0; i < n*(n-1)/2; i++){ a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); d = sc.nextInt(); if(c>d) x[a] += 3; else if(c<d) x[b] += 3; else{ x[a] += 1; x[b] += 1; } } for(int j = 1; j <= n; j++){ for(int h = 1; h <= n; h++){ if(x[j] < x[h]) y[j] += 1; } } for(int k = 1; k < n+1; k++) System.out.println(y[k] + 1); } }
Main.java:3: error: class AOJ10018 is public, should be declared in a file named AOJ10018.java public class AOJ10018 { ^ 1 error
s232109565
p00489
Java
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int team = sc.nextInt(); int Maxgame = team * (team - 1) / 2; int[] indexA = new int[Maxgame]; int[] indexB = new int[Maxgame]; int[] pointA = new int[Maxgame]; int[] pointB = new int[Maxgame]; for(int i = 0; i < Maxgame; i++){ indexA[i] = sc.nextInt() - 1; indexB[i] = sc.nextInt() - 1; pointA[i] = sc.nextInt(); pointB[i] = sc.nextInt(); } String solve = solve(team,indexA,indexB,pointA,pointB); System.out.println(solve + "\n"); } private static String solve(int team,int[] indexA,int[] indexB,int[] pointA,int[] pointB){ int[] winpoint = new int[team]; for(int i = 0;i < indexA.length;i++){ if(pointA[i] > pointB[i]){ winpoint[indexA[i]] += 3; } else if(pointA[i] < pointB[i]){ winpoint[indexB[i]] += 3; } else { winpoint[indexA[i]]++; winpoint[indexB[i]]++; } } int[] rank = new int[team]; for(int i = 0; i < winpoint.length; i++){ for(int j = 0; j < winpoint.length; j++){ if(winpoint[i] < winpoint[j])rank[i]++; } } StringBuilder sb = new StringBuilder(); for(int i = 0; i < rank.length; i++){ sb.append((rank[i] + 1) + "\n"); } return sb.toString().trim(); } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s556915987
p00489
Java
import java.util.Arrays; import java.util.Scanner; public class AOJ0566 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] t = new int[n+1]; for(int i=0;i<n*(n-1)/2;i++){ int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); if(c>d){ t[a]+=3; } else if(c<d){ t[b]+=3; } else{ t[a]+=1; t[b]+=1; } } int[] r = new int[n]; for(int i=1;i<=n;i++){ r[i-1] = t[i]; } Arrays.sort(r); int[] r2 = new int[n+1]; int cnt = 1; int z; for(int i=n-1;i>=0;){ z=0; for(int j=1;j<=n;j++){ if(r[i]==t[j]){ r2[j] = cnt; z++; } } cnt+=z; i-=z; } for(int i=1;i<=n;i++){ System.out.println(r2[i]); } } }
Main.java:3: error: class AOJ0566 is public, should be declared in a file named AOJ0566.java public class AOJ0566 { ^ 1 error
s859808703
p00489
C
#inclued<stdio.h> int main(void) { int i,j,k[101],t[101],jun[101],n,a,b,c,d,temp; scanf("%d",&n); for(i=1;i<=n;i++){ k[i]=0; t[i]=i; } for(i=0;i<n*(n-1)/2;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d){ k[a]+=3; } if(c<d){ k[b]+=3; } if(c==d){ k[a]+=1; k[b]+=1; } } for(i=1;i<=n;i++){ for(j=i+1;j<=n;i++){ if(k[i]<k[j]){ temp=k[i]; k[i]=k[j]; k[j]=temp; temp=t[i]; t[i]=t[j]; t[j]=temp; } } } for(i=1;i<n;i++){ if(k[i]==k[i+1]){
main.c:1:2: error: invalid preprocessing directive #inclued; did you mean #include? 1 | #inclued<stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inclued<stdio.h> main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d",&n); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:37:17: error: expected declaration or statement at end of input 37 | if(k[i]==k[i+1]){ | ^~ main.c:37:17: error: expected declaration or statement at end of input main.c:37:17: error: expected declaration or statement at end of input
s995210700
p00489
C
#include<stdio.h> int main( void ) { short n ; short i ,j ; short team[ 4 ] ; short cnt ; scanf( "%d", &n ) ; short point[ n + 1 ] = { 0 } ; for( i = 0 ; i < n * ( n - 1 ) / 2 ; i++ ) { scanf( "%d %d %d %d", &team[ 0 ] , &team[ 2 ] , &team[ 1 ] , &team[ 3 ] ) ; if( team [ 1 ] == team[ 3 ] ) { point[ team[ 0 ] ]++ ; point[ team[ 2 ] ]++ ; } else { point[ team[ 1 ] > team[ 3 ] ? team[ 0 ] : team[ 2 ] ] += 3 ; } } for( i = 1 ; i <= n ; i++ ) { cnt = 1 ; for( j = 1 ; j <= n ; j++ ) { if( i == j ) { continue ; } if( point[ i ] < point[ j ] ) { cnt++ ; } } printf( "%d\n", cnt ) ; } return 0 ; }
main.c: In function 'main': main.c:9:32: error: variable-sized object may not be initialized except with an empty initializer 9 | short point[ n + 1 ] = { 0 } ; | ^
s977971456
p00489
C
#include<stdio.h> int main(void) { int game,n,i,j,team[100],a,b,c,d,ban[100]; scanf("%d",&n); for(i=0;i<n;i++){ team[i]=0; ban[i]=1; } game=n*(n-1)/2; for(i=0;i<game;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d){ team[a-1]+=3; } else if(c==d){ team[a-1]+=1; team[b-1]+=1; else{ team[b-1]+=3; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(team[i]<team[j]){ ban[i]++; } printf("%d\n",banb[i]); } return 0; }
main.c: In function 'main': main.c:19:1: error: expected '}' before 'else' 19 | else{ | ^~~~ main.c:27:15: error: 'banb' undeclared (first use in this function); did you mean 'ban'? 27 | printf("%d\n",banb[i]); | ^~~~ | ban main.c:27:15: note: each undeclared identifier is reported only once for each function it appears in main.c:30:1: error: expected declaration or statement at end of input 30 | } | ^ main.c:30:1: error: expected declaration or statement at end of input
s228973799
p00489
C
#include<stdio.h> int main(void) { int game,n,i,j,team[100],a,b,c,d,ban[100]; scanf("%d",&n); for(i=0;i<n;i++){ team[i]=0; ban[i]=1; } game=n*(n-1)/2; for(i=0;i<game;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d){ team[a-1]+=3; } else if(c==d){ team[a-1]+=1; team[b-1]+=1; else{ team[b-1]+=3; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(team[i]<team[j]){ ban[i]++; } printf("%d\n",banb[i]); } return 0; }
main.c: In function 'main': main.c:19:1: error: expected '}' before 'else' 19 | else{ | ^~~~ main.c:27:15: error: 'banb' undeclared (first use in this function); did you mean 'ban'? 27 | printf("%d\n",banb[i]); | ^~~~ | ban main.c:27:15: note: each undeclared identifier is reported only once for each function it appears in main.c:30:1: error: expected declaration or statement at end of input 30 | } | ^ main.c:30:1: error: expected declaration or statement at end of input
s956938861
p00489
C
#include<stdio.h> int main(void) { int game,n,i,j,team[100],a,b,c,d,ban[100]; scanf("%d",&n); for(i=0;i<n;i++){ team[i]=0; ban[i]=1; } game=n*(n-1)/2; for(i=0;i<game;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d){ team[a-1]+=3; } else if(c==d){ team[a-1]+=1; team[b-1]+=1; else{ team[b-1]+=3; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(team[i]<team[j]){ ban[i]++; } printf("%d\n",ban[i]); } return 0; }
main.c: In function 'main': main.c:19:1: error: expected '}' before 'else' 19 | else{ | ^~~~ main.c:30:1: error: expected declaration or statement at end of input 30 | } | ^ main.c:30:1: error: expected declaration or statement at end of input
s178812562
p00489
C
#include<stdio.h> int main(void) { int game,n,i,j,team[100],a,b,c,d,ban[100]; scanf("%d",&n); for(i=0;i<n;i++){ team[i]=0; ban[i]=1; } game=n*(n-1)/2; for(i=0;i<game;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d){ team[a-1]+=3; } else if(c==d){ team[a-1]+=1; team[b-1]+=1; else{ team[b-1]+=3; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(team[i]<team[j]){ ban[i]++; } printf("%d\n",ban[i]); } return 0; }
main.c: In function 'main': main.c:18:1: error: expected '}' before 'else' 18 | else{ | ^~~~ main.c:29:1: error: expected declaration or statement at end of input 29 | } | ^ main.c:29:1: error: expected declaration or statement at end of input
s167510927
p00489
C
#include<stdio.h> int main(void) { int game,n,i,j,team[100]; int a,b,c,d,ban[100]; scanf("%d",&n); for(i=0;i<n;i++){ team[i]=0; ban[i]=1; } game=n*(n-1)/2; for(i=0;i<game;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d){ team[a-1]+=3; } else if(c==d){ team[a-1]+1; team[b-1]+1; else{ team[b-1]+3; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(team[i]<team[j]){ ban[i]++; } printf("%d\n",ban[i]); } return 0; }
main.c: In function 'main': main.c:20:1: error: expected '}' before 'else' 20 | else{ | ^~~~ main.c:31:1: error: expected declaration or statement at end of input 31 | } | ^ main.c:31:1: error: expected declaration or statement at end of input
s979762346
p00489
C
#include<stdio.h> int main(void) { int game,n,i,j,team[100]; int a,b,c,d,ban[100]; scanf("%d",&n); for(i=0;i<n;i++){ team[i]=0; ban[i]=1; } game=n*(n-1)/2; for(i=0;i<game;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d){ team[a-1]+=3; } else if(c==d){ team[a-1]+=1; team[b-1]+=1; else{ team[b-1]+=3; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(team[i]<team[j]){ ban[i]++; } printf("%d\n",ban[i]); } return 0; }
main.c: In function 'main': main.c:20:1: error: expected '}' before 'else' 20 | else{ | ^~~~ main.c:31:1: error: expected declaration or statement at end of input 31 | } | ^ main.c:31:1: error: expected declaration or statement at end of input
s627677381
p00489
C
#include<stdio.h> int main(void) { int game,n,i,j,team[100]; int a,b,c,d,ban[100]; scanf("%d",&n); for(i=0;i<n;i++){ team[i]=0; ban[i]=1; } game=n*(n-1)/2; for(i=0;i<game;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d){ team[a-1]+=3; } else if(c==d){ team[a-1]+=1; team[b-1]+=1; else{ team[b-1]+=3; } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(team[i]<team[j]){ ban[i]++; } printf("%d\n",ban[i]); } } return 0; }
main.c: In function 'main': main.c:19:1: error: expected '}' before 'else' 19 | else{ | ^~~~ main.c:31:1: error: expected declaration or statement at end of input 31 | } | ^
s380505847
p00489
C
#include <stdio.h> int main(void){ int team[100]={0}; int res[100], mach[4], n, i, j, a; scanf("%d", &n); for(i = 0; i < n*(n-1)/2; i++){ for(j = 0; j < 4; j++){ scanf("%d", &mach[j]); } if(s[2] == s[3]){ team[mach[0]-1]++; team[mach[1]-1]++; } else if(s[2] > s[3]) team[mach[0]-1] += 3; else team[mach[1]-1] += 3; } for(i = 0; i < n; i++){ for(j = 0; j < n; j++){ if(team[i] < team[j]) res[i]++; } printf("%d\n", res[i] + 1); } return 0; }
main.c: In function 'main': main.c:14:8: error: 's' undeclared (first use in this function) 14 | if(s[2] == s[3]){ | ^ main.c:14:8: note: each undeclared identifier is reported only once for each function it appears in
s233547911
p00489
C
a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];}
main.c:1:1: warning: data definition has no type or storage class 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^ 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,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^ main.c:1:7: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^ main.c:1:9: error: type defaults to 'int' in declaration of 'Z' [-Wimplicit-int] 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^ main.c:1:13: error: return type defaults to 'int' [-Wimplicit-int] 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^~~~ main.c: In function 'main': main.c:1:13: error: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:1:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} main.c:1:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^~~~~ main.c:1:25: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:76: error: 's' undeclared (first use in this function) 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^ main.c:1:76: note: each undeclared identifier is reported only once for each function it appears in main.c:1:120: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^~~~~~ main.c:1:120: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:120: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:120: note: include '<stdio.h>' or provide a declaration of 'printf' main.c: At top level: main.c:1:9: warning: array 'Z' assumed to have one element 1 | a,b,n,i,Z[];main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,Z);)c-*Z?s[c>*Z?a:b]+=3:++Z[a]-++Z[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=Z[i]<Z[a++];} | ^
s491538324
p00489
C
#include<stdio.h> int main(){ int n,*t,*rank,x,y; int a,b,c,d; t=(int*)malloc(sizeof(int)*(n+1)); rank=(int*)malloc(sizeof(int)*(n+1)); for(x=0;x<=n;x++){ t[x]=0; rank[x]=1; } for(x=0;x<n*(n-1)/2;x++){ scanf("%d %d %d %d",&a,&b,&c,&d); if(c>d)t[a]+=3; if(c<d)t[b]+=3; if(c==d)t[a]+=1,t[b]+=1; scanf("\n"); } fclose(fp); for(x=1;x<=n;x++){ for(y=x+1;y<=n;y++){ if(t[x]>t[y])rank[y]+=1; if(t[x]<t[y])rank[x]+=1; } } for(x=1;x<=n;x++){ printf("%d\n",rank[x]); } free(t); free(rank); return 0; }
main.c: In function 'main': main.c:7:17: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration] 7 | t=(int*)malloc(sizeof(int)*(n+1)); | ^~~~~~ main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc' 1 | #include<stdio.h> +++ |+#include <stdlib.h> 2 | main.c:7:17: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch] 7 | t=(int*)malloc(sizeof(int)*(n+1)); | ^~~~~~ main.c:7:17: note: include '<stdlib.h>' or provide a declaration of 'malloc' main.c:20:16: error: 'fp' undeclared (first use in this function) 20 | fclose(fp); | ^~ main.c:20:16: note: each undeclared identifier is reported only once for each function it appears in main.c:30:9: error: implicit declaration of function 'free' [-Wimplicit-function-declaration] 30 | free(t); | ^~~~ main.c:30:9: note: include '<stdlib.h>' or provide a declaration of 'free' main.c:30:9: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch] main.c:30:9: note: include '<stdlib.h>' or provide a declaration of 'free'
s718633434
p00489
C
#include<cstdio> #include<algorithm> #include<vector> #include<string> #include<iostream> using namespace std; #define rep(i,n) for(int i=0;i<int(n);i++) #define reps(i,n) for(int i=1;i<=int(n);i++) int main(){ int point[111]={0}; int n; cin>>n; for(int i=0; i<(n)*(n-1)/2;i++){ int a,b,c,d; cin>>a>>b>>c>>d; a--;b--; if(c>d)point[a]+=3; if(d>c)point[b]+=3; if(c==d){ point[a]++; point[b]++; } } int cont=1; int rank[111]; for(int i=10000;i>=0;i--){ bool flg=0; for(int j=0;j<n;j++){ if(point[j]==i){ rank[j]=cont; flg=1; } } if(flg==1)cont++; } rep(i,n)printf("%d\n",rank[i]); }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s731387051
p00489
C
#include<cstdio> #include<algorithm> #include<vector> #include<string> #include<iostream> using namespace std; #define rep(i,n) for(int i=0;i<int(n);i++) #define reps(i,n) for(int i=1;i<=int(n);i++) int main(){ int point[111]={0}; int n; cin>>n; for(int i=0; i<(n)*(n-1)/2;i++){ int a,b,c,d; cin>>a>>b>>c>>d; a--;b--; if(c>d)point[a]+=3; if(d>c)point[b]+=3; if(c==d){ point[a]++; point[b]++; } } for(int i=0;i<n;i++){ int rank=1; for(int j=0;j<n;j++){ if(point[i]<point[j])rank++; } printf("%d %d\n",rank,point[i]); } }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s095912581
p00489
C
#include <stdio.h> int main(){ int n,i,j; scanf("%d",&n); j = n*(n-1); int team[n],a,b,c,d; int team[n] ={}; for(i=0;i<j/2;i++){ scanf("%d%d%d%d",&a,&b,&c,&d); if(c>d){ team[a] += 3; }else if(c<d){ team[b] += 3; }else{ team[a] += 1; team[b] += 1; } }
main.c: In function 'main': main.c:7:13: error: redeclaration of 'team' with no linkage 7 | int team[n] ={}; | ^~~~ main.c:6:13: note: previous declaration of 'team' with type 'int[n]' 6 | int team[n],a,b,c,d; | ^~~~ main.c:18:13: error: expected declaration or statement at end of input 18 | } | ^
s284215532
p00489
C
#include <stdio.h> int main(){ int n,i,j; scanf("%d",&n); j = n*(n-1); int team[100],score[100],a,b,c,d,e; scanf("%d%d%d%d",&a,&b,&c,&d); if(c>d){ team[a] += 3; }else if(c<d){ team[b] += 3; }else{ team[a] += 1; team[b] += 1; } for(e=0;e<100;e++){ score[e] = team[e]; } int x; for(i=1;i<n;i++){ for(j=1;j<n;j++){ if(team[j]<team[j+1]){ x = team[j+1]; team[j+1] =team[j]; team[j] = x; } } } int k,l,up,rank; for(k=0;k<n;k++){ for(l=0;l<k;l++){ if(team[k]<team[l]){ up += 1; } } team[k] = team[up+1]; } for(e=0;e<100;e++){ for(f=0;f<100;f++){ if(score[e] = team[f]); printf("%d",f); } } return 0; }
main.c: In function 'main': main.c:41:7: error: 'f' undeclared (first use in this function) 41 | for(f=0;f<100;f++){ | ^ main.c:41:7: note: each undeclared identifier is reported only once for each function it appears in
s915174076
p00489
C
#include <stdio.h> int main(){ int n,i,j; scanf("%d",&n); j = n*(n-1); int team[100],score[100],a,b,c,d,e; for(i=0;i<j/2;i++){ scanf("%d%d%d%d",&a,&b,&c,&d); if(c>d){ team[a] += 3; }else if(c<d){ team[b] += 3; }else{ team[a] += 1; team[b] += 1; } } for(e=0;e<100;e++){ score[e] = team[e]; } int x; for(i=1;i<n;i++){ for(j=1;j<n;j++){ if(team[j]<team[j+1]){ x = team[j+1]; team[j+1] =team[j]; team[j] = x; } } } int k,l,up,rank; for(k=0;k<n;k++){ for(l=0;l<k;l++){ if(team[k]<team[l]){ up += 1; } } team[k] = team[up+1]; } for(e=0;e<100;e++){ for(f=0;f<100;f++){ if(score[e] = team[f]); printf("%d",f); } } return 0; }
main.c: In function 'main': main.c:41:7: error: 'f' undeclared (first use in this function) 41 | for(f=0;f<100;f++){ | ^ main.c:41:7: note: each undeclared identifier is reported only once for each function it appears in
s748442035
p00489
C
#include <stdio.h> int main(){ int n,i,j; scanf("%d",&n); j = n*(n-1); int team[100],score[100],a,b,c,d,e; for(i=0;i<j/2;i++){ scanf("%d%d%d%d",&a,&b,&c,&d); if(c>d){ team[a] += 3; }else if(c<d){ team[b] += 3; }else{ team[a] += 1; team[b] += 1; } } for(e=0;e<100;e++){ score[e] = team[e] } int x; for(i=1;i<n;i++){ for(j=1;j<n;j++){ if(team[j]<team[j+1]){ x = team[j+1]; team[j+1] =team[j]; team[j] = x; } } } for(f=0;f<100;f++){ if(score[e] ==team[f]){ printf("%d\n",f); } } return 0; }
main.c: In function 'main': main.c:19:30: error: expected ';' before '}' token 19 | score[e] = team[e] | ^ | ; 20 | } | ~ main.c:31:21: error: 'f' undeclared (first use in this function) 31 | for(f=0;f<100;f++){ | ^ main.c:31:21: note: each undeclared identifier is reported only once for each function it appears in
s361276454
p00489
C
#include<stdio.h> int points[101]; int main(){ scanf("%d", &n); for(i = 0;i < n * (n - 1) / 2;i++){ int ai, bi, ci, di; scanf("%d%d%d%d", &ai, &bi, &ci, &di); if(ci == di){ points[ai]++; points[bi]++; } else if(ci > di){ points[ai] += 3; } else{ points[bi] += 3; } } for(i = 1;i <= n;i++){ int res = 1; for(j = 1;j <= n;j++){ if(points[j] > points[i])res++; } printf("%d\n", res); } return 0; }
main.c: In function 'main': main.c:6:16: error: 'n' undeclared (first use in this function) 6 | scanf("%d", &n); | ^ main.c:6:16: note: each undeclared identifier is reported only once for each function it appears in main.c:7:7: error: 'i' undeclared (first use in this function) 7 | for(i = 0;i < n * (n - 1) / 2;i++){ | ^ main.c:23:9: error: 'j' undeclared (first use in this function) 23 | for(j = 1;j <= n;j++){ | ^
s970156350
p00489
C
#include <stdio.h> #include <math.h> int main(int argc, const char * argv[]) { int n, n2; scanf("%d", &n); n2 = n * (n - 1) / 2; int team[n]; int i, j; int a, b, c, d; for (i = 0; i < n2; i++) { scanf("%d %d %d %d", &a, &b, &c, &d); if (c > d) { team[a - 1] += 3; } else if (c < d) { team[b - 1] += 3; } else { team[a - 1] += 1; team[b - 1] += 1; } } for (i = 0; i < n; i++) { int count = 1; for (j = 0; j < n; j++) { if (team[i] < team[j]) { count++; } } Printf("%d\n", count); } return 0; }
main.c: In function 'main': main.c:38:9: error: implicit declaration of function 'Printf'; did you mean 'printf'? [-Wimplicit-function-declaration] 38 | Printf("%d\n", count); | ^~~~~~ | printf
s329223732
p00489
C
#include<stdio.h> int main() { int a,b,c,d,n,i,j,r[101]={0},s[101]={0}; scanf("%d",&n); for(i=0;i<n*(n-1)/2;i++,c==d?r[a]++,r[b]++:c>d?r[a]+=3:r[b]+=3) scanf("%d%d%d%d",&a,&b,&c,&d); for(i=0;i<n;s[i]=c,i++) for(j=1,c=0,d=i==0?100000:s[i-1];j<=n;j++) { if(d>r[j]&&c<r[j]) c=r[j]; } for(i=1;i<=n;i++) { for(j=0;s[j]!=r[i];j++); printf("%d\n",j+1); } return 0; }a
main.c: In function 'main': main.c:6:68: error: lvalue required as left operand of assignment 6 | for(i=0;i<n*(n-1)/2;i++,c==d?r[a]++,r[b]++:c>d?r[a]+=3:r[b]+=3) | ^~ main.c: At top level: main.c:20:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 20 | }a | ^
s208124993
p00489
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int main(){ int n,i,j,a[101],b[101],c[101],d[101],p=0,team[101],team2[101],team3[101],result[101],cnt=0,z; cin>>n; for(i=0;i<=n;i++){ a[i]=0; b[i]=0; c[i]=0; d[i]=0; team[i]=0; team2[i]=0; team3[i]=0; result[i]=0; } p=n*(n-1)/2; for(i=1;i<=p;i++){ cin>>a[i]>>b[i]>>c[i]>>d[i]; if(c[i]>d[i]){ team[a[i]]=team[a[i]]+3; } else if(c[i]<d[i]){ team[b[i]]=team[b[i]]+3; } else{ team[a[i]]=team[a[i]]+1; team[b[i]]=team[b[i]]+1; } } for(i=1;i<=n;i++){ team2[i]=team[i]; } for(i=1;i<=n;i++){ if(team[i]<=team[i+1]){ z=team[i]; team[i]=team[i+1]; team[i+1]=z; } } for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ if(team[i]==team2[j]){ team3[j]=i; team2[j]=-1; } } for(i=1;i<=n;i++){ printf("%d\n",team3[i]); } return 0; }
a.cc: In function 'int main()': a.cc:63:2: error: expected '}' at end of input 63 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s387875210
p00489
C++
#error ! #include <bits/stdc++.h> #define chmin(a, b) ((a)=min((a), (b))) #define chmax(a, b) ((a)=max((a), (b))) #define fs first #define sc second #define eb emplace_back using namespace std; typedef long long ll; typedef pair<int, int> P; typedef tuple<int, int, int> T; const ll MOD=1e9+7; const ll INF=1e18; int dx[]={1, -1, 0, 0}; int dy[]={0, 0, 1, -1}; int main(){ int d, n; cin>>d>>n; vector<int> t(d); vector<int> a(n), b(n), c(n); for(int i=0; i<d; i++) cin>>t[i]; for(int i=0; i<n; i++) cin>>a[i]>>b[i]>>c[i]; vector<vector<ll>> dp(210, vector<ll>(210, -INF)); for(int i=0; i<=100; i++){ if(a[i]<=t[0] && t[0]<=b[i]) dp[0][i]=0; } for(int i=1; i<d; i++){ for(int j=0; j<=100; j++){ if(dp[i-1][j]<=-INF) continue; for(int k=0; k<n; k++){ if(a[k]<=t[i] && t[i]<=b[k]){ dp[i][c[k]]=max(dp[i][c[k]], dp[i-1][j]+abs(c[k]-j)); } } } } ll ans=0; for(int i=0; i<=100; i++){ chmax(ans, dp[d-1][i]); } cout << ans << endl; }
a.cc:1:2: error: #error ! 1 | #error ! | ^~~~~
s690664181
p00489
C++
えらー #include <bits/stdc++.h> using namespace std; const int vecx[]={0,1,0,-1}; const int vecy[]={1,0,-1,0}; int r; vector<int> bfs(int w,int h,int sx,int sy,vector<vector<int>> &m){ vector<vector<bool>> visited(h+2,vector<bool>(w+2,false)); for (int i = 0; i < h+2; ++i) { if(i==0||i==h+1){ for (int j = 0; j < w+2; ++j) { visited[i][j]=true; } } visited[i][0]=true; visited[i][w+1]=true; } int tl=1; vector<int> ret(r+1,0); priority_queue<pair<int,pair<int,int>> > s; s.push(make_pair(1,make_pair(sx,sy))); int roomn=0; while(!s.empty()){ auto t=s.top(); tl=max(tl,t.first); ++roomn; ret[roomn]=tl; for (int i = 0; i < 4; ++i) { int x=t.second.first+vecx[i]; int y=t.second.second+vecx[i]; if(!visited[x][y])s.push(make_pair(m[y][x],make_pair(x,y))); } visited[t.second.first][t.second.second]=true; s.pop(); } return ret; } int main() { int w1,h1,x1,y1,w2,h2,x2,y2; while (true){ cin>>r; if(r==0)break; cin>>w1>>h1>>x1>>y1; vector<vector<int>> o1(w1,vector<int>(h1,0)); for (int i = 0; i < h1; ++i) { for (int j = 0; j < w1; ++j) { cin>>o1[i][j]; } } vector<int> a1=bfs(w1,h1,x1,y1,o1); } return 0; }
a.cc:1:1: error: '\U00003048\U00003089\U000030fc' does not name a type 1 | えらー | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); |
s480362251
p00489
C++
えらー #include <bits/stdc++.h> using namespace std; const int vecx[]={0,1,0,-1}; const int vecy[]={1,0,-1,0}; int r; vector<int> bfs(int w,int h,int sx,int sy,vector<vector<int>> &m){ vector<vector<bool>> visited(h+2,vector<bool>(w+2,false)); for (int i = 0; i < h+2; ++i) { if(i==0||i==h+1){ for (int j = 0; j < w+2; ++j) { visited[i][j]=true; } } visited[i][0]=true; visited[i][w+1]=true; } int tl=1; vector<int> ret(r+1,0); priority_queue<pair<int,pair<int,int>> > s; s.push(make_pair(1,make_pair(sx,sy))); int roomn=0; cout<<"ok"; while(!s.empty()){ auto t=s.top(); tl=max(tl,t.first); if(visited[t.second.first][t.second.second])continue; ++roomn; ret[roomn]=tl; for (int i = 0; i < 4; ++i) { int x=t.second.first+vecx[i]; int y=t.second.second+vecx[i]; if(!visited[x][y])s.push(make_pair(m[y-1][x-1],make_pair(x,y))); } visited[t.second.first][t.second.second]=true; s.pop(); } return ret; } int main() { int w1,h1,x1,y1,w2,h2,x2,y2; while (true){ cin>>r; if(r==0)break; cin>>w1>>h1>>x1>>y1; vector<vector<int>> o1(w1,vector<int>(h1,0)); for (int i = 0; i < h1; ++i) { for (int j = 0; j < w1; ++j) { cin>>o1[i][j]; } } vector<int> a1=bfs(w1,h1,x1,y1,o1); for(auto i:a1)cout<<i<<endl; } return 0; }
a.cc:1:1: error: '\U00003048\U00003089\U000030fc' does not name a type 1 | えらー | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); |
s359025016
p00489
C++
#include <stdio.h> typedef struct { int id; int rank; int score; } TEAM; TEAM team[200]; int cmp_score(TEAM *A, TEAM *B) { return (B->score - A->score); } int cmp_id(TEAM *A, TEAM *B) { return (A->id - B->id); } int main(void) { int N; int i, j; for (i = 0; i < 200; i++){ team[i].id = i; } scanf("%d", &N); for (i = 0; i < N * (N - 1) / 2; i++){ int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); if (c > d){ team[a - 1].score += 3; } else if (c == d){ team[a - 1].score += 1; team[b - 1].score += 1; } else { team[b - 1].score += 3; } } qsort(team, N, sizeof(TEAM), cmp_score); for (i = 1; i <= N; i++){ if (i == 1){ team[i].rank = 1; } else if (team[i - 1].score == team[i].score){ team[i].rank = team[i - 1].rank; } else if (team[i - 1].score > team[i].score){ team[i].rank = i; } } qsort(team, N, sizeof(TEAM), cmp_id); for (i = 0; i < N; i++){ printf("%d\n", team[i].rank + 1); } return 0; }
a.cc: In function 'int main()': a.cc:48:9: error: 'qsort' was not declared in this scope 48 | qsort(team, N, sizeof(TEAM), cmp_score); | ^~~~~
s224489640
p00489
C++
#include<iostream> #include<vector> using namespace std; typedef pair<int,int> pii; int main(){ int n; cin>>n; vector<pii>team; for(int j=0;j<n;j++) team.push_back(pii(0,j)); for(int i=0;i<(n*(n-1))/2;i++){ int ta,tb,sa,sb; cin>>ta>>tb>>sa>>sb; if(sa>sb){ team[--ta].first+=3; }else if(sa<sb){ team[--tb].first+=3; }else{ team[--ta].first++; team[--tb].first++; } } sort(team.begin(),team.end()); int ans[n]; for(int i=0;i<team.size();i++){ int cnt=0; if(team[i].first==team[i+1].first)cnt++; ans[team[i].second]=n-i-cnt; } for(int i:ans)cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:3: error: 'sort' was not declared in this scope; did you mean 'short'? 23 | sort(team.begin(),team.end()); | ^~~~ | short
s772574657
p00489
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int a[] = new int[10000]; int b[] = new int[10000]; for(int i = 1; i <= n*(n-1)/2; i++){ for(int h = 1; h <= 4; h++){ b[h] = in.nextInt(); } if(b[3] > b[4]){ a[b[1]] += 3; }else if(b[3] < b[4]){ a[b[2]] += 3; }else if(b[3] == b[4]){ a[b[1]] += 1; a[b[2]] += 1; } } for(int j = 1; j <= n; j++){ int an = n; for(int k = 1; k <= n; k++){ if(j == k){ continue; }else if(a[j] >= a[k]){ an--; } } System.out.println(an); } } }
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:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s589334412
p00489
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i=0; i<n; i++) #define rev(i, n) for(int i=(n)-1; i>=0; i--) int n; int d[111]; int rank[111]; int A, B, C, D; int main(int argc, char *argv[]) { cin >> n; rep(_, n * (n - 1) / 2){ cin >> A >> B >> C >> D; if(C > D){ d[A - 1] += 3; } else if(C < D){ d[B - 1] += 3; } else{ d[A - 1] += 1; d[B - 1] += 1; } } vector<int> res[333]; rep(i, 333) rep(j, n) if(d[j] == i) res[i].push_back(j); int p = 1; rev(i, 333) if(res[i].size()){ rep(j, res[i].size()) rank[res[i][j]] = p; p += res[i].size(); } rep(i, n) cout << rank[i] << endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:34:27: error: reference to 'rank' is ambiguous 34 | rep(j, res[i].size()) rank[res[i][j]] = p; | ^~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:9:5: note: 'int rank [111]' 9 | int rank[111]; | ^~~~ a.cc:38:21: error: reference to 'rank' is ambiguous 38 | rep(i, n) cout << rank[i] << endl; | ^~~~ /usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank' 1437 | struct rank | ^~~~ a.cc:9:5: note: 'int rank [111]' 9 | int rank[111]; | ^~~~
s134673724
p00489
C++
import Control.Monad import Control.Applicative import Data.List main = do n <- readLn l <- map (map (read :: String -> Int) . words) <$> replicateM ((n * (n - 1)) `div` 2) getLine mapM_ print $ solve n l point :: [(Int, Int)] -> [Int] -> [(Int, Int)] point x [a, b, c, d] | c < d = (b, 3):x | c == d = (a, 1):(b, 1):x | c > d = (a, 3):x func :: Int -> Int -> [(Int, Int)] -> [(Int, Int)] func a b [] = [(b, a)] func a b ((x, y):z) | a == -1 = func x y z | x == a = func a (b + y) z | otherwise = (b, a):(func x y z) func2 :: Int -> Int -> Int -> [(Int, Int)] -> [(Int, Int)] func2 a b c [] = [] func2 a b c ((x, y):z) | a == -1 = (y, 1):(func2 x 1 2 z) | a == x = (y, b):(func2 x b (c + 1) z) | otherwise = (y, c):(func2 x c (c + 1) z) func3 :: [(Int, Int)] -> [Int] func3 l = map (\(x, y) -> y) $ sort l solve :: Int -> [[Int]] -> [Int] solve n l = func3 $ func2 (-1) (-1) (-1) $ reverse $ sort $ func (-1) (-1) $ sort $ foldl point [(x, 0) | x <- [1..n]] l
a.cc:7:86: error: stray '`' in program 7 | l <- map (map (read :: String -> Int) . words) <$> replicateM ((n * (n - 1)) `div` 2) getLine | ^ a.cc:7:90: error: stray '`' in program 7 | l <- map (map (read :: String -> Int) . words) <$> replicateM ((n * (n - 1)) `div` 2) getLine | ^ a.cc:31:16: error: stray '\' in program 31 | func3 l = map (\(x, y) -> y) $ sort l | ^ a.cc:34:113: error: too many decimal points in number 34 | solve n l = func3 $ func2 (-1) (-1) (-1) $ reverse $ sort $ func (-1) (-1) $ sort $ foldl point [(x, 0) | x <- [1..n]] l | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import Control.Monad | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'