submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s152943978
p03632
C
#include<Stdio.h> int main() { int A,B,C,D,max,min,s; scanf("%d%d%d%d",&A,&B,&C,&D); min=B<D?B:D; max=A>C?A:C; s=min-max; if(s>0) printf("%d\n",s); else printf("0\n"); }
main.c:1:9: fatal error: Stdio.h: No such file or directory 1 | #include<Stdio.h> | ^~~~~~~~~ compilation terminated.
s618371370
p03632
C++
#include <iostream> using namespace std; int n[103];   int main(void){ int a,b,c,d,ans=0; cin>>a>>b>>c>>d; n[a]=1; n[b]=-1; n[c]=1; n[d]=-1; for(int i=0;i<=101;i++){ if(n[i]>1)ans++; n[i+1]+=n[i]; } cout<<ans<<endl; }
a.cc:4:1: error: extended character   is not valid in an identifier 4 |   | ^ a.cc:4:1: error: '\U000000a0' does not name a type 4 |   | ^
s986341109
p03632
C++
//abc070_b Two Switches #include <bits/stdc++.h> using namespace std; int main() { int A; int B int C; int D; cin >> A; cin >> B; cin >> C; cin >> D; if( A < C ) A = C; if( B > D ) B = D; if( A > B ) cout << 0 << endl; else cout << B - A << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:1: error: expected initializer before 'int' 11 | int C; | ^~~ a.cc:15:16: error: 'B' was not declared in this scope 15 | cin >> B; | ^ a.cc:16:16: error: 'C' was not declared in this scope 16 | cin >> C; | ^
s082569730
p03632
C++
//abc070_b Two Switches #include <bits/stdc++.h> using namespace std; int main() { char A; char B char C; char D; cin >> A; cin >> B; cin >> C; cin >> D; if( A < C ) A = C; if( B > D ) B = D; if( A > B ) cout << 0 << endl; else cout << B - A << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:1: error: expected initializer before 'char' 11 | char C; | ^~~~ a.cc:15:16: error: 'B' was not declared in this scope 15 | cin >> B; | ^ a.cc:16:16: error: 'C' was not declared in this scope 16 | cin >> C; | ^
s131957343
p03632
C++
/** * @Author: Pranta Sarker * */ #include<bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(0) #define bfast cin.tie(0) #define outs(x) cout << x << " " #define outn(x) cout << x << "\n" #define sf scanf #define pf printf #define pfn(x , k) printf(k , x) #define nl puts("") #define psb push_back #define mset(c,v) memset(c , v , sizeof c) #define loop0(n) for(int i=0; i<n; i++) #define loop1(n) for(int i=1; i<=n; i++) #define mpair(x , y) make_pair(x , y) #define all(x) x.begin(), x.end() #define pi acos(-1.0) #define psb push_back #define clr clear() typedef unsigned long long ull; typedef long long LL; typedef vector<int>vii; typedef vector<LL>vll; typedef vector<string>vs; typedef map<int, int>mpii; typedef map<string, int>mpsi; typedef map<char, int>mpci; typedef map<LL, LL>mpll; const int mod = 1000007; const int high = 1002; int main() { fast; int A , B , C , D; while(cin >> A >> B >> C >> D) { if(C >= A && C >= B) { outn(ans); continue; } int start = max(A , C); int end = min(B , D); if(start > end) outn(0); else outn(end - start); } return 0; }
a.cc: In function 'int main()': a.cc:49:30: error: 'ans' was not declared in this scope; did you mean 'abs'? 49 | outn(ans); | ^~~ a.cc:13:25: note: in definition of macro 'outn' 13 | #define outn(x) cout << x << "\n" | ^
s774955079
p03632
C++
#include <iostream> using namespace std; int main() { int a, b, c, d; int count = 0; cin >> a >> b >> c >> d; for(int i=0;i<=100;i++){ if(a<=i && i<=b && c<=i && i<=d){ count++; } } if(count != 0){ coun--; } cout << count << endl; }
a.cc: In function 'int main()': a.cc:15:5: error: 'coun' was not declared in this scope; did you mean 'count'? 15 | coun--; | ^~~~ | count
s003641956
p03632
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void){ int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); if (c > a){ if (b > c){ if (b > d){ printf("%d\n", c - d); }else{ printf("%d\n", d - c); } }else{ printf("0\n"); } }else if(a > c){ if (d > a){ if (d > b){ printf("%d", a - b); }else[ printf("%d", a - d); ] }else{ printf("0\n"); } } return 0; }
main.c: In function 'main': main.c:23:18: error: expected expression before '[' token 23 | }else[ | ^ main.c:24:36: error: expected ']' before ';' token 24 | printf("%d", a - d); | ^ | ] main.c:25:14: error: expected ';' before '}' token 25 | ] | ^ | ; 26 | }else{ | ~
s612893457
p03632
C
#include<stdio.h> int main(){ int A,B,C,D; scanf("%d %d %d %d",&A,&B,&C,&D); if(B=<C||D=<A){ printf("0"); //ok }else if(A=<C){ if(D=<B){ printf("%d",D-C); }else{ printf("%d",B-C); } }else if(C<A){ if(B=<D){ printf("%d",B-A); }else{ printf("%d",D-A); } } return 0; }
main.c: In function 'main': main.c:5:10: error: expected expression before '<' token 5 | if(B=<C||D=<A){ | ^ main.c:7:16: error: expected expression before '<' token 7 | }else if(A=<C){ | ^ main.c:8:14: error: expected expression before '<' token 8 | if(D=<B){ | ^ main.c:14:14: error: expected expression before '<' token 14 | if(B=<D){ | ^
s829788660
p03632
C
#include<stdio.h> int main(){ int A,B,C,D; scanf("%d %d %d %d",&A,&B,&C,&D); if(B=<C||D=<A){ printf("0"); }else if(A=<C){ printf("%d",D-C); }else if(C<A){ printf("%d",B-A); } return 0; }
main.c: In function 'main': main.c:5:10: error: expected expression before '<' token 5 | if(B=<C||D=<A){ | ^ main.c:7:16: error: expected expression before '<' token 7 | }else if(A=<C){ | ^
s461760690
p03632
C++
#include <iostream> using namespace std; int main() { int a,b,c,d; cin>>a>>b>>c>>d; if(b<c||d<a) { cout<<0; return 0; } if(a<=c&&b>=10d) { cout<<d-c; return 0; } if(c<=a&&d>=b) { cout<<b-a; return 0; } if(c<b) { cout<<b-c; return 0; } if(a<d) { cout<<d-a; return 0; } return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: unable to find numeric literal operator 'operator""d' 12 | if(a<=c&&b>=10d) | ^~~
s022489792
p03632
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c,d; cin>>a>>b>>c>>d; if(b<c||d<a) { cout<<0; return 0; } if(a<=c&&b>=10d) { cout<<d-c; return 0; } if(c<=a&&d>=b) { cout<<b-a; return 0; } if(c<b) { cout<<b-c; return 0; } if(a<d) { cout<<d-a; return 0; } return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: unable to find numeric literal operator 'operator""d' 12 | if(a<=c&&b>=10d) | ^~~
s444325539
p03632
C++
#include<iostream> #include<string> using namespace std; int main(){ int a,b,c,d,t; cin >> a >> b >>c >> d; t = min(c,d) - max(a,b); if(t<0){t = 0;} cout << t << endl; return 0; }
a.cc:8:21: error: extended character   is not valid in an identifier 8 | t = min(c,d) - max(a,b); | ^ a.cc: In function 'int main()': a.cc:8:21: error: expected ';' before '\U00003000' 8 | t = min(c,d) - max(a,b); | ^~ | ;
s125053352
p03632
C++
#include<stdio.h> int main(void) { int a,b,c,d; scanf("%d %d %d %d",&a,&b,&c,&d); if(b=<c) printf("0\n"); else{ if(a<c) a=c; if(b>d) b=d; printf("%d\n",b-a); } return 0; }
a.cc: In function 'int main()': a.cc:6:14: error: expected primary-expression before '<' token 6 | if(b=<c) printf("0\n"); | ^
s154671823
p03632
C++
#include<stdio.h> int main(void) { int a,b,c,d; scanf("%d %d %d %d",&a,&b,&c,&d); if(b=<c) printf("0\n"); else{ if(a<c) a=c; if(b>d) b=d; printf("%d\n",b-a); } return 0; }
a.cc: In function 'int main()': a.cc:6:14: error: expected primary-expression before '<' token 6 | if(b=<c) printf("0\n"); | ^
s646488469
p03632
C++
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define dump(x) cerr << #x " = " << (x) << '\n' #define sz(x) ((int)(x).size()) #define endl '\n' #ifdef _DEBUG27_ //#define STRESS 1 #endif typedef long long llong; const int INF = 2e9 + 999; const llong LINF = 2e18 + 999; void inv(bool e); template<typename T> T sign(T a); template<typename T> void die(T &a); template<typename T> void umax(T &a, T b); template<typename T> void umin(T &a, T b); bool brute, alter; int cnt_tests = 1; // Improving csa rating // Code below llong x1, y1, x2, y2; void inp() { cin >> x1 >> y1 >> x2 >> y2; } void solve() { cout << max(0ll, min(y1, y2) - max(x1, x2)); } void stress() { } void naive() { } void run(); int main() { #ifdef _DEBUG27_ if (1) freopen("input.txt", "r", stdin); #else ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); if (0) { freopen("palindrome.in", "r", stdin); freopen("palindrome.out", "w", stdout); } #endif srand(time(0)); #ifdef STRESS brute = true; #else brute = false; #endif for (int i = 0; (i < cnt_tests); i++) { run(); } cerr << endl << "Time: " << clock() / 1000.0 << " ms"; return 0; } void run() { if (!brute) { inp(); } else { stress(); } solve(); cout << endl; } template<typename T> void die(T &a) { cout << a; exit(0); } template<typename T> T sign(T a) { if (a == 0) return 0; if (a < 0) return -1; return 1; } template<typename T> void umax(T &a, T b) { if (b > a) a = b; } template<typename T> void umin(T &a, T b) { if (b < a) a = b; } void inv(bool e) { if (!e) { vector<int> a; a[-1] += 1; } } /** CLEARING BUFFER cout << VAL << flush; OR printf(VAL); fflush(stdout); */
a.cc:36:11: error: 'llong y1' redeclared as different kind of entity 36 | llong x1, y1, x2, y2; | ^~ 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/cassert:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33, 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 'void inp()': a.cc:39:15: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'double(double) noexcept') 39 | cin >> x1 >> y1 >> x2 >> y2; | ~~~~~~~~~ ^~ ~~ | | | | | double(double) noexcept | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /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:39:18: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'double (*)(double) noexcept' 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ /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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'short int' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'short unsigned int' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'unsigned int' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'long unsigned int' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'long long unsigned int' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'void*' [-fpermissive] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept a.cc:39:18: 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:39:18: 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] 39 | cin >> x1 >> y1 >> x2 >> y2; | ^~ | | | double (*)(double) noexcept /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match) 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed: a.cc:39:18: error: invalid conversion from 'double (*)(double) noexcept' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios
s850471185
p03632
C++
A,B,C,D = map(int,input().split()) lower = max(A,C) upper = min(B,D) print(max(0,upper-lower))
a.cc:1:1: error: 'A' does not name a type 1 | A,B,C,D = map(int,input().split()) | ^
s745820390
p03632
C++
#include <iostream> using namespace std; int main() { int x,y; int a,b,c,d; cin >> a >> b >> c >> d; if(a<b && c<d) { if(c < b) {if(c > a){x=c;} else {x=a;}} if(d > b) {y=b;} else {y=d;} cout<<y-x<<endl; else {cout<<0<<endl;} } return 0; }
a.cc: In function 'int main()': a.cc:17:1: error: expected '}' before 'else' 17 | else {cout<<0<<endl;} | ^~~~ a.cc:9:16: note: to match this '{' 9 | if(a<b && c<d) { | ^ a.cc: At global scope: a.cc:20:1: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s828491814
p03632
C
#include<stdio.h> int main(void){ int a,b,c,d; int min,max; scanf("%d %d %d %d",&a,&b,&c,&d); min=c; max=d; if(a>c)min=a; if(b<d)max=b; ans=max-min; if(ans>=0){ printf("%d\n",ans); }else{ printf("0\n"); } return 0; }
main.c: In function 'main': main.c:10:5: error: 'ans' undeclared (first use in this function) 10 | ans=max-min; | ^~~ main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
s792085938
p03632
C
#include<stdio.h> int main(void){ int a,b,c,d; int min,max; scanf("%d %d %d %d",&a,&b,&c,&d); min=c; max=d; if(a>c)min=a; if(b<d)max=b; ans=max-min; if(ans>=0){ printf("%d\n",ans); }else{ printf("0\n") } return 0; }
main.c: In function 'main': main.c:10:5: error: 'ans' undeclared (first use in this function) 10 | ans=max-min; | ^~~ main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in main.c:14:22: error: expected ';' before '}' token 14 | printf("0\n") | ^ | ; 15 | } | ~
s182847155
p03632
C
#include <stdio.h> #include <math.h> int main(){ int a b c d; scanf("%d %d %d %d", &a, &b, &c, &d); printf("%d", (int)(fmax(fmax(a,c)-fmin(b,d),0))); }
main.c: In function 'main': main.c:5:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'b' 5 | int a b c d; | ^ main.c:5:11: error: unknown type name 'b' main.c:5:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'd' 5 | int a b c d; | ^ main.c:6:27: error: 'a' undeclared (first use in this function) 6 | scanf("%d %d %d %d", &a, &b, &c, &d); | ^ main.c:6:27: note: each undeclared identifier is reported only once for each function it appears in main.c:6:31: error: 'b' undeclared (first use in this function) 6 | scanf("%d %d %d %d", &a, &b, &c, &d); | ^ main.c:6:35: error: 'c' undeclared (first use in this function) 6 | scanf("%d %d %d %d", &a, &b, &c, &d); | ^ main.c:6:39: error: 'd' undeclared (first use in this function) 6 | scanf("%d %d %d %d", &a, &b, &c, &d); | ^
s027372513
p03632
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); String[] number = line.sprit(" "); int a = Integer.parseInt(number[0]); int b = Integer.parseInt(number[1]); int c = Integer.parseInt(number[2]); int d = Integer.parseInt(number[3]); int r = 0; if(a < c) { if(c < b) { r = b - c; System.out.println(r); } else if(b < c) { System.out.println(r); } } else if(c < a) { if(a < d) { r = d - a; System.out.println(r); } else if(d < a) { System.out.println(r); } } } }
Main.java:8: error: cannot find symbol String[] number = line.sprit(" "); ^ symbol: method sprit(String) location: variable line of type String 1 error
s224952462
p03632
C
#include <iostream> using namespace std; int main (void) { int A, B, C, D, s_in, s_out ; cin >> A >> B >> C >> D; if (A < C) s_in = C; else s_in = A; if (B < D) s_out = B; else s_out = D; if (s_in < s_out){ cout << (s_out - s_in) << "\n"; } else { cout << 0 << "\n"; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s472115986
p03632
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; cin>>a>>b>>c>>d; int ans = max((min(b,d) - max(a,c) , 0); cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:8:48: error: expected ')' before ';' token 8 | int ans = max((min(b,d) - max(a,c) , 0); | ~ ^ | )
s109231283
p03632
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; cin>>a>>b>>c>>d; cout<<max((min(b,d) - max(a,c) , 0)<<endl; }
a.cc: In function 'int main()': a.cc:8:44: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 8 | cout<<max((min(b,d) - max(a,c) , 0)<<endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
s611536542
p03632
C
#include<stdio.h> int main() { int a,b,c,d,p,sum,q; scanf("%d%d%d%d",&a,&b,&c,&d); if(b<c||d<a) { sum=0; } else { if(b>d) p=d else p=b; if(a>c) q=a; else q=c; sum=p-q; } printf("%d\n",sum); return 0; }
main.c: In function 'main': main.c:13:12: error: expected ';' before 'else' 13 | p=d | ^ | ; 14 | else | ~~~~
s491404436
p03632
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; int A, B, C, D; int main() { while (scanf("%d %d %d %d", &A, &B, &C, &D) != EOF) { int ans = 0; if (B <= C || A >= D) { ans = 0; } else if (A <= C && B >= D || A > C && B < D) { ans = abs(D - C); } 1 8 4 5 4 5 1 8 else if (A < C && B < D || A > C && B > D) { ans = abs(C - B); } else if (A == C && B == D) { ans = D - C + 1; } printf("%d\n", ans); } }
a.cc: In function 'int main()': a.cc:16:18: error: expected ';' before numeric constant 16 | 1 8 4 5 4 5 1 8 | ^ ~ | ; a.cc:20:17: error: 'else' without a previous 'if' 20 | else if (A == C && B == D) { | ^~~~
s945900315
p03632
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; int A, B, C, D; int main() { while (scanf("%d %d %d %d", &A, &B, &C, &D) != EOF) { int ans = 0; if (B <= C || A >= D) { ans = 0; } else if (A <= C && B >= D || A > C && B < D) { ans = abs(D - C); } 1 8 4 5 4 5 1 8 else if (A < C && B < D || A > C && B > D) { ans = abs(C - B); } else if (A == C && B == D) { ans = D - C + 1; } printf("%d\n", ans); } }
a.cc: In function 'int main()': a.cc:16:18: error: expected ';' before numeric constant 16 | 1 8 4 5 4 5 1 8 | ^ ~ | ; a.cc:20:17: error: 'else' without a previous 'if' 20 | else if (A == C && B == D) { | ^~~~
s100529024
p03632
C++
#include <iostream> #include <algorithm> int main() { int a, b, c, d; std::cin >> a >> b >> c >> d; int firstPoint = std::min(b, d) int secondPoint = std::max(a, c) std::cout << std::max(0, firstPoint - secondPoint); }
a.cc: In function 'int main()': a.cc:9:5: error: expected ',' or ';' before 'int' 9 | int secondPoint = std::max(a, c) | ^~~
s207019845
p03632
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <string> #include <iomanip> #include <map> #include <set> #include <vector> #include <queue> #include <deque> #include <stack> #include <cmath> using namespace std; int a,b,c,d,ans; bool get[105]; int main(){ scanf("%d%d%d%d",&a,&b,&c,&d); for (int i=a;i<b;++i)get[i]=1; for (int i=c;i<d;++i)ans+=get[i]; printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:22:30: error: reference to 'get' is ambiguous 22 | for (int i=a;i<b;++i)get[i]=1; | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68, 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/tuple:2517:5: note: candidates are: 'template<class _Tp, class ... _Types> constexpr const _Tp&& std::get(const tuple<_Elements ...>&&)' 2517 | get(const tuple<_Types...>&& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2505:5: note: 'template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const tuple<_Elements ...>&)' 2505 | get(const tuple<_Types...>& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2494:5: note: 'template<class _Tp, class ... _Types> constexpr _Tp&& std::get(tuple<_Elements ...>&&)' 2494 | get(tuple<_Types...>&& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2483:5: note: 'template<class _Tp, class ... _Types> constexpr _Tp& std::get(tuple<_Elements ...>&)' 2483 | get(tuple<_Types...>& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2476:5: note: 'template<long unsigned int __i, class ... _Elements> constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&)' 2476 | get(const tuple<_Elements...>&) = delete; | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1307:5: note: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const pair<_Up, _Tp>&&)' 1307 | get(const pair<_Up, _Tp>&& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1302:5: note: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_Up, _Tp>&&)' 1302 | get(pair<_Up, _Tp>&& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1297:5: note: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_Up, _Tp>&)' 1297 | get(const pair<_Up, _Tp>& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1292:5: note: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_Up, _Tp>&)' 1292 | get(pair<_Up, _Tp>& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1287:5: note: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const pair<_T1, _T2>&&)' 1287 | get(const pair<_Tp, _Up>&& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1282:5: note: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_T1, _T2>&&)' 1282 | get(pair<_Tp, _Up>&& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1277:5: note: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_T1, _T2>&)' 1277 | get(const pair<_Tp, _Up>& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1272:5: note: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_T1, _T2>&)' 1272 | get(pair<_Tp, _Up>& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:150:5: note: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const array<_Tp, _Nm>&&)' 150 | get(const array<_Tp, _Nm>&&) noexcept; | ^~~ /usr/include/c++/14/bits/stl_pair.h:146:5: note: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const array<_Tp, _Nm>&)' 146 | get(const array<_Tp, _Nm>&) noexcept; | ^~~ /usr/include/c++/14/bits/stl_pair.h:142:5: note: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(array<_Tp, _Nm>&&)' 142 | get(array<_Tp, _Nm>&&) noexcept; | ^~~ /usr/include/c++/14/bits/stl_pair.h:138:5: note: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(array<_Tp, _Nm>&)' 138 | get(array<_Tp, _Nm>&) noexcept; | ^~~ /usr/include/c++/14/tuple:2466:5: note: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(const tuple<_Elements ...>&&)' 2466 | get(const tuple<_Elements...>&& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2457:5: note: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(tuple<_Elements ...>&&)' 2457 | get(tuple<_Elements...>&& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2451:5: note: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(const tuple<_Elements ...>&)' 2451 | get(const tuple<_Elements...>& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2445:5: note: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(tuple<_Elements ...>&)' 2445 | get(tuple<_Elements...>& __t) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1265:5: note: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(const pair<_Tp1, _Tp2>&&)' 1265 | get(const pair<_Tp1, _Tp2>&& __in) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1260:5: note: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const pair<_Tp1, _Tp2>&)' 1260 | get(const pair<_Tp1, _Tp2>& __in) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1255:5: note: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(pair<_Tp1, _Tp2>&&)' 1255 | get(pair<_Tp1, _Tp2>&& __in) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1250:5: note: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(pair<_Tp1, _Tp2>&)' 1250 | get(pair<_Tp1, _Tp2>& __in) noexcept | ^~~ a.cc:18:6: note: 'bool get [105]' 18 | bool get[105]; | ^~~ a.cc:23:35: error: reference to 'get' is ambiguous 23 | for (int i=c;i<d;++i)ans+=get[i]; | ^~~ /usr/include/c++/14/tuple:2517:5: note: candidates are: 'template<class _Tp, class ... _Types> constexpr const _Tp&& std::get(const tuple<_Elements ...>&&)' 2517 | get(const tuple<_Types...>&& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2505:5: note: 'template<class _Tp, class ... _Types> constexpr const _Tp& std::get(const tuple<_Elements ...>&)' 2505 | get(const tuple<_Types...>& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2494:5: note: 'template<class _Tp, class ... _Types> constexpr _Tp&& std::get(tuple<_Elements ...>&&)' 2494 | get(tuple<_Types...>&& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2483:5: note: 'template<class _Tp, class ... _Types> constexpr _Tp& std::get(tuple<_Elements ...>&)' 2483 | get(tuple<_Types...>& __t) noexcept | ^~~ /usr/include/c++/14/tuple:2476:5: note: 'template<long unsigned int __i, class ... _Elements> constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&)' 2476 | get(const tuple<_Elements...>&) = delete; | ^~~ /usr/include/c++/14/bits/stl_pair.h:1307:5: note: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const pair<_Up, _Tp>&&)' 1307 | get(const pair<_Up, _Tp>&& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1302:5: note: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_Up, _Tp>&&)' 1302 | get(pair<_Up, _Tp>&& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1297:5: note: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_Up, _Tp>&)' 1297 | get(const pair<_Up, _Tp>& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1292:5: note: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_Up, _Tp>&)' 1292 | get(pair<_Up, _Tp>& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1287:5: note: 'template<class _Tp, class _Up> constexpr const _Tp&& std::get(const pair<_T1, _T2>&&)' 1287 | get(const pair<_Tp, _Up>&& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1282:5: note: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_T1, _T2>&&)' 1282 | get(pair<_Tp, _Up>&& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1277:5: note: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_T1, _T2>&)' 1277 | get(const pair<_Tp, _Up>& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:1272:5: note: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_T1, _T2>&)' 1272 | get(pair<_Tp, _Up>& __p) noexcept | ^~~ /usr/include/c++/14/bits/stl_pair.h:150:5: note: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const array<_Tp, _Nm>&&)' 150 | get(const array<_Tp, _Nm>&&) noexcept;
s531716424
p03632
C++
#include <iostream> #include <vector> #include <algorithm> #include <functional> #include <cmath> #define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++) #define rep(i,n) reps(i,0,n) using namespace std; using ll = long long; int main(){ int a,b,c,d; cin >> a >> b >> c >> d; if((d<=a )|| (c>=b ) cout << 0 << endl; else if((a>=c&&b>=d&&d>=a)||(b>=d && d>= a && a >= c)) cout<< d-a<<endl; else if(a<=c&&b>=d) cout << d-c<<endl; else if((d>=b&&a<=c&&b>=c)||(d<=c && c <= b && b <= d)) cout << b-c << endl; else if(d >= b && a >= c) cout << b-a << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:26: error: expected ';' before 'cout' 15 | if((d<=a )|| (c>=b ) cout << 0 << endl; | ^~~~~ | ; a.cc:16:5: error: expected primary-expression before 'else' 16 | else if((a>=c&&b>=d&&d>=a)||(b>=d && d>= a && a >= c)) cout<< d-a<<endl; | ^~~~ a.cc:15:46: error: expected ')' before 'else' 15 | if((d<=a )|| (c>=b ) cout << 0 << endl; | ~ ^ | ) 16 | else if((a>=c&&b>=d&&d>=a)||(b>=d && d>= a && a >= c)) cout<< d-a<<endl; | ~~~~
s748297386
p03632
C++
int main() { int ans, a, b, c, d; std::cin >> a >> b >> c >> d; if(c >= b || a >= d){ ans = 0; }else if(a <= c && b <= d){ ans = b - c; }else if(b <= d){ ans = b - a; }else if(a <= d){ ans = d - a; }else{ans = d - c} std::cout << ans << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:4:10: error: 'cin' is not a member of 'std' 4 | std::cin >> a >> b >> c >> d; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int main() a.cc:13:22: error: expected ';' before '}' token 13 | }else{ans = d - c} | ^ | ; a.cc:14:10: error: 'cout' is not a member of 'std' 14 | std::cout << ans << std::endl; | ^~~~ a.cc:14:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:14:30: error: 'endl' is not a member of 'std' 14 | std::cout << ans << std::endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | int main()
s992586831
p03632
C
#include <stdio.h> int main(void) { int a,b,c,d,e,f,g; scanf("%d%d%d%d",&a,&b,&c,&d); if(a < c){ f = c; } else { f = a; } if(b < d){ g = b; } else { g = d; e = g - f; if(e < 0){ e = 0; } printf("%d\n",e); return 0; }
main.c: In function 'main': main.c:21:1: error: expected declaration or statement at end of input 21 | } | ^
s818358380
p03632
C++
#include <iostream> using namespace std; int main(){ int a, b, c, d; cin >> a >> b >> c >> d; int fullLength = d - a; int aLength = b - a; int bLength = d - c; if (B > d) { cout << bLength << endl; } else if (c > b) { cout << 0 << endl; } cout << fullLength - aLength - bLength << endl; }
a.cc: In function 'int main()': a.cc:11:13: error: 'B' was not declared in this scope 11 | if (B > d) | ^
s403196257
p03632
C
#include<stdio.h> int main() { int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); if(b<=c || (a>=c && b>=d) { printf("0\n"); } else if(b>c) { int max=a,min=b; if(max<=c) { max=c; } if(min>=d) { min=d; } printf("%d\n",min-max); } return 0; }
main.c: In function 'main': main.c:6:30: error: expected ')' before '{' token 6 | if(b<=c || (a>=c && b>=d) | ~ ^ | ) 7 | { | ~ main.c:24:1: error: expected expression before '}' token 24 | } | ^
s820437022
p03632
C
#include<stdio.h> int main() { int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); if(b<=c || a>=c) { printf("0\n"); } else if(b>c && ) { int max=a,min=b; if(max<=c) { max=c; } if(min>=d) { min=d; } printf("%d\n",min-max); } return 0; }
main.c: In function 'main': main.c:10:20: error: expected expression before ')' token 10 | else if(b>c && ) | ^ main.c:13:12: error: 'max' undeclared (first use in this function) 13 | if(max<=c) | ^~~ main.c:13:12: note: each undeclared identifier is reported only once for each function it appears in main.c:17:12: error: 'min' undeclared (first use in this function); did you mean 'main'? 17 | if(min>=d) | ^~~ | main
s695080943
p03632
C++
#include <vector> #include <algorithm> #include <functional> #include <cmath> #define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++) #define rep(i,n) reps(i,0,n) using namespace std; using ll = long long; int main(){ int a,b,c,d; cin >> a >> b >> c >> d; if((d<=a )|| (c>=b )) cout << 0 << endl; else if(a>=c&&b>=d&&d>=a) cout<< d-a<<endl; else if(a<=c&&b>=d) cout << d-c<<endl; else if(d>=b&&a<=c&&b>=c) cout << b-c << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: 'cin' was not declared in this scope 13 | cin >> a >> b >> c >> d; | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <cmath> +++ |+#include <iostream> 5 | a.cc:14:28: error: 'cout' was not declared in this scope 14 | if((d<=a )|| (c>=b )) cout << 0 << endl; | ^~~~ a.cc:14:28: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:14:42: error: 'endl' was not declared in this scope 14 | if((d<=a )|| (c>=b )) cout << 0 << endl; | ^~~~ a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 4 | #include <cmath> +++ |+#include <ostream> 5 | a.cc:15:33: error: 'cout' was not declared in this scope 15 | else if(a>=c&&b>=d&&d>=a) cout<< d-a<<endl; | ^~~~ a.cc:15:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:45: error: 'endl' was not declared in this scope 15 | else if(a>=c&&b>=d&&d>=a) cout<< d-a<<endl; | ^~~~ a.cc:15:45: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:16:27: error: 'cout' was not declared in this scope 16 | else if(a<=c&&b>=d) cout << d-c<<endl; | ^~~~ a.cc:16:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:16:41: error: 'endl' was not declared in this scope 16 | else if(a<=c&&b>=d) cout << d-c<<endl; | ^~~~ a.cc:16:41: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:17:33: error: 'cout' was not declared in this scope 17 | else if(d>=b&&a<=c&&b>=c) cout << b-c << endl; | ^~~~ a.cc:17:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:17:48: error: 'endl' was not declared in this scope 17 | else if(d>=b&&a<=c&&b>=c) cout << b-c << endl; | ^~~~ a.cc:17:48: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s688960054
p03632
C++
#include <bits/stdc++.h> using namespace std; int main() { cin >> a >> b >> c >> d; a = max(a,c); b = min(b,d); cout << max(0,b-a+1); return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: 'a' was not declared in this scope 6 | cin >> a >> b >> c >> d; | ^ a.cc:6:21: error: 'b' was not declared in this scope 6 | cin >> a >> b >> c >> d; | ^ a.cc:6:26: error: 'c' was not declared in this scope 6 | cin >> a >> b >> c >> d; | ^ a.cc:6:31: error: 'd' was not declared in this scope 6 | cin >> a >> b >> c >> d; | ^
s186818097
p03632
C
#include <stdio.h> int main(void) { int a,b,c,d,e; scanf("%d %d %d %d",&a &b &c &d); e = b - c - a; if(e < 0){ e = 0; } printf("%d\n",e); return 0; }
main.c: In function 'main': main.c:5:28: error: invalid operands to binary & (have 'int *' and 'int') 5 | scanf("%d %d %d %d",&a &b &c &d); | ~~ ^ | | | int *
s326866190
p03632
C
#include <stdio.h> int main(void) { int a,b,c,d,e; scanf("%d%d%d%d",&a&b&c&d); e = b - c - a; if(e < 0){ e = 0; } printf("%d\n",e); return 0; }
main.c: In function 'main': main.c:5:24: error: invalid operands to binary & (have 'int *' and 'int') 5 | scanf("%d%d%d%d",&a&b&c&d); | ~~^ | | | int *
s109681463
p03632
C++
#include <iostream> #include <vector> using namespace std; int main(){ bool v[100]; for(int i=0;i<100;i++) v[i]=true; int a,b,c,d; int count=0; cin>>a>>b>>c>>d; for(int i=a;i<=b;i++){ for(int j=c;j<=d;j++){ if(i==j){ count++; } } } cout<<count<<endl; } } }
a.cc:22:1: error: expected declaration before '}' token 22 | } | ^ a.cc:24:3: error: expected declaration before '}' token 24 | } | ^
s894461605
p03632
C++
#include <iostream> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int time; if(b<c || d<a){ time = 0; } if(b==c || ) if(a<=c && c<=b && b<=d){ time = b-c; } if(c<=a && a<=d && d<=b){ time = d-a; } if(a<=c && d<=b){ time = d-c; } if(c<a && b<d){ time = b-a; } cout << time << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:20: error: expected primary-expression before ')' token 10 | if(b==c || ) | ^
s228521283
p03632
C++
#include<cstdio> int a,b,c; int main() { scanf("%d%d%d%d",&a,&b,&c,&d); if (b>a+c)printf("%d",min(d,b-a-c)); else printf("0"); }
a.cc: In function 'int main()': a.cc:5:36: error: 'd' was not declared in this scope 5 | scanf("%d%d%d%d",&a,&b,&c,&d); | ^ a.cc:6:31: error: 'min' was not declared in this scope; did you mean 'main'? 6 | if (b>a+c)printf("%d",min(d,b-a-c)); | ^~~ | main
s968034752
p03632
C++
#include <iostream> #include <vector> using namespace std; int main(){ bool v[100]; for(int i=0;i<100;i++) v[i]=true; int a,b,c,d; int count=0; cin>>a>>b>>c>>d; for(int i=a;i<=b;i++){ for(int j=c;j<=d;j++){ if(i==j){ count++; } cour<<count<<endl; } } }
a.cc: In function 'int main()': a.cc:18:1: error: 'cour' was not declared in this scope 18 | cour<<count<<endl; | ^~~~
s530905582
p03632
C
#include<stdio.h> int main(void){ int A,B,C,D; scanf("%d %d %d %d",&A,&B,&C,&D); if(A<C){ if(B<D){ printf(""%d\n,B-C); } else { printf("%d\n",D-C); } } else{ if(B<D){ printf("%d",B-A); } else{ printf("%d",D-A); } } return 0; }
main.c: In function 'main': main.c:7:16: error: stray '\' in program 7 | printf(""%d\n,B-C); | ^ main.c:7:15: error: 'd' undeclared (first use in this function) 7 | printf(""%d\n,B-C); | ^ main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in main.c:7:16: error: expected ')' before 'n' 7 | printf(""%d\n,B-C); | ~ ^~ | )
s425518913
p03632
C++
#include<iostream> #inlcude<cstring> using namespace std; int main() { int A,B,C,D,sum=0; int a[100]={0}; cin>>A>>B>>C>>D; for(int i=0;i<=110;i++) { if(i>=A&&i<B) a[i]++; if(i>=C&&i<D) a[i]++; } for(int i=0;i<=110;i++) { if(a[i]==2) sum++; } cout<<sum<<endl; }
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include? 2 | #inlcude<cstring> | ^~~~~~~ | include
s768874852
p03632
C++
#include<iostream> #inlcude<cstring> using namespace std; int main() { int A,B,C,D,sum=0; int a[100]={0}; while(cin>>A>>B>>C>>D) { memset(a,0,sizeof(a)); sum=0; for(int i=0;i<=110;i++) { if(i>=A&&i<B) a[i]++; if(i>=C&&i<D) a[i]++; } for(int i=0;i<=110;i++) { if(a[i]==2) sum++; } cout<<sum<<endl; } }
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include? 2 | #inlcude<cstring> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:10:17: error: 'memset' was not declared in this scope 10 | memset(a,0,sizeof(a)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | #inlcude<cstring>
s616711562
p03632
C++
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); int a,b,c,d; while(cin>>a>>b>>c>>d) { int ans ; if(a<=c&&b>=d) { ans = d-c; } else if(a>=c&&b<=d) { ans = b-a; } else if(b<d) { ans = b-c; } else { ans = d-a; } ans = (abs)ans; cout<<ans<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:27:27: error: cannot resolve overloaded function 'abs' based on conversion to type 'int' 27 | ans = (abs)ans; | ^
s678000869
p03632
C++
#include<cstdio>#include<cstdio> #include<algorithm> int main() { int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); if(c > b) printf("0\n"); else if(b > c && b <= d && c >= a) { printf("%d\n",b-c); } else if(b > c && b <= d && c <= a) { printf("%d\n",b-a); } else if(b > c && d <= b && c >= a) { printf("%d\n",d-c); } else if(b > c && d <= b && a >= c) { printf("%d\n",d-a); } return 0; }> int main() { int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); if(c >= b) printf("0\n"); if(b > c && b <= d && c >= a) { printf("%d\n",b-c); } if(b > c && b <= d && c <= a) { printf("%d\n",b-a); } if(b > c && d <= b && c >= a) { printf("%d\n",d-c); } if(b > c && d <= b && a >= c) { printf("%d\n",d-a); } return 0; }
a.cc:1:17: warning: extra tokens at end of #include directive 1 | #include<cstdio>#include<cstdio> | ^ a.cc:26:2: error: expected unqualified-id before '>' token 26 | }> | ^
s198209809
p03632
Java
import java.util.*; impiort java.io.*; class test { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int d=sc.nextInt(); int min=Math.min(a,c); int max=Math.max(b,d); int ans=max-min; if(ans<0) { System.out.println("0"); } else System.out.println(ans); sc.close(); } }
Main.java:2: error: class, interface, enum, or record expected impiort java.io.*; ^ 1 error
s957440363
p03632
C++
#include<iostream> using namespace std; int main(){ int,a,b,c,d; cin>>a>>b>>c>>d; int ans=0; int flag=0; if(a>b) flag=a; else flag=b; if(c>d) ans=d-flag; else ans=c-flag; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:5:6: error: expected unqualified-id before ',' token 5 | int,a,b,c,d; | ^
s435865568
p03632
C++
#include<iostream> using namespace std; int main(){ int,a,b,c,d; cin>>a>>b>>c>>d; int ans=0; int flag=0; if(a>b) flag=a; else flag=b; if(c>d) ans=d-flag; else ans=c-flag; return 0; }
a.cc: In function 'int main()': a.cc:4:6: error: expected unqualified-id before ',' token 4 | int,a,b,c,d; | ^
s233869492
p03632
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int A = in.nextInt(); int B = in.nextInt(); int C = in.nextInt(); int D = in.nextInt(); int start = Math.max(A, C); int end = Math.min(B, D); if((A <= start)&&(start <= B)&&(C <= start)&&(start <= D)&&(A <= end)&&(end <= B)&&(C <= end)&&(end <= D)){ System.out.println(end - start); } else{ System.out.println("0"); } in.close();
Main.java:23: error: reached end of file while parsing in.close(); ^ 1 error
s357650985
p03632
C++
#include <bits/stdc++.h> using namespace std; int main(){ cin.sync_with_stdio(0); cin.tie(0); int a, b, c, d; cin >> a >> b >> c >> d; int maxbeg = max(a, c); int mined = min(b, d); int ans = max(0, mined - maxbeg); cout << ed; return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: 'ed' was not declared in this scope; did you mean 'd'? 12 | cout << ed; | ^~ | d
s668364092
p03632
C++
// problem // Created by 聂小楠 on 2017/8/12. // All rights reserved. #include<bits/stdc++.h> #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<queue> #include<vector> #include<functional> #define endl '\n' #define ll long long #define pii pair<int,int> #define MAX_N 1000 #define Mem(a,b) memset(a,b,sizeof(a)) #define FREI freopen("in.txt","r",stdin) #define FREO freopen("out.txt","w",stdout) #define INF 2147483647 using namespace std; const ll mod =1e9+7; int a[105]; int ans[105][105]; int main() { std::ios::sync_with_stdio(false); int a,b,c,d; cin>>a>>b>>c>>d; int ans=0; if(a<=c&&b>=d) ans=d-c; if(a<=c&&b=<d) ans=b-c; if(a>=c&&b>=d) ans=d-a; if(a>=c&&b=<d) ans=b-a; if(ans<0) ans=0; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:33:15: error: expected primary-expression before '<' token 33 | if(a<=c&&b=<d) | ^ a.cc:37:15: error: expected primary-expression before '<' token 37 | if(a>=c&&b=<d) | ^
s372522784
p03632
C++
// LINK ZADATKA:http://abc070.contest.atcoder.jp/tasks/abc070_b #include <queue> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <complex> #include <fstream> #include <cstring> #include <string> #include <climits> using namespace std; typedef long long ll; typedef complex<double> point; typedef pair<int,int> ii; typedef vector<int> vi; typedef vector< vector<int> > vvi; #define FOR(k,a,b) for(int k=(a); k<=(b); ++k) #define REP(k,a) for(int k=0; k<(a);++k) #define SZ(a) int((a).size()) #define ALL(c) (c).begin(),(c).end() #define PB push_back #define MP make_pair #define INF 999999999 #define INFLONG 1000000000000000000 #define MOD 1000000007 #define MAX 100 #define ITERS 100 #define MAXM 200000 #define MAXN 1000000 #define _gcd __gcd #define eps 1e-9 int polje[110], start, end; int main(){ int a, b, c, d; scanf("%d %d %d %d", &a, &b, &c, &d); FOR(i, a, b) polje[i]++; FOR(i, c, d) polje[i]++; FOR(i, 0, 100){ //printf("%d ", polje[i]); if(polje[i] == 2 && !start){ start = i; } if(polje[i] != 2 && start && !end){ end = i-1; } } //printf("%d %d\n", start, end); printf("%d\n", end-start); }
a.cc: In function 'int main()': a.cc:65:47: error: reference to 'end' is ambiguous 65 | if(polje[i] != 2 && start && !end){ | ^~~ In file included from /usr/include/c++/14/deque:68, from /usr/include/c++/14/queue:62, from a.cc:3: /usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 116 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept; | ^~~ /usr/include/c++/14/bits/range_access.h:115:31: note: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 115 | template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept; | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ In file included from /usr/include/c++/14/bits/stl_deque.h:63, from /usr/include/c++/14/deque:66: /usr/include/c++/14/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ a.cc:52:24: note: 'int end' 52 | int polje[110], start, end; | ^~~ a.cc:66:25: error: reference to 'end' is ambiguous 66 | end = i-1; | ^~~ /usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 116 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept; | ^~~ /usr/include/c++/14/bits/range_access.h:115:31: note: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 115 | template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept; | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ a.cc:52:24: note: 'int end' 52 | int polje[110], start, end; | ^~~ a.cc:70:24: error: reference to 'end' is ambiguous 70 | printf("%d\n", end-start); | ^~~ /usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 116 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept; | ^~~ /usr/include/c++/14/bits/range_access.h:115:31: note: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 115 | template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept; | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ a.cc:52:24: note: 'int end' 52 | int polje[110], start, end; | ^~~
s719320459
p03632
C++
/** * * Author: Mouhanad * Lang: GNU C++14 * **/ #include<bits/stdc++.h> using namespace std; #define F first #define S second #define ii pair < int , int > #define LS pair < ll , string > typedef long long ll; const int inf = 1<<30; const int N =100100; int n , a[N] , q ; int main ( ){ int a , b , c , d ; cin >> a >> b >> c >> d ; if ( c > b || a > d ) cout <<0; else if ( a >= c && b <= d ) cout << b - a; else if ( c >= a && d <= b) cout << d - c cout << min(b,d) - max(a,c); return 0 ; }
a.cc: In function 'int main()': a.cc:24:44: error: expected ';' before 'cout' 24 | else if ( c >= a && d <= b) cout << d - c | ^ | ; 25 | cout << min(b,d) - max(a,c); | ~~~~
s872582349
p03632
C++
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> #include<ctime> #include<queue> using namespace std; int a,b,c,d; int tot; int main() { cin>>a>>b>>c>>d; for(int i=0;i<=101;i++) { if(i>=a&&i<=b&&i>=c&&i<=d)tot++; } cout<<max(tot-1,0)2; return 0; }
a.cc: In function 'int main()': a.cc:18:27: error: expected ';' before numeric constant 18 | cout<<max(tot-1,0)2; | ^ | ;
s874269688
p03632
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define RI(a) scanf("%d",&a) #define RII(a,b) scanf("%d%d",&a,&b) #define RIII(a,b,c) scanf("%d%d%d",&a,&b,&c) #define IOS ios_base::sync_with_stdio(0); cin.tie(0) #define ALL(a) a.begin(),a.end() #define F first #define S second #define REP(i,n) for(int i=0;i<(n);i++) #define pb push_back #ifdef leowang #define debug(...) do{\ fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\ _DO(__VA_ARGS__);\ }while(0) template<typename I> void _DO(I&&x){cerr<<x<<endl;} template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);} #else #define debug(...) #endif //}}} const ll maxn=100005; const ll maxlg=__lg(maxn)+2; const ll INF64=8000000000000000000LL; const int INF=2000000000;   int main() { int a,b,c,d; cin>>a>>b>>c>>d; cout<<max(0,min(b,d)-max(a,c)); return 0; }
a.cc:29:1: error: extended character   is not valid in an identifier 29 |   | ^ a.cc:29:1: error: '\U000000a0' does not name a type 29 |   | ^
s592534877
p03632
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int ans = min(b, d) - max(a, c)aa#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int ans = min(b, d) - max(a, c); cout << (ans > 0 ? ans : 0) << endl; return 0; } ; cout << (ans > 0 ? ans : 0) << endl; return 0; }
a.cc:12:38: error: stray '#' in program 12 | int ans = min(b, d) - max(a, c)aa#include <iostream> | ^ a.cc: In function 'int main()': a.cc:12:36: error: expected ',' or ';' before 'aa' 12 | int ans = min(b, d) - max(a, c)aa#include <iostream> | ^~ a.cc:18:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 18 | int main() | ^~ a.cc:18:9: note: remove parentheses to default-initialize a variable 18 | int main() | ^~ | -- a.cc:18:9: note: or replace parentheses with braces to value-initialize a variable a.cc:19:1: error: a function-definition is not allowed here before '{' token 19 | { | ^
s535507096
p03632
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int ans = min(b, d) - max(a, c)a; cout << (ans > 0 ? ans : 0) << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:36: error: expected ',' or ';' before 'a' 12 | int ans = min(b, d) - max(a, c)a; | ^
s103410085
p03632
C++
#include <bits/stdc++.h> using namespace std; typedef int64_t ll; struct Solution { void solve(std::istream& in, std::ostream& out) { ll A, B, C, D; in >> A >> B >> C >> D; out << max(0LL, min(D, B) - max(C, A)) << endl; } }; void solve(std::istream& in, std::ostream& out) { out << std::setprecision(12); Solution solution; solution.solve(in, out); } #include <fstream> #include <iostream> int main() { ios_base::sync_with_stdio(0); cin.tie(0); istream& in = cin; ostream& out = cout; solve(in, out); return 0; }
a.cc: In member function 'void Solution::solve(std::istream&, std::ostream&)': a.cc:8:19: error: no matching function for call to 'max(long long int, long int)' 8 | out << max(0LL, min(D, B) - max(C, A)) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:8:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long int') 8 | out << max(0LL, min(D, B) - max(C, A)) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:8:19: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 8 | out << max(0LL, min(D, B) - max(C, A)) << endl; | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
s290488492
p03632
C++
#include <bits/stdc++.h> using namespace std; #define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++) #define rep(x,to) for(int (x)=0;(x)<(to);(x)++) #define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--) #define all(c) (c).begin(),(c).end() #define sz(v) (int)(v).size() typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii; const ll mod = 1e9+7; bool chpal(string s){ int n=sz(s); rep(i,n/2) if(s[i]!=s[n-1-i]) return false; return true; } int main() { //cin.tie(0); ios_base::sync_with_stdio(false); int a,b,c,d; cin >>a >>b >>c >>d; int mn = max(a,c); int mx = min(b,d); cout<< max(0,mx-mn) <<"\n"; return 0; } #include <bits/stdc++.h> using namespace std; #define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++) #define rep(x,to) for(int (x)=0;(x)<(to);(x)++) #define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--) #define all(c) (c).begin(),(c).end() #define sz(v) (int)(v).size() typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii; const ll mod = 1e9+7; bool chpal(string s){ int n=sz(s); rep(i,n/2) if(s[i]!=s[n-1-i]) return false; return true; } int main() { //cin.tie(0); ios_base::sync_with_stdio(false); int a,b,c,d; cin >>a >>b >>c >>d; int mn = max(a,c); int mx = min(b,d); cout<< max(0,mx-mn) <<"\n"; return 0; }
a.cc:43:10: error: redefinition of 'const ll mod' 43 | const ll mod = 1e9+7; | ^~~ a.cc:12:10: note: 'const ll mod' previously defined here 12 | const ll mod = 1e9+7; | ^~~ a.cc:45:14: error: redefinition of 'bool chpal(std::string)' 45 | bool chpal(string s){ | ^~~~~ a.cc:14:14: note: 'bool chpal(std::string)' previously defined here 14 | bool chpal(string s){ | ^~~~~ a.cc:51:5: error: redefinition of 'int main()' 51 | int main() | ^~~~ a.cc:20:5: note: 'int main()' previously defined here 20 | int main() | ^~~~
s971189932
p03632
C++
#include<string> #include<deque> #include<queue> #include<vector> #include<algorithm> #include<iostream> #include<set> #include<cmath> #include<tuple> #include<chrono> #include<functional> #include<iterator> #include<random> #include<unordered_set> #include<array> #include<map> using namespace std; typedef long long int llint; #define mp make_pair #define mt make_tuple #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define fir first #define sec second #define res resize #define ins insert #define era erase const int mod=1000000007; const llint big=1e18+10; const long double pai=3.141592653589793238462643383279502884197; const long double eps=1e-9; template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}} template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}} llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);} llint lcm(llint a,llint b){return a/gcd(a,b)*b;} int main(void){ llint a,b,c,d; cin>>a>>b>>c>>d; cout<<max(min(c,d)-min(a,b),0)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:41:18: error: no matching function for call to 'max(long long int, int)' 41 | cout<<max(min(c,d)-min(a,b),0)<<endl; | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:41:18: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 41 | cout<<max(min(c,d)-min(a,b),0)<<endl; | ~~~^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:41:18: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 41 | cout<<max(min(c,d)-min(a,b),0)<<endl; | ~~~^~~~~~~~~~~~~~~~~~~~~
s357284807
p03632
C++
/* Success may not come to me immediately, * but it will come definitely.... */ #include<bits/stdc++.h> //===================================================================== using namespace std; //===================================================================== #define opt ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); //===================================================================== #define li int64_t #define ld double_t #define ulli uint64_t //===================================================================== #define rep(i,a,b) for(i=a;i<b;i++) #define repr(i,a,b) for(i=a;i>b;i--) #define repi(i,v) for(i=v.begin();i!=v.end();i++) #define elif else if #define mset(a,b) memset(a,b,sizeof(a)) #define nl cout<<'\n' //===================================================================== typedef vector<li> vli; typedef vector<string> vstr; typedef pair<li,li> pli; typedef pair<li,pli > ppli; typedef pair<li,ppli > pppli; typedef vector<pli > vpl; typedef vector<ppli > vppli; typedef vector<pppli > vpppli; //===================================================================== #define pb push_back #define pob pop_back #define pf push_front #define pof pop_front #define all(v) v.begin(),v.end() #define itr iterator #define sz size() #define lb lower_bound #define ub upper_bound #define bs binary_search #define mp make_pair #define F first #define S second //===================================================================== #define mod (li)(1e9+7) #define inf (li)(1e18) #define MX1 (li)(1e5+5) #define MX2 (li)(1e6+5) #define pi acos(-1) //===================================================================== li power(li a,li b){li ans=1;while(b){if(b&1){ans=(ans*a)%mod;} a=(a*a)%mod;b>>=1;}return ans;} //===================================================================== li mmi(li n){return power(n,mod-2);} //===================================================================== li two(li n){return (1LL<<n);} //===================================================================== void onbit(li &n,li x){n|=two(x);} //===================================================================== void offbit(li &n,li x){n&=~two(x);} //===================================================================== li cntbit(li n){li res=0;while(n and ++res)n-=n&-n;return res;} //===================================================================== li dx[]={-1,0,1,0},dy[]={0,-1,0,1}; //===================================================================== /*------------------------MAIN CODE BEGINS NOW!------------------------*/ void solve(){ li a,b,c,d; cin>>a>>b>>c>>d; li ans=0; li cnt1=0,cnt2=0; rep(i,0,max(b,d)+1){ if(i==a) cnt1=1; if(i==c) cnt2=1; if(i==b+1) cnt1=0; if(i==d+1) cnt2=0; if(cnt1 and cnt2) ans++; } cout<<ans; } int main(){ opt #ifndef ONLINE_JUDGE // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); #endif li t=1; //cin>>t; while(t--){ solve(); } return 0; }
a.cc: In function 'void solve()': a.cc:72:7: error: 'i' was not declared in this scope 72 | rep(i,0,max(b,d)+1){ | ^ a.cc:14:25: note: in definition of macro 'rep' 14 | #define rep(i,a,b) for(i=a;i<b;i++) | ^
s320554121
p03632
Java
package main.tasks; import lib.io.MyInput; import java.io.PrintWriter; public class TaskB { public void solve(int testNumber, MyInput in, PrintWriter out) { int a = in.nextInt(); int b = in.nextInt(); int c = in.nextInt(); int d = in.nextInt(); int x = Math.max(Math.min(b,d)-Math.max(a,b), 0); out.println(x); } }
Main.java:6: error: class TaskB is public, should be declared in a file named TaskB.java public class TaskB { ^ Main.java:3: error: package lib.io does not exist import lib.io.MyInput; ^ Main.java:7: error: cannot find symbol public void solve(int testNumber, MyInput in, PrintWriter out) { ^ symbol: class MyInput location: class TaskB 3 errors
s532817890
p03632
C++
#include<map> #include<set> #include<list> #include<cmath> #include<queue> #include<stack> #include<cstdio> #include<string> #include<vector> #include<complex> #include<cstdlib> #include<cstring> #include<numeric> #include<sstream> #include<iostream> #include<algorithm> #include<functional> #define mp make_pair #define pb push_back #define all(x) (x).begin(),(x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define Yes() printf("Yes\n") #define No() printf("No\n") using namespace std; #define int long long //typedef long long ll; typedef unsigned long long ull; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef pair<int,int> P; const int INF=1e+9; const double EPS=1e-9; const int MOD=1000000007; const int dx[]={1,0,-1,0},dy[]={0,-1,0,1}; signed main(){ int a,b,c,d,ans; cin >> a >> b >> c >> d; ans = min(c,d) - max(a,b); cout << max(ans,0) << endl; return 0; }
a.cc: In function 'int main()': a.cc:48:20: error: no matching function for call to 'max(long long int&, int)' 48 | cout << max(ans,0) << endl; | ~~~^~~~~~~ In file included from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:48:20: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 48 | cout << max(ans,0) << endl; | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:16: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:48:20: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 48 | cout << max(ans,0) << endl; | ~~~^~~~~~~
s079968658
p03633
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,i,z,c=0; long long z=0,t[101]; cin>>n; for(i=0;i<n;i++){ cin>>t[i]; c=max({z,t[i]}); } if(c<=1000000000000000000){ for(i=0;i<n-1;i++){ z=t[i]/__gcd(t[i],t[i+1])*t[i+1]; } cout<<z<<'\n'; } if(c>1000000000000000000){ cout<<1000000000000000000<'\n'; } return 0; }
a.cc: In function 'int main()': a.cc:5:14: error: conflicting declaration 'long long int z' 5 | long long z=0,t[101]; | ^ a.cc:4:12: note: previous declaration as 'int z' 4 | int n,i,z,c=0; | ^ a.cc:9:12: error: no matching function for call to 'max(<brace-enclosed initializer list>)' 9 | c=max({z,t[i]}); | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed: a.cc:9:12: note: deduced conflicting types for parameter '_Tp' ('int' and 'long long int') 9 | c=max({z,t[i]}); | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided a.cc:18:32: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'char') 18 | cout<<1000000000000000000<'\n'; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ | | | | | char | std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>} a.cc:18:32: note: candidate: 'operator<(int, int)' (built-in) 18 | cout<<1000000000000000000<'\n'; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ a.cc:18:32: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:18:33: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:18:33: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:18:33: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | cout<<1000000000000000000<'\n'; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: n
s857673913
p03633
C++
#include <bits/stddc++.h> using namespace std; signed gcd(long long x, long long y) { if (y == 0)return x; return gcd(y, x % y); } signed lcm(long long x, long long y) { return x / gcd(x, y) * y; } int main(){ long long N; long long ans=0; for(int i=0;i<N;i++){ long long a;cin>>a; ans=lcm(a,ans); } cout<<ans<<endl; }
a.cc:1:10: fatal error: bits/stddc++.h: No such file or directory 1 | #include <bits/stddc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s286271144
p03633
C++
#include <bits/stdc++.h> using namespace std; #define ll long long ll gcd(ll a, ll b) { if(b = 0) return a; else return gcd(a, a%b); } ll lcm(ll a, ll b){ if(b > a) swap(a,b); ll g = gcd(a, b); return a * b / g; } void solve(){ int n; cin >> n; ll t[n]; ll ans = 1; for(int i == 0; i < n; ++i) { cin >> t[i]; ans = lcm(ans, t[i]); } cout << ans << endl; } int main(){ solve(); return 0; }
a.cc: In function 'void solve()': a.cc:19:12: error: expected ';' before '==' token 19 | for(int i == 0; i < n; ++i) { | ^~~ | ; a.cc:19:13: error: expected primary-expression before '==' token 19 | for(int i == 0; i < n; ++i) { | ^~ a.cc:19:24: error: expected ')' before ';' token 19 | for(int i == 0; i < n; ++i) { | ~ ^ | ) a.cc:19:28: error: 'i' was not declared in this scope 19 | for(int i == 0; i < n; ++i) { | ^
s462755549
p03633
C++
#include <bits/stdc++.h> using namespace std #define ll long long ll gcd(ll a, ll b) { if(b = 0) return a; else return gcd(a, a%b); } ll lcm(ll a, ll b){ if(b > a) swap(a,b); ll g = gcd(a, b); return a * b / g; } void solve(){ int n; cin >> n; ll t[n]; ll ans = 1; for(int i = 0; i < n; ++i) { cin >> t[i]; ans = lcm(ans, t[i]); } cout << ans << endl; } int main(){ solve(); return 0; }
a.cc:2:20: error: expected ';' before 'long' 2 | using namespace std | ^ | ;
s594594486
p03633
C++
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i,n) for(int i=0;i<(n);++i) #define repi(i,a,b) for(int i=int(a);i<int(b);++i) #define all(x) (x).begin(), (x).end() #define PI 3.14159265358979323846264338327950L using namespace std; typedef long long ll; typedef long double ld; ll GCD(ll a,ll b){ if(b==0) return a; return GCD(b,a%b); } int main() { int n; cin>>n; vector<ll> a(n); ll lcm,gcd; rep(i,n){ cin>>a[i]; if(i==0) r=a[i],lcm=a[i]; else{ gcd=GCD(lcm,a[i]); lcm=(lcm/gcd)*a[i]; } } cout<<lcm; }
a.cc: In function 'int main()': a.cc:21:18: error: 'r' was not declared in this scope 21 | if(i==0) r=a[i],lcm=a[i]; | ^
s796074147
p03633
C++
#include <iostream> using namespace std; int gcd(int a, int b) { if (a%b == 0) { return(b); } else { return(gcd(b, a%b)); } } int lcm(int a, int b) { return a * b / gcd(a, b); } int main(){ int n; cin >> n; ll ans = 1; for(int i=0; i<n; i++){ ll num; cin >> num; ans = lcm(ans, num); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:24:3: error: 'll' was not declared in this scope 24 | ll ans = 1; | ^~ a.cc:26:7: error: expected ';' before 'num' 26 | ll num; | ^~~~ | ; a.cc:27:12: error: 'num' was not declared in this scope; did you mean 'enum'? 27 | cin >> num; | ^~~ | enum a.cc:28:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 28 | ans = lcm(ans, num); | ^~~ | abs a.cc:30:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 30 | cout << ans << endl; | ^~~ | abs
s335140651
p03633
C++
#include <bits/stdc++.h> using namespace std; typedef unsigned long long int ll; int n; ll a[n]; ll findGCD(ll a, ll b){ if(b==0) return a; return findGCD(b,a%b); } int main() { cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } ll lcm=a[0]; for(int i=1;i<n;i++){ ll b; b = findGCD(lcm,a[i]); lcm= lcm/b*a[i]; } cout<<lcm; }
a.cc:5:6: error: size of array 'a' is not an integral constant-expression 5 | ll a[n]; | ^
s065707537
p03633
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>; template<class T,class U> using umap = unordered_map<T,U>; template<class T> using uset = unordered_set<T>; template<class T> bool ChangeMax(T&a,const T&b){ if(a >= b) return false; a = b; return true; } template<class T> bool ChangeMin(T&a,const T&b){ if(a <= b) return false; a = b; return true; } template<class T, size_t N, class U> void Fill(T (&a)[N], const U&v){ fill((U*)a,(U*)(a+N),v); } template<class T> istream& operator >> (istream&is, vector<T>&v){ for(auto&e:v)is >> e; return is; } llgcd(ll x, ll y){ if(y == 0)return x; return gcd(y, x % y); } ll lcm(ll a,ll b){return a*b/gcd(a,b);} int main(){ int n; cin >> n; ll ans = 1; for(int i = 0; i < n; ++i){ ll x; cin >> x; ans = lcm(ans,x); } cout << ans << endl; }
a.cc:39:1: error: ISO C++ forbids declaration of 'llgcd' with no type [-fpermissive] 39 | llgcd(ll x, ll y){ | ^~~~~
s758627283
p03633
C++
// C++ program to find LCM of two numbers #include <iostream> #include <vector> #include <numeric> #define REP(i, n) for(int i = 0; i < n; i++) #define REPONE(i, n) for(int i = 1; i < n; i++) #define ld long double #define ll long long using namespace std; // Driver program to test above function int main() { int n; cin >> n; vector<ll> time; ll t; REP(i, n) { cin >> t; time.push_back(t); } ll ans = time[0]; ld tmp; REPONE(i, n) { tmp = ((ld)ans * (ld)time[i]) ans = tmp/ gcd((ll)ans, (ll)time[i]); // ans = lcm(ans, time[i]); } cout << (ll)ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:28:38: error: expected ';' before 'ans' 28 | tmp = ((ld)ans * (ld)time[i]) | ^ | ; 29 | ans = tmp/ gcd((ll)ans, (ll)time[i]); | ~~~
s621713665
p03633
C++
// C++ program to find LCM of two numbers #include <iostream> #include <vector> #include <numeric> #define REP(i, n) for(int i = 0; i < n; i++) #define REPONE(i, n) for(int i = 1; i < n; i++) #define ld long double #define ll long long using namespace std; // Driver program to test above function int main() { int n; cin >> n; vector<ll> time; ll t; REP(i, n) { cin >> t; time.push_back(t); } ll ans = time[0]; REPONE(i, n) { tmp = ((ld)ans * (ld)time[i]) ans = tmp/ gcd((ll)ans, (ll)time[i]); // ans = lcm(ans, time[i]); } cout << (ll)ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:27:9: error: 'tmp' was not declared in this scope; did you mean 'tm'? 27 | tmp = ((ld)ans * (ld)time[i]) | ^~~ | tm
s062790794
p03633
Java
import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Queue; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { execute18_1(); } private static void execute18_1() { try (Scanner sc = new Scanner(System.in)) { int n = sc.nextInt(); long[] t= new long[n]; for(int i=0;i<n;i++) { t[i] = sc.nextLong(); } long ans=t[0]; for(int i=1;i<n;i++) { ans=lcm2(ans, t[i]); } System.out.println(ans); } } private static long gcd2(long a, long b) { if (b == 0) return a; return gcd(b, a % b); } private static long lcm2(long m, long n) { return m / gcd2(m, n) * n; } }
Main.java:42: error: cannot find symbol return gcd(b, a % b); ^ symbol: method gcd(long,long) location: class Main 1 error
s597978624
p03633
Java
import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Queue; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { execute18_1(); } private static void execute18_1() { try (Scanner sc = new Scanner(System.in)) { int n = sc.nextInt(); long[] t= new long[n]; for(int i=0;i<n;i++) { t[i] = sc.nextLong(); } long ans=t[0]; for(int i=1;i<n;i++) { ans=lcm2(ans, t[i]); } System.out.println(ans); } } private static long gcd2(long a, long b) { if (b == 0) return a; return gcd(b, a % b); } private static long lcm2(long m, long n) { return m / gcd2(m, n) * n; } }
Main.java:42: error: cannot find symbol return gcd(b, a % b); ^ symbol: method gcd(long,long) location: class Main 1 error
s326880859
p03633
Java
public class Main { public static void main(String[] args) { execute18_1(); } private static void execute18_1() { try (Scanner sc = new Scanner(System.in)) { int n = sc.nextInt(); long[] t= new long[n]; for(int i=0;i<n;i++) { t[i] = sc.nextLong(); } long ans=t[0]; for(int i=1;i<n;i++) { ans=k(ans, t[i]); } System.out.println(ans); } } private static long k(long x, long y) { long min = Math.min(x, y); long max =Math.max(x, y); if(max%y==0) return max; long temp; while ((temp = max % min) != 0) { min = max; max = temp; } return x*y/min; } }
Main.java:9: error: cannot find symbol (Scanner sc = new Scanner(System.in)) { ^ symbol: class Scanner location: class Main Main.java:9: error: cannot find symbol (Scanner sc = new Scanner(System.in)) { ^ symbol: class Scanner location: class Main 2 errors
s611356310
p03633
C++
//https://atcoder.jp/contests/abc070/tasks/abc070_c #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pint; typedef pair<ll,ll> pll; typedef pair<int,pint> ppint; typedef pair<ll,pll> ppll; typedef vector<int> vint; typedef vector<ll> vll; const double pi=3.141592653589793; const int INF10 = 1000000001; const ll INF15 = 1e15 +1; const long long INF18 = 1e18 + 1; const int mod = 1000000007; //const int mod = 998244353; const double EPS=0.00001; #define rep(i, n) for (int i = 0; i < (ll)(n); i++) #define rep1(i, n) for (int i = 1; i <= (ll)(n); i++) #define rep2(i,start,end) for(int i=(ll)start;i<=(ll)end;i++) #define vrep(i, n) for(int i=(ll)n-1;i>=0;i--) #define vrep1(i, n) for(int i=(ll)n;i>0;i--) #define all(n) n.begin(),n.end() #define pb push_back #define debug(x) cerr << #x <<": " << x << '\n' #define arep(it,a) for(auto it : a ) struct edge{ edge(int s,int e,long long c){ to=e;from=s;cost=c; } edge(int i,long long c=1){ edge(-1,i,c); } int from; int to; long cost; }; typedef vector<edge> edges; //bを何回足せばaを超えるか(O(a/b)) //a+b-1/bとすればよし //2進数表示したときの最高桁(O(log n)) int bi_max(long n){ int m = 0; for (m; (1 << m) <= n; m++); m = m - 1; return m; } //bi_eに二進数表示したやつを代入(O(log^2 n)) //bitset<N> a(n)でnの二進数表示が得られて、a[i]=0or1でi番目のfragが立ってるかわかる //x^n mod m (nが負の時は0)(O(log n)) long myPow(long x, long n, long m=mod){ if (n < 0) return 0; if (n == 0) return 1; if (n % 2 == 0) return myPow(x * x % m, n / 2, m); else return x * myPow(x, n - 1, m) % m; } // auto mod int // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4807 : optimize // https://youtu.be/8uowVvQ_-Mo?t=1329 : division struct mint{ ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint &operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint &operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { return mint(*this) += a; } mint operator-(const mint a) const { return mint(*this) -= a; } mint operator*(const mint a) const { return mint(*this) *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint &operator/=(const mint a) { return *this *= a.inv(); } mint operator/(const mint a) const { return mint(*this) /= a; } bool operator!=(const int a) { return this->x!=a; } bool operator==(const int a) { return this->x==a; } }; istream &operator>>(istream &is, const mint &a) { return is >> a.x; } ostream &operator<<(ostream &os, const mint &a) { return os << a.x; } // combination mod prime // https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619 struct combination{ vector<mint> fact, ifact; combination(int n) : fact(n + 1), ifact(n + 1) { assert(n < mod); fact[0] = 1; for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i; ifact[n] = fact[n].inv(); for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i; } mint operator()(int n, int k) { if (k < 0 || k > n) return 0; return fact[n] * ifact[k] * ifact[n - k]; } }; template<class T> bool maxin (T &a,T b){if(a<b){a=b;return 1;}return 0;} template<class T> bool minin (T &a,T b){if(a>b){a=b;return 1;}return 0;} template<class M,class N> common_type_t<M,N> gcd(M a,N b){ a=abs(a);b=abs(b); if(a < b) return gcd(b, a); M r; while ((r=a%b)) { a = b; b = r; } return b; } template<class M,class N> common_type_t<M,N> lcm(M a,N b){ return (a/gcd(a,b))*b; } const int N_MAX=100005; int n; vll a; void Main(){ int x=0,y=INF10,z=1; //入力 cin>>n; ll b; rep(i,n){ cin>>b; a.pb(b); } //処理 if(n==1){ cout << a[0] <<endl; return; } ll ans=lcm(a[0],a[1]); rep(i,n-2){ ans=lcm(ans,a[i+2]); } //出力 cout << ans <<endl; } int main(){ cin.tie(nullptr); cout<<fixed<<setprecision(12); Main(); }
a.cc: In function 'void Main()': a.cc:175:15: error: call of overloaded 'lcm(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)' is ambiguous 175 | ll ans=lcm(a[0],a[1]); | ~~~^~~~~~~~~~~ a.cc:153:20: note: candidate: 'std::common_type_t<_Mn, _Nn> lcm(M, N) [with M = long long int; N = long long int; std::common_type_t<_Mn, _Nn> = long long int]' 153 | common_type_t<M,N> lcm(M a,N b){ | ^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58, from a.cc:2: /usr/include/c++/14/numeric:188:5: note: candidate: 'constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn) [with _Mn = long long int; _Nn = long long int; common_type_t<_Mn, _Nn> = long long int]' 188 | lcm(_Mn __m, _Nn __n) noexcept | ^~~ a.cc:177:16: error: call of overloaded 'lcm(ll&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)' is ambiguous 177 | ans=lcm(ans,a[i+2]); | ~~~^~~~~~~~~~~~ a.cc:153:20: note: candidate: 'std::common_type_t<_Mn, _Nn> lcm(M, N) [with M = long long int; N = long long int; std::common_type_t<_Mn, _Nn> = long long int]' 153 | common_type_t<M,N> lcm(M a,N b){ | ^~~ /usr/include/c++/14/numeric:188:5: note: candidate: 'constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn) [with _Mn = long long int; _Nn = long long int; common_type_t<_Mn, _Nn> = long long int]' 188 | lcm(_Mn __m, _Nn __n) noexcept | ^~~
s001336138
p03633
C++
from math import gcd answer = 1 for _ in range(int(input())): T = int(input()) answer = answer*T//gcd(answer,T) print(answer)
a.cc:1:1: error: 'from' does not name a type 1 | from math import gcd | ^~~~
s783470860
p03633
C++
ll lcm=v[0]; fo1(i,n-1) { lcm/=(__gcd(lcm,v[i])); lcm*=v[i]; } cout<<lcm; // if(vfun()) // cout<<"YES\n"; // else // cout<<"NO\n"; } } ///before sub /// check for value of zero and single input in array ///loop vars,1LL in mult, equal, one, bounds, int v ll, endl, finish taking inputs /// check whether test cases are given or not
a.cc:2:13: error: 'll' does not name a type 2 | ll lcm=v[0]; | ^~ a.cc:3:16: error: expected constructor, destructor, or type conversion before '(' token 3 | fo1(i,n-1) | ^ a.cc:9:13: error: 'cout' does not name a type 9 | cout<<lcm; | ^~~~ a.cc:14:5: error: expected declaration before '}' token 14 | } | ^ a.cc:15:1: error: expected declaration before '}' token 15 | } | ^
s117024795
p03633
C++
def gcd(a, b): if(a == 0): return b return gcd(b % a, a) def lcm(a, b): return a/ gcd(a, b) * b t = int(input()) ans = 1 while(t != 0): t -= 1 n = int(input()) ans = lcm(ans, n) print(int(ans))
a.cc:1:1: error: 'def' does not name a type 1 | def gcd(a, b): | ^~~
s812992171
p03633
C++
def gcd(a, b): if a == 0: return b return gcd(b % a, a) n = (input()) res = (input()) while n > 1: x = (input()) res = (res * x) // gcd(res, x); n -= 1 print(res)
a.cc:1:1: error: 'def' does not name a type 1 | def gcd(a, b): | ^~~
s079730640
p03633
C++
import math n = int(input()) t = [] for i in range(n): p = int(input()) t.append(p) ans = t[0] for i in range(1,n): ans = (ans*t[i]) // math.gcd(ans,t[i]) print(ans)
a.cc:1:1: error: 'import' does not name a type 1 | import math | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s522492864
p03633
C++
import math N = int(input()) T = [int(input()) for _ in range(N)] def lcm(x, y): return (x * y) // math.gcd(x, y) ans = 1 for i in range(N): ans = lcm(ans,T[i]) print(ans)
a.cc:1:1: error: 'import' does not name a type 1 | import math | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s938064238
p03633
C++
//要はT[i]の最小公倍数lcmの求め方。 #include<bits/stdc++.h> using namespace std; int main(){ int N,T; int T[100]; cin >> N >> T; for(int i=0;i<N:i++){ cin >>T[i]; } return 0; }
a.cc: In function 'int main()': a.cc:7:6: error: conflicting declaration 'int T [100]' 7 | int T[100]; | ^ a.cc:6:8: note: previous declaration as 'int T' 6 | int N,T; | ^ a.cc:10:14: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions] 10 | for(int i=0;i<N:i++){ | ^ a.cc:10:17: error: found ':' in nested-name-specifier, expected '::' 10 | for(int i=0;i<N:i++){ | ^ | :: a.cc:10:16: error: 'N' is not a class, namespace, or enumeration 10 | for(int i=0;i<N:i++){ | ^ a.cc:15:1: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~ a.cc:12:3: error: expected ';' before 'return' 12 | } | ^ | ; ...... 15 | return 0; | ~~~~~~ a.cc:15:1: error: expected primary-expression before 'return' 15 | return 0; | ^~~~~~ a.cc:12:3: error: expected ')' before 'return' 12 | } | ^ | ) ...... 15 | return 0; | ~~~~~~ a.cc:10:5: note: to match this '(' 10 | for(int i=0;i<N:i++){ | ^
s705045311
p03633
C++
#include<bits/stdc++.h> using namespace std; using ll=unsigned long long int; #define rep(i,n) for(ll i=0;i<(n);i++) ll gcd(ll a,ll b){ if(a%b==0)return b; else return gcd(b,a%b); } ll lcm(ll a,ll b){ return a/gcd(b,a%b)*b; } ll main(){ ll n; cin>>n; vector<ll>t(n); rep(i,n)cin>>t[i]; sort(t.begin(),t.end()); ll ans=1; rep(i,n){ ans=lcm(ans,t[i]); } cout<<ans<<endl; }
a.cc:15:1: error: '::main' must return 'int' 15 | ll main(){ | ^~
s897189261
p03633
C++
// https://ei1333.github.io/luzhiled/ // http://beet-aizu.hatenablog.com/entry/2017/01/04/113233 // http://www.prefield.com/algorithm/ #include <bits/stdc++.h> constexpr char bn = '\n'; using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vd = vector<ld>; using vs = vector<string>; using vb = vector<bool>; using vvl = vector<vector<ll>>; using vvd = vector<vector<ld>>; using vvs = vector<vector<string>>; using vvb = vector<vector<bool>>; #define pb push_back #define eb emplace_back #define fi first #define se second template<class T> using vc = vector<T>; template<class T> using vvc = vector<vector<T>>; using Graph = vector<vector<ll>>; const ll INF = 1LL << 60; void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);} const ll tl= 1000000007; #define REP(i, n) for (ll i = 0; i < n; i++) #define REREP(i, n) for (ll i = n; i >= 0; i--) #define FOR(i, a, n) for (ll i = a; i < n; i++) #define REFOR(i, n, a) for (ll i = n; i >= a; i--) #define CLR(mat,f) memset(mat, f, sizeof(mat)) #define IN(a, b, x) (a<=x&&x<=b) #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除 #define debug cout << "line : " << __LINE__ << " debug" << endl; #define ini(...) int __VA_ARGS__; in(__VA_ARGS__) #define inl(...) long long __VA_ARGS__; in(__VA_ARGS__) #define ind(...) long double __VA_ARGS__; in(__VA_ARGS__) #define ins(...) string __VA_ARGS__; in(__VA_ARGS__) #define inc(...) char __VA_ARGS__; in(__VA_ARGS__) void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);} void out(){cout << endl;} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);} template<typename T>void die(T x){out(x); exit(0);} #define in1(A) REP(i,A.size()) in(A[i]); #define in2(A,B) REP(i,A.size()) in(A[i],B[i]); #define in3(s,t,u) REP(i,sz(s)){in(s[i] , t[i] , u[i]);} #define in4(s,t,u,v) REP(i,sz(s)){in(s[i] , t[i] , u[i] , v[i]);} #define each(x,v) for(auto& x : v) #define all(v) (v).begin(),(v).end() #define sz(v) ((int)(v).size()) struct Point{ ld x,y; }; ld dist(Point a, Point b){return sqrt(abs(a.x-b.x)*abs(a.x-b.x)+abs(a.y-b.y)*abs(a.y-b.y));} // 2点間の距離 ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; } ll lcm(ll a,ll b){ return a / gcd(a,b) * b;} ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } ll fact(ll n){ if(n < 2) return 1; return (n * fact(n-1))%tl; } //階乗 inline ll updiv(ll a,ll b){ return (a + b - 1) / b; } //切り上げ template <typename T,typename U>ll ceil(T a,U b){return (a + b - 1) / b;} template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); } template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); } #define YES(n) ((n) ? "YES" : "NO" ) #define Yes(n) ((n) ? "Yes" : "No" ) #define yes(n) ((n) ? "yes" : "no" ) //------------------------------------------------------------------------------------------------- int main(){ init(); ll ans= 0; inl(n); vl A(n); in1(A); ans=A[0]; FOR(i,1,n){ ans= ans*/gcd(ans,A[i])*A[i]; } out(ans); }
a.cc: In function 'int main()': a.cc:80:18: error: expected primary-expression before '/' token 80 | ans= ans*/gcd(ans,A[i])*A[i]; | ^
s715895666
p03633
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a%b); } ll lcm(ll a, ll b) { reurn a / gcd(a, b) * b; } int main() { ll N; cin >> N; vector<ll> T(N, 0); for (int i = 0; i < N; ++i) { cin >> T[i]; } ll ans = 0; for (int i = 0; i < N; ++i) { asn = lcm(ans, T[i]); } cout << ans << endl; }
a.cc: In function 'll lcm(ll, ll)': a.cc:14:9: error: 'reurn' was not declared in this scope 14 | reurn a / gcd(a, b) * b; | ^~~~~ a.cc:15:1: warning: no return statement in function returning non-void [-Wreturn-type] 15 | } | ^ a.cc: In function 'int main()': a.cc:28:17: error: 'asn' was not declared in this scope; did you mean 'ans'? 28 | asn = lcm(ans, T[i]); | ^~~ | ans
s054222972
p03633
C++
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 #define pri(x) cout << (x) << "\n" #define pri2(x, y) cout << (x) << " " << (y) << "\n" #define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n" const long long mod = 1e9 + 7; typedef long long ll; typedef priority_queue<int> PQ; typedef vector<long long> VL; typedef vector<bool> VB; typedef vector<int> VI; // VI a(n); typedef vector<double> VD; typedef vector<string> VS; typedef vector<char> VC; typedef vector<VS> VSS; typedef vector<VC> VCC; typedef vector<VI> VII; // VII a(n,VI(m)) n * m typedef vector<VL> VLL; typedef pair<int, int> PII; typedef map<int, int> MP; // MP a; typedef vector<pair<ll, ll>> PS; template <class T, class U> bool chmax(T &a, U b) { if (a <= b) { a = b; return 1; } return 0; } template <class T, class U> bool chmin(T &a, U b) { if (a > b) { a = b; return 1; } return 0; } template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << "{"; rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); } os << "}"; return os; } // g++ -std=c++11 prac.cpp // operator << (cout,a); // chmin(min,a) template<typename T> T gcd(T a, T b){ return b != 0 ? gcd(b, a % b) : a; } template<typename T> T lcm(T a, T b){ return a/gcd(a,b)*b; } int main() { ll n,k,m,x=0, y=0 , z = 0, h,w, ans=0,sum = 1, Max = -1, Min = 3e9+1; string u; bool ok=true; cin >> n; VL a(n); rep(i,n) cin >> a[i]; sort(ALL(a)); if(n==1){ pri(a[i]); return 0; } else{ x = lcm(a[0],a[1]); for(int i=2; i<n; i++){ x = lcm(a[i],x); } pri(x); return 0; } }
a.cc: In function 'int main()': a.cc:74:11: error: 'i' was not declared in this scope 74 | pri(a[i]); | ^ a.cc:7:25: note: in definition of macro 'pri' 7 | #define pri(x) cout << (x) << "\n" | ^
s561608059
p03633
C
#include<stdio.h> int main() { int i,j,N,max; max = 0; scanf("%d",&N); long long T[N]: long long ans=0; for(i=0;i<N;i++){ scanf("%ld",&T[i]); } for(i=1;i<N;i++){ if(T[max]<T[i]){ max = i; } } i=1; while(i>0){ for(j=0;j<N;j++){ if((T[max]*(i))%T[j]!=0){ break; }else{ ans = (T[max]*(i)); printf("%ld",ans); return 0; } } i++; } return 0; }
main.c: In function 'main': main.c:8:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token 8 | long long T[N]: | ^ main.c:8:17: error: expected expression before ':' token main.c:11:18: error: 'T' undeclared (first use in this function) 11 | scanf("%ld",&T[i]); | ^ main.c:11:18: note: each undeclared identifier is reported only once for each function it appears in main.c:24:9: error: 'ans' undeclared (first use in this function) 24 | ans = (T[max]*(i)); | ^~~
s242237522
p03633
C++
#include<bits/stdc++.h> #define ll long long #define P pair<ll ,ll> using namespace std; ll gcd(ll a,ll b){ if(a<b)return gcd(b,a); if(a%b==0)return b; return gcd(b ,a%b); } int main(){ ll n;cin >> n; vector<ll>t(n); for(int i=0;i<n;i++) cin >> t[i]; ll lcm = t[0]; for(int i=1;i<n;i++) lcm = a[i]*lcm/gcd(a[i] ,lcm); cout << lcm << endl; }
a.cc: In function 'int main()': a.cc:17:32: error: 'a' was not declared in this scope 17 | for(int i=1;i<n;i++) lcm = a[i]*lcm/gcd(a[i] ,lcm); | ^
s233542213
p03633
C++
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((lint)(x).size()) #define POW2(n) (1LL << (n)) #define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++) #define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) int main() { lint n;cin >> n; lint ans=1; REP(i,n){ lint t; cin >> t; ans =__detail::__lcm(ans, t); } cout << ans << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:23:24: error: '__lcm' is not a member of 'std::__detail' 23 | ans =__detail::__lcm(ans, t); | ^~~~~
s817162228
p03633
C++
#include<bits/stdc++.h> using namespace std; //min(x,y)が0以下の場合はmax(x,y)が返される //ユークリッドの互除法を元に実装 long long gcd(long long x,long long y){ if(x<y) swap(x,y); //xの方が常に大きい long long r; while(y>0){ r=x%y; x=y; y=r; } return x; } //オーバフローしないようにかける順番を気を付ける long long lcm(long long x,long long y){ return long long(x/gcd(x,y))*y; } int main(){ int N; cin>>N; long long T[N],ans=1; for(int i=0;i<N;i++){ cin>>T[i]; ans=lcm(ans,T[i]); } cout<<ans<<endl; }
a.cc: In function 'long long int lcm(long long int, long long int)': a.cc:19:12: error: expected primary-expression before 'long' 19 | return long long(x/gcd(x,y))*y; | ^~~~ a.cc:19:11: error: expected ';' before 'long' 19 | return long long(x/gcd(x,y))*y; | ^~~~~ | ; a.cc:19:12: error: expected primary-expression before 'long' 19 | return long long(x/gcd(x,y))*y; | ^~~~
s177405001
p03633
C++
#include<bits/stdc++.h> using namespace std; //min(x,y)が0以下の場合はmax(x,y)が返される //ユークリッドの互除法を元に実装 ll gcd(ll x,ll y){ if(x<y) swap(x,y); //xの方が常に大きい ll r; while(y>0){ r=x%y; x=y; y=r; } return x; } //オーバフローしないようにかける順番を気を付ける ll lcm(ll x,ll y){ return ll(x/gcd(x,y))*y; } int main(){ int N; cin>>N; long long T[N],ans=1; for(int i=0;i<N;i++){ cin>>T[i]; ans=gcd(ans,T[i]); } cout<<ans<<endl; }
a.cc:5:1: error: 'll' does not name a type 5 | ll gcd(ll x,ll y){ | ^~ a.cc:18:1: error: 'll' does not name a type 18 | ll lcm(ll x,ll y){ | ^~
s888041231
p03633
C++
#include <iostream> #include <vector> using namespace std; template <class T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); } template <class T> T lcm(T a, T b) { return a / gcd(a, b) * b; } int main(void) { int N; cin >> N; unsigned long long ans = 1; for (int i = 0; i < N; i++) { unsigned long long T; cin >> T; ans = lcm(ans, unsigned long long(T)); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:20:20: error: expected primary-expression before 'unsigned' 20 | ans = lcm(ans, unsigned long long(T)); | ^~~~~~~~
s624996170
p03633
C++
#include <bits/stdc++.h> using namespace std; int main (void) { int N; cin >> N; vector<long long> T(N); for ( int i=0; i<N; i++ ) { cin >> T.at(i); } sort(T.begin(), T.end(), greater<long long>()); bool ans_not_found = true; long long ans = T.at(0); while ( ans_not_found ) { ans_not_found = false; for ( int i=1; i<N; i++ ) { if ( ans % T.at(i) != 0 ) { ans_not_found = true; ans += T.as(0); break; } } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:22:26: error: 'class std::vector<long long int>' has no member named 'as'; did you mean 'at'? 22 | ans += T.as(0); | ^~ | at
s861294628
p03633
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; void solve() { int n; cin >> n; __int128 ans = 1; for (int i = 0; i < n; i++) { ll t; cin >> t; ans = (t * ans) / __gcd(t, ans); } ll x = ans; cout << x; } int main() { ios::sync_with_stdio(false); cin.tie(0); int T = 1; //cin >> T; while(T--) solve(); }
a.cc: In function 'void solve()': a.cc:13:40: error: no matching function for call to '__gcd(ll&, __int128&)' 13 | ans = (t * ans) / __gcd(t, ans); | ~~~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)' 1137 | __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n) | ^~~~~ /usr/include/c++/14/bits/stl_algo.h:1137:5: note: template argument deduction/substitution failed: a.cc:13:40: note: deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and '__int128') 13 | ans = (t * ans) / __gcd(t, ans); | ~~~~~^~~~~~~~
s613497302
p03633
C++
v
a.cc:1:1: error: 'v' does not name a type 1 | v | ^