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() { sc...
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=...
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: err...
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 ...
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...
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, ...
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' ...
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; ...
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...
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; ...
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(); | ~~~ ^~ ~~~~~~...
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"); | ...
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 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;...
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{ | ^~~~~~~ | ...
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,p...
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 | usin...
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<<(f...
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?...
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<<(fab...
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...
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<<(...
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...
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; i...
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 ...
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;...
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[...
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; | ~~~~^~~~~~~ | | ...
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; ...
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...
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:6...
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{ ...
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])*...
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=...
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 ...
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...
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\U00...
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]) ...
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; ...
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 | ...
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" << ...
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 declara...
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 = sc...
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:...
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 = sc...
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:...
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...
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") ...
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; #...
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...
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; #...
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]; doub...
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...
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...
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]...
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; | ^~~ | e...
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 "...
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:2...
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){ c...
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(...
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; | ...
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...
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 = Mat...
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.p...
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....
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())...
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.readLin...
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()); ^...
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...
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.print...
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.next...
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 ...
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 =...
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; ...
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]; ...
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:...
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 = ...
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); ...
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...
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(Strin...
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 ...
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 =...
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 =...
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;...
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++...
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",...
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 d...
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] = ...
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)); ^ ...
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]...
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)); ^ ...
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){...
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; } } } pr...
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...
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)...
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; ...
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...
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 ...
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] mai...
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]...
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();...
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...
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...
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...
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+...
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 r...
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++) sca...
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...
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__' b...
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; ...
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 declaratio...
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 declarati...
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 ...
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...
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...
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); ...
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]) su...
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++){/*ゴール*/ ...
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; | ^~~~~~~ | ...
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++){/*スタート*/ ...
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; | ^~~~~~~ | ...
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++){/*スタート*/ ...
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; | ^~~~~~~ | ...
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++){/*スタート*/ ...
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; | ^~~~~~~ | ...
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 <...
main.c: In function 'main': main.c:21:34: error: expected ';' before 'for' 21 | ans = -5000000000 | ^ | ; 22 | for (i = 0; i < n - 1; i++){/*スタート*/ | ~~~