submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s902724461 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
const int INF = (int)1e9 + 7;
#define REP(i, n) for (int i = 0, i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x <<
//cin,coutより遅いので注意
template <class T = int>
void in() //in<string>();とか書く intのときはそのままin();
{
T x;
cin >> x;
return (x);
}
template <class T>
void print(T &x) { cout << x << "\n"; }
signed main()
{
cin.tie(0);
ios::sync_with_stdio(false);
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << max(0, min(b, d) - max(a, c)) << "\n";
} | a.cc: In function 'int main()':
a.cc:27:16: error: no matching function for call to 'max(int, long long int)'
27 | cout << max(0, min(b, d) - max(a, c)) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:27:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
27 | cout << max(0, min(b, d) - max(a, c)) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/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:27:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
27 | cout << max(0, min(b, d) - max(a, c)) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
|
s954366534 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
const int INF = (int)1e9 + 7;
#define REP(i, n) for (int i = 0, i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x <<
//cin,coutより遅いので注意
template <class T = int>
void in() //in<string>();とか書く intのときはそのままin();
{
T x;
cin >> x;
return (x);
}
template <class T>
void print(T &x) { cout << x << "\n"; }
signed main()
{
cin.tie(0);
ios::sync_with_stdio(false);
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << max(0, min(b, d) - max(a, c)) << "\n";
} | a.cc: In function 'int main()':
a.cc:27:16: error: no matching function for call to 'max(int, long long int)'
27 | cout << max(0, min(b, d) - max(a, c)) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:27:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
27 | cout << max(0, min(b, d) - max(a, c)) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/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:27:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
27 | cout << max(0, min(b, d) - max(a, c)) << "\n";
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
|
s081366726 | p03632 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int A,B,C,D;
cin>>A>>B>>C>>D;
int sum=0;
for(int i=C;i<=D;i++){
for(int j=A;j<=B;j++){
if(i==j){
sum++;
}
}
}
if(sum==0){
cout<<sum<<endl;
}
else{
cou<<sum-1<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:19:5: error: 'cou' was not declared in this scope; did you mean 'cos'?
19 | cou<<sum-1<<endl;
| ^~~
| cos
|
s173531806 | p03632 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif
#define FILE_IO freopen("input.txt","r",stdin)
#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define debug(x) cerr << #x << " = " << x << endl;
const int MOD=1e9+7;
const int INF=1<<29;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename T>void print(T t){for(auto &it:t)cout<<it<<" ";}
inline int powerexp(int a,int b,int m){int res=1;while(b){if(b&1)res=res*a%m;a=a*a%m,b>>=1;}return res%m;}
void solve(){
int A[2],B[2];
for(auto& it:A)cin>>it;
for(auto& it:B)cin>>it;
if(A[1]<B[0]){cout<<0;return;}
int ans=min(A[1],B[1]);
ans-=max(A[0],B[0]);
cout<<max(ans,0)<<endl;
}
//-----------------------------
//comment from here for TOPCODER
int32_t main(){
IOS;
solve();
#ifdef LOCAL_DEFINE
cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl;
#endif
}
| a.cc: In function 'void solve()':
a.cc:26:12: error: no matching function for call to 'max(long long int&, int)'
26 | cout<<max(ans,0)<<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:2:
/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:26:12: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
26 | 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:
/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:26:12: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
26 | cout<<max(ans,0)<<endl;
| ~~~^~~~~~~
|
s309824600 | p03632 | C++ | #include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
template <class T> using V = vector<T>;
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
ll sum(ll n) {
ll m=0;
FOR(i,0,20){
m+=n%10;
n/=10;
if(n==0){
break;
}
}
return m;
}
ll combi(ll n,ll m) {
ll ans=1;
rFOR(i,n,n-m){
ans*=i;
}
FOR(i,1,m+1){
ans/=i;
}
return ans;
}
ll lcm(ll a,ll b){
ll n;
n=a/gcd(a,b)*b;
return n;
}
/****************************************\
| Thank you for viewing my code:) |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka |
\****************************************/
signed main() {
ll a,b;
ci(a>>b);
ll c,d;
ci(c>>d);
ll A=rM(b,d);
ll B=M(a,c);
co(M(0,A-B))
} | a.cc: In function 'int main()':
a.cc:26:19: error: no matching function for call to 'max(int, ll)'
26 | #define M(a,b) max(a,b)
| ~~~^~~~~
a.cc:32:21: note: in definition of macro 'co'
32 | #define co(a) cout<<a<<endl;
| ^
a.cc:83:6: note: in expansion of macro 'M'
83 | co(M(0,A-B))
| ^
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:26:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
26 | #define M(a,b) max(a,b)
| ~~~^~~~~
a.cc:32:21: note: in definition of macro 'co'
32 | #define co(a) cout<<a<<endl;
| ^
a.cc:83:6: note: in expansion of macro 'M'
83 | co(M(0,A-B))
| ^
/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:26:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
26 | #define M(a,b) max(a,b)
| ~~~^~~~~
a.cc:32:21: note: in definition of macro 'co'
32 | #define co(a) cout<<a<<endl;
| ^
a.cc:83:6: note: in expansion of macro 'M'
83 | co(M(0,A-B))
| ^
|
s458105409 | p03632 | C++ | int main(void) {
int A,B,C,D;
cin >> A >> B >> C >> D;
const int lower = max(A,C);
const int upper = min(B,D);
cout << max(0,upper-lower) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> A >> B >> C >> D;
| ^~~
a.cc:5:19: error: 'max' was not declared in this scope
5 | const int lower = max(A,C);
| ^~~
a.cc:6:19: error: 'min' was not declared in this scope; did you mean 'main'?
6 | const int upper = min(B,D);
| ^~~
| main
a.cc:8:2: error: 'cout' was not declared in this scope
8 | cout << max(0,upper-lower) << endl;
| ^~~~
a.cc:8:32: error: 'endl' was not declared in this scope
8 | cout << max(0,upper-lower) << endl;
| ^~~~
|
s180615231 | p03632 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <deque>
#include <utility>
#include <algorithm>
using namespace std;
int main(void){
int a, b, c, d;
cin>>a>>b>>c>>d;
if(b<c){
cout<<0<<endl;
}else id(b>c){
int t=b<=d?b:d;
int s=a<=c?c:a;
cout<<t-s<<endl;
}else{
cout<<1<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:17:11: error: 'id' was not declared in this scope; did you mean 'd'?
17 | }else id(b>c){
| ^~
| d
a.cc:23:6: error: 'else' without a previous 'if'
23 | }else{
| ^~~~
|
s370423909 | p03632 | C++ | #include <iostream>
using namespace std;
int d[101];
int32_t main()
{
int a, b, c, d;
for (int i=a; i<=b; i++) d[i]++;
for (int i=c; i<=d; i++) d[i]++;
int res = 0;
for (int i=0; i<=100; i++) if (d[i]==2) res++;
cout << res;
return 0;
} | a.cc: In function 'int32_t main()':
a.cc:9:29: error: invalid types 'int[int]' for array subscript
9 | for (int i=a; i<=b; i++) d[i]++;
| ^
a.cc:10:29: error: invalid types 'int[int]' for array subscript
10 | for (int i=c; i<=d; i++) d[i]++;
| ^
a.cc:12:35: error: invalid types 'int[int]' for array subscript
12 | for (int i=0; i<=100; i++) if (d[i]==2) res++;
| ^
|
s225250940 | p03632 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define repi(i,a,b) for(int i=a; i<=(b); ++i)
#define rrep(i,n) for(int i=(n-1); i>=0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define pr(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
#define yes "Yes"
#define no "No"
using ll = long long;
using namespace std;
typedef pair<int,int> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int MOD = 1e9 + 7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int A,B,C,D;
int tm[150];
int main(){
cin >> A >> B >> C >> D;
tm[A]++,tm[B]--,tm[C]++,tm[D]--;
rep(i,101) tm[i+1] += tm[i];
int ct = 0;
rep(i,101) if(tm[i] == 2) ++ct;
pr(ct);
} | a.cc: In function 'int main()':
a.cc:31:5: error: reference to 'tm' is ambiguous
31 | tm[A]++,tm[B]--,tm[C]++,tm[D]--;
| ^~
In file included from /usr/include/time.h:39,
from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
from /usr/include/c++/14/ext/atomicity.h:35,
from /usr/include/c++/14/bits/ios_base.h:39,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
7 | struct tm
| ^~
a.cc:28:5: note: 'int tm [150]'
28 | int tm[150];
| ^~
a.cc:31:13: error: reference to 'tm' is ambiguous
31 | tm[A]++,tm[B]--,tm[C]++,tm[D]--;
| ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
7 | struct tm
| ^~
a.cc:28:5: note: 'int tm [150]'
28 | int tm[150];
| ^~
a.cc:31:21: error: reference to 'tm' is ambiguous
31 | tm[A]++,tm[B]--,tm[C]++,tm[D]--;
| ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
7 | struct tm
| ^~
a.cc:28:5: note: 'int tm [150]'
28 | int tm[150];
| ^~
a.cc:31:29: error: reference to 'tm' is ambiguous
31 | tm[A]++,tm[B]--,tm[C]++,tm[D]--;
| ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
7 | struct tm
| ^~
a.cc:28:5: note: 'int tm [150]'
28 | int tm[150];
| ^~
a.cc:32:16: error: reference to 'tm' is ambiguous
32 | rep(i,101) tm[i+1] += tm[i];
| ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
7 | struct tm
| ^~
a.cc:28:5: note: 'int tm [150]'
28 | int tm[150];
| ^~
a.cc:32:27: error: reference to 'tm' is ambiguous
32 | rep(i,101) tm[i+1] += tm[i];
| ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
7 | struct tm
| ^~
a.cc:28:5: note: 'int tm [150]'
28 | int tm[150];
| ^~
a.cc:34:19: error: reference to 'tm' is ambiguous
34 | rep(i,101) if(tm[i] == 2) ++ct;
| ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
7 | struct tm
| ^~
a.cc:28:5: note: 'int tm [150]'
28 | int tm[150];
| ^~
|
s617232557 | p03632 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin >> a >> b >> c >> d;
int goal = min(b,d);
int start = min(a,c);
ans = goal - start;
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | ans = goal - start;
| ^~~
| abs
|
s833136622 | p03632 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <stdio.h>
#include <set>
#include <vector>
using namespace std;
int main(){
int a, b, c, d;
cin>>a>>b>>c>>d;
int ans = 0;
if(a>c){
if(a>=d){
ans = 0;
}
else{
if(b<=d){
ans = b-a;
}
else{
ans = d-a;
}
}
}
else
{
if(b<=c){
ans = 0
}
else{
if(d<=b){
ans = d-c;
}
else{
ans = b-c;
}
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:20: error: expected ';' before '}' token
31 | ans = 0
| ^
| ;
32 | }
| ~
|
s385693594 | p03632 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <stdio.h>
#include <set>
#include <vector>
using namespace std;
int main(){
int a, b, c, d;
cin>>a>>b>>c>>d;
int ans = 0;
if(a>c){
if(a>=d){
ans = 0;
}
else{
if(b<=d){
ans = b-a;
}
else{
ans = d-a;
}
}
}
else
{
if(b<=c){
ans = 0
}
else{
if(d<=b){
ans = d-c;
}
else{
ans = b-c;
}
}
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:20: error: expected ';' before '}' token
31 | ans = 0
| ^
| ;
32 | }
| ~
|
s954408758 | p03632 | C++ | #include<iostream>
int main(){
int a,b,c,d;
std::cin>>a>>b>>c>>d;
std::cout<<std::max(0,std::min(b,d)-std::max(a,c))<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:55: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | std::cout<<std::max(0,std::min(b,d)-std::max(a,c))<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s366571920 | p03632 | C++ | #include<iostream>
int main(){
int a,b,c,d;
std::cin>>a>>b>>c>>d;
std::cout<<max(0,min(b,d)-max(a,c))<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:20: error: 'min' was not declared in this scope; did you mean 'std::min'?
5 | std::cout<<max(0,min(b,d)-max(a,c))<<endl;
| ^~~
| std::min
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
a.cc:5:29: error: 'max' was not declared in this scope; did you mean 'std::max'?
5 | std::cout<<max(0,min(b,d)-max(a,c))<<endl;
| ^~~
| std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
a.cc:5:14: error: 'max' was not declared in this scope; did you mean 'std::max'?
5 | std::cout<<max(0,min(b,d)-max(a,c))<<endl;
| ^~~
| std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
a.cc:5:40: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | std::cout<<max(0,min(b,d)-max(a,c))<<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s985671807 | p03632 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>
#include <cstdint>
using namespace std;
using lli = long long int;
using i64 = int64_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x)
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0)
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs
int main() {
i64 a, b, c, d;
cin >> a >> b >> c >> d;
cout << max(0ll, min(b, d) - max(a, c)) << '\n';
return 0;
}
| a.cc: In function 'int main()':
a.cc:35:14: error: no matching function for call to 'max(long long int, long int)'
35 | cout << max(0ll, min(b, d) - max(a, c)) << '\n';
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:35:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long int')
35 | cout << max(0ll, min(b, d) - max(a, c)) << '\n';
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:11:
/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:35:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
35 | cout << max(0ll, min(b, d) - max(a, c)) << '\n';
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s098805253 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A, B, C, D;
cin >> A >> B >> C >> D;
cout << max(0, min(B, D) - max(a, C)) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:34: error: 'a' was not declared in this scope
8 | cout << max(0, min(B, D) - max(a, C)) << endl;
| ^
|
s971456110 | p03632 | C++ | #include<iostream>
using namespace std;
int main(void){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(a<=b && b<=c && c<=d)cout<<0<<endl;
else if(a<=c && c<=b && b<=d)cout<<b-c<<endl;
else if(c<=a && a<=b && b<=d)cout<<b-a<<endl;
else if(a<=c && c<=d && d<=b)cout<<d-c<<endl;
else if(c<=a && a<=d && d<=b)cout<<d-a<<endl;
else(a<=d && d<=a && a<=b)cout<<0<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before 'cout'
11 | else(a<=d && d<=a && a<=b)cout<<0<<endl;
| ^~~~
| ;
|
s014417516 | p03632 | C++ | #include <bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
int as,ae,bs,be,answer;
cin >> as >> ae >> bs >> be;
if(as<=bs && bs <= ae) anwer= ae-bs;
if(as>bs && as < be) answer= be-as;
cout << answer;
} | a.cc: In function 'int main()':
a.cc:9:26: error: 'anwer' was not declared in this scope; did you mean 'answer'?
9 | if(as<=bs && bs <= ae) anwer= ae-bs;
| ^~~~~
| answer
|
s027021198 | p03632 | C++ | #include <iostream>
#include <cstdlib>
using namespace std;
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
int ans = 0;
if (A < C) {
if (A + B >= C) {
if (A + B <= C + D) {
ans = (A + B) - C;
}
else {
ans = D;
}
}
}
else if {
if (C + D >= A) {
if (C + D <= A + B) {
ans = (C + D) - A;
}
else {
ans = B;
}
}
}
else {
ans = abs(C - D);
}
cout << ans << '\n';
} | a.cc: In function 'int main()':
a.cc:19:11: error: expected '(' before '{' token
19 | else if {
| ^
| (
a.cc:29:3: error: 'else' without a previous 'if'
29 | else {
| ^~~~
|
s705706348 | p03632 | C++ | #include <iostream>
using namespace std;
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
int ans = 0;
if (A < C) {
if (A + B >= C) {
if (A + B <= C + D) {
ans = (A + B) - C;
}
else {
ans = D;
}
}
}
else {
if (C + D >= A) {
if (C + D <= A + B) {
ans = (C + D) = A;
}
else {
ans = B;
}
}
}
cout << ans << '\n';
} | a.cc: In function 'int main()':
a.cc:21:18: error: lvalue required as left operand of assignment
21 | ans = (C + D) = A;
| ~~~^~~~
|
s949738691 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d, s;
cin >> a >> b >> c >> d;
s = max(0, min(b, d) - max(a, c))
cout << s << endl;
}
| a.cc: In function 'int main()':
a.cc:8:36: error: expected ';' before 'cout'
8 | s = max(0, min(b, d) - max(a, c))
| ^
| ;
9 | cout << s << endl;
| ~~~~
|
s411990295 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vint;
int main() {
ll a,b ,c,d,ans=0;
cin >>a>>b>>c>>d;
vint v(101),b(101);
for (ll i=a;i<=b;i++) v.at(i)++;
for (ll i=c;i<=d;i++) b.at(i)++;
for (ll i=0;i<=100;i++) {
if (v.at(i)==1 && b.at(i)==1) ans++;
}
cout << ans;
} | a.cc: In function 'int main()':
a.cc:9:15: error: conflicting declaration 'vint b'
9 | vint v(101),b(101);
| ^
a.cc:6:8: note: previous declaration as 'll b'
6 | ll a,b ,c,d,ans=0;
| ^
a.cc:11:27: error: request for member 'at' in 'b', which is of non-class type 'll' {aka 'long long int'}
11 | for (ll i=c;i<=d;i++) b.at(i)++;
| ^~
a.cc:14:25: error: request for member 'at' in 'b', which is of non-class type 'll' {aka 'long long int'}
14 | if (v.at(i)==1 && b.at(i)==1) ans++;
| ^~
|
s524674646 | p03632 | C++ | #include <iostream>
using namespace std;
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
int start, end ;
start = min(A, C);
end = max(B, D);
int cnt = 0;
bool Alice, Bob;
for(int i = start; i < end; ++i) {
if (i >= A && i <= B) Alice = true;
else Alice = false;
if (i >= C && i <= D) Bob = true;
else Bob = false;
if (Alice && Bob) ++cnt;
}
cout << cnd << endl;
} | a.cc: In function 'int main()':
a.cc:20:11: error: 'cnd' was not declared in this scope; did you mean 'cnt'?
20 | cout << cnd << endl;
| ^~~
| cnt
|
s909188419 | 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 << endl;
}
else if(a <= c){
if(b <= d){
cout << b - c << endl;
}
else{
cout << d - c < endl;
}
}
else{
if(b <= d){
cout << b - a << endl;
}
else{
cout << d - a < endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:17:21: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
17 | cout << d - c < endl;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/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:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
17 | cout << d - c < endl;
| ^~~~
/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:17:23: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
17 | cout << d - c < endl;
| ^~~~
/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:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
17 | cout << d - c < endl;
| ^~~~
/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:17:23: note: couldn't deduce template parameter '_Bi_iter'
17 | cout << d - c < endl;
| ^~~~
/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:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
17 | cout << d - c < endl;
| ^~~~
/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:17:23: note: couldn't deduce template parameter '_Bi_iter'
17 | cout << d - c < endl;
| ^~~~
/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:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
17 | cout << d - c < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/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:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
17 | cout << d - c < endl;
| ^~~~
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:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
17 | cout << d - c < endl;
| ^~~~
/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:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
17 | cout << d - c < endl;
| ^~~~
/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:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
17 | cout << d - c < endl;
| ^~~~
/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: note: template argument deduction/substitution failed:
a.cc:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
17 | cout << d - c < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:17:23: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
17 | cout << d - c < endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:17:23: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
17 | cout << d - c < endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:17:23: note: couldn't deduce template parameter '_CharT'
17 | cout << d - c < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:17:23: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
17 | cout << d - c < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | |
s350903951 | p03632 | C++ | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int a[4];
for (int i=0; i<4; i++) {
cin>>a[i];
}
if (a[1]<a[2]) {
cout<<0<<endl;
retrun 0;
}
sort(a,a+3);
cout<<a[2]-a[1]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:5: error: 'retrun' was not declared in this scope
12 | retrun 0;
| ^~~~~~
|
s771119829 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c,d;
cin>>a>>b>>c>>d;
if(a<c&&b<d){
cout<<b-c<<endl;
}
else if(a>c&&b>d){
cout<<d-a<<endl;
}
else if(a>c&&b<d){
cout<<b-a<<endl;
}
else if(a<c&&b>d){
cout<<d-c<<endl;
}
else if(a=c&&b<d){
cout<<b-a<<endl;
}
else if(a=c&&b>d){
cout<<d-c<<endl;
}
else if(a>c&&b=d){
cout<<b-a<<endl;
}
else if(a<c&&b=d){
cout<<d-c<<endl;
}
else if(a=c&&b=d){
cout<<b-a<<endl;
}
else{
cout<<0<<endl;
}
} | a.cc: In function 'int main()':
a.cc:24:20: error: lvalue required as left operand of assignment
24 | else if(a>c&&b=d){
| ~~~^~~
a.cc:27:20: error: lvalue required as left operand of assignment
27 | else if(a<c&&b=d){
| ~~~^~~
a.cc:30:20: error: lvalue required as left operand of assignment
30 | else if(a=c&&b=d){
| ~^~~
|
s155020472 | p03632 | Java | import java.util.*;
import static java.lang.Math.abs;
public class Main{
public static void main(String... args){
Scanner sc=new Scanner(System.in);
int[] x=new int[]{sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()};
int[] tl=new int[101];
for(int i=0;i<101;i++){
if(i>=x[0]&&i<=x[1])tl++;
if(i>=x[2]&&i<=x[3])tl++;
}
int ans=0;
for(int i=0;i<101;i++){
if(tl[i]==2)ans++;
}
System.out.println(ans);
}
}
| Main.java:9: error: bad operand type int[] for unary operator '++'
if(i>=x[0]&&i<=x[1])tl++;
^
Main.java:10: error: bad operand type int[] for unary operator '++'
if(i>=x[2]&&i<=x[3])tl++;
^
2 errors
|
s125764098 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
if (b =< c || a >= d) {
cout << 0 << endl;
return 0;
}
if (b >= c) {
if (c >= a) {
cout << d - c << endl;
return 0
} else {
cout << d - a << endl;
return 0;
}
}
if (a <= d) {
if (a >= c) {
cout << b - a << endl;
return 0;
} else {
cout << b - c << endl;
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before '<' token
8 | if (b =< c || a >= d) {
| ^
a.cc:16:15: error: expected ';' before '}' token
16 | return 0
| ^
| ;
17 | } else {
| ~
|
s778079770 | p03632 | C++ | #include<bits.stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(d>=b){
if(c>=b){
cout<<" "<<endl;
return 0;
}
else if(c>=a&&c<b){
cout<<b-c<<endl;
return 0;
}
else if(c<a){
cout<<a-b<<endl;
return 0;
}
}
else if(d<b){
if(c>=a){
if(d-c==0){
cout<<" "<<endl;
}
cout<<d-c<<endl;
}
else{
cout<<d-a<<endl;
}
}
else{
cout<<" "<<endl;
return 0;
}
} | a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
1 | #include<bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s034863288 | p03632 | C++ | #include<bits.stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(d>=b){
if(c>=b){
cout<<" "<<endl;
return 0;
}
else if(c>=a&&c<b){
cout<<b-c<<endl;
return 0;
}
else if(c<a){
cout<<a-b<<endl;
return 0;
}
}
else if(d<b){
if(c>=a){
if(d-c==0){
cout<<" "<<endl;
}
cout<<d-c<<endl;
}
else{
cout<<d-a<<endl;
}
}
else{
cout<<" "<<endl;
return 0;
}
} | a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
1 | #include<bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s875449255 | p03632 | C++ | #include<bits.stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
if(d>=b){
if(c>=b){
cout<<" "<<endl;
return 0;
}
else if(c>=a&&c<b){
cout<<b-c<<endl;
return 0;
}
else if(c<a){
cout<<a-b<<endl;
return 0;
}
}
else if(d<b){
if(c>=a){
if(d-c==0){
cout<<" "<<endl;
}
cout<<d-c<<endl;
}
else{
cout<<d-a<<endl;
}
}
else{
cout<<" "<<endl;
return 0;
}
} | a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
1 | #include<bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s580514545 | p03632 | Java | import java.util.Scanner;
public class ABC70_B {
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 ans = 0;
ans = Math.min(b, d) - Math.max(a, c);
System.out.println(ans > 0 ? ans : 0);
}
}
| Main.java:3: error: class ABC70_B is public, should be declared in a file named ABC70_B.java
public class ABC70_B {
^
1 error
|
s635360759 | p03632 | C | #include<stdio.h>
int main(){
int A, B, C, D, ans;
scanf("%d %d %d %d", &A, &B, &C, &D);
if(A >= C && B >= D){
ans = D - A;;
} else if(A >= C && B < D){
ans = B - A;
} else if(A < C && B >= D){
ans = D - C;
} else if(A < C && B < D){
ans = B - C;
}
if(ans < 0){
ans = 0;
}
printf("%d\n", ans);
return 0;
} | main.c: In function 'main':
main.c:11:4: error: stray '\343' in program
11 | }<U+3000>else if(A < C && B >= D){
| ^~~~~~~~
|
s645688459 | p03632 | C++ | #include<cstdio>
#include<vector>
#include<queue>
#include<string>
#include<algorithm>
#include<functional>
#include<cstring>
using namespace std;
/**** Type Define ****/
typedef long long ll;
typedef pair<ll, ll> P;
/**** Const List ****/
const ll INF = ((ll)1 << 31) - 1;
const ll DINF = (ll)1e20;
const ll UNION_FIND_MAX = 100000;
const ll SEGMENT_TREE_MAX = (1 << 18) - 1;
const ll MAX_FLOW_MAX_V = 10000;
const ll MIN_COST_FLOW_MAX_V = 10000;
const ll BIPARTITE_MATCHING_MAX_V = 10000;
const ll DIJKSTRA_MAX_V = 1000000;
/**** General Functions ****/
template <typename T>
T tmin(T a, T b) { return a > b ? b : a; };
template <typename T>
T tmax(T a, T b) { return a > b ? a : b; };
template <typename T>
T tadd(T a, T b) { return a + b; };
template <typename T>
T tmul(T a, T b) { return a * b; };
template <typename T>
T tpow(T a, T b) { return a * b; };
ll gcd(ll a, ll b) {
if (b == 0) return a;
return gcd(b, a % b);
}
/**** Dijkstra ****/
class Dijkstra { // double は無理!!
public:
struct edge { ll to, cost; };
ll V;
vector<edge> G[DIJKSTRA_MAX_V];
ll d[DIJKSTRA_MAX_V];
priority_queue<P, vector<P>, greater<P> > que;
Dijkstra() {}
Dijkstra(ll v) {
init(v);
}
void init(ll v) {
V = v;
for (ll i = 0; i < v; i++) {
G[i].clear();
}
}
void search(ll from) {
for (ll i = 0; i < V; i++) d[i] = INF;
d[from] = 0;
que.push(P(0, from));
while (!que.empty()) {
P p = que.top(); que.pop();
ll b = p.second;
ll c = p.first;
if (d[b] <= c) continue;
for (ll i = 0; i < G[b].size(); i++) {
edge e = G[b][i];
ll nc = c + e.cost;
ll nt = e.to;
if (d[nt] > nc) que.push(P(nc, nt)), d[nt] = nc;
}
}
}
};
/**** Matrix ****/
template <typename T>
struct Matrix {
typedef vector<T> vec;
typedef vector<vec> mat;
ll x, y; // x: horizon y: vertical
mat d;
Matrix(ll _y, ll _x = -1) {
if (_x == -1) _x = _y;
x = _x, y = _y;
for (int i = 0; i < y; i++) for (int j = 0; j < x; j++) d[i][j] = 0;
}
void unit() {
for (int i = 0; i < y; i++) for (int j = 0; j < x; j++) d[i][j] = i == j ? 1 : 0;
}
Matrix copy() {
Matrix m(y, x);
for (int i = 0; i < y; i++) for (int j = 0; j < x; j++) m.d[i][j] = d[i][j];
return m;
}
Matrix<T> operator + (Matrix<T>& t) { // No error check! Don't forget to check Matrix size!!
Matrix<T> m(y, x);
for (int i = 0; i < y; i++) for (int j = 0; j < x; j++) m.d[i][j] = d[i][j] + t.d[i][j];
return m;
}
Matrix<T> operator - (Matrix<T>& t) {
Matrix<T> m(y, x);
for (int i = 0; i < y; i++) for (int j = 0; j < x; j++) m.d[i][j] = d[i][j] - t.d[i][j];
return m;
}
Matrix<T> operator * (T t) {
Matrix<T> m(y, x);
for (int i = 0; i < y; i++) for (int j = 0; j < x; j++) m.d[i][j] = d[i][j] * t;
return m;
}
Matrix<T> det(Matrix<T>& t) { // x need to correspond to t.y
Matrix<T> m(y, x);
for (int i = 0; i < y; i++)
for (int j = 0; j < x; j++)
for (int k = 0; k < t.x; k++) m.d[i][j] += d[i][k] * t.d[k][j]; ////////////// mod???
return m;
}
};
/**** Zip ****/
template <typename T>
class Zip {
vector<T> d;
bool flag;
public:
Zip() {
flag = false;
}
void add(T x) {
d.push_back(x);
flag = true;
}
ll getNum(T x) { // T need to have operator < !!
if (flag) {
sort(d.begin(), d.end());
d.erase(unique(d.begin(), d.end()), d.end());
flag = false;
}
return lower_bound(d.begin(), d.end(), x) - d.begin();
}
ll size() {
return (ll)d.size();
}
};
/**** Union Find ****/
class UnionFind {
ll par[UNION_FIND_MAX];
ll rank[UNION_FIND_MAX];
public:
void init(ll n) {
for (ll i = 0; i < n; i++) par[i] = i, rank[i] = 0;
}
UnionFind(ll n) {
init(n);
}
ll findRoot(ll x) {
if (par[x] == x) return x;
return par[x] = findRoot(par[x]);
}
void merge(ll x, ll y) {
x = findRoot(x);
y = findRoot(y);
if (x == y) return;
if (rank[x] < rank[y]) {
par[x] = y;
} else {
par[y] = x;
if (rank[x] == rank[y]) rank[x]++;
}
}
bool isSame(ll x, ll y) {
return findRoot(x) == findRoot(y);
}
};
template <typename T>
class UnionFindT {
ll par[UNION_FIND_MAX];
ll rank[UNION_FIND_MAX];
T weight[UNION_FIND_MAX];
public:
void init(ll n, T w) {
for (ll i = 0; i < n; i++) par[i] = i, rank[i] = 0, weight[i] = w;
}
UnionFindT(ll n, T w) {
init(n, w);
}
ll findRoot(ll x) {
if (par[x] == x) return x;
weight[x] += weight[par[x]];
return par[x] = findRoot(par[x]);
}
T getWeight(ll x) {
findRoot(x);
return weight[x];
}
bool merge(ll x, ll y, T w) {
// weight(y) = weight(x) + wにする
w += weight(x);
w -= weight(y);
x = findRoot(x);
y = findRoot(y);
if (x == y) return false;
if (rank[x] < rank[y]) {
par[x] = y;
weight[x] = -w;
} else {
par[y] = x;
weight[y] = w;
if (rank[x] == rank[y]) rank[x]++;
}
return true;
}
T diff(ll x, ll y) { // xが基準でyの重み
return weight(y) - weight(x);
}
bool isSame(ll x, ll y) {
return findRoot(x) == findRoot(y);
}
};
/**** Segment Tree ****/
template <typename T>
struct SegmentTree {
ll n;
T dat[SEGMENT_TREE_MAX];
function<T(T, T)> acc;
T out;
SegmentTree(function<T(T, T)> func, T overNum) {
acc = func;
out = overNum;
}
void init(ll _n) {
n = 1;
while (n < _n) n *= 2;
for (ll i = 0; i < 2 * n - 1; i++) dat[i] = out;
}
void nodeUpdate(ll k, T d) {
// k番目をdに変える
k += n - 1;
dat[k] = d;
while (k > 0) {
k = (k - 1) / 2;
dat[k] = acc(dat[k * 2 + 1], dat[k * 2 + 2]);
}
}
T rangeQuery(ll a, ll b) {
return tempRangeQuery(a, b, 0, 0, n);
}
private:
T tempRangeQuery(const ll& a, const ll& b, ll k, ll l, ll r) {
if (r <= a || b <= l) return out;
if (a <= l && r <= b) return dat[k];
T vl = tempRangeQuery(a, b, k * 2 + 1, l, (l + r) / 2);
T vr = tempRangeQuery(a, b, k * 2 + 2, (l + r) / 2, r);
return acc(vl, vr);
}
};
/**** Network Flow ****/
class MaxFlow {
public:
struct edge { ll to, cap, rev; };
vector<edge> G[MAX_FLOW_MAX_V];
bool used[MAX_FLOW_MAX_V];
ll level[MAX_FLOW_MAX_V];
ll iter[MAX_FLOW_MAX_V];
void init() {
for (ll i = 0; i < MAX_FLOW_MAX_V; i++) {
G[i].clear();
}
}
void add_edge(ll from, ll to, ll cap) {
G[from].push_back((edge){to, cap, (ll)G[to].size()});
G[to].push_back((edge){from, 0, (ll)G[from].size() - 1});
}
void add_undirected_edge(ll e1, ll e2, ll cap) {
G[e1].push_back((edge){e2, cap, (ll)G[e2].size()});
G[e2].push_back((edge){e1, cap, (ll)G[e1].size() - 1});
}
ll dfs(ll v, ll t, ll f) {
if (v == t) return f;
used[v] = true;
for (ll i = 0; i < (ll)G[v].size(); i++) {
edge &e = G[v][i];
if (!used[e.to]&& e.cap > 0) {
ll d = dfs(e.to, t, min(f, e.cap));
if (d > 0) {
e.cap -= d;
G[e.to][e.rev].cap += d;
return d;
}
}
}
return 0;
}
ll max_flow(ll s, ll t) {
ll flow = 0;
while (1) {
memset(used, 0, sizeof(used));
ll f = dfs(s, t, INF);
if (f == 0) return flow;
flow += f;
}
}
void bfs(ll s) {
memset(level, -1, sizeof(level));
queue<ll> que;
level[s] = 0;
que.push(s);
while (!que.empty()) {
ll v = que.front(); que.pop();
for (ll i = 0; i < (ll)G[v].size(); i++) {
edge &e = G[v][i];
if (e.cap > 0 && level[e.to] < 0) {
level[e.to] = level[v] + 1;
que.push(e.to);
}
}
}
}
ll dinic_dfs(ll v, ll t, ll f) {
if (v == t) return f;
for (ll &i= iter[v]; i < (ll)G[v].size(); i++) {
edge &e = G[v][i];
if (e.cap > 0 && level[v] < level[e.to]) {
ll d = dinic_dfs(e.to, t, min(f, e.cap));
if (d > 0) {
e.cap -= d;
G[e.to][e.rev].cap += d;
return d;
}
}
}
return 0;
}
ll dinic(ll s, ll t) {
ll flow = 0;
while (1) {
bfs(s);
if (level[t] < 0) return flow;
memset(iter, 0, sizeof(iter));
ll f;
while ((f = dinic_dfs(s, t, INF)) > 0) {
flow += f;
}
}
}
};
/**** bipartite matching ****/
class BipartiteMatching {
public:
ll V;
vector<ll> G[BIPARTITE_MATCHING_MAX_V];
ll match[BIPARTITE_MATCHING_MAX_V];
bool used[BIPARTITE_MATCHING_MAX_V];
BipartiteMatching(ll v) {
V = v;
}
void init(ll v) {
V = v;
for (ll i = 0; i < BIPARTITE_MATCHING_MAX_V; i++) {
G[i].clear();
}
}
void add_edge(ll u, ll v) {
G[u].push_back(v);
G[v].push_back(u);
}
bool dfs(ll v) {
used[v] = true;
for (ll i = 0; i < (ll)G[v].size(); i++) {
ll u = G[v][i], w = match[u];
if (w < 0 || !used[w] && dfs(w)) {
match[v] = u;
match[u] = v;
return true;
}
}
return false;
}
ll max_matching() {
ll res = 0;
memset(match, -1, sizeof(match));
for (ll v = 0; v < V;v++) {
if (match[v] < 0) {
memset(used, 0, sizeof(used));
if (dfs(v)) {
res++;
}
}
}
return res;
}
};
class MinCostFlow {
public:
struct edge { ll to, cap, cost, rev; };
ll V;
vector<edge> G[MIN_COST_FLOW_MAX_V];
ll dist[MIN_COST_FLOW_MAX_V];
ll prevv[MIN_COST_FLOW_MAX_V];
ll preve[MIN_COST_FLOW_MAX_V];
ll h[MIN_COST_FLOW_MAX_V];
MinCostFlow(ll v) {
V = v;
}
void init() {
for (ll i = 0; i < MAX_FLOW_MAX_V; i++) {
G[i].clear();
}
}
void add_edge(ll from, ll to, ll cap, ll cost) {
G[from].push_back((edge){to, cap, cost, (ll)G[to].size()});
G[to].push_back((edge){from, 0, -cost, (ll)G[from].size() - 1});
}
void add_undirected_edge(ll e1, ll e2, ll cap, ll cost) {
add_edge(e1, e2, cap, cost);
add_edge(e2, e1, cap, cost);
}
ll min_cost_flow(ll s, ll t, ll f) { // minas
ll res = 0;
while (f > 0) {
fill(dist, dist + V, INF);
dist[s] = 0;
bool update = true;
while (update) {
update = false;
for (ll v = 0; v < V; v++) {
if (dist[v] == INF) continue;
for (ll i = 0; i < (ll)G[v].size(); i++) {
edge &e = G[v][i];
if (e.cap > 0 && dist[e.to] > dist[v] + e.cost) {
dist[e.to] = dist[v] + e.cost;
prevv[e.to] = v;
preve[e.to] = i;
update = true;
}
}
}
}
if (dist[t] == INF) {
return -1;
}
ll d = f;
for (ll v = t; v != s; v = prevv[v]) {
d = min(d, G[prevv[v]][preve[v]].cap);
}
f -= d;
res += d * dist[t];
for (ll v = t; v != s; v = prevv[v]) {
edge &e = G[prevv[v]][preve[v]];
e.cap -= d;
G[v][e.rev].cap += d;
}
}
return res;
}
ll min_cost_flow_dijkstra(ll s, ll t, ll f) {
ll res = 0;
fill(h, h + V, 0);
while (f > 0) {
priority_queue<P, vector<P>, greater<P> > que;
fill(dist, dist + V, 0);
dist[s] = 0;
que.push(P(0, s));
while (!que.empty()) {
P p = que.top(); que.pop();
int v = p.second;
if (dist[v] < p.first) continue;
for (int i = 0; i < G[v].size(); i++) {
edge &e = G[v][i];
if (e.cap > 0 && dist[e.to] > dist[v] + e.cost + h[v] - h[e.to]) {
dist[e.to] = dist[v] + e.cost + h[v] - h[e.to];
prevv[e.to] = v;
preve[e.to] = i;
que.push(P(dist[e.to], e.to));
}
}
}
if (dist[t] == INF) {
return -1;
}
for (int v = 0; v < V; v++) h[v] += dist[v];
int d = f;
for (int v = t; v != s; v = prevv[v]) {
d = tmin<ll>(d, G[prevv[v]][preve[v]].cap);
}
f -= d;
res += d * h[t];
for (int v = t; v != s; v = prevv[v]) {
edge &e = G[prevv[v]][preve[v]];
e.cap -= d;
G[v][e.rev].cap += d;
}
return res;
}
return 0;
}
};
/**** main function ****/
ll a, b, c, d;
int main() {
scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
printf("%lld\n", max(min(b, d) - max(a, c), 0));
}
| a.cc: In function 'int main()':
a.cc:536:23: error: no matching function for call to 'max(long long int, int)'
536 | printf("%lld\n", max(min(b, d) - max(a, c), 0));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
from a.cc:2:
/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:536:23: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
536 | printf("%lld\n", max(min(b, d) - max(a, c), 0));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/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:536:23: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
536 | printf("%lld\n", max(min(b, d) - max(a, c), 0));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
|
s934537404 | p03632 | C++ |
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
int ans=0;
if(c<=a&&b<=d){
cout<<(b-a);
return 0;
}
if(c>=a&&b>=d){
cout<<(d-c);
return 0;
}
if(a<=c&&c<=b){
cout<<(b-c);
return 0;
}
if(c<=a&&a<=d){
cout<<(d-a);
return 0;
}
cout<<ans;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
5 | 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 |
a.cc:8:5: error: 'cout' was not declared in this scope
8 | cout<<(b-a);
| ^~~~
a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout<<(d-c);
| ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:5: error: 'cout' was not declared in this scope
16 | cout<<(b-c);
| ^~~~
a.cc:16:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:5: error: 'cout' was not declared in this scope
20 | cout<<(d-a);
| ^~~~
a.cc:20:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:3: error: 'cout' was not declared in this scope
23 | cout<<ans;
| ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s184042416 | p03632 | C++ | int main(){
int a,b,c,d,ret;
cin >> a >> b >> c >> d;
ret = (a > c ? c:a) - (b > d ? d:b);
if(ret >= 0) cin << ret;
else cin << 0;
return 0;
} | a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
3 | cin >> a >> b >> c >> d;
| ^~~
|
s644416718 | p03632 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(void) {
int a, b, c, d; cin >> a >> b >> c >> d;
if (b < c) { cout << "0" << endl; }
else if(b==c){cout<<"1"<<endl;}
else { cout << min(b, d) - max(c,a) << endl; }
return 0;
}
| a.cc:9:3: error: extended character is not valid in an identifier
9 | else if(b==c){cout<<"1"<<endl;}
| ^
a.cc: In function 'int main()':
a.cc:9:3: error: '\U00003000else' was not declared in this scope
9 | else if(b==c){cout<<"1"<<endl;}
| ^~~~~~
a.cc:10:9: error: 'else' without a previous 'if'
10 | else { cout << min(b, d) - max(c,a) << endl; }
| ^~~~
|
s921406828 | p03632 | C++ | #include<stdio.h>
int main(){
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(c>=b){
printf("0\n");
}
if(c<b){
if(c>a&&b<d)printf("%d\n",b-c);
if(c>a&&b>d)printf("%d\n",d-c);
if(c<a&&b<d)printf("%d\n",b-a);
if(c<a&&b>
| a.cc: In function 'int main()':
a.cc:12:27: error: expected primary-expression at end of input
12 | if(c<a&&b>
| ^
a.cc:12:27: error: expected ')' at end of input
12 | if(c<a&&b>
| ~ ^
| )
a.cc:12:27: error: expected statement at end of input
a.cc:12:27: error: expected '}' at end of input
a.cc:8:16: note: to match this '{'
8 | if(c<b){
| ^
a.cc:12:27: error: expected '}' at end of input
12 | if(c<a&&b>
| ^
a.cc:2:11: note: to match this '{'
2 | int main(){
| ^
|
s787203097 | p03632 | C++ | #define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;
int sumdigit(int x){
int sum = 0;
while(x != 0){
sum += x % 10;
x /= 10;
}
return sum;
}
int main(){
int A, B, C, D;
cin >> A >> B >> C >> D;
int a[101] = {};
for(int i = A; i < B; i++){
a[i] = 1;
}
for(int i = C; i < D; i++){
a[i] += 1;
}
int cnt = 0;
for(int i = 0; i <= 101; i++){
if(a[i] == 2)cnt++;
}
| a.cc: In function 'int main()':
a.cc:34:6: error: expected '}' at end of input
34 | }
| ^
a.cc:21:11: note: to match this '{'
21 | int main(){
| ^
|
s038593103 | p03632 | C++ | #include <iostream>
using namespace std;
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
int res = 0;
if (C <= B < D) res += B - C;
if (D <= B) res += D - C;
cout >> res >> endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
13 | cout >> res >> endl;
| ~~~~ ^~ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:13:8: note: candidate: 'operator>>(int, int)' (built-in)
13 | cout >> res >> endl;
| ~~~~~^~~~~~
a.cc:13:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:13:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
13 | cout >> res >> endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:13:11: required from here
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s664565556 | p03632 | C++ | #include <iostream>
using namespace std;
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
int res = 0;
if (C <= B < D) num += B - C;
if (D <= B) num += D - C;
cout >> res >> endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:19: error: 'num' was not declared in this scope; did you mean 'enum'?
10 | if (C <= B < D) num += B - C;
| ^~~
| enum
a.cc:11:15: error: 'num' was not declared in this scope; did you mean 'enum'?
11 | if (D <= B) num += D - C;
| ^~~
| enum
a.cc:13:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
13 | cout >> res >> endl;
| ~~~~ ^~ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:13:8: note: candidate: 'operator>>(int, int)' (built-in)
13 | cout >> res >> endl;
| ~~~~~^~~~~~
a.cc:13:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:13:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
13 | cout >> res >> endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:13:11: required from here
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s106074128 | p03632 | C++ | #include <iostream>
using namespace std;
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
int res = 0;
if (C <= B < D) num = B - C;
if (D <= B) num = D - C;
cout >> res >> endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:19: error: 'num' was not declared in this scope; did you mean 'enum'?
10 | if (C <= B < D) num = B - C;
| ^~~
| enum
a.cc:11:15: error: 'num' was not declared in this scope; did you mean 'enum'?
11 | if (D <= B) num = D - C;
| ^~~
| enum
a.cc:13:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
13 | cout >> res >> endl;
| ~~~~ ^~ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:13:8: note: candidate: 'operator>>(int, int)' (built-in)
13 | cout >> res >> endl;
| ~~~~~^~~~~~
a.cc:13:8: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:13:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
13 | cout >> res >> endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:13:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:13:11: required from here
13 | cout >> res >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
s566908970 | p03632 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
using namespace std;
typedef long long ll;
int main(){
int a, b, c, d;
cin >> a >> b >> c >> d;
int ans;
ans =min(b, d) - max(a, c)
if (ans <= 0){
cout << 0 << endl;
}
else {
cout << ans << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:29: error: expected ';' before 'if'
16 | ans =min(b, d) - max(a, c)
| ^
| ;
17 | if (ans <= 0){
| ~~
a.cc:20:3: error: 'else' without a previous 'if'
20 | else {
| ^~~~
|
s484957622 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B,C,D;
cin >> A >> B >>C >>D;
int time = 0;
//aliceのほうが早い
if(A<C){
if(B>=C){
if(D>B){time = B-C;}
else{time = D-C;}
}
else if(A>C){
if(D>=A){
if(B>D){time = D-A;}
else{time= B-A;}
}
else{
if(B-A>=D-C){
time =B-A;
}
else time = D-C;
}
cout <<time << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:37:2: error: expected '}' at end of input
37 | }
| ^
a.cc:12:16: note: to match this '{'
12 | if(A<C){
| ^
a.cc:37:2: error: expected '}' at end of input
37 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s040746246 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B,C,D;
cin >> A >> B >>C >>D;
int time = 0;
//aliceのほうが早い
if(A<C){
if(B>=C){
if(D>B){time = B-C;}
else{time = D-C;}
}
else if(A>C){
if(D>=A){
if(B>D){time = D-A;}
else{time= B-A;
}
else{
if(B-A>=D-C){
time =B-A;
}
else time = D-C;
}
cout <<time << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:24:9: error: expected '}' before 'else'
24 | else{
| ^~~~
a.cc:19:25: note: to match this '{'
19 | if(D>=A){
| ^
a.cc:37:2: error: expected '}' at end of input
37 | }
| ^
a.cc:12:16: note: to match this '{'
12 | if(A<C){
| ^
a.cc:37:2: error: expected '}' at end of input
37 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s728589586 | p03632 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int main(){
int A,B,C,D;
cin >> A >> B >> C >> D;
if(min(B,D) < max(A,C)){
cout << '0' << endl;
}else{
cout << min(B,D)-max(A,C) << endl;
}
}
} | a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s177876359 | 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 << endl;
else cout << min(abs(a-d),abs(b-c),abs(a-b),abs(c-d)) << endl;
} | a.cc: In function 'int main()':
a.cc:8:21: error: no matching function for call to 'min(int, int, int, int)'
8 | else cout << min(abs(a-d),abs(b-c),abs(a-b),abs(c-d)) << 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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 4 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 4 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate expects 2 arguments, 4 provided
|
s819973247 | p03632 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<(((min(b,d))-(max(a,c))>=0)?((min(b,d))-(max(a,c)):0)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:59: error: expected ')' before ':' token
10 | cout<<(((min(b,d))-(max(a,c))>=0)?((min(b,d))-(max(a,c)):0)<<endl;
| ~ ^
| )
a.cc:10:68: error: expected ':' before ';' token
10 | cout<<(((min(b,d))-(max(a,c))>=0)?((min(b,d))-(max(a,c)):0)<<endl;
| ^
| :
a.cc:10:68: error: expected primary-expression before ';' token
a.cc:10:68: error: expected ')' before ';' token
10 | cout<<(((min(b,d))-(max(a,c))>=0)?((min(b,d))-(max(a,c)):0)<<endl;
| ~ ^
| )
|
s603342919 | p03632 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int A,B,C,D;
cin>>A>>B>>C>>D;
int time=0;
if(A=<C&&C<B)time=min(D,B)-C;
else if(C=<A&&A<D) time=min(D,B)-A;
cout<<time<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:8: error: expected primary-expression before '<' token
11 | if(A=<C&&C<B)time=min(D,B)-C;
| ^
a.cc:12:13: error: expected primary-expression before '<' token
12 | else if(C=<A&&A<D) time=min(D,B)-A;
| ^
|
s220366600 | p03632 | C++ | #include<stdio.h>
int main()
{
int A,B,C,D,Z;
scanf("%d %d %d %d",&A,&B,&C,&D);
if(A<C)
{
if(B>D)
{
Z=D-C;
printf("%d\n",Z);
}
}
else
{
Z=B-C;
if(Z>0)
{
printf("%d\n",Z);
}
else
{
printf("0\n");
}
}
}
else
{
if(D>B)
{
Z=D-C;
if(Z>0)
{
printf("%d\n",Z);
}
else
{
printf("0\n");
}
}
else
{
Z=B-A;
if(Z>0)
{
printf("%d\n",Z);
}
else
{
printf("0\n");
}
}
}
return 0;
}
| a.cc:27:4: error: expected unqualified-id before 'else'
27 | else
| ^~~~
a.cc:54:9: error: expected unqualified-id before 'return'
54 | return 0;
| ^~~~~~
a.cc:55:1: error: expected declaration before '}' token
55 | }
| ^
|
s657612947 | p03632 | C++ | #include<stdio.h>
int main()
{
int A,B,C,D,Z;
while(scanf("%d %d %d %d",&A,&B,&C,&D)!=EOF)
{
if(0<=A&B>A&B<=100&0<=C&D>C&D<=100)
{
if(A<C)
{
if(B>D)
{
Z=D-C;
printf("%d\n",Z);
}
else
{
Z=B-C;
if(Z>0){
printf("%d\n);
}
else
{
printf("0\n");
}
}
}
else
{
if(D>B)
{
Z=D-C;
printf("%d\n",Z);
}
else
{
Z=D-A;
if(Z>0)
{
printf("%d\n",Z);
}
else
{
printf("0\n");
}
}
}
}
}
return 0;
} | a.cc:20:11: warning: missing terminating " character
20 | printf("%d\n);
| ^
a.cc:20:11: error: missing terminating " character
20 | printf("%d\n);
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:21:9: error: expected primary-expression before '}' token
21 | }
| ^
|
s670890598 | p03632 | C++ | #include<stdio.h>
int main()
{
int A,B,C,D,E,F,Z;
while(scanf("%d %d %d %d",&A,&B,&C,&D)!=EOF)
{
if(0<=A&B>A&B<=100&0<=C&D>C&D<=100)
{
E=D+C;
F=A+B;
if(A<C)
{
if(F>E)
{
printf("%d\n",D);
}
else
{
Z=B-C;
if(Z>0){
printf("%d\n",Z);
}
else
{
printf("0\n")
}
}
}
else{
{
if(E>F)
{
printf("%d\n",B);
}
else
{
Z=D-A;
if(Z>0)
{
printf("%d\n",Z);
}
else
{
printf("0\n")
}
}
}
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:25:30: error: expected ';' before '}' token
25 | printf("0\n")
| ^
| ;
26 | }
| ~
a.cc:44:22: error: expected ';' before '}' token
44 | printf("0\n")
| ^
| ;
45 | }
| ~
|
s804610339 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C, D;
cout << A << B << C << D;
int t=min(B,D)-max(A, C);
if (t>=0) cout << t <<endl;
else cout << o << endl;
}
| a.cc: In function 'int main()':
a.cc:10:16: error: 'o' was not declared in this scope
10 | else cout << o << endl;
| ^
|
s798590371 | p03632 | C++ | #include <iostream>
#include <bits/stdc++.h>
#define Max(a,b) max({a,b})
#define Min(a,b) min({a,b})
#define rep(i,m,n) for(int (i)=(m);(i)<(int)(n);(i)++)
#define len(n) n.size()
#define print(n) cout << (n) << endl;
// s.substr(i,n)
typedef long long ll;
using namespace std;
//char a = 65;
long long int inf = 1000000007;
int n,m,a,b,c,d,cou,co;
long long int lla,llb,llc;
double d,k;
const ll LINF = 1e18;
char num = 65;
string s,t;
int lis[20];
/*
int binary(int bina){
int ans = 0;
for (int i = 0; bina>0 ; i++)
{
ans = ans+(bina%2)*pow(10,i);
bina = bina/2;
}
return ans;
}
*/
int main(){
cin >> a >> b >> c >> d;
print(max(0,min(b,d)-max(a,c)))
return 0;
} | a.cc:21:8: error: conflicting declaration 'double d'
21 | double d,k;
| ^
a.cc:19:15: note: previous declaration as 'int d'
19 | int n,m,a,b,c,d,cou,co;
| ^
|
s912427100 | p03632 | C++ | using namespace std;
int main() {
int time[100] = { 0 };
int A, B, C, D;
int cnt=0;
cin >> A >> B >> C >> D;
for (int i = A; i < B; i++)
{
time[i] = 1;
}
for (int i = C; i < D; i++)
{
if (time[i] != 0)
cnt++;
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
8 | 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 | using namespace std;
a.cc:20:9: error: 'cout' was not declared in this scope
20 | cout << cnt << endl;
| ^~~~
a.cc:20:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:24: error: 'endl' was not declared in this scope
20 | cout << cnt << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s423539753 | p03632 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main(){
int a, b, c, d;
cin >> a >> b >> c >> d;
if(b >= c){
cout << b - c << endl;
}
else{
cout << 0 << endl;
}
} | a.cc:10:1: error: extended character is not valid in an identifier
10 | int a, b, c, d;
| ^
a.cc: In function 'int main()':
a.cc:10:1: error: '\U00003000int' was not declared in this scope
10 | int a, b, c, d;
| ^~~~~
a.cc:11:10: error: 'a' was not declared in this scope
11 | cin >> a >> b >> c >> d;
| ^
a.cc:11:15: error: 'b' was not declared in this scope
11 | cin >> a >> b >> c >> d;
| ^
a.cc:11:20: error: 'c' was not declared in this scope
11 | cin >> a >> b >> c >> d;
| ^
a.cc:11:25: error: 'd' was not declared in this scope
11 | cin >> a >> b >> c >> d;
| ^
|
s973943830 | p03632 | C++ | 10 90 20 80
| a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 90 20 80
| ^~
|
s476356896 | p03632 | C++ | #include<stdio.h>
int main(){
int a,b,c,d,x[100]={0},i,ans=0;
scanf("%d%d%d%d",&a,&b,&c,&d);
for(i=a;i<b;i++)x[i]++;
for(i=c;i<d;i++)x[i]++;
for(i=0;i<100;i++)if(x[i]==2)ans++;
printf("%d"ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:10: error: unable to find string literal operator 'operator""ans' with 'const char [3]', 'long unsigned int' arguments
8 | printf("%d"ans);
| ^~~~~~~
|
s414876869 | p03632 | C++ | open System
open System.Collections.Generic
open System.Linq
open System
// Following contents are my library. The Main processes are on the bottom of this code.
let puts = Console.WriteLine : 'a -> unit
let put = Console.Write : 'a -> unit
let Read() = Console.ReadLine()
let Reads () = Console.ReadLine().Split()
let ReadInt () = Read() |> int
let ReadDouble () = Reads() |> (fun x -> x.[0], x.[1])
let ReadTriple () = Reads() |> (fun x -> x.[0], x.[1], x.[2])
let ReadQuadruple () = Reads() |> (fun x -> x.[0], x.[1], x.[2], x.[3])
let FuncDouble f1 f2 (t1, t2) = (f1 t1, f2 t2)
let FuncTriple f1 f2 f3 (t1, t2, t3) = (f1 t1, f2 t2, f3 t3)
let FuncQuadruple f1 f2 f3 f4 (t1, t2, t3, t4) = (f1 t1, f2 t2, f3 t3, f4 t4)
let ReadIntQuadruple () = ReadQuadruple() |> FuncQuadruple int int int int
let ReadIntTriple () = ReadTriple () |> FuncTriple int int int
let ReadIntDouble () = ReadDouble () |> FuncDouble int int
let ensmallen l = l % 1000000007L
let manhattan x y = abs (fst x - fst y) + abs (snd x - snd y)
let sayYESNO b = if b then puts "YES" else puts "NO"
// The main contents of this submission are below this line.
let a, b, c, d = ReadIntQuadruple()
let l = min b d - max a c
if l <= 0 then puts 0 else puts l
| a.cc:8:32: warning: missing terminating ' character
8 | let puts = Console.WriteLine : 'a -> unit
| ^
a.cc:8:32: error: missing terminating ' character
8 | let puts = Console.WriteLine : 'a -> unit
| ^~~~~~~~~~
a.cc:9:27: warning: missing terminating ' character
9 | let put = Console.Write : 'a -> unit
| ^
a.cc:9:27: error: missing terminating ' character
9 | let put = Console.Write : 'a -> unit
| ^~~~~~~~~~
a.cc:1:1: error: 'open' does not name a type
1 | open System
| ^~~~
|
s348566380 | p03632 | C++ | open System
open System.Collections.Generic
open System.Linq
open System
// Following contents are my library. The Main processes are on the bottom of this code.
let puts = Console.WriteLine : 'a -> unit
let put = Console.Write : 'a -> unit
let Read() = Console.ReadLine()
let Reads () = Console.ReadLine().Split()
let ReadInt () = Read() |> int
let ReadDouble () = Reads() |> (fun x -> x.[0], x.[1])
let ReadTriple () = Reads() |> (fun x -> x.[0], x.[1], x.[2])
let ReadQuadruple () = Reads() |> (fun x -> x.[0], x.[1], x.[2], x.[3])
let FuncDouble f1 f2 (t1, t2) = (f1 t1, f2 t2)
let FuncTriple f1 f2 f3 (t1, t2, t3) = (f1 t1, f2 t2, f3 t3)
let FuncQuadruple f1 f2 f3 f4 (t1, t2, t3, t4) = (f1 t1, f2 t2, f3 t3, f4 t4)
let ReadIntQuadruple () = ReadQuadruple() |> FuncQuadruple int int int int
let ReadIntTriple () = ReadTriple () |> FuncTriple int int int
let ReadIntDouble () = ReadDouble () |> FuncDouble int int
let ensmallen l = l % 1000000007L
let manhattan x y = abs (fst x - fst y) + abs (snd x - snd y)
let sayYESNO b = if b then puts "YES" else puts "NO"
// The main contents of this submission are below this line.
let a, b, c, d = ReadIntQuadruple()
let l = min b d - max a c
if l <= 0 then puts 0 else puts l
| a.cc:8:32: warning: missing terminating ' character
8 | let puts = Console.WriteLine : 'a -> unit
| ^
a.cc:8:32: error: missing terminating ' character
8 | let puts = Console.WriteLine : 'a -> unit
| ^~~~~~~~~~
a.cc:9:27: warning: missing terminating ' character
9 | let put = Console.Write : 'a -> unit
| ^
a.cc:9:27: error: missing terminating ' character
9 | let put = Console.Write : 'a -> unit
| ^~~~~~~~~~
a.cc:1:1: error: 'open' does not name a type
1 | open System
| ^~~~
|
s140947423 | p03632 | C++ | #include <bits/stdc++.h>
#define o(output) cout << output << endl
#define priolity_queue pq
#define push p
#define top t
using namespace std;
string s;
int a,b,c,d;
char A,B;
map<char,int> mp;
int main(){
cin>>a>> b>>c>>d;
o(max(a,c)-min(b,d));
| a.cc: In function 'int main()':
a.cc:17:24: error: expected '}' at end of input
17 | o(max(a,c)-min(b,d));
| ^
a.cc:15:11: note: to match this '{'
15 | int main(){
| ^
|
s450112224 | p03632 | C | #include <stdio.h>
int main(void){
int a,b,c,d;
int first,end;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
if(a>c){
first=a;
}else{
first=c;
}
if(b>d){
end=d
}else{
end=b;
}
if(end>first){
printf("%d\n",end-first);
}else{
printf("0\n");
}
return 0;
} | main.c: In function 'main':
main.c:15:10: error: expected ';' before '}' token
15 | end=d
| ^
| ;
16 | }else{
| ~
|
s513556703 | p03632 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(int argc, const char * argv[]) {
int A,B,C,D;
cin>>A>>B>>C>>D;
int robot[101];
memset(robot, 0, sizeof(robot));
for(int alice=A;alice<=B;++alice){
++robot[alice];
}
for(int Bob=C;Bob<=D;++Bob){
++robot[Bob];
}
int sum=0;
for(int i=0;i<=101;++i){
if(robot[i]==2)++sum;
}
cout<<(sum-1)<<endl;
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:8:5: error: 'memset' was not declared in this scope
8 | memset(robot, 0, sizeof(robot));
| ^~~~~~
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 | #include <string>
|
s799628527 | p03632 | C++ | #include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
int A,B,C,D;
cin>>A>>B>>C>>D;
int robot[101];
memset(robot, 0, sizeof(robot));
for(int alice=A;alice<=B;++alice){
++robot[alice];
}
for(int Bob=C;Bob<=D;++Bob){
++robot[Bob];
}
int sum=0;
for(int i=0;i<=101;++i){
if(robot[i]==2)++sum;
}
cout<<(sum-1)<<endl;
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:7:5: error: 'memset' was not declared in this scope
7 | memset(robot, 0, sizeof(robot));
| ^~~~~~
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 | using namespace std;
|
s213509001 | p03632 | C++ | >#include<iostrem>
>#include<string>
>#include<algorithm>
>using namespace std;
>int main(){
> int a,b,c,d;
> cin>>a>>b>>c>>d;
> if(b==c){
> cout<<b<<endl;
> }
> else if(c>b){
> cout<<c-b<<endl;
> }
>
> else cout<<0<<endl;
>
>} | a.cc:1:2: error: stray '#' in program
1 | >#include<iostrem>
| ^
a.cc:2:2: error: stray '#' in program
2 | >#include<string>
| ^
a.cc:3:2: error: stray '#' in program
3 | >#include<algorithm>
| ^
a.cc:1:1: error: expected unqualified-id before '>' token
1 | >#include<iostrem>
| ^
a.cc:5:1: error: expected unqualified-id before '>' token
5 | >int main(){
| ^
|
s232551544 | p03632 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define repr(i, n) for(int i = n;i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define PI 3.141592653589793
#define MOD 1000000007
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int a,b,c,d;
cin >> a >> b >> c >> d;
if(a <= c && c <= b){
else if(b <= c) cout << abs(c - b) << endl;
else cout << d - c << endl;
}
else cout << 0 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:21:9: error: expected '}' before 'else'
21 | else if(b <= c) cout << abs(c - b) << endl;
| ^~~~
a.cc:20:25: note: to match this '{'
20 | if(a <= c && c <= b){
| ^
a.cc: At global scope:
a.cc:24:5: error: expected unqualified-id before 'else'
24 | else cout << 0 << endl;
| ^~~~
a.cc:26:9: error: expected unqualified-id before 'return'
26 | return 0;
| ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
27 | }
| ^
|
s457520388 | p03632 | C++ | 10 90 20 80 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 90 20 80
| ^~
|
s273533959 | p03632 | Java | Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int d = sc.nextInt();
int x = 0,y = 0;
if(a > c) {
y = a;
a = c;
c = y;
y = b;
b = d;
y = d;
}
if(b < c) {
System.out.println(x);
}else if(b < d ){
x = (b - c);
System.out.println(x);
}else if(b >= d && a < c) {
x = (d - c);
System.out.println(x);
}
}
}
| Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
Scanner sc = new Scanner(System.in);
^
(use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
if(a > c) {
^
Main.java:9: error: class, interface, enum, or record expected
a = c;
^
Main.java:10: error: class, interface, enum, or record expected
c = y;
^
Main.java:11: error: class, interface, enum, or record expected
y = b;
^
Main.java:12: error: class, interface, enum, or record expected
b = d;
^
Main.java:13: error: class, interface, enum, or record expected
y = d;
^
Main.java:14: error: class, interface, enum, or record expected
}
^
Main.java:17: error: class, interface, enum, or record expected
}else if(b < d ){
^
Main.java:19: error: class, interface, enum, or record expected
System.out.println(x);
^
Main.java:20: error: class, interface, enum, or record expected
}else if(b >= d && a < c) {
^
Main.java:22: error: class, interface, enum, or record expected
System.out.println(x);
^
Main.java:23: error: class, interface, enum, or record expected
}
^
13 errors
|
s084945556 | p03632 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <set>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, k, n) for(int i = (k); i < (int)(n); i++)
using namespace std;
int main(){
int A, B, C, D;
cin >> A >> B >> C >> D;
int X[101] = {0};
int cnt = 0;
for(int i = A; i < B; i++){
X[i]++;
}
//for(int i = 0; i < 100; i++)
cout << X[i] << " ";
for(int i = C; i < D; i++){
X[i]++;
}
//cout << endl;
//for(int i = 0; i < 100; i++)
// cout << X[i] << " ";
for(int i = 0; i <= 100; i++){
if(X[i] == 2)
cnt++;
}
cout << cnt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:19: error: 'i' was not declared in this scope
17 | cout << X[i] << " ";
| ^
|
s946870042 | p03632 | Java | import java.util.*;
public class Main {
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();
if(a >= d || b =< c)System.out.println("0");
else if(a <= c && d <= b)System.out.println(d-c);
else if(c <= a && b <= d)System.out.println(b-a);
else if(a <= c && c <= b && b <= d)System.out.println(b-c);
else if(b <= a && a <= d && d <= c)System.out.println(d-a);
}} | Main.java:9: error: > or ',' expected
if(a >= d || b =< c)System.out.println("0");
^
1 error
|
s112253462 | p03632 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
int main(){
int A, B, C, D;
cin >> A >> B >> C >> D;
ans = min(B,D) - max(A,C);
if(ans>0) cout << ans;
else cout << 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
8 | ans = min(B,D) - max(A,C);
| ^~~
| abs
|
s599395773 | p03632 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<ll, ll> P;
#define MOD (1000000007ll)
#define l_ength size
int main(void){
int a,b,c,d,cnt[110],ans=0;
fill(cnt,cnt+110,0);
cin >> a >> b >> c >> d;
cnt[a]++;
cnt[b]--;
cnt[c]++;
cnt[d]--;
for(i=1; i<=100; ++i){
cnt[i] += cnt[i-1];
}
for(i=0; i<=100; ++i){
if(cnt[i] == 2){
ans++;
}
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:13: error: 'i' was not declared in this scope
18 | for(i=1; i<=100; ++i){
| ^
a.cc:21:13: error: 'i' was not declared in this scope
21 | for(i=0; i<=100; ++i){
| ^
|
s542616716 | p03632 | C++ | #include<iostream>
int A,B,C,D;main(){std::cin>>A>>B>>C>>D;std::cout<<max(0,min(B,D)-max(A,C));} | a.cc:2:13: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | int A,B,C,D;main(){std::cin>>A>>B>>C>>D;std::cout<<max(0,min(B,D)-max(A,C));}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:58: error: 'min' was not declared in this scope; did you mean 'std::min'?
2 | int A,B,C,D;main(){std::cin>>A>>B>>C>>D;std::cout<<max(0,min(B,D)-max(A,C));}
| ^~~
| std::min
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
a.cc:2:67: error: 'max' was not declared in this scope; did you mean 'std::max'?
2 | int A,B,C,D;main(){std::cin>>A>>B>>C>>D;std::cout<<max(0,min(B,D)-max(A,C));}
| ^~~
| std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
a.cc:2:52: error: 'max' was not declared in this scope; did you mean 'std::max'?
2 | int A,B,C,D;main(){std::cin>>A>>B>>C>>D;std::cout<<max(0,min(B,D)-max(A,C));}
| ^~~
| std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
|
s691176171 | p03632 | C | #include<cstdio>
int A,B,C,D,a;main(){scanf("%d%d%d%d",&A,&B,&C,&D);ans=(B<D?B:D)-(A<C?C:A);printf("%d",a<0?0:a);} | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s944989845 | p03632 | C++ | An adult game master and
N
N children are playing a game on an ice rink. The game consists of
K
K rounds. In the
i
i-th round, the game master announces:
Form groups consisting of
A
i
Ai children each!
Then the children who are still in the game form as many groups of
A
i
Ai children as possible. One child may belong to at most one group. Those who are left without a group leave the game. The others proceed to the next round. Note that it's possible that nobody leaves the game in some round.
In the end, after the
K
K-th round, there are exactly two children left, and they are declared the winners.
You have heard the values of
A
1
A1,
A
2
A2, ...,
A
K
AK. You don't know
N
N, but you want to estimate it.
Find the smallest and the largest possible number of children in the game before the start, or determine that no valid values of
N
N exist.
Constraints
1
≤
K
≤
10
5
1≤K≤105
2
≤
A
i
≤
10
9
2≤Ai≤109
All input values are integers.
Input
Input is given from Standard Input in the following format:
K
K
A
1
A1
A
2
A2
.
.
.
...
A
K
AK
Output
Print two integers representing the smallest and the largest possible value of
N
N, respectively, or a single integer
−
1
−1 if the described situation is impossible.
Sample Input 1 Copy
Copy
4
3 4 3 2
Sample Output 1 Copy
Copy
6 8
For example, if the game starts with
6
6 children, then it proceeds as follows:
In the first round,
6
6 children form
2
2 groups of
3
3 children, and nobody leaves the game.
In the second round,
6
6 children form
1
1 group of
4
4 children, and
2
2 children leave the game.
In the third round,
4
4 children form
1
1 group of
3
3 children, and
1
1 child leaves the game.
In the fourth round,
3
3 children form
1
1 group of
2
2 children, and
1
1 child leaves the game.
The last
2
2 children are declared the winners.
Sample Input 2 Copy
Copy
5
3 4 100 3 2
Sample Output 2 Copy
Copy
-1
This situation is impossible. In particular, if the game starts with less than
100
100 children, everyone leaves after the third round.
Sample Input 3 Copy
Copy
10
2 2 2 2 2 2 2 2 2 2
Sample Output 3 Copy
Copy
2 3 | a.cc:16:170: warning: missing terminating ' character
16 | Ai children as possible. One child may belong to at most one group. Those who are left without a group leave the game. The others proceed to the next round. Note that it's possible that nobody leaves the game in some round.
| ^
a.cc:16:170: error: missing terminating ' character
16 | Ai children as possible. One child may belong to at most one group. Those who are left without a group leave the game. The others proceed to the next round. Note that it's possible that nobody leaves the game in some round.
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:31:12: warning: missing terminating ' character
31 | AK. You don't know
| ^
a.cc:31:12: error: missing terminating ' character
31 | AK. You don't know
| ^~~~~~~
a.cc:41:1: error: extended character ≤ is not valid in an identifier
41 | ≤
| ^
a.cc:43:1: error: extended character ≤ is not valid in an identifier
43 | ≤
| ^
a.cc:46:1: error: extended character ≤ is not valid in an identifier
46 | 1≤K≤105
| ^
a.cc:46:1: error: extended character ≤ is not valid in an identifier
a.cc:48:1: error: extended character ≤ is not valid in an identifier
48 | ≤
| ^
a.cc:51:1: error: extended character ≤ is not valid in an identifier
51 | ≤
| ^
a.cc:54:1: error: extended character ≤ is not valid in an identifier
54 | 2≤Ai≤109
| ^
a.cc:54:1: error: extended character ≤ is not valid in an identifier
a.cc:78:1: error: extended character − is not valid in an identifier
78 | −
| ^
a.cc:80:1: error: extended character − is not valid in an identifier
80 | −1 if the described situation is impossible.
| ^
a.cc:1:1: error: 'An' does not name a type
1 | An adult game master and
| ^~
|
s144436202 | p03632 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,o,k;
cin>>a>>b>>c>>d;
o=max(a,c);
k=min(b,d);
if(k-o>0)
cout<<k-o;
else
cout<<0; | a.cc: In function 'int main()':
a.cc:11:9: error: expected '}' at end of input
11 | cout<<0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s942598847 | p03632 | C++ | #include<iostream>
using namespace std;
int main() {
int A, B, C, D,T;
cin >> A >> B >> C >> D;
if (C <= B) {
if (D >= B&&C>=A) T = B - C;
if(D>=B&&C<=A) T=B-A
if (D<=B&&C>=A) T = D - C;
if (D <=B&&C <=A) T = D - A;
if (D <= A) T = 0;
}
else T = 0;
cout << T;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:36: error: expected ';' before 'if'
9 | if(D>=B&&C<=A) T=B-A
| ^
| ;
10 | if (D<=B&&C>=A) T = D - C;
| ~~
|
s556430606 | p03632 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
if(a<b&&c<d)
{
int t;
if(a<c)
{
if(b<d) t=b-c;
else t=d-c;
}
else
{
if(b<d) t=b-a;
else t=b-a;
}
}
if(t<0) t=0;
cout<<t<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:21:12: error: 't' was not declared in this scope
21 | if(t<0) t=0;
| ^
a.cc:22:15: error: 't' was not declared in this scope
22 | cout<<t<<endl;
| ^
|
s532235524 | p03632 | C++ | #include <iostream>
int main() {
int a,b,c,d;
std::cin >> a >> b >> c >> d;
b - a - c > 0 ? std::cout << b - a - c << endl : std::cout << "0" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:51: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | b - a - c > 0 ? std::cout << b - a - c << endl : std::cout << "0" << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s446107903 | p03632 | C | #include<stdio.h>
int main(){
int a,b,c,d,m,n;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(judge(a)&&judge(b)&&judge(c)&&judge(d))
{compare(a,b);
compare(c,d);
if(b>c&&b<d&&a<c)
printf("%d",b-c);
if(b<=c||a>=d)
printf("0");
if(b>=d&&a<=c)
printf("%d",d-c);
if(a>c&&a<d&&b>d)
printf("%d",d-a);
if(a>c&&b<d)
printf("%d",b-a);
}
return 0;
} | main.c: In function 'main':
main.c:5:4: error: implicit declaration of function 'judge' [-Wimplicit-function-declaration]
5 | if(judge(a)&&judge(b)&&judge(c)&&judge(d))
| ^~~~~
main.c:6:2: error: implicit declaration of function 'compare' [-Wimplicit-function-declaration]
6 | {compare(a,b);
| ^~~~~~~
|
s416560015 | p03632 | C | #include<stdio.h>
int main(){
int a,b,c,d,m,n;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(judge(a)&&judge(b)&&judge(c)&&judge(d))
{compare(a,b);
compare(c,d);
if(b>c&&b<d)
printf("%d",b-c);
if(b<=c)
printf("0");
if(b>d)
printf("%d",d-c);
}
return 0;
}
int judge(int q)
{
if(0<q&&q<100) return 1;
else return 0;
} | main.c: In function 'main':
main.c:5:4: error: implicit declaration of function 'judge' [-Wimplicit-function-declaration]
5 | if(judge(a)&&judge(b)&&judge(c)&&judge(d))
| ^~~~~
main.c:6:2: error: implicit declaration of function 'compare' [-Wimplicit-function-declaration]
6 | {compare(a,b);
| ^~~~~~~
|
s511632674 | p03632 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define N 108
int a,b,c,d,time = 0;
int flag[N];
int main()
{
scanf("%d%d%d%d", &a, &b, &c, &d);
for (int i = 0; i < N; i++)
flag[i] = 0;
for (int i = a; i < b; i++)
flag[i] ++;
for (int i = c; i < d; i++)
if (flag[i] != 0)
time++;
printf("%d\n", time);
return 0;
} | a.cc:10:13: error: 'int time' redeclared as different kind of entity
10 | int a,b,c,d,time = 0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
from /usr/include/c++/14/ext/atomicity.h:35,
from /usr/include/c++/14/bits/ios_base.h:39,
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/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
76 | extern time_t time (time_t *__timer) __THROW;
| ^~~~
a.cc: In function 'int main()':
a.cc:22:25: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
22 | time++;
| ^~~~
a.cc:22:29: error: lvalue required as increment operand
22 | time++;
| ^~
|
s455798001 | 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)&&(d<a)printf("0");
else if (b > d)printf("%d", d - c);
else if(b>c)printf("%d", b - c);
else if (d > b)printf(b - a);
else printf(b - c);
} | main.c: In function 'main':
main.c:6:27: error: expected ')' before 'printf'
6 | if ((b < c)&&(d<a)printf("0");
| ~ ^~~~~~
| )
main.c:11:1: error: expected expression before '}' token
11 | }
| ^
|
s786348003 | p03632 | C | #include<stdio,h>
int main()
{
int A, B, C, D;
scanf("%d", A);
scanf("%d", B);
scanf("%d", C);
scanf("%d", D);
if (B < C || D < A)
printf("%d",0);
else
{
if (A < C)
{
if (B < D)
{
printf("%d", B - C);
}
else
{
printf("%d", D - C);
}
}
else
{
if (B < D)
{
printf("%d", B - A);
}
else
{
printf("%d", D - A);
}
}
}
return 0;
} | main.c:1:9: fatal error: stdio,h: No such file or directory
1 | #include<stdio,h>
| ^~~~~~~~~
compilation terminated.
|
s198408830 | p03632 | C | #include<stdio.h>
int main()
{
int a[4];
int i;
for(i=0;i<4;i++)
scanf("%d",a[i]);
if(a[1]<=a[2])||a[3]<=a[0])
printf("%d",0);
else{
for(i=0;i<4;i++)
for(int j=0;j<3;j++)
if(a[j]>a[j+1])
{
int temp=a[j];
a[j]=a[j+1],a[j+1]=temp;
}
printf("%d",a[3]-a[2]);
}
return 0;
} | main.c: In function 'main':
main.c:8:21: error: expected expression before '||' token
8 | if(a[1]<=a[2])||a[3]<=a[0])
| ^~
main.c:8:33: error: expected statement before ')' token
8 | if(a[1]<=a[2])||a[3]<=a[0])
| ^
main.c:10:7: error: 'else' without a previous 'if'
10 | else{
| ^~~~
|
s776066095 | p03632 | C++ | #include<stdio.h>
int main(void){
int a,b,c,d,t,i,s=0;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(a>c){
t=a;a=c;c=t;
t=b;b=d;d=t;
}
for(i=a;i<b;i++){
if(i>=c&&i<d)
s++;
}
printf("%d\n",s);
}
return 0;
} | a.cc:21:1: error: expected unqualified-id before 'return'
21 | return 0;
| ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
|
s703396428 | p03632 | C++ | v#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ROF(i,a,b) for(int i=(a);i>(b);i--)
#define all(a) (a).begin(),(a).end()
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;
main(){
int a,b,c,d; cin >> a >> b >> c >> d;
cout << max(0,min(b,d)-min(a,c)) << endl;
} | a.cc:1:2: error: stray '#' in program
1 | v#include<bits/stdc++.h>
| ^
a.cc:1:1: error: 'v' does not name a type
1 | v#include<bits/stdc++.h>
| ^
a.cc:9:9: error: 'vector' does not name a type
9 | typedef vector<int> vi;
| ^~~~~~
a.cc:10:9: error: 'vector' does not name a type
10 | typedef vector<vi> vii;
| ^~~~~~
a.cc:11:9: error: 'vector' does not name a type
11 | typedef vector<string> vs;
| ^~~~~~
a.cc:12:9: error: 'pair' does not name a type
12 | typedef pair<int,int> pii;
| ^~~~
a.cc:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
15 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:16:16: error: 'cin' was not declared in this scope
16 | int a,b,c,d; cin >> a >> b >> c >> d;
| ^~~
a.cc:17:3: error: 'cout' was not declared in this scope
17 | cout << max(0,min(b,d)-min(a,c)) << endl;
| ^~~~
a.cc:17:17: error: 'min' was not declared in this scope; did you mean 'main'?
17 | cout << max(0,min(b,d)-min(a,c)) << endl;
| ^~~
| main
a.cc:17:11: error: 'max' was not declared in this scope
17 | cout << max(0,min(b,d)-min(a,c)) << endl;
| ^~~
a.cc:17:39: error: 'endl' was not declared in this scope
17 | cout << max(0,min(b,d)-min(a,c)) << endl;
| ^~~~
|
s280510327 | p03632 | C++ | #include <iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
vector<int> x(101, 0);
for(int i=a; <=b; i++){
x[i] = 1;
}
int cnt = 0;
for(int i=c; i<=d; i++){
if( x[i] == 1 ) cnt++;
}
cout << cnt << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:16: error: expected primary-expression before '<=' token
20 | for(int i=a; <=b; i++){
| ^~
|
s632680550 | p03632 | C++ | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
int a, b, c, d;
int main() {
cin >> a >> b >> c >> d;
cout << max(0, )min(b, d) - max(a, c)) << endl;
}
| a.cc: In function 'int main()':
a.cc:41:20: error: expected primary-expression before ')' token
41 | cout << max(0, )min(b, d) - max(a, c)) << endl;
| ^
|
s699355636 | p03632 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
max=a;
min=a;
if(max<b){
max=b;
}
if(min>b){
min=b;
}
if(max<c){
max=c;
}
if(min>c){
min=c;
}
if(max<d){
max=d;
}
if(min>d){
min=d;
}
max-=min;
cout<<max<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:7: error: overloaded function with no contextual type information
6 | max=a;
| ^
a.cc:7:7: error: overloaded function with no contextual type information
7 | min=a;
| ^
a.cc:8:6: error: parse error in template argument list
8 | if(max<b){
| ^~~~~
a.cc:8:11: error: cannot resolve overloaded function 'max' based on conversion to type 'bool'
8 | if(max<b){
| ^
a.cc:9:9: error: overloaded function with no contextual type information
9 | max=b;
| ^
a.cc:11:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
11 | if(min>b){
| ~~~^~
a.cc:12:9: error: overloaded function with no contextual type information
12 | min=b;
| ^
a.cc:14:8: error: parse error in template argument list
14 | if(max<c){
| ^~~~~
a.cc:14:13: error: cannot resolve overloaded function 'max' based on conversion to type 'bool'
14 | if(max<c){
| ^
a.cc:15:9: error: overloaded function with no contextual type information
15 | max=c;
| ^
a.cc:17:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
17 | if(min>c){
| ~~~^~
a.cc:18:9: error: overloaded function with no contextual type information
18 | min=c;
| ^
a.cc:20:8: error: parse error in template argument list
20 | if(max<d){
| ^~~~~
a.cc:20:13: error: cannot resolve overloaded function 'max' based on conversion to type 'bool'
20 | if(max<d){
| ^
a.cc:21:9: error: overloaded function with no contextual type information
21 | max=d;
| ^
a.cc:23:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
23 | if(min>d){
| ~~~^~
a.cc:24:9: error: overloaded function with no contextual type information
24 | min=d;
| ^
a.cc:26:8: error: overloaded function with no contextual type information
26 | max-=min;
| ^~~
a.cc:27:7: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
27 | cout<<max<<endl;
| ~~~~^~~~~
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/ |
s312737163 | p03632 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d;
int o,p,q,r;
int ans=0;
cin>>a>>b>>c>>d;
o=a;
p=b;
q=c;
r=d;
if(a<c){
a+=c;
b-=a;
d-=c;
if(b>d){
ans=d;
}else{
ans=b;
}
}
a=o;
b=p;
c=q;
d=r
if(a>c){
c+=a;
b-=a;
d-=c;
if(b>d){
ans=d;
}else{
ans=b;
}
}
a=o;
b=p;
c=q;
d=r;
if(a==c){
b-=a;
d-=c;
if(b>d){
ans=d;
}else{
ans=b;
}
}
if(ans<0){
ans=0;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:25:6: error: expected ';' before 'if'
25 | d=r
| ^
| ;
26 | if(a>c){
| ~~
|
s999937962 | p03632 | C++ | int a,b,A,B,C,D;
scanf("%d%d%d%d",&A,&B,&C,&D);
{
if(A<D&&C<B)
{
if(A<C){a=C;}
else{a=A;}
if(B<D){b=B;}
else{b=D;}
printf("%d\n",b-a);
}
else
printf("0\n");
}
return 0;
} | a.cc:2:14: error: expected constructor, destructor, or type conversion before '(' token
2 | scanf("%d%d%d%d",&A,&B,&C,&D);
| ^
a.cc:3:9: error: expected unqualified-id before '{' token
3 | {
| ^
a.cc:15:9: error: expected unqualified-id before 'return'
15 | return 0;
| ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
16 | }
| ^
|
s999624414 | p03632 | C | #include <stdio.h>
void pria(int a, int b, int c, int d);
void prib();
void pric(int c, int d);
int main()
{
int a, b, c, d;
while (scanf("%d%d%d%d", &a, &b, &c, &d)!=EOF) {
if (c>a&&c<b&&d>b) pria(a, b, c, d);
else if (c>b) prib();
else pric(c, d);
}
return 0;
}
void pria(int a, int b, int c, int d)
{
printf("%d\n\n", b-c);
printf("Alice started holding down her button %d second after the start-up of the robot,
and released her button %d second after the start-up.\n", a, b);
printf("Bob started holding down his button %d second after the start-up, and released his button %d second after the start-up.\n", c, d);
printf("Therefore, the time when both of them were holding down their buttons, is the %d seconds from %d seconds after the start-up to %d seconds after the start-up.\n", b-c, c, b);
}
void prib()
{
printf("0\n\n");
printf("Alice and Bob were not holding their buttons at the same time, so the answer is zero seconds.\n");
}
void pric(int c, int d)
{
printf("%d\n", d-c);
} | main.c: In function 'pria':
main.c:21:16: warning: missing terminating " character
21 | printf("Alice started holding down her button %d second after the start-up of the robot,
| ^
main.c:21:16: error: missing terminating " character
21 | printf("Alice started holding down her button %d second after the start-up of the robot,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:22:1: error: 'and' undeclared (first use in this function)
22 | and released her button %d second after the start-up.\n", a, b);
| ^~~
main.c:22:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:4: error: expected ')' before 'released'
22 | and released her button %d second after the start-up.\n", a, b);
| ^~~~~~~~~
| )
main.c:21:15: note: to match this '('
21 | printf("Alice started holding down her button %d second after the start-up of the robot,
| ^
main.c:22:54: error: stray '\' in program
22 | and released her button %d second after the start-up.\n", a, b);
| ^
main.c:22:56: warning: missing terminating " character
22 | and released her button %d second after the start-up.\n", a, b);
| ^
main.c:22:56: error: missing terminating " character
22 | and released her button %d second after the start-up.\n", a, b);
| ^~~~~~~~~
main.c:24:190: error: expected ';' before '}' token
24 | printf("Therefore, the time when both of them were holding down their buttons, is the %d seconds from %d seconds after the start-up to %d seconds after the start-up.\n", b-c, c, b);
| ^
| ;
25 | }
| ~
|
s459101047 | p03632 | C | #include<stdio.h> #include<math.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==0&&c!=0&&d>b)||(a<c&&b<d)) { printf("%d",b-c); return 0; } if((c==0&&a!=0&&d<b)||(a>c&&b>d)) { printf("%d",d-a); return 0; } if(a>c&&b<d) { printf("%d",b-a); return 0; } if(c>a&&d<b) { printf("%d",d-c); return 0; } if(a==0&&c==0) { if(b<d) printf("%d",b); else printf("%d",d); return 0; } if(a==c&&b==d) { printf("%d",b-a); return 0; } if(b==d) { if(a<c) printf("%d",d-c); else printf("%d",b-a); return 0; } if(a==c) { if(b>d) printf("%d",d-c); else printf("%d",b-a); return 0; } } return 0; } | main.c:1:19: warning: extra tokens at end of #include directive
1 | #include<stdio.h> #include<math.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==0&&c!=0&&d>b)||(a<c&&b<d)) { printf("%d",b-c); return 0; } if((c==0&&a!=0&&d<b)||(a>c&&b>d)) { printf("%d",d-a); return 0; } if(a>c&&b<d) { printf("%d",b-a); return 0; } if(c>a&&d<b) { printf("%d",d-c); return 0; } if(a==0&&c==0) { if(b<d) printf("%d",b); else printf("%d",d); return 0; } if(a==c&&b==d) { printf("%d",b-a); return 0; } if(b==d) { if(a<c) printf("%d",d-c); else printf("%d",b-a); return 0; } if(a==c) { if(b>d) printf("%d",d-c); else printf("%d",b-a); return 0; } } return 0; }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s569893852 | p03632 | C | #include<stdio.h> #include<math.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==0&&c!=0&&d>b)||(a<c&&b<d)) { printf("%d",b-c); return 0; } if((c==0&&a!=0&&d<b)||(a>c&&b>d)) { printf("%d",d-a); return 0; } if(a>c&&b<d) { printf("%d",b-a); return 0; } if(c>a&&d<b) { printf("%d",d-c); return 0; } if(a==0&&c==0) { if(b<d) printf("%d",b); else printf("%d",d); return 0; } if(a==c&&b==d) { printf("%d",b-a); return 0; } if(b==d) { if(a<c) printf("%d",d-c); else printf("%d",b-a); return 0; } if(a==c) { if(b>d) printf("%d",d-c); else printf("%d",b-a); return 0; } } return 0; } | main.c:1:19: warning: extra tokens at end of #include directive
1 | #include<stdio.h> #include<math.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==0&&c!=0&&d>b)||(a<c&&b<d)) { printf("%d",b-c); return 0; } if((c==0&&a!=0&&d<b)||(a>c&&b>d)) { printf("%d",d-a); return 0; } if(a>c&&b<d) { printf("%d",b-a); return 0; } if(c>a&&d<b) { printf("%d",d-c); return 0; } if(a==0&&c==0) { if(b<d) printf("%d",b); else printf("%d",d); return 0; } if(a==c&&b==d) { printf("%d",b-a); return 0; } if(b==d) { if(a<c) printf("%d",d-c); else printf("%d",b-a); return 0; } if(a==c) { if(b>d) printf("%d",d-c); else printf("%d",b-a); return 0; } } return 0; }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s207880688 | p03632 | C | #include<stdio.h>
int main()
{
int a,b,c,d;
while(scanf("%d %d %d %d",&a,&b,&c,&d)!=EOF)
if(c>=b||a>=d)
printf("0");
if(c<=b&&c>a&&d<=b)
printf("%d",d-c);
if(c<b&&c>a&&d>b)
printf("%d",b-c);
if(a<=d&&a>c&&b<=d)
printf("%d",b-a);
if(a<d&&a>c&&b>d)
printf("%d",d-a);
if(a=c&&b=d)
printf("%d",&b-a);
return 0;
} | main.c: In function 'main':
main.c:16:18: error: lvalue required as left operand of assignment
16 | if(a=c&&b=d)
| ^
|
s162407924 | p03632 | C++ | ./Main.c: In function ‘main’:
./Main.c:7:8: error: expected expression before ‘int’
if(a!=int(a))
^
./Main.c:9:13: error: expected expression before ‘int’
else if(b!=int(b))
^
./Main.c:11:13: error: expected expression before ‘int’
else if(c!=int(c))
^
./Main.c:13:13: error: expected expression before ‘int’
else if(d!=int(d))
^
./Main.c:5:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
^ | a.cc:1:23: error: extended character ‘ is not valid in an identifier
1 | ./Main.c: In function ‘main’:
| ^
a.cc:1:23: error: extended character ’ is not valid in an identifier
a.cc:2:49: error: extended character ‘ is not valid in an identifier
2 | ./Main.c:7:8: error: expected expression before ‘int’
| ^
a.cc:2:49: error: extended character ’ is not valid in an identifier
a.cc:5:50: error: extended character ‘ is not valid in an identifier
5 | ./Main.c:9:13: error: expected expression before ‘int’
| ^
a.cc:5:50: error: extended character ’ is not valid in an identifier
a.cc:8:51: error: extended character ‘ is not valid in an identifier
8 | ./Main.c:11:13: error: expected expression before ‘int’
| ^
a.cc:8:51: error: extended character ’ is not valid in an identifier
a.cc:11:51: error: extended character ‘ is not valid in an identifier
11 | ./Main.c:13:13: error: expected expression before ‘int’
| ^
a.cc:11:51: error: extended character ’ is not valid in an identifier
a.cc:14:49: error: extended character ‘ is not valid in an identifier
14 | ./Main.c:5:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
| ^
a.cc:14:49: error: extended character ’ is not valid in an identifier
a.cc:1:1: error: expected unqualified-id before '.' token
1 | ./Main.c: In function ‘main’:
| ^
a.cc:16:1: error: expected unqualified-id before '^' token
16 | ^
| ^
|
s616344650 | p03632 | C | #include<stdio.h>
int main(void)
{
double n,i,m,a,b,c,d,x,y;
scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
if(a!=int(a))
return -1;
else if(b!=int(b))
return -1;
else if(c!=int(c))
return -1;
else if(d!=int(d))
return -1;
if(a<0||a>=b||a>100||b<=0||b>100)
return -1;
else if(c<0||c>=d||c>100||d<=0||d>100)
return -1;
else if(b<c)
printf("0\n");
else if(a<=c&&b>=d)
printf("%lf\n",d-c);
else if(a>=c&&b<=d)
printf("%lf\n",b-a);
else
printf("%.0lf\n",b-c);
return 0;
} | main.c: In function 'main':
main.c:7:15: error: expected expression before 'int'
7 | if(a!=int(a))
| ^~~
main.c:9:20: error: expected expression before 'int'
9 | else if(b!=int(b))
| ^~~
main.c:11:20: error: expected expression before 'int'
11 | else if(c!=int(c))
| ^~~
main.c:13:20: error: expected expression before 'int'
13 | else if(d!=int(d))
| ^~~
|
s472213866 | p03632 | C | #include<stdio.h>
#define max(a,c) ((a)>=(c)?(a):(c))
#define min(b,d) ((b)=<(d)?(b):(d))
int main()
{
int a,b,c,d,min,max;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(a>d&&c>b)
printf("0\n");
else
{
min=min(b,d);
max=max(a,c);
printf("%d\n",min-max);
}
return 0;
} | main.c: In function 'main':
main.c:3:23: error: expected expression before '<' token
3 | #define min(b,d) ((b)=<(d)?(b):(d))
| ^
main.c:12:21: note: in expansion of macro 'min'
12 | min=min(b,d);
| ^~~
|
s436376925 | 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.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.