submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s206546302
p00021
C++
#include <stdio.h> #include <math.h> const double eps = 1e-10; int n; //math.hライブラリでy1, y2...とかって変数名が使われてるらしい double ix1, ix2, ix3, ix4; double iy1, iy2, iy3, iy4; //増加率を見る方法 int solve1() { double r1 = (iy2-iy1)/(ix2-ix1); double r2 = (iy4-iy3)/(ix4-ix3); return (fabs(r1-r2) < eps) } int main() { scanf("%d", &n); for(int i=0; i<n; ++i) { scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ix1, &iy1, &ix2, &iy2, &ix3, &iy3, &ix4, &iy4); if(solve1()) { printf("YES\n"); } else { printf("NO\n"); } } }
a.cc: In function 'int solve1()': a.cc:15:31: error: expected ';' before '}' token 15 | return (fabs(r1-r2) < eps) | ^ | ; 16 | } | ~
s634745832
p00021
C++
#include <iostream> using namespace std; int main(void) {     double x[4];     double y[4];     int n;     cin >> n;     while(n--){         for(int i=0; i<4; i++){             cin >> x[i] >> y[i];         }         double d1,d2;         d1 = (y[1]-y[0])/(x[1]-x[0]);         d2 = (y[3]-y[2])/(x[3]-x[2]);         if(d1==d2) cout << "YES" << endl;         else cout << "NO" << endl;     }     return 0; }
a.cc:5:1: error: extended character   is not valid in an identifier 5 |     double x[4]; | ^ a.cc:5:1: error: extended character   is not valid in an identifier a.cc:5:1: error: extended character   is not valid in an identifier a.cc:5:1: error: extended character   is not valid in an identifier a.cc:6:1: error: extended character   is not valid in an identifier 6 |     double y[4]; | ^ a.cc:6:1: error: extended character   is not valid in an identifier a.cc:6:1: error: extended character   is not valid in an identifier a.cc:6:1: error: extended character   is not valid in an identifier a.cc:7:1: error: extended character   is not valid in an identifier 7 |     int n; | ^ a.cc:7:1: error: extended character   is not valid in an identifier a.cc:7:1: error: extended character   is not valid in an identifier a.cc:7:1: error: extended character   is not valid in an identifier a.cc:8:1: error: extended character   is not valid in an identifier 8 |     cin >> n; | ^ a.cc:8:1: error: extended character   is not valid in an identifier a.cc:8:1: error: extended character   is not valid in an identifier a.cc:8:1: error: extended character   is not valid in an identifier a.cc:9:1: error: extended character   is not valid in an identifier 9 |     while(n--){ | ^ a.cc:9:1: error: extended character   is not valid in an identifier a.cc:9:1: error: extended character   is not valid in an identifier a.cc:9:1: error: extended character   is not valid in an identifier a.cc:10:1: error: extended character   is not valid in an identifier 10 |         for(int i=0; i<4; i++){ | ^ a.cc:10:1: error: extended character   is not valid in an identifier a.cc:10:1: error: extended character   is not valid in an identifier a.cc:10:1: error: extended character   is not valid in an identifier a.cc:10:1: error: extended character   is not valid in an identifier a.cc:10:1: error: extended character   is not valid in an identifier a.cc:10:1: error: extended character   is not valid in an identifier a.cc:10:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier 11 |             cin >> x[i] >> y[i]; | ^ a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:11:1: error: extended character   is not valid in an identifier a.cc:12:1: error: extended character   is not valid in an identifier 12 |         } | ^ a.cc:12:1: error: extended character   is not valid in an identifier a.cc:12:1: error: extended character   is not valid in an identifier a.cc:12:1: error: extended character   is not valid in an identifier a.cc:12:1: error: extended character   is not valid in an identifier a.cc:12:1: error: extended character   is not valid in an identifier a.cc:12:1: error: extended character   is not valid in an identifier a.cc:12:1: error: extended character   is not valid in an identifier a.cc:13:1: error: extended character   is not valid in an identifier 13 |         double d1,d2; | ^ a.cc:13:1: error: extended character   is not valid in an identifier a.cc:13:1: error: extended character   is not valid in an identifier a.cc:13:1: error: extended character   is not valid in an identifier a.cc:13:1: error: extended character   is not valid in an identifier a.cc:13:1: error: extended character   is not valid in an identifier a.cc:13:1: error: extended character   is not valid in an identifier a.cc:13:1: error: extended character   is not valid in an identifier a.cc:14:1: error: extended character   is not valid in an identifier 14 |         d1 = (y[1]-y[0])/(x[1]-x[0]); | ^ a.cc:14:1: error: extended character   is not valid in an identifier a.cc:14:1: error: extended character   is not valid in an identifier a.cc:14:1: error: extended character   is not valid in an identifier a.cc:14:1: error: extended character   is not valid in an identifier a.cc:14:1: error: extended character   is not valid in an identifier a.cc:14:1: error: extended character   is not valid in an identifier a.cc:14:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier 15 |         d2 = (y[3]-y[2])/(x[3]-x[2]); | ^ a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:15:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier 16 |         if(d1==d2) cout << "YES" << endl; | ^ a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:16:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier 17 |         else cout << "NO" << endl; | ^ a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:17:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier 18 |     } | ^ a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:18:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier 19 |     return 0; | ^ a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc:19:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:5:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0double' was not declared in this scope 5 |     double x[4]; | ^~~~~~~~~~ a.cc:6:11: error: expected ';' before 'y' 6 |     double y[4]; | ^~ | ; a.cc:7:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0int' was not declared in this scope 7 |     int n; | ^~~~~~~ a.cc:8:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0cin' was not declared in this scope 8 |     cin >> n; | ^~~~~~~ a.cc:8:12: error: 'n' was not declared in this scope 8 |     cin >> n; | ^ a.cc:9:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0while' was not declared in this scope 9 |     while(n--){ | ^~~~~~~~~ a.cc:19:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0return' was not declared in this scope 19 |     return 0; | ^~~~~~~~~~
s472070813
p00021
C++
#!/usr/bin/env python n = input() for loop in range(n): S = raw_input().split() x1, y1, x2, y2, x3, y3, x4, y4 = map(float, S) v1 = [x2 - x1, y2 - y1] v2 = [x4 - x3, y4 - y3] norm = (v1[0] * v1[0] + v1[1] * v1[1]) * (v2[0] * v2[0] + v2[1] * v2[1]) inn = v1[0] * v2[0] + v1[1] * v2[1] if abs(norm) - inn * inn < 1e-10: print "YES" else: print "NO"
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/env python | ^ a.cc:2:1: error: 'n' does not name a type 2 | n = input() | ^
s284315543
p00021
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
s014485421
p00021
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; double x1,x2,x3,x4,y1,y2,y3,y4; cin >> n; string ans[n]; for(int i=0;i<n;i++){ cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4; if((y1-y2)/(x1-x2)==(y3-y4)/(x3-x4) and (y1-y3)/(x1-x3)!=(y1-y2)/(x1-x2) and (y1-y4)/(x1-x4)!=(y1-y2)/(x1-x2) x1-x2!=0 and x3-x4!=0 and y1-y2!=0 and y3-y4!=0){ ans[i]="YES"; }else{ ans[i]="NO"; } } for(int i=0;i<n;i++){ cout << ans[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:114: error: expected ')' before 'x1' 10 | if((y1-y2)/(x1-x2)==(y3-y4)/(x3-x4) and (y1-y3)/(x1-x3)!=(y1-y2)/(x1-x2) and (y1-y4)/(x1-x4)!=(y1-y2)/(x1-x2) x1-x2!=0 and x3-x4!=0 and y1-y2!=0 and y3-y4!=0){ | ~ ^~~ | )
s134992146
p00021
C++
a#include <iostream> using namespace std; struct pt { double x; double y; }; int main() { int num; cin >> num; while(num--) { pt p1, p2, p3, p4; cin >> p1.x >> p1.y; cin >> p2.x >> p2.y; cin >> p3.x >> p3.y; cin >> p4.x >> p4.y; pt v1 = {p1.x-p2.x, p1.y-p2.y}; pt v2 = {p3.x-p4.x, p3.y-p4.y}; if (v1.y==0 && v2.y==0) cout << "YES\n"; else if (v1.x/v1.y == v2.x/v2.y) cout << "YES\n"; else cout << "NO\n"; } return 0; }
a.cc:1:2: error: stray '#' in program 1 | a#include <iostream> | ^ a.cc:1:1: error: 'a' does not name a type 1 | a#include <iostream> | ^ a.cc: In function 'int main()': a.cc:21:9: error: 'cin' was not declared in this scope 21 | cin >> num; | ^~~ a.cc:39:41: error: 'cout' was not declared in this scope 39 | if (v1.y==0 && v2.y==0) cout << "YES\n"; | ^~~~ a.cc:41:50: error: 'cout' was not declared in this scope 41 | else if (v1.x/v1.y == v2.x/v2.y) cout << "YES\n"; | ^~~~ a.cc:43:22: error: 'cout' was not declared in this scope 43 | else cout << "NO\n"; | ^~~~
s605234190
p00021
C++
#include<complex> #include<iostream> using namespace std; int main(){const double E=1e-10;int n;double x1,y1,x2,y2,x3,y3,x4,y4;cin>>n;while(n--{cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;cout<<((abs((y2-y1)*(x4-x3)-(y4-y3)*(x2-x1))<E)?"YES":"NO")<<endl;}}
a.cc: In function 'int main()': a.cc:4:86: error: expected ')' before '{' token 4 | int main(){const double E=1e-10;int n;double x1,y1,x2,y2,x3,y3,x4,y4;cin>>n;while(n--{cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;cout<<((abs((y2-y1)*(x4-x3)-(y4-y3)*(x2-x1))<E)?"YES":"NO")<<endl;}} | ~ ^ | )
s139776108
p00021
C++
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class Main{ Scanner sc; static final int INF=1<<28; static final double EPS=1e-9; void run(){ sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=0; i<n; i++){ double x1=sc.nextDouble(); double y1=sc.nextDouble(); double x2=sc.nextDouble(); double y2=sc.nextDouble(); double x3=sc.nextDouble(); double y3=sc.nextDouble(); double x4=sc.nextDouble(); double y4=sc.nextDouble(); double vx1=x2-x1; double vy1=y2-y1; double vx2=x4-x3; double vy2=y4-y3; double ip=vx1*vx2+vy1*vy2; ip*=ip; double n1=vx1*vx1+vy1*vy1; double n2=vx2*vx2+vy2*vy2; println(abs(ip-abs(n1*n2))<EPS?"YES":"NO"); } sc.close(); } void print(String s){ System.out.print(s); } void println(String s){ System.out.println(s); } public static void main(String[] args){ new Main().run(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.lang.*; | ^~~~~~ 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.math.*; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.io.*; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import static java.lang.Math.*; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import static java.util.Arrays.*; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:9:1: error: expected unqualified-id before 'public' 9 | public class Main{ | ^~~~~~
s735068250
p00021
C++
#include <iostream> #include <complex> using namespace std; typedef complex<double> P; const double EPS = 1e-9; int main(){ int N; cin >> N; while(N--){ P a,b,c,d; cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); P one = a-b; P two = c-d; bool f = false; if( abs(one.imag()) < EPS || abs(two.imag()) < EPS ){ f = abs(one.imag()) < EPS && abs(two.imag()) < EPS; }else{ f = abs(one.real()/one.imag() - two.real()/two.imag()) < EPS; } cout << (f?"YES":"NO") << endl; } // }
a.cc: In function 'int main()': a.cc:11:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double') 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~ ^~ ~~~~~~~~ | | | | | double | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'double&' to an rvalue of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed: a.cc:11:30: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'double' 11 | cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag() >> d.real() >> d.imag(); | ~~~~~~^~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'double' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'double' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::b
s976534300
p00021
C++
int main(){ int n,i,j; double x[4],y[4]; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<4;j++)scanf("%d %d",&x[j],&y[j]); if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))printf("YES\n"); else printf("NO\n"); } }
a.cc: In function 'int main()': a.cc:4:9: error: 'scanf' was not declared in this scope 4 | scanf("%d",&n); | ^~~~~ a.cc:7:73: error: 'printf' was not declared in this scope 7 | if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))printf("YES\n"); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(){ a.cc:8:22: error: 'printf' was not declared in this scope 8 | else printf("NO\n"); | ^~~~~~ a.cc:8:22: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s594136156
p00021
C++
#include <iostream> n,i,j;main(){double x[4],y[4];std::cin>>n;for(i=0;i<n;i++){for(j=0;j<4;j++)std::cin>>x[j]>>y[j];if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))std::cout<<"YES\n";else std::cout<<"NO\n";}}
a.cc:2:1: error: 'n' does not name a type 2 | n,i,j;main(){double x[4],y[4];std::cin>>n;for(i=0;i<n;i++){for(j=0;j<4;j++)std::cin>>x[j]>>y[j];if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))std::cout<<"YES\n";else std::cout<<"NO\n";}} | ^ a.cc:2:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | n,i,j;main(){double x[4],y[4];std::cin>>n;for(i=0;i<n;i++){for(j=0;j<4;j++)std::cin>>x[j]>>y[j];if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))std::cout<<"YES\n";else std::cout<<"NO\n";}} | ^~~~ a.cc: In function 'int main()': a.cc:2:41: error: 'n' was not declared in this scope 2 | n,i,j;main(){double x[4],y[4];std::cin>>n;for(i=0;i<n;i++){for(j=0;j<4;j++)std::cin>>x[j]>>y[j];if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))std::cout<<"YES\n";else std::cout<<"NO\n";}} | ^ a.cc:2:47: error: 'i' was not declared in this scope 2 | n,i,j;main(){double x[4],y[4];std::cin>>n;for(i=0;i<n;i++){for(j=0;j<4;j++)std::cin>>x[j]>>y[j];if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))std::cout<<"YES\n";else std::cout<<"NO\n";}} | ^ a.cc:2:64: error: 'j' was not declared in this scope 2 | n,i,j;main(){double x[4],y[4];std::cin>>n;for(i=0;i<n;i++){for(j=0;j<4;j++)std::cin>>x[j]>>y[j];if(((y[0]-y[1])/(x[0]-x[1]))==((y[2]-y[3])/(x[2]-x[3])))std::cout<<"YES\n";else std::cout<<"NO\n";}} | ^
s010401393
p00021
C++
import java.io.*; class Main{ public static void main(String[] args)throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String buf; double[][] data=new double[4][2]; int n=Integer.parseInt(br.readLine()); for(int k=0;k<n;k++){ if((buf=br.readLine())==null)break; if(buf.length()==0)break; String[] buf2=buf.split(" "); for(int i=0;i<4;i++){ for(int j=0;j<2;j++){ data[i][j]=Double.parseDouble(buf2[i*2+j]); } } if((data[0][1]-data[1][1]/data[0][0]-data[1][0])==(data[2][1]-data[3][1]/data[2][0]-data[3][0])) System.out.println("YES"); else System.out.println("NO"); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:15: error: expected ':' before 'static' 3 | public static void main(String[] args)throws IOException{ | ^~~~~~~ | : a.cc:3:33: error: 'String' has not been declared 3 | public static void main(String[] args)throws IOException{ | ^~~~~~ a.cc:3:42: error: expected ',' or '...' before 'args' 3 | public static void main(String[] args)throws IOException{ | ^~~~ a.cc:3:46: error: expected ';' at end of member declaration 3 | public static void main(String[] args)throws IOException{ | ^ | ; a.cc:3:47: error: 'throws' does not name a type 3 | public static void main(String[] args)throws IOException{ | ^~~~~~ a.cc:25:2: error: expected ';' after class definition 25 | } | ^ | ;
s677682713
p00021
C++
#include <cmath> #include <complex> #include <vector> #include <cfloat> #include <algorithm> using namespace std; //二次元幾何テンプレート //点クラス point->x,y //直線クラス line->s,v // class point; class line; point vec_add(point vec1,point vec2);//ベクトルの足し算 point vec_sub(point vec1,point vec2);//ベクトルの引き算 double inner_product(point a,point b);//内積 double outer_product(point a,point b);//外積 bool vec_parallel(point vec1,point vec2);//ベクトルの並行判定(交差判定falseとしても使える) bool vec_angle_right(point vec1,point vec2);//ベクトルの直行判定 bool cross_line_segment(line a,point p1,point p2);//直線と線分の交差判定 // class point{ public: double x,y; point(){ x=0; y=0; } point(double a,double b){ x=a; y=b; } }; //直線クラス class line{ public: point s,v; public: line(point a,point b){ s=a; v=vec_sub(a,b); } }; //多角形(頂点を保持する) typedef vector<point> polygon; //ベクトルの足し算 point vec_add(point vec1,point vec2){ point res(vec1.x+vec2.x,vec1.y+vec2.y); return res; } //ベクトルの引き算 point vec_sub(point vec1,point vec2){ point res(vec1.x-vec2.x,vec1.y-vec2.y); return res; } //内積 double inner_product(point a,point b){ return a.x * b.x + a.y * b.y; } //外積 double outer_product(point a,point b){ return a.x * b.y - a.y * b.x; } //ベクトルの並行判定 bool vec_parallel(point vec1,point vec2){ if(outer_product(vec1,vec2)==0){ return true; }else{ return false; } } //ベクトルの直交判定 bool vec_angle_right(point vec1,point vec2){ if(inner_product(vec1,vec2)==0){ return true; }else{ return false; } } bool cross_line_segment(line l,point p1,point p2){ p1=vec_sub(p1,l.s); p2=vec_sub(p2,l.s); if(outer_product(p1,l.v)*outer_product(p2,l.v)<0){ return true; }else{ return false; } } // int main(){ int n; point p[4]; cin>>n; for(;n--;){ for(int i=0;i<4;i++){ cin>>p[i].x; cin>>p[i].y; } p[0]=vec_sub(p[0],p[1]); p[2]=vec_sub(p[2],p[3]); if(vec_parallel(p[0],p[2])){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:105:9: error: 'cin' was not declared in this scope 105 | cin>>n; | ^~~ a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include <algorithm> +++ |+#include <iostream> 6 | using namespace std; a.cc:114:25: error: 'cout' was not declared in this scope 114 | cout<<"YES"<<endl; | ^~~~ a.cc:114:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:116:25: error: 'cout' was not declared in this scope 116 | cout<<"NO"<<endl; | ^~~~ a.cc:116:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s350291516
p00021
C++
#include<iostream> #include<cstdlib> using namespace std; #define EPS 1e-10 double x1,y1,x2,y2,x3,y3,x4,y4; int det(){ double dx1,dy1,dx2,dy2; dx1 = x1-x2; dy1 = y1-y2; dx2 = x3-x4; dy2 = y3-y4; return dx1*dy2 - dy1*dx2; } int main(){ int n; cin>>n; while(n--){ cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; cout<<(fabs(det())<EPS?"YES":"NO")<<endl; } return 0; }
a.cc:5:11: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch] 5 | double x1,y1,x2,y2,x3,y3,x4,y4; | ^~ a.cc: In function 'int main()': a.cc:19:24: error: 'fabs' was not declared in this scope; did you mean 'labs'? 19 | cout<<(fabs(det())<EPS?"YES":"NO")<<endl; | ^~~~ | labs
s699315342
p00021
C++
#include<iostream> #include<cmath> using namespace std; #define EPS 1e-10 double x1,y1,x2,y2,x3,y3,x4,y4; int det(){ double dx1,dy1,dx2,dy2; dx1 = x1-x2; dy1 = y1-y2; dx2 = x3-x4; dy2 = y3-y4; return dx1*dy2 - dy1*dx2; } int main(){ int n; cin>>n; while(n--){ cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; cout<<(fabs(det())<EPS?"YES":"NO")<<endl; } return 0; }
a.cc:5:11: error: 'double y1' redeclared as different kind of entity 5 | double x1,y1,x2,y2,x3,y3,x4,y4; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int det()': a.cc:9:17: error: invalid operands of types 'double(double) noexcept' and 'double' to binary 'operator-' 9 | dy1 = y1-y2; | ~~^~~ | | | | | double | double(double) noexcept a.cc: In function 'int main()': a.cc:18:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept') 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ~~~~~~~^~~~ | | | | | double(double) noexcept | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept' 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(short int)y1' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(short unsigned int)y1' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(int)y1' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(unsigned int)y1' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(long int)y1' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(long unsigned int)y1' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(long long int)y1' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(long long unsigned int)y1' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(void*)y1' to 'void*&' /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept /usr/include/c
s895643876
p00021
C++
#include<iostream> #include<cmath> using namespace std; #define EPS 1e-10 double x1,y1,x2,y2,x3,y3,x4,y4; double det(){ double dx1,dy1,dx2,dy2; dx1 = x1-x2; dy1 = y1-y2; dx2 = x3-x4; dy2 = y3-y4; return dx1*dy2 - dy1*dx2; } int main(){ int n; cin>>n; while(n--){ cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; cout<<(fabs(det())<EPS?"YES":"NO")<<endl; } return 0; }
a.cc:5:11: error: 'double y1' redeclared as different kind of entity 5 | double x1,y1,x2,y2,x3,y3,x4,y4; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)' 257 | __MATHCALL (y1,, (_Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'double det()': a.cc:9:17: error: invalid operands of types 'double(double) noexcept' and 'double' to binary 'operator-' 9 | dy1 = y1-y2; | ~~^~~ | | | | | double | double(double) noexcept a.cc: In function 'int main()': a.cc:18:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept') 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ~~~~~~~^~~~ | | | | | double(double) noexcept | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept' 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(short int)y1' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(short unsigned int)y1' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(int)y1' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(unsigned int)y1' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(long int)y1' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(long unsigned int)y1' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(long long int)y1' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(long long unsigned int)y1' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept a.cc:18:26: error: cannot bind rvalue '(void*)y1' to 'void*&' /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed: a.cc:18:26: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive] 18 | cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; | ^~ | | | double (*)(double) noexcept /usr/includ
s351420715
p00021
C++
#include<iostream> using namespace std; int main(){ int n; cin >> n; double ax,ay,bx,by,cx,cy,dx,dy,ans1,ans2,x,y; for(int i=0;i<n;i++){ cin >> ax >> ay >> bx >> by >> cx >> cy >> dx >> dy; x = ax - bx; y = ay - by; ans1 = y / x; x = cx - dx; y = cy - dy; ans2 = y / x; if(ans1==ans2) cout << "YES" << endl; if(ans1!=ans2) cout << "NO" << endl; }
a.cc: In function 'int main()': a.cc:17:5: error: expected '}' at end of input 17 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s235085890
p00021
C++
#include <iostream> #include <cmath> using namespace std; int main (void) { double x1, y1, x2, y2, x3, y3, x4, y4; int n; cin >> n; for(int i = 0; i < n; i++) { cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4; double t1 = (y1-y2)/(x1-x2)); double t2 = (y3-y4)/(x3-x4)); //cout << t1 << " " << t2 << endl; if ( t1 == t2 ) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:14:32: error: expected ',' or ';' before ')' token 14 | double t1 = (y1-y2)/(x1-x2)); | ^ a.cc:15:32: error: expected ',' or ';' before ')' token 15 | double t2 = (y3-y4)/(x3-x4)); | ^
s448730495
p00021
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ float x[4], y[4]; for(int j = 0; j < 4; j++){ cin >> x[j] >> y[j]; } //float ab = 999999, cd = 999999; ab = (y[0]-y[1]) / (x[0]-x[1]); cd = (y[2]-y[3]) / (x[2]-x[3]); if(ab == cd) cout << "YES"<< endl; else cout << "NO" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'ab' was not declared in this scope; did you mean 'abs'? 13 | ab = (y[0]-y[1]) / (x[0]-x[1]); | ^~ | abs a.cc:14:17: error: 'cd' was not declared in this scope 14 | cd = (y[2]-y[3]) / (x[2]-x[3]); | ^~
s017598185
p00021
C++
#include <iostream> using namespace std; int main(){ double x1,y1,x2,y2,x3,y3,x4,y4; int n; cin>>n; while(n--){ cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; double a,b,c,d; a=y2-y1; b=y4-y3; c=x2-x1; d=x4-x3; if() if(a/c==d/b)cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:8: error: expected primary-expression before ')' token 15 | if() | ^
s586520106
p00021
C++
#include <iostream> using namespace std; int main(){ double x1,y1,x2,y2,x3,y3,x4,y4; int n; cin>>n; while(n--){ cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4; double a,b,c,d; a=y2-y1; b=y4-y3; c=x2-x1; d=x4-x3; if(a/c==d/b)cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0;
a.cc: In function 'int main()': a.cc:19:12: error: expected '}' at end of input 19 | return 0; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s009166988
p00021
C++
#include<cstdio> int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++){ double x1,y1,x2,y2,x3,y3,x4,y4; scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4); if((y2-y1)/(x2-x1)==(y4-y3)/(x4-x3)) printf("YES\n"); else printf("NO\n"); }
a.cc: In function 'int main()': a.cc:10:6: error: expected '}' at end of input 10 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s934140235
p00021
C++
#include <iostream> using namespace std; int main(){ int a,b,c,d,e,f,g,h; int n; cin>>n; while(n--){ cin>>a>>b>>c>>d>>e>>f>>g>>h; if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; else cout>>"NO">>endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:37: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [4]') 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ~~~~^~~~~~~ | | | | | const char [4] | std::ostream {aka std::basic_ostream<char>} 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:39: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~~ 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:33: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~ 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:39: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~~ /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:39: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~~ /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:39: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~~ /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:39: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~~ /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:39: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~~ /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:39: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~~ /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 = const char (&)[4]]': a.cc:11:39: required from here 11 | if((c-a)/(d-b)==(g-e)/(h-f))cout>>"YES">>endl; | ^~~~~ /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:12:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [3]') 12 | else cout>>"NO">>endl; | ~~~~^~~~~~ | | | | | const char [3] | std::ostream {aka std::basic_ostream<char>} /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:12:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | else cout>>"NO">>endl; | ^~~~ /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:12:10: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 12 | else cout>>"NO">>endl; | ^~~~ /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:12:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 12 | else cout>>"NO">>endl; | ^~~~ /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:12:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | else cout>>"NO">>endl; | ^~~~ /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:12:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 12 | else cout>>"NO">>endl; | ^~~~ /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/incl
s064320244
p00021
C++
#include <stdio.h> int main(void){ int b[100],n; double a[100],c[100]; scanf("%d",&n); for(b[2]=1;b[2]<=n;b[2]++){ for(b[3]=1;b[3]<=8;b[3]++){ scanf("%lf",&a[b[3]+10*n]); } } for(b[2]=1;b[2]<=n;b[2]++){ c[0]*1.0=a[6+10*n]/a[7+10*n]*1.0; c[1]*1.0=a[2+10*n]/a[3+10*n]*1.0; if(c[0]==c[1]){ printf("YES\n"); } else printf("NO\n"); } return 0; }
a.cc: In function 'int main()': a.cc:14:13: error: lvalue required as left operand of assignment 14 | c[0]*1.0=a[6+10*n]/a[7+10*n]*1.0; | ~~~~^~~~ a.cc:15:13: error: lvalue required as left operand of assignment 15 | c[1]*1.0=a[2+10*n]/a[3+10*n]*1.0; | ~~~~^~~~
s476170550
p00021
C++
#include<iostream> using namespace std; #define EPS 1e-5 struct point{ double x; double y; }; struct line{ double a; double b; }; bool get_line( const point& a , const point& b , line *a_b ); istream& operator >> ( istream& s , point& p ); int main(void) { point a, b, c, d; line a_b, c_d; bool result1 , result2; int num; cin >> num; for( int i = 0 ; i < num ; i++ ) { cin >> a >> b >> c >> d; result1 = get_line( a , b , &a_b ); result2 = get_line( c , d , &c_d ); if( result1 == false && result2 == false ) { cout << "YES" << endl; } else { if( fabs(a_b.a - c_d.a) < EPS ) cout << "YES" << endl; else cout << "NO" << endl; } } return 0; } istream& operator >> ( istream& s , point& p ) { return s >> p.x >> p.y; } bool get_line( const point& a , const point& b , line *a_b ) { if( fabs(a.x - b.x) < EPS ) return false; else{ a_b->a = (a.y - b.y)/(a.x - b.x); a_b->b = a.y - (a.x * a_b->a); return true; } }
a.cc: In function 'int main()': a.cc:45:17: error: 'fabs' was not declared in this scope; did you mean 'labs'? 45 | if( fabs(a_b.a - c_d.a) < EPS ) cout << "YES" << endl; | ^~~~ | labs a.cc: In function 'bool get_line(const point&, const point&, line*)': a.cc:60:13: error: 'fabs' was not declared in this scope; did you mean 'labs'? 60 | if( fabs(a.x - b.x) < EPS ) return false; | ^~~~ | labs a.cc:66:1: warning: control reaches end of non-void function [-Wreturn-type] 66 | } | ^
s229337361
p00021
C++
#include<iostream> using namespace std; int main(){ int n; double x[4],y[4]; cin>>n; for(;n--;){ for(int i=0;i<4;i++){ cin>>x[i]; cin>>y[i]; } if((x[0]-x[1])*(y[2]-y[3])==(x[2]-x[3])*(y[0]-y[1])){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } return 0; }
a.cc:1:21: warning: extra tokens at end of #include directive 1 | #include<iostream> using namespace std; int main(){ int n; double x[4],y[4]; cin>>n; for(;n--;){ for(int i=0;i<4;i++){ cin>>x[i]; cin>>y[i]; } if((x[0]-x[1])*(y[2]-y[3])==(x[2]-x[3])*(y[0]-y[1])){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } return 0; } | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s087621940
p00021
C++
n = input()+1 for v in range(1,n): (x1,y1,x2,y2,x3,y3,x4,y4)=map(int,raw_input().split()) if x2-x1=0 or x4-x3=0: if x2-x1=0 and x4-x3=0: print "YES" else: print "NO" elif y2-y1=0 or y4-y3=0: if y2-y1=0 and y4-y3=0: print "YES" else: print "NO" else: a = (y2-y1)/(x2-x1)
a.cc:1:1: error: 'n' does not name a type 1 | n = input()+1 | ^
s142230370
p00021
C++
n = input()+1 for v in range(1,n): (x1,y1,x2,y2,x3,y3,x4,y4)=map(int,raw_input().split()) if x2-x1==0 or x4-x3==0: if x2-x1==0 and x4-x3==0: print "YES" else: print "NO" elif y2-y1==0 or y4-y3==0: if y2-y1==0 and y4-y3==0: print "YES" else: print "NO" else: a = (y2-y1)/(x2-x1) b = (y4-y3)/(x4-x3) if a == b: print "YES" else: print "NO"
a.cc:1:1: error: 'n' does not name a type 1 | n = input()+1 | ^
s813683399
p00021
C++
#!/usr/bin/python # -*- coding:utf-8 -*- def main(): numData = int(raw_input()) count = 0 while count < numData: line = raw_input() coords = map(float, line.strip().split()) result = isParallel(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5], coords[6], coords[7]) if result : print "YES" else: print "NO" count += 1 def isParallel(x1, y1, x2, y2, x3, y3, x4, y4): # 小数点以下最大5桁までの精度で計算すればよい x1 = int(x1 * 100000) y1 = int(y1 * 100000) x2 = int(x2 * 100000) y2 = int(y2 * 100000) x3 = int(x3 * 100000) y3 = int(y3 * 100000) x4 = int(x4 * 100000) y4 = int(y4 * 100000) # 直線ABの傾きが無限大かどうか if (x2 == x1): # 傾き無限大ならば、CDもそうなら平行 return x4 == x3 else: # 有限の傾きならば傾きが等しければOK return (y2 - y1)/(x2 - x1) == (y4 - y3)/(x4 - x3) main()
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/python | ^ a.cc:2:3: error: invalid preprocessing directive #- 2 | # -*- coding:utf-8 -*- | ^ a.cc:20:11: error: invalid preprocessing directive #\U00005c0f\U00006570\U000070b9\U00004ee5\U00004e0b\U00006700\U00005927\U0000ff15\U00006841\U0000307e\U00003067\U0000306e\U00007cbe\U00005ea6\U00003067\U00008a08\U00007b97\U00003059\U0000308c\U00003070\U00003088\U00003044 20 | # 小数点以下最大5桁までの精度で計算すればよい | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:29:11: error: invalid preprocessing directive #\U000076f4\U00007ddaAB\U0000306e\U000050be\U0000304d\U0000304c\U00007121\U00009650\U00005927\U0000304b\U00003069\U00003046\U0000304b 29 | # 直線ABの傾きが無限大かどうか | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:31:19: error: extended character 、 is not valid in an identifier 31 | # 傾き無限大ならば、CDもそうなら平行 | ^ a.cc:31:19: error: invalid preprocessing directive #\U000050be\U0000304d\U00007121\U00009650\U00005927\U0000306a\U00003089\U00003070\U00003001CD\U00003082\U0000305d\U00003046\U0000306a\U00003089\U00005e73\U0000884c 31 | # 傾き無限大ならば、CDもそうなら平行 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:34:19: error: invalid preprocessing directive #\U00006709\U00009650\U0000306e\U000050be\U0000304d\U0000306a\U00003089\U00003070\U000050be\U0000304d\U0000304c\U00007b49\U00003057\U00003051\U0000308c\U00003070OK 34 | # 有限の傾きならば傾きが等しければOK | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:4:1: error: 'def' does not name a type 4 | def main(): | ^~~
s301543167
p00021
C++
#include <stdio.h> int main(void) { int kaisu,i,j; double x[4],y[4]; scanf("%d",&kaisu); for(i=0;i<kaisu;i++) { for(j=0;j<4;j++) { scanf("%lf %lf",&x[j],&y[j]); if(-100 > x[j] || 100 < x[j] || -100 > x[j] || 100 < x[j])break; if(x[0]==x[1]) { if(x[2] == x[3]) printf("YES\n"); else printf("NO\n"); } else if(x[2] == x[3]) printf("NO\n"); else { if((y[1]-y[0]) / (x[1]-x[0]) == (y[3]-y[2]) / (x[3]-x[2])) printf("YES\n"); else printf("NO\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:32:2: error: expected '}' at end of input 32 | } | ^ a.cc:3:16: note: to match this '{' 3 | int main(void) { | ^
s209324674
p00021
C++
#include <cstdio> using namespace std; int main(){ int t; __int64 x1, y1, x2, y2, x3, y3, x4, y4; double s1, s2, s3, s4, s5, s6, s7, s8; scanf("%d", &t); while(t--){ scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &s1, &s2, &s3, &s4, &s5, &s6, &s7, &s8); x1 = s1 * 10000; x2 = s3 * 10000; x3 = s5 * 10000; x4 = s7 * 10000; y1 = s2 * 10000; y2 = s4 * 10000; y3 = s6 * 10000; y4 = s8 * 10000; printf("%s\n", ((x2 - x1) * (y4 - y3) == (x4 - x3) * (y2 - y1))? "YES" : "NO"); } return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 6 | __int64 x1, y1, x2, y2, x3, y3, x4, y4; | ^~~~~~~ | __int64_t a.cc:11:17: error: 'x1' was not declared in this scope; did you mean 's1'? 11 | x1 = s1 * 10000; x2 = s3 * 10000; x3 = s5 * 10000; x4 = s7 * 10000; | ^~ | s1 a.cc:11:34: error: 'x2' was not declared in this scope; did you mean 's2'? 11 | x1 = s1 * 10000; x2 = s3 * 10000; x3 = s5 * 10000; x4 = s7 * 10000; | ^~ | s2 a.cc:11:51: error: 'x3' was not declared in this scope; did you mean 's3'? 11 | x1 = s1 * 10000; x2 = s3 * 10000; x3 = s5 * 10000; x4 = s7 * 10000; | ^~ | s3 a.cc:11:68: error: 'x4' was not declared in this scope; did you mean 's4'? 11 | x1 = s1 * 10000; x2 = s3 * 10000; x3 = s5 * 10000; x4 = s7 * 10000; | ^~ | s4 a.cc:12:17: error: 'y1' was not declared in this scope; did you mean 's1'? 12 | y1 = s2 * 10000; y2 = s4 * 10000; y3 = s6 * 10000; y4 = s8 * 10000; | ^~ | s1 a.cc:12:34: error: 'y2' was not declared in this scope; did you mean 's2'? 12 | y1 = s2 * 10000; y2 = s4 * 10000; y3 = s6 * 10000; y4 = s8 * 10000; | ^~ | s2 a.cc:12:51: error: 'y3' was not declared in this scope; did you mean 's3'? 12 | y1 = s2 * 10000; y2 = s4 * 10000; y3 = s6 * 10000; y4 = s8 * 10000; | ^~ | s3 a.cc:12:68: error: 'y4' was not declared in this scope; did you mean 's4'? 12 | y1 = s2 * 10000; y2 = s4 * 10000; y3 = s6 * 10000; y4 = s8 * 10000; | ^~ | s4
s906399456
p00021
C++
#include<iostream> using namespace std; int main(){ double a[2],b[2],c[2],d[2],a,b; int n; cin >> n; for(int i=0;i<n;i++){ cin >> a[0] >> a[1] >> b[0] >> b[1] >> c[0] >> c[1] >> d[0] >> d[1]; a = () if((b[1]-a[1])/(b[0]-a[0]))==(d[1]-c[1])/(d[0]-c[0]) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:4:30: error: conflicting declaration 'double a' 4 | double a[2],b[2],c[2],d[2],a,b; | ^ a.cc:4:10: note: previous declaration as 'double a [2]' 4 | double a[2],b[2],c[2],d[2],a,b; | ^ a.cc:4:32: error: conflicting declaration 'double b' 4 | double a[2],b[2],c[2],d[2],a,b; | ^ a.cc:4:15: note: previous declaration as 'double b [2]' 4 | double a[2],b[2],c[2],d[2],a,b; | ^ a.cc:9:10: error: expected primary-expression before ')' token 9 | a = () | ^ a.cc:11:5: error: 'else' without a previous 'if' 11 | else cout << "NO" << endl; | ^~~~
s276398203
p00021
C++
/** * */ import java.util.*; /** * @author afterCmidday * */ class Main { /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ final double eps = 1e-10; int n; Scanner scan = new Scanner(System.in); n = scan.nextInt(); for(int i = 0;i < n;i++){ double x1 = scan.nextDouble(), y1 = scan.nextDouble(), x2 = scan.nextDouble(), y2 = scan.nextDouble(); double a = x2 - x1, b = y2 - y1; double x3 = scan.nextDouble(), y3 = scan.nextDouble(), x4 = scan.nextDouble(), y4 = scan.nextDouble(); double c = x4 - x3, d = y4 - y3; double e = a * d - b * c; System.out.println("" + e); if(Math.abs(e) < eps){ System.out.println("YES"); }else{ System.out.println("NO"); } } } }
a.cc:4:1: error: 'import' does not name a type 4 | import java.util.*; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:14:15: error: expected ':' before 'static' 14 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:14:33: error: 'String' has not been declared 14 | public static void main(String[] args) { | ^~~~~~ a.cc:14:42: error: expected ',' or '...' before 'args' 14 | public static void main(String[] args) { | ^~~~ a.cc:36:2: error: expected ';' after class definition 36 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:16:17: error: 'final' was not declared in this scope 16 | final double eps = 1e-10; | ^~~~~ a.cc:18:17: error: 'Scanner' was not declared in this scope 18 | Scanner scan = new Scanner(System.in); | ^~~~~~~ a.cc:19:21: error: 'scan' was not declared in this scope 19 | n = scan.nextInt(); | ^~~~ a.cc:22:36: error: 'x2' was not declared in this scope; did you mean 'x1'? 22 | double a = x2 - x1, b = y2 - y1; | ^~ | x1 a.cc:24:36: error: 'x4' was not declared in this scope; did you mean 'x3'? 24 | double c = x4 - x3, d = y4 - y3; | ^~ | x3 a.cc:25:40: error: 'd' was not declared in this scope 25 | double e = a * d - b * c; | ^ a.cc:25:44: error: 'b' was not declared in this scope 25 | double e = a * d - b * c; | ^ a.cc:26:25: error: 'System' was not declared in this scope 26 | System.out.println("" + e); | ^~~~~~ a.cc:26:47: error: invalid operands of types 'const char [1]' and 'double' to binary 'operator+' 26 | System.out.println("" + e); | ~~ ^ ~ | | | | | double | const char [1] a.cc:27:28: error: 'Math' was not declared in this scope 27 | if(Math.abs(e) < eps){ | ^~~~ a.cc:27:42: error: 'eps' was not declared in this scope 27 | if(Math.abs(e) < eps){ | ^~~
s080878252
p00021
C++
/** * */ import java.util.*; /** * @author afterCmidday * */ class Main { /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ final double eps = 1e-10; int n; Scanner scan = new Scanner(System.in); n = scan.nextInt(); for(int i = 0;i < n;i++){ double x1 = scan.nextDouble(), y1 = scan.nextDouble(), x2 = scan.nextDouble(), y2 = scan.nextDouble(); double a = x2 - x1, b = y2 - y1; double x3 = scan.nextDouble(), y3 = scan.nextDouble(), x4 = scan.nextDouble(), y4 = scan.nextDouble(); double c = x4 - x3, d = y4 - y3; double e = a * d - b * c; if(Math.abs(e) < eps){ System.out.println("YES"); }else{ System.out.println("NO"); } } } }
a.cc:4:1: error: 'import' does not name a type 4 | import java.util.*; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:14:15: error: expected ':' before 'static' 14 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:14:33: error: 'String' has not been declared 14 | public static void main(String[] args) { | ^~~~~~ a.cc:14:42: error: expected ',' or '...' before 'args' 14 | public static void main(String[] args) { | ^~~~ a.cc:35:2: error: expected ';' after class definition 35 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:16:17: error: 'final' was not declared in this scope 16 | final double eps = 1e-10; | ^~~~~ a.cc:18:17: error: 'Scanner' was not declared in this scope 18 | Scanner scan = new Scanner(System.in); | ^~~~~~~ a.cc:19:21: error: 'scan' was not declared in this scope 19 | n = scan.nextInt(); | ^~~~ a.cc:22:36: error: 'x2' was not declared in this scope; did you mean 'x1'? 22 | double a = x2 - x1, b = y2 - y1; | ^~ | x1 a.cc:24:36: error: 'x4' was not declared in this scope; did you mean 'x3'? 24 | double c = x4 - x3, d = y4 - y3; | ^~ | x3 a.cc:25:40: error: 'd' was not declared in this scope 25 | double e = a * d - b * c; | ^ a.cc:25:44: error: 'b' was not declared in this scope 25 | double e = a * d - b * c; | ^ a.cc:26:28: error: 'Math' was not declared in this scope 26 | if(Math.abs(e) < eps){ | ^~~~ a.cc:26:42: error: 'eps' was not declared in this scope 26 | if(Math.abs(e) < eps){ | ^~~ a.cc:27:33: error: 'System' was not declared in this scope 27 | System.out.println("YES"); | ^~~~~~ a.cc:29:33: error: 'System' was not declared in this scope 29 | System.out.println("NO"); | ^~~~~~
s529994259
p00021
C++
#include <stdio.h> #include <conio.h> int main() { int num ; double ax, ay, bx, by, cx, cy, dx, dy ; scanf("%d",&num) ; for( int i = 0 ; i < num ; i ++ ) { scanf("%lf %lf %lf %lf %lf %lf %lf %lf", ax , ay , bx , by , cx , cy , dx , dy ) ; if( ((by-ay)/(bx-ax)) == ((dy-cy)/(dx-cx)) ) printf("YES\n") ; else printf("NO\n") ; } return 0; }
a.cc:2:10: fatal error: conio.h: No such file or directory 2 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s811514192
p00021
C++
#include <stdio.h> #include <conio.h> int main() { int num ; double ax, ay, bx, by, cx, cy, dx, dy ; scanf("%d",&num) ; for( int i = 0 ; i < num ; i ++ ) { scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &ax , &ay , &bx , &by , &cx , &cy , &dx , &dy ) ; if( ((by-ay)/(bx-ax)) == ((dy-cy)/(dx-cx)) ) printf("YES\n") ; else printf("NO\n") ; } return 0; }
a.cc:2:10: fatal error: conio.h: No such file or directory 2 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s469729497
p00021
C++
#include <iostream> #include <iomanip> #include <cassert> #include <algorithm> #include <functional> #include <vector> #include <string> #include <cstring> #include <stack> #include <queue> #include <map> #include <bitset> #include <sstream> #include <istream> #include <cmath> #include <cstdio> using namespace std; #define vci vector<int> #define vcs vector<string> #define pb push_back #define sz size() #define mapci map<char, int> #define mapsi map<string, int> #define all(x) x.begin(), x.end() #define for_(i, a, b) for (int i=(int)a; i<(int)b; i++) #define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--) #define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c) #define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c) #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i) #define vcitr vector<int>::iterator #define vcsitr vector<string>::iterator #define mapcitr map<char, int>::iterator #define mapsitr map<string, int>::iterator typedef long long ll; const int iINF = 2147483647; const ll lINF = 9223372036854775807; template <class T> inline void dbg(T t) { cout << t << endl; } struct Point2D { double x, y; Point2D (double a=0, double b=0) { x=a; y=b; } }; int main() { int n; cin >> n; Point2D a, b, c, d; for (int i=0; i<n; i++) { cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y; cout double p = (a.y-b.y)/(a.x-b.x), q = (c.y-d.y)/(c.x-d.x); if (fabs(p-q) < 1e-9) cout << "YES" << endl; else cout << "NO" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:57:21: error: expected ';' before 'double' 57 | cout | ^ | ; 58 | double p = (a.y-b.y)/(a.x-b.x), q = (c.y-d.y)/(c.x-d.x); | ~~~~~~ a.cc:60:26: error: 'p' was not declared in this scope 60 | if (fabs(p-q) < 1e-9) cout << "YES" << endl; | ^ a.cc:60:28: error: 'q' was not declared in this scope 60 | if (fabs(p-q) < 1e-9) cout << "YES" << endl; | ^
s656000237
p00021
C++
#include <iostream> #include <iomanip> #include <cassert> #include <algorithm> #include <functional> #include <vector> #include <string> #include <cstring> #include <stack> #include <queue> #include <map> #include <bitset> #include <sstream> #include <istream> #include <cmath> #include <cstdio> using namespace std; #define vci vector<int> #define vcs vector<string> #define pb push_back #define sz size() #define mapci map<char, int> #define mapsi map<string, int> #define all(x) x.begin(), x.end() #define for_(i, a, b) for (int i=(int)a; i<(int)b; i++) #define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--) #define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c) #define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c) #define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i) #define vcitr vector<int>::iterator #define vcsitr vector<string>::iterator #define mapcitr map<char, int>::iterator #define mapsitr map<string, int>::iterator typedef long long ll; const int iINF = 2147483647; const ll lINF = 9223372036854775807; template <class T> inline void dbg(T t) { cout << t << endl; } struct Point2D { double x, y; Point2D (double a=0, double b=0) { x=a; y=b; } }; typedef Point2D Vector2D; double dist2D(const Point2D& a, const Point2D& b) { return sqrt( (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) ); } Vector2D sub_vector2D(const Vector2D& a, const Vector2D& b) { Vector2D ret; ret.x = a.x - b.x; ret.y = a.y - b.y; return ret; } double cross_product(const Vector2D& a, const Vector2D& b) { return a.x*b.y - a.y*b.x; } double inner_product(const Vector2D& a, const Vector2D& b) { return a.x*b.x + a.y*b.y; } int main() { int n; cin >> n; Point2D a, b, c, d; Vector2D x, y; for (int i=0; i<n; i++) { cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y; x = sub_vector(b, a); y = sub_vector(d, c); if (cross_product(x, y)) cout << "NO" << endl; else cout << "YES" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:74:21: error: 'sub_vector' was not declared in this scope; did you mean 'sub_vector2D'? 74 | x = sub_vector(b, a); y = sub_vector(d, c); | ^~~~~~~~~~ | sub_vector2D
s663613926
p00021
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<vector> #include<string> #include<map> #include<stack> #include<cstring> #include<cstdlib> using namespace std; #define reps(i,f,n) for(int i=f;i<int(n);i++) #define rep(i,n) reps(i,0,n) int main(){ int n; cin>>n; rep(t,n){ double x[4]; double y[4]; rep(i,4){ cin>>x[i]>>y[i]; } double dx1 = x[0]-x[1]; double dx2 = x[2]-x[3]; double dy1 = y[0]-y[1]; double dy2 = y[2]-y[3]; if(dx1==0){ if(dx2==0)puts("YES"); else puts("NO"); }else{ double a1 = dy1/dx1; double a2 = dy2/dx2; if(fabs(a1-a2)<0.000000001)puts("YES"); else puts("NO"); } } }
a.cc: In function 'int main()': a.cc:42:28: error: 'fabs' was not declared in this scope; did you mean 'labs'? 42 | if(fabs(a1-a2)<0.000000001)puts("YES"); | ^~~~ | labs
s605429451
p00021
C++
import java.io.IOException; import java.util.Locale; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); while (N-- > 0) { double x1 = sc.nextDouble(); double y1 = sc.nextDouble(); double x2 = sc.nextDouble(); double y2 = sc.nextDouble(); double x3 = sc.nextDouble(); double y3 = sc.nextDouble(); double x4 = sc.nextDouble(); double y4 = sc.nextDouble(); double[] AB = {x2-x1, y2-y1}, CD = {x4-x3, y4-y3}; double cross = AB[0]*CD[1]-AB[1]*CD[0]; if (cross < 1e-10) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.IOException; | ^~~~~~ 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.util.Locale; | ^~~~~~ 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.util.Scanner; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: expected unqualified-id before 'public' 6 | public class Main { | ^~~~~~
s378974453
p00021
C++
#include <complex> #include <iostream> #include <cmath> using namespace std; typedef complex<double> xy_t; double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); } const double eps = 1e-11; double x[4],y[4]; int N; int main() { cin >> N; for (int i=0; i<N; ++i) { for (int i=0; i<4; ++i) { cin >> x[i] >> y[i]; } xy_t a[2] = { xy_t(x[0],y[0]) - xy_t(x[1],y[1]), xy_t(x[2],y[2]) - xy_t(x[3],y[3]) }; bool p = abs(cross_product(a[0],a[1]))/2 < esp; cout << ( p ? "YES" : "NO") << endl; } }
a.cc: In function 'int main()': a.cc:21:60: error: 'esp' was not declared in this scope; did you mean 'exp'? 21 | bool p = abs(cross_product(a[0],a[1]))/2 < esp; | ^~~ | exp
s512078930
p00021
C++
#include<algorithm> #include<vector> #include<cassert> #include<string> using namespace std; long long N, X[4], Y[4]; string parallel_judge(){ if ((X[1] * 100000 - X[0] * 100000)*(Y[3] * 100000 - Y[2] * 100000) == (Y[1] * 100000 - Y[0] * 100000)*(X[3] * 100000 - X[2] * 100000)){ return "YES"; } else{ return "NO"; } } int main() { cin >> N; for (int i = 0; i < N; i++){ for (int j = 0; j < 4; j++){ cin >> X[j] >> Y[j]; } cout << parallel_judge() << endl; } }
a.cc: In function 'int main()': a.cc:21:9: error: 'cin' was not declared in this scope 21 | cin >> N; | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include<string> +++ |+#include <iostream> 5 | a.cc:26:17: error: 'cout' was not declared in this scope 26 | cout << parallel_judge() << endl; | ^~~~ a.cc:26:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:26:45: error: 'endl' was not declared in this scope 26 | cout << parallel_judge() << endl; | ^~~~ a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 4 | #include<string> +++ |+#include <ostream> 5 |
s217426166
p00021
C++
// 0021.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include "stdafx.h" #include <iostream> using namespace std; #define EPS 1e-7 int main() { double x1, y1, x2, y2, x3, y3, x4, y4; int n; cin >> n; for (int i = 0; i < n; i++){ cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4; if (x1 == x2 && x3 == x4){ cout << "YES" << endl; } else if (x1 == x2 || x3 == x4){ cout << "NO" << endl; } else if (abs((y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3)) < EPS){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } return 0; }
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s238602907
p00021
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<vector> #include<cmath> #include<cstdio> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb(in,tmp) in.push_back(tmp) #define all(in) in.begin(),in.end() const double PI=acos(-1); using namespace std; int main(){ int n; double x[4],y[4]; cin>>n; for(;n--;){ for(j=0;j<4;j++){ cin>>x[j]; cin>>y[j]; } if((x[0]-x[1])*(y[2]-y[3])==(x[2]-x[3])*(y[0]-y[1]))cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:9: error: 'j' was not declared in this scope 19 | for(j=0;j<4;j++){ | ^
s876308969
p00021
C++
#include<iostream> using namespace std; int main(){ int n; double a1,a2,b1,b2 double c1,c2,d1,d2; cin>>n; for(int i=0;i<n;i++){ cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2; if( (b2-a2)/(b1-a1) == (d2-c2)/(d1-c1) ) cout<<"YES"<<endl; else cout<<"NO"<<endl; } }
a.cc: In function 'int main()': a.cc:7:9: error: expected initializer before 'double' 7 | double c1,c2,d1,d2; | ^~~~~~ a.cc:10:34: error: 'b2' was not declared in this scope; did you mean 'b1'? 10 | cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2; | ^~ | b1 a.cc:10:38: error: 'c1' was not declared in this scope; did you mean 'b1'? 10 | cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2; | ^~ | b1 a.cc:10:42: error: 'c2' was not declared in this scope; did you mean 'a2'? 10 | cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2; | ^~ | a2 a.cc:10:46: error: 'd1' was not declared in this scope; did you mean 'b1'? 10 | cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2; | ^~ | b1 a.cc:10:50: error: 'd2' was not declared in this scope; did you mean 'a2'? 10 | cin>>a1>>a2>>b1>>b2>>c1>>c2>>d1>>d2; | ^~ | a2
s245834184
p00022
Java
import java.util.Scanner; public class vol0022 { public static void main(String args[]) { Scanner scn = new Scanner(System.in); int n; while((n = scn.nextInt())!=0) { long min = 0,max = -1000,buf = 0; for(int i = 0;i < n;i++) { buf += scn.nextLong(); max = Math.max(max, buf); min = Math.min(min, buf); } System.out.println(max - min); } scn.close(); } }
Main.java:3: error: class vol0022 is public, should be declared in a file named vol0022.java public class vol0022 { ^ 1 error
s686784859
p00022
Java
import java.util.Scanner; public class Main{ public static void main(String args[]) { Scanner scn = new Scanner(System.in); int n; while((n = scn.nextInt())!=0) { long min = 0,max = -100000000000l,buf = 0; for(int i = 0;i < n;i++) { buf += scn.nextLong(); max = Math.max(max, buf); min = Math.min(min, buf); } System.out.println(max - min); } scn.close(); }
Main.java:17: error: reached end of file while parsing } ^ 1 error
s672935941
p00022
Java
7 -5 -1 6 4 9 -6 -7 13 1 2 3 2 -2 -1 1 2 3 2 1 -2 1 3 1000 -200 201 0
Main.java:1: error: class, interface, enum, or record expected 7 ^ 1 error
s620119432
p00022
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in); String str; while((str=br.readLine())!="0"){ int n=Integer.parseInt(str); int max=-1000000; int[] a=new int[n]; int[] s=new int[n+1]; s[0]=0; for(int i=0;i<n;i++){ a[i]=Integer.parseInt(br.readLine()); s[i+1]+=a[i] } for(int a=0;a<n;a++){ for(int b=a+1;b<=n;b++){ max=Math.max(max,s[b]-s[a]); } } System.out.println(max); } } }
Main.java:5: error: ')' or ',' expected BufferedReader br=new BufferedReader(new InputStreamReader(System.in); ^ Main.java:15: error: ';' expected s[i+1]+=a[i] ^ 2 errors
s448325140
p00022
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; while((str=br.readLine())!="0"){ int n=Integer.parseInt(str); int max=-1000000; int[] a=new int[n]; int[] s=new int[n+1]; s[0]=0; for(int i=0;i<n;i++){ a[i]=Integer.parseInt(br.readLine()); s[i+1]+=a[i]; } for(int a=0;a<n;a++){ for(int b=a+1;b<=n;b++){ max=Math.max(max,s[b]-s[a]); } } System.out.println(max); } } }
Main.java:17: error: variable a is already defined in method main(String[]) for(int a=0;a<n;a++){ ^ 1 error
s749695213
p00022
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; while((str=br.readLine())!="0"){ int n=Integer.parseInt(str); int max=-1000000; int[] s=new int[n+1]; s[0]=0; for(int i=0;i<n;i++){ m=Integer.parseInt(br.readLine()); s[i+1]+=m; } for(int a=0;a<n;a++){ for(int b=a+1;b<=n;b++){ max=Math.max(max,s[b]-s[a]); } } System.out.println(max); } } }
Main.java:13: error: cannot find symbol m=Integer.parseInt(br.readLine()); ^ symbol: variable m location: class Main Main.java:14: error: cannot find symbol s[i+1]+=m; ^ symbol: variable m location: class Main 2 errors
s675830383
p00022
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; while((str=br.readLine())!="0"){ int n=Integer.parseInt(str); int max=-1000000; int[] s=new int[n+1]; s[0]=0; for(int i=0;i<n;i++){ int m=Integer.parseInt(br.readLine()); s[i+1]+=m; } for(int a=0;a<n;a++){ for(int b=a+1;b<=n;b++){ max=Math.max(max,s[b]-s[a]); } } System.out.println(max); } } }
Main.java:7: error: unreported exception IOException; must be caught or declared to be thrown while((str=br.readLine())!="0"){ ^ Main.java:13: error: unreported exception IOException; must be caught or declared to be thrown int m=Integer.parseInt(br.readLine()); ^ 2 errors
s876090822
p00022
Java
import java.util.Arrays; import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); void run() { for (;;) { int n = sc.nextInt(); int M = -Integer.MAX_VALUE / 2; if (n == 0) return; int[] a = new int[n]; int[] dp = new int[n]; for (int i = 0; i < n; i++) a[i] = sc.nextInt(); Arrays.fill(dp, M); dp[0] = a[0]; for (int i = 1; i < n; i++) { dp[i] = Math.max(dp[i - 1] + a[i], a[i]); M = Math.max(M, dp[i]); } System.out.println(M); } } public static void main(String[] args) { new AOJ0_22().run(); } }
Main.java:27: error: cannot find symbol new AOJ0_22().run(); ^ symbol: class AOJ0_22 location: class Main 1 error
s512076537
p00022
Java
import java.util.Scanner; public class Ma { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); int sum; while(K>0){ sum = 0; int[] n = new int[K]; for(int i = 0; i < n.length; i++){ int num = sc.nextInt(); sum += num; } System.out.println(sum); K = sc.nextInt(); } } }
Main.java:2: error: class Ma is public, should be declared in a file named Ma.java public class Ma { ^ 1 error
s804065188
p00022
Java
public class Main { private static Scanner scr; public static void main(String args[]) throws IOException{ scr = new Scanner(System.in); while (true){ try{ int n = Integer.parseInt(scr.nextLine()); int[] data = new int[n]; for(int i=0; i<n; i++){ data[i] = Integer.parseInt(scr.nextLine()); } if (n==0) break; //??\????????? System.out.println( SearchMax(data) ); }catch(Exception e){ System.err.println("Exception"); break; } } } private static int SearchMax(int[] data){ int max = 0; for(int i=0; i<data.length; i++){ int sump=0; for(int j=i; j<data.length; j++){ sump += data[j]; if(sump>max) max=sump; } } return max; } }
Main.java:2: error: cannot find symbol private static Scanner scr; ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol public static void main(String args[]) throws IOException{ ^ symbol: class IOException location: class Main Main.java:4: error: cannot find symbol scr = new Scanner(System.in); ^ symbol: class Scanner location: class Main 3 errors
s414311464
p00022
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ for(;;){ int n = scan.nextInt(); if(n == 0){ break; } int[] kou = new int[n]; for(int i = 0; i < n; i++){ kou[i] = scan.nextInt(); } int max = Integer.MIN_VALUE; int sum = 0; for(int i = 0; i < n; i++){ sum = kou[i]; max = Math.max(sum, max); for(int j = i + 1;j < n; j++){ sum += kou[j]; max = Math.max(sum, max); } sum = 0; } System.out.printf("%d\n", max) } } }
Main.java:29: error: ';' expected System.out.printf("%d\n", max) ^ 1 error
s605684905
p00022
Java
import java.util.Scanner; import java.util.List; import java.util.ArrayList; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { int n = sc.nextInt(); if(n == 0) { break; } int[] arr = new int[n]; for(int i=0; i<n; i++) { int a = sc.nextInt(); arr[i] = a; } int max_sum = -100000000000000; for(int i=0; i<n; i++) { int sum = arr[i]; for(int j=i+1; j<n; j++) { sum += arr[j]; if(max_sum < sum) { max_sum = sum; } } } System.out.println(max_sum); } } }
Main.java:18: error: integer number too large int max_sum = -100000000000000; ^ 1 error
s596606772
p00022
Java
public class Main{ public static void main(String [] args){ Main m = new Main(); m.run(); } void run(){ Scanner sc = new Scanner(System.in); for(;;){ int n = sc.nextInt(); if(n == 0) break; int[] seq = new int[n]; for(int i = 0; i < n ;i++){ seq[i] = sc.nextInt(); } long ans = solve(seq); } } long solve(int[] seq){ int n = seq.length; long ans = -Long.MAX; for(int start = 0; start < n; start++){ for(int end = start; end < n ; end++){ long sum = 0; for(int index = start; index <= end; index++){ sum += seq[index]; } ans = Math.max(ans, sum); } } return ans; } }
Main.java:8: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:8: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:25: error: cannot find symbol long ans = -Long.MAX; ^ symbol: variable MAX location: class Long 3 errors
s777398722
p00022
Java
import java.io.util.*; public class Main{ public static void main(String [] args){ Main m = new Main(); m.run(); } void run(){ Scanner sc = new Scanner(System.in); for(;;){ int n = sc.nextInt(); if(n == 0) break; int[] seq = new int[n]; for(int i = 0; i < n ;i++){ seq[i] = sc.nextInt(); } long ans = solve(seq); } } long solve(int[] seq){ int n = seq.length; long ans = -Long.MAX; for(int start = 0; start < n; start++){ for(int end = start; end < n ; end++){ long sum = 0; for(int index = start; index <= end; index++){ sum += seq[index]; } ans = Math.max(ans, sum); } } return ans; } }
Main.java:1: error: package java.io.util does not exist import java.io.util.*; ^ Main.java:10: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:10: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:27: error: cannot find symbol long ans = -Long.MAX; ^ symbol: variable MAX location: class Long 4 errors
s104500874
p00022
Java
import java.util.*; public class Main{ public static void main(String [] args){ Main m = new Main(); m.run(); } void run(){ Scanner sc = new Scanner(System.in); for(;;){ int n = sc.nextInt(); if(n == 0) break; int[] seq = new int[n]; for(int i = 0; i < n ;i++){ seq[i] = sc.nextInt(); } long ans = solve(seq); } } long solve(int[] seq){ int n = seq.length; long ans = -Long.MAX; for(int start = 0; start < n; start++){ for(int end = start; end < n ; end++){ long sum = 0; for(int index = start; index <= end; index++){ sum += seq[index]; } ans = Math.max(ans, sum); } } return ans; } }
Main.java:27: error: cannot find symbol long ans = -Long.MAX; ^ symbol: variable MAX location: class Long 1 error
s349856091
p00022
Java
import java.util.Scanner; //Maximum Sum Sequence public class AOJ0022 { public static int cs(int[] a){ int min = 0; int x = 0; int max = Integer.MIN_VALUE; for(int i=0;i<a.length;i++){ x += a[i]; max = Math.max(max, x-min); min = Math.min(min, x); } return max; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(true){ int n = sc.nextInt(); if(n==0)break; int a[] = new int[n]; for(int i=0;i<n;i++)a[i]=sc.nextInt(); System.out.println(cs(a)); } } }
Main.java:4: error: class AOJ0022 is public, should be declared in a file named AOJ0022.java public class AOJ0022 { ^ 1 error
s779668833
p00022
Java
7 -5 -1 6 4 9 -6 -7 13 1 2 3 2 -2 -1 1 2 3 2 1 -2 1 3 1000 -200 201 0
Main.java:1: error: class, interface, enum, or record expected 7 ^ 1 error
s641970555
p00022
Java
import java.io.*; public class M0022 { public static void main ( String args[] ) throws IOException { int i , j , sum , Input , max1 , max2; int[] data; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while ( true ) { sum = 0; max1 = 0; max2 = 0; data = new int[5000]; Input = Integer.parseInt(in.readLine()); if ( Input == 0 ) break; for ( i =0; i < Input; i++ ) data[i] = Integer.parseInt(in.readLine()); for ( i = 0; i < data.length; i++ ) { for ( j = i; j < data.length; j++ ) { sum += data[j]; if ( max1 < sum ) max1 = sum; } if ( max2 < max1 ) max2 = max1; sum = 0; } System.out.println(max2); } } }
Main.java:3: error: class M0022 is public, should be declared in a file named M0022.java public class M0022 { ^ 1 error
s980757751
p00022
Java
import java.io.*; public class 0022 { public static void main ( String args[] ) throws IOException { int i , j , sum , Input , max1 , max2; int[] data; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while ( true ) { sum = 0; max1 = 0; max2 = 0; data = new int[5000]; Input = Integer.parseInt(in.readLine()); if ( Input == 0 ) break; for ( i =0; i < Input; i++ ) data[i] = Integer.parseInt(in.readLine()); for ( i = 0; i < data.length; i++ ) { for ( j = i; j < data.length; j++ ) { sum += data[j]; if ( max1 < sum ) max1 = sum; } if ( max2 < max1 ) max2 = max1; sum = 0; } System.out.println(max2); } } }
Main.java:3: error: <identifier> expected public class 0022 { ^ 1 error
s349804747
p00022
Java
import java.util.Scanner; public class aoj0022 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int num = s.nextInt(); while(num!=0){ int max = 0; int[] data = new int[num]; for(int i=0 ; i<num ; i++) data[i] = s.nextInt(); for(int i=0 ; i<num ; i++){ int sum = 0; for(int j=i ; j<num ; j++){ sum+=data[k]; if(max<sum) max=sum; } } num = s.nextInt(); System.out.println(max); } } }
Main.java:3: error: class aoj0022 is public, should be declared in a file named aoj0022.java public class aoj0022 { ^ Main.java:16: error: cannot find symbol sum+=data[k]; ^ symbol: variable k location: class aoj0022 2 errors
s102000145
p00022
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int num = s.nextInt(); while(num!=0){ int max = 0; int[] data = new int[num]; for(int i=0 ; i<num ; i++) data[i] = s.nextInt(); for(int i=0 ; i<num ; i++){ int sum = 0; for(int j=i ; j<num ; j++){ sum+=data[k]; if(max<sum) max=sum; } } num = s.nextInt(); System.out.println(max); } } }
Main.java:16: error: cannot find symbol sum+=data[k]; ^ symbol: variable k location: class Main 1 error
s881800778
p00022
Java
import java.util.Scanner; public class aoj0022 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int num = s.nextInt(); while(num!=0){ int max = Integer.MIN_VALUE; int[] data = new int[num]; for(int i=0 ; i<num ; i++) data[i] = s.nextInt(); for(int i=0 ; i<num ; i++){ int sum = 0; for(int j=i ; j<num ; j++){ sum+=data[j]; if(max<sum) max=sum; } } num = s.nextInt(); System.out.println(max); } } }
Main.java:3: error: class aoj0022 is public, should be declared in a file named aoj0022.java public class aoj0022 { ^ 1 error
s056175363
p00022
Java
#include <stdio.h> int array[1000]; int n,i,sum=0,k=0; void tansaku(int a); int main(void) { while(1) { sum = 0; for(i=0;i<1000;i++) { array[i] = 0; } scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++) { scanf("%d",&array[i]); } for(i=0;i<n;i++) { tansaku(i); k = 0; } printf("%d\n",sum); } return 0; } void tansaku(int a) { if(a>n)return; k += array[a]; if(k > sum) { sum = k; } if(a == n)return; tansaku(a+1); }
Main.java:1: error: illegal character: '#' #include <stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <stdio.h> ^ Main.java:3: error: class, interface, enum, or record expected int n,i,sum=0,k=0; ^ Main.java:4: error: unnamed classes are a preview feature and are disabled by default. void tansaku(int a); ^ (use --enable-preview to enable unnamed classes) Main.java:5: error: <identifier> expected int main(void) ^ Main.java:14: error: illegal start of expression scanf("%d",&n); ^ Main.java:18: error: illegal start of expression scanf("%d",&array[i]); ^ 7 errors
s065622556
p00022
Java
public class Main { public static void main(String args[]) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n; int sum=0; int max=-100000; int[] a = new int[5000]; n = Integer.parseInt(br.readLine()); if (n != 0) { for(int i=1; i<=n; i++) { a[i] = Integer.parseInt(br.readLine()); } for (int i=1; i<=n; i++) { for (int j=i; j<=n; j++) { sum += a[j]; } if (max<sum) { max = sum; } sum = 0; } System.out.println(max); } else { return; } } }
Main.java:4: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:4: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:4: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main 3 errors
s793881353
p00022
Java
public class Main { public static void main(String args[]) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n; int sum=0; int max=-100000; int[] a = new int[5000]; n = Integer.parseInt(br.readLine()); while (n!=0) { for(int i=0; i<n; i++) { a[i] = Integer.parseInt(br.readLine()); } for (int i=0; i<n; i++) { for (int j=i; j<=n; j++) { sum += a[j]; } if (max<sum) { max = sum; } sum = 0; } System.out.println(max); n = Integer.parseInt(br.readLine()); } } }
Main.java:4: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:4: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:4: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main 3 errors
s002230691
p00022
C
#include <stdio.h> int main(void) { int i, j, n; long a[10000], sum, max; while (scanf("%d", &n), n != 0){ for (i = 0; i < n; i++){ scanf("%d", &a[i]); } max = -100000000; for (i = 0; i < n; i++){ sum = 0 for (j = i; j < n; j++){ sum += a[i]; if (sum < 0) break; } if (sum > max){ max = sum; } } printf("%d\n", max); } return 0; }
main.c: In function 'main': main.c:15:32: error: expected ';' before 'for' 15 | sum = 0 | ^ | ; 16 | for (j = i; j < n; j++){ | ~~~
s322328698
p00022
C
#include <stdio.h> #include <limits.h> int main() { int array[5000], n, i, j, sum, max; while (1){ scanf("%d", &n); if (n == 0){ break; } max = INT_MIN; for (i = 0; i < n; i++){ scanf("%d", &array[i]); } for (i = 0; i < n; i++){ sum = 0; for (j = i; j < n; j++){ if (max < sum){ max = sum; } } } printf("%d\n", max) } return 0; }
main.c: In function 'main': main.c:26:20: error: expected ';' before '}' token 26 | printf("%d\n", max) | ^ | ; 27 | } | ~
s646613778
p00022
C
#include <stdio.h> #include <limits.h> int main() { int array[5000], n, i, j, sum, max; while (1){ scanf("%d", &n); if (n == 0){ break; } max = INT_MIN; for (i = 0; i < n; i++){ scanf("%d", &array[i]); } for (i = 0; i < n; i++){ sum = 0; for (j = i; j < n; j++){ sum +=array[j]; if (max < sum){ max = sum; } } } printf("%d\n", max) } return 0; }
main.c: In function 'main': main.c:27:20: error: expected ';' before '}' token 27 | printf("%d\n", max) | ^ | ; 28 | } | ~
s202830897
p00022
C
#include <stdio.h> int get_max (int,int a[]); int main (void) { int n,a[5000]; int i,j,sum,max=0; scanf("%d", &n); while(n!=0) do{ for(i=0;i<n;i++){ scanf("%d", &a[i]); } for(i=0;i<n;i++){ sum=0; for(j=i;j<n;j++){ sum+=a[i]; if(max<sum){ max=sum; } } } printf("%d\n", max); scanf("%d",&n); } return 0; }
main.c: In function 'main': main.c:29:9: error: expected 'while' before 'return' 29 | return 0; | ^~~~~~
s008899497
p00022
C
#include<stdio.h> #define MAX 5000 int max(int a,int b){ if(a > b)return a; return b; } int f(int a[],int n){ int t=a[0]; int s=a[0]; for(int k=1;k<n;k++) t=max(t+a[k],a[k]); s=max(s,t+a[k]); return s; } int main(){ int n,i,j; int A[MAX]; int ans; while(1) { scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++) { scanf("%d",&A[i]); } ans=f(A,n); printf("%d\n",ans); } return 0; }
main.c: In function 'f': main.c:17:15: error: 'k' undeclared (first use in this function) 17 | s=max(s,t+a[k]); | ^ main.c:17:15: note: each undeclared identifier is reported only once for each function it appears in
s413395743
p00022
C
int down(int data[], int ans[]){ int i; int temp; int max=INT_MIN; int sum=0; for(i=ans[1];i>=0;i--){ sum+=data[i]; if(max<=sum){ max=sum; temp=i; } } ans[2]=temp; if(ans[0]==max) return 0; else{ ans[0]=max; up(data,ans); } } /*int first(int data[], int ans[], int n){ int max1=INT_MIN, max2=INT_MIN, temp1, temp2, i, sum; ans[0]=INT_MIN; ans[1]=n-1; ans[2]=0; sum=0; for(i=ans[2];i<=ans[1];i++){ sum+=data[i]; if(max1<=sum){ max1=sum; temp1=i; } } sum=0; for(i=ans[1];i>=0;i--){ sum+=data[i]; if(max2<=sum){ max2=sum; temp2=i; } } if(temp1>=temp2){ ans[1]=temp1; ans[0]=max1; down(data, ans); } else{ ans[2]=temp2; ans[0]=max2; up(data, ans); } } */
main.c: In function 'down': main.c:4:11: error: 'INT_MIN' undeclared (first use in this function) 4 | int max=INT_MIN; | ^~~~~~~ main.c:1:1: note: 'INT_MIN' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>' +++ |+#include <limits.h> 1 | int down(int data[], int ans[]){ main.c:4:11: note: each undeclared identifier is reported only once for each function it appears in 4 | int max=INT_MIN; | ^~~~~~~ main.c:17:5: error: implicit declaration of function 'up' [-Wimplicit-function-declaration] 17 | up(data,ans); | ^~
s600484554
p00022
C
i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v;
main.c:1:1: warning: data definition has no type or storage class 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'v' [-Wimplicit-int] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^ main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^ main.c:1:13: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^ main.c:1:16: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^ main.c:1:18: error: return type defaults to 'int' [-Wimplicit-int] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^~~~ main.c: In function 'main': main.c:1:18: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:32: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; main.c:1:32: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^~~~~ main.c:1:32: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:50: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^~~~~~ main.c:1:50: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:50: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:50: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:71: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; main.c:1:71: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^~~~~~ main.c:1:71: note: include '<string.h>' or provide a declaration of 'memset' main.c:1:1: error: expected declaration or statement at end of input 1 | i,v,s[5000],m,*p;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",m))for(memset(s,i=0,n*4),m=-1e5;i++<n;)for(scanf("%d",&v),p=s+i;p---s;m=*p>m?*p:m)*p+=v; | ^
s136576821
p00022
C
#include<stdio.h> #include<stdlib.h> #include<string.h> int i,j,k; int n; __int64 a[5004],x,ans=0; int main(){ scanf("%d",&n); while(n!=0){ a[0]=a[1]=0;ans=0; for(i=1;i<=n;i++){ scanf("%lld",&x); a[i]+=x; a[i+1]=a[i]; } for(i=0;i<=n-1;i++){ for(j=i+1;j<=n;j++){ if(a[j]-a[i]>ans)ans=a[j]-a[i]; } } printf("%lld\n",ans); scanf("%d",&n); } return 0; }
main.c:7:1: error: unknown type name '__int64'; did you mean '__int64_t'? 7 | __int64 a[5004],x,ans=0; | ^~~~~~~ | __int64_t
s814640789
p00022
C
import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); List<Integer> list = new ArrayList<Integer>(); while(true){ int n = sc.nextInt(); if(n == 0){break;} list.clear(); for(int i = 0; i < n; i++){ list.add(sc.nextInt()); } int max_num = Integer.MIN_VALUE; for(int i = 0;i < n;i++){ int sum = 0; for(int j = i;j < n;j++){ sum += list.get(j); if(max_num < sum){ max_num = sum; } } } System.out.println(max_num); } } }
main.c:1:1: error: unknown type name 'import' 1 | import java.io.IOException; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.io.IOException; | ^ main.c:2:1: error: unknown type name 'import' 2 | import java.util.ArrayList; | ^~~~~~ main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 2 | import java.util.ArrayList; | ^ main.c:3:1: error: unknown type name 'import' 3 | import java.util.List; | ^~~~~~ main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 3 | import java.util.List; | ^ main.c:4:1: error: unknown type name 'import' 4 | import java.util.Scanner; | ^~~~~~ main.c:4:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 4 | import java.util.Scanner; | ^ main.c:7:1: error: unknown type name 'public' 7 | public class Main { | ^~~~~~ main.c:7:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main' 7 | public class Main { | ^~~~
s102869957
p00022
C
#include<stdio.h> int main(void) { int n,a[5001],i,j,sum,max; while(1) { max=-10000000 for(i=0;i<5001;i++) a[i]=0; scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++) scanf("%d",a[i]); for(i=2;i<n;i++) { sum=0; for(j=0;j<=i;j++) { sum+=a[j]; } if(max<sum)max=sum; } printf("%d\n",max); } return 0; }
main.c: In function 'main': main.c:8:14: error: expected ';' before 'for' 8 | max=-10000000 | ^ | ; 9 | 10 | for(i=0;i<5001;i++) | ~~~
s308292949
p00022
C
#include<stdio.h> int main(void) { int n,a[5001],i,j,sum,max; while(1) { max=-10000000; for(i=0;i<5001;i++) a[i]=0; scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++) scanf("%d",a[i]); for(i=2;i<n;i++) { sum=0; for(j=0;j<=i;j++) { sum+=a[j]; }
main.c: In function 'main': main.c:25:1: error: expected declaration or statement at end of input 25 | } | ^ main.c:25:1: error: expected declaration or statement at end of input main.c:25:1: error: expected declaration or statement at end of input
s870460492
p00022
C
i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));}
main.c:1:1: warning: data definition has no type or storage class 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^ main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:20: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} main.c:1:20: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^~~~~ main.c:1:20: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:41: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^~~~~~ main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:41: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:64: error: 'INT_MIN' undeclared (first use in this function) 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^~~~~~~ main.c:1:1: note: 'INT_MIN' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>' +++ |+#include <limits.h> 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} main.c:1:64: note: each undeclared identifier is reported only once for each function it appears in 1 | i,n,t;main(m){for(;scanf("%d",&n,t=0),n;printf("%d\n",m))for(m=INT_MIN;n--&&scanf("%d",&i);(t+=i)>m?m=t:(t<0)&&(t=0));} | ^~~~~~~
s350958307
p00022
C
#include <cstdio> int main(){int n,i,j,s,m,a[5000];while(scanf("%d", &n)&&n){for(i=0;i<n;i++)scanf("%d",&a[i]);m=-2147483647;for(i=0;i<n;i++,s=0)for(j=i;j<n;j++)if((s+=a[j])>m)m=s;printf("%d\n",m);}}
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s744382685
p00022
C
i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);}
main.c:1:1: warning: data definition has no type or storage class 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} | ^ main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} main.c:1:23: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} | ^~~~~ main.c:1:23: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:40: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} | ^~~~~~ main.c:1:40: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:40: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:40: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:65: error: invalid operands to binary * (have 'char *' and 'int') 1 | i,n,t;main(m){for(;t=!scanf("%d",&n),n;printf("%d\n",m))for(m=""*-1;n--;m=(t+=i)>m?t:m,t*=t>0)scanf("%d",&i);} | ~~^ | | | char *
s945915364
p00022
C
include<stdio.h> #include<limits.h> #define DEBUG 0 int buf [5001]; /* 100kx5k= 500M 2^20 = 1M */ int sum(int begin, int end){ int i; int sum=0; for(i=begin; i<end; i++) sum +=buf[i]; return sum; } int find_max_sum(int count){ int i, j; int max, s; max = INT_MIN; for(i = 0; i < count; i++){ for(j = i+1; j <= count; j++){ s = sum(i,j); if(s>=max) max =s; } } return max; } int main(){ int count; int i; while((scanf("%i", &count) == 1) && count){ if(DEBUG) printf("count: %d\n", count); for(i=0; i<count;i++){ scanf("%i", buf+i); if(DEBUG) printf("data: %d\n", *(buf+i)); } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ main.c: In function 'sum': main.c:19:11: error: 'buf' undeclared (first use in this function) 19 | sum +=buf[i]; | ^~~ main.c:19:11: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'main': main.c:41:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 41 | while((scanf("%i", &count) == 1) && count){ | ^~~~~ main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 2 | #include<limits.h> +++ |+#include <stdio.h> 3 | main.c:41:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 41 | while((scanf("%i", &count) == 1) && count){ | ^~~~~ main.c:41:10: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:43:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 43 | printf("count: %d\n", count); | ^~~~~~ main.c:43:7: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:43:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:43:7: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:45:19: error: 'buf' undeclared (first use in this function) 45 | scanf("%i", buf+i); | ^~~ main.c:47:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 47 | printf("data: %d\n", *(buf+i)); | ^~~~~~ main.c:47:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:50:1: error: expected declaration or statement at end of input 50 | } | ^
s509104761
p00022
C
g#include <stdio.h> #include <stdlib.h> /* prototype declaration */ int init(); long findMax(); int n; int *a; int main(int argc, const char *argv[]) { while(init()) printf("%ld\n", findMax()); return 0; } int init() { int i; scanf("%d", &n); if(n){ a = malloc(sizeof(int)*n); for(i=0; i<n; i++) scanf("%d", &a[i]); return 1; }else{ free(a); return 0; } } long findMax() { int i, j; long max = 0, sum = 0; for(i=0; i<n; i++){ for(j=i; j<n; j++){ sum += a[j]; if(max<sum) max = sum; } sum = 0; } return max; }
main.c:1:2: error: stray '#' in program 1 | g#include <stdio.h> | ^ main.c:1:1: error: unknown type name 'g' 1 | g#include <stdio.h> | ^ main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | g#include <stdio.h> | ^ In file included from main.c:2: /usr/include/stdlib.h:98:8: error: unknown type name 'size_t' 98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; | ^~~~~~ /usr/include/stdlib.h:57:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 56 | #include <bits/floatn.h> +++ |+#include <stddef.h> 57 | /usr/include/stdlib.h:531:25: error: unknown type name 'size_t' 531 | size_t __statelen) __THROW __nonnull ((2)); | ^~~~~~ /usr/include/stdlib.h:531:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:561:25: error: unknown type name 'size_t' 561 | size_t __statelen, | ^~~~~~ /usr/include/stdlib.h:561:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:661:42: error: unknown type name 'size_t' 661 | extern void arc4random_buf (void *__buf, size_t __size) | ^~~~~~ /usr/include/stdlib.h:661:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:672:22: error: unknown type name 'size_t' 672 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ | ^~~~~~ /usr/include/stdlib.h:672:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:675:22: error: unknown type name 'size_t' 675 | extern void *calloc (size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:675:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:675:38: error: unknown type name 'size_t' 675 | extern void *calloc (size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:675:38: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:683:36: error: unknown type name 'size_t' 683 | extern void *realloc (void *__ptr, size_t __size) | ^~~~~~ /usr/include/stdlib.h:683:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:695:41: error: unknown type name 'size_t' 695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:695:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:695:57: error: unknown type name 'size_t' 695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:695:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:701:41: error: unknown type name 'size_t' 701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:701:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:701:57: error: unknown type name 'size_t' 701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:701:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/stdlib.h:706: /usr/include/alloca.h:32:22: error: unknown type name 'size_t' 32 | extern void *alloca (size_t __size) __THROW; | ^~~~~~ /usr/include/alloca.h:25:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 24 | #include <stddef.h> +++ |+#include <stddef.h> 25 | /usr/include/stdlib.h:712:22: error: unknown type name 'size_t' 712 | extern void *valloc (size_t __size) __THROW __attribute_malloc__ | ^~~~~~ /usr/include/stdlib.h:712:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:718:45: error: unknown type name 'size_t' 718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:718:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:718:65: error: unknown type name 'size_t' 718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:718:65: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:724:29: error: unknown type name 'size_t' 724 | extern void *aligned_alloc (size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:724:29: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:724:49: error: unknown type name 'size_t' 724 | extern void *aligned_alloc (size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:724:49: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:961:23: error: unknown type name 'size_t' 961 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | ^~~~~~ /usr/include/stdlib.h:961:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:961:39: error: unknown type name 'size_t' 961 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | ^~~~~~ /usr/include/stdlib.h:961:39: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:970:34: error: unknown type name 'size_t' 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ^~~~~~ /usr/include/stdlib.h:970:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:970:50: error: unknown type name 'size_t' 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ^~~~~~ /usr/include/stdlib.h:970:50: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1044:20: error: unknown type name 'size_t' 1044 | size_t __len) __THROW __nonnull ((3, 4, 5)); | ^~~~~~ /usr/include/stdlib.h:1044:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1047:20: error: unknown type name 'size_t' 1047 | size_t __len) __THROW __nonnull ((3, 4, 5)); | ^~~~~~ /usr/include/stdlib.h:1047:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1051:45: error: unknown type name 'size_t' 1051 | char *__restrict __buf, size_t __len) | ^~~~~~ /usr/include/stdlib.h:1051:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1055:45: error: unknown type name 'size_t' 1055 | char *__restrict __buf, size_t __len) | ^~~~~~ /usr/include/stdlib.h:1055:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1062:36: error: unknown type name 'size_t' 1062 | extern int mblen (const char *__s, size_t __n) __THROW; | ^~~~~~ /usr/include/stdlib.h:1062:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1066:48: error: unknown type name 'size_t' 1066 | const char *__restrict __s, size_t __n) __THROW; | ^~~~~~ /usr/include/stdlib.h:1066:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1073:8: error: unknown type name 'size_t' 1073 | extern size_t mbstowcs (wchar_t *__restrict __pwcs, | ^~~~~~ /usr/include/stdlib.h:1073:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1074:53: error: unknown type name 'size_t' 1074 | const char *__restrict __s, size_t __n) __THROW | ^~~~~~ /usr/include/stdlib.h:1074:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1077:8: error: unknown type name 'size_t' 1077 |
s503800757
p00022
C
for(i=0;i<n;i++) if(b[0]<b[i]) b[0]=b[i]; printf("%d\n",b[0]); } return 0; }
main.c:1:7: error: expected identifier or '(' before 'for' 1 | for(i=0;i<n;i++) | ^~~ main.c:1:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | for(i=0;i<n;i++) | ^ main.c:1:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 1 | for(i=0;i<n;i++) | ^~ main.c:4:14: error: expected declaration specifiers or '...' before string constant 4 | printf("%d\n",b[0]); | ^~~~~~ main.c:4:21: error: unknown type name 'b' 4 | printf("%d\n",b[0]); | ^ main.c:5:5: error: expected identifier or '(' before '}' token 5 | } | ^ main.c:6:3: error: expected identifier or '(' before 'return' 6 | return 0; | ^~~~~~ main.c:7:1: error: expected identifier or '(' before '}' token 7 | } | ^
s419637926
p00022
C
#include<stdio.h> #define MAX 5000 int sum(int s,int e,int *list){ int ans=0; int i; for(i=s;i<=e;i++){ ans+=list[i]; } return ans; } int main(){ int t[MAX]; int n; int a[MAX]; int i,j,k; int max=-200000000; while(scanf("%d",&n)){ if(n==0){ break; } max=-200000000; for(i=0;i<n;i++){ t[i]=0; } for(i=0;i<n;i++){ scanf("%d",&a[i]); for(j=i;j<n;j++){ t[j]+=a[i]; } } for(i=0;i<n;i++){ for(j=0;j<i;j++){ int S = sum(j,i,a); if(S)>t[i]){ t[i]=S; } } } for(i=0;i<n;i++){ if(max<t[i]){ max=t[i]; } } printf("%d\n",max); } return 0; }
main.c: In function 'main': main.c:34:38: error: expected expression before '>' token 34 | if(S)>t[i]){ | ^ main.c:34:43: error: expected statement before ')' token 34 | if(S)>t[i]){ | ^
s666512411
p00022
C
i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);}
main.c:1:1: warning: data definition has no type or storage class 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^ main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:20: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} main.c:1:20: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^~~~~ main.c:1:20: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:42: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^~~~~~ main.c:1:42: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:42: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:42: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:79: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} main.c:1:79: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^~~~ main.c:1:79: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:79: error: too many arguments to function 'fmax' main.c:1:78: error: lvalue required as left operand of assignment 1 | i,n,t;main(m){for(;scanf("%d",&i),n|i;n||printf("%d\n",m))!n--?t=m=-9e5,n=i:m=fmax(t+=i,m,t*=t>0);} | ^
s653148933
p00022
C
i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;}
main.c:1:1: warning: data definition has no type or storage class 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} | ^ main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:24: error: lvalue required as left operand of assignment 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} | ^ main.c:1:34: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} main.c:1:34: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} | ^~~~~ main.c:1:34: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:61: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;n?:i=t=m=-9e5,scanf("%d",n--?&i:&n),n;n?:printf("%d\n",m))t*=t>0,t+=i,m=t>m?t:m;} | ^~~~~~ main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:61: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf'
s143431143
p00022
C
i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;}
main.c:1:1: warning: data definition has no type or storage class 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} | ^ main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:20: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} main.c:1:20: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} | ^~~~~ main.c:1:20: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:45: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} | ^~~~~~ main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:45: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:89: error: lvalue required as left operand of assignment 1 | i,n,t;main(m){for(;scanf("%d",n?&i:&n),n;n||printf("%d\n",m))n--?t*=t>0,t+=i,m=t>m?t:m:t=m=-9e5;} | ^
s893485676
p00022
C
#include <stdio.h> void tansaku(int a); int main(void) { int array[1000]; int n,i,sum=0,k=0; while(1) { sum = 0; for(i=0;i<1000;i++) { array[i] = 0; } scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++) { scanf("%d",&array[i]); } for(i=0;i<n;i++) { tansaku(i); k = 0; } printf("%d\n",sum); } return 0; } void tansaku(int a) { if(a>n)return; k += array[a]; if(k > sum) { sum = k; } if(a == n)return; tansaku(a+1); }
main.c: In function 'tansaku': main.c:31:14: error: 'n' undeclared (first use in this function) 31 | if(a>n)return; | ^ main.c:31:14: note: each undeclared identifier is reported only once for each function it appears in main.c:32:9: error: 'k' undeclared (first use in this function) 32 | k += array[a]; | ^ main.c:32:14: error: 'array' undeclared (first use in this function) 32 | k += array[a]; | ^~~~~ main.c:33:16: error: 'sum' undeclared (first use in this function) 33 | if(k > sum) | ^~~
s343092226
p00022
C
#include <stdio.h> int main(void) { int array[5000]; int i,n,j,max,tmp=0; while(1) { scanf("%d",&n); if(n == 0)break; for(i=~;i<n;i++) { scanf("%d",&array[i]); } for(i=0;i<n;i++) { for(j=i;j<n;j++) { tmp += array[j]; if(max < tmp)max = tmp; } tmp = 0; } printf("%d\n",max); } return 0; }
main.c: In function 'main': main.c:10:24: error: expected expression before ';' token 10 | for(i=~;i<n;i++) | ^
s316781798
p00022
C
#include<stdio.h> int main(){ int i,n,maxIdx,minIdx; long item[5000],sum,sumMax,sumMin; while(scanf("%d",&n)!=EOF){ if(n==0) break; sumMin=0; sumMax=0; sum=0; for(i=0;i<n;i++){ scanf("%ld",&item[i]); if(i==0){ sum+=item[i]; if(sumMax<item[i]) sumMax=item[i]; else if(sumMin>item[i]) sumMin=item[i]; } else{ sum+=item[i]; if(sumMax<sum){ sumMax=sum; maxIdx=i; } else if(sumMin>sum){ minIdx=i; if(maxIdx>minIdx){ sumMin=sum; } } } printf("%ld\n",sumMax-sumMin); } return 0; }
main.c: In function 'main': main.c:43:1: error: expected declaration or statement at end of input 43 | } | ^
s228725061
p00022
C
7 -5 -1 6 4 9 -6 -7 13 1 2 3 2 -2 -1 1 2 3 2 1 -2 1 3 1000 -200 201 0
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 7 | ^
s523158994
p00022
C
#include <stdio.h> int main(void) { int n; int i, j, k; int a[5000]; __int64 ans; __int64 buf; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &a[i]); } ans = -200000; for (i = 0; i < n - 1; i++){/*スタート*/ for (j = i + 1; j < n; j++){/*ゴール*/ buf = 0; for (k = i; k <= j; k++){/*項数*/ buf += a[k]; } if (ans < buf){ ans = buf; } } } printf("%lld\n", ans); } return (0); }
main.c: In function 'main': main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'? 8 | __int64 ans; | ^~~~~~~ | __int64_t main.c:9:9: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 buf; | ^~~~~~~ | __int64_t
s933988207
p00022
C
#include <stdio.h> int main(void) { int n; int i, j, k; int a[5000]; __int64 ans; __int64 buf; int start_max; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &a[i]); } ans = -2000000; start_max = -1000000; for (i = 0; i < n - 1; i++){/*スタート*/ if (start_max < a[i]){ start_max = a[i]; } else { continue; } for (j = i + 1; j < n; j++){/*ゴール*/ buf = 0; for (k = i; k <= j; k++){/*項数*/ buf += a[k]; } if (ans < buf){ ans = buf; } } } printf("%lld\n", ans); } return (0); } /* 音ゲーの精度がよくなりますように。 */
main.c: In function 'main': main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'? 8 | __int64 ans; | ^~~~~~~ | __int64_t main.c:9:9: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 buf; | ^~~~~~~ | __int64_t
s455848208
p00022
C
#include <stdio.h> int main(void) { int n; int i, j, k; int a[5000]; __int64 ans; __int64 buf; int start_max; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &a[i]); } ans = -2000000; start_max = -1000000; for (i = 0; i < n - 1; i++){/*スタート*/ if (start_max < a[i]){ start_max = a[i]; } else { continue; } for (j = i + 1; j < n; j++){/*ゴール*/ buf = 0; for (k = i; k <= j; k++){/*項数*/ buf += a[k]; } if (ans < buf){ ans = buf; } } } printf("%lld\n", ans); } return (0); } /* 音ゲーの精度がよくなりますように。 */
main.c: In function 'main': main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'? 8 | __int64 ans; | ^~~~~~~ | __int64_t main.c:9:9: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 buf; | ^~~~~~~ | __int64_t
s937826072
p00022
C
#include <stdio.h> int main(void) { int n; int i, j, k; int a[5000]; __int64 ans; __int64 buf; int start_max; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &a[i]); } ans = -2000000; start_max = -1000000; for (i = 0; i < n - 1; i++){/*スタート*/ /*if (a[i - 1] >= a[i] && i != 0){ continue; }*/ buf = a[i]; for (j = i + 1; j < n; j++){/*ゴール*/ /*for (k = i; k <= j; k++){/*項数*/ /*printf("[%d]%d ", k, a[k]); buf += a[k]; }*/ buf += a[j]; /*printf("%d\n", buf);*/ if (ans < buf){ ans = buf; } } } printf("%lld\n", ans); } return (0); } /* 音ゲーの精度がよくなりますように。 */
main.c: In function 'main': main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'? 8 | __int64 ans; | ^~~~~~~ | __int64_t main.c:9:9: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 buf; | ^~~~~~~ | __int64_t
s683850491
p00022
C
#include <stdio.h> int main(void) { int n; int i, j; int a[5000]; long long ans; long long buf; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &a[i]); } ans = -5000000000 for (i = 0; i < n - 1; i++){/*スタート*/ buf = a[i]; for (j = i + 1; j < n; j++){/*ゴール*/ buf += a[j]; if (ans < buf){ ans = buf; } } } printf("%lld\n", ans); } return (0); } /* 音ゲーの精度がよくなりますように。 */
main.c: In function 'main': main.c:21:34: error: expected ';' before 'for' 21 | ans = -5000000000 | ^ | ; 22 | for (i = 0; i < n - 1; i++){/*スタート*/ | ~~~