submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s473776067
p03694
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ int n char a[100]; scanf("%d",&n); for(int i=0;i<n;i++)scanf("%c",&a[i]); qsort(a,n,sizeof(int),strcmp); printf("%d",a[n-1]-a[0]); return 0; }
main.c: In function 'main': main.c:5:8: error: expected ';' before 'char' 5 | int n | ^ | ; 6 | char a[100]; | ~~~~ main.c:7:15: error: 'n' undeclared (first use in this function) 7 | scanf("%d",&n); | ^ main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in main.c:9:25: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types] 9 | qsort(a,n,sizeof(int),strcmp); | ^~~~~~ | | | int (*)(const char *, const char *) In file included from main.c:2: /usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(const char *, const char *)' 971 | __compar_fn_t __compar) __nonnull ((1, 4)); | ~~~~~~~~~~~~~~^~~~~~~~
s939529048
p03694
C++
#include <iostream> #include <vector> using namespace std; int main(){ int n, ans; cin >> n; vector<int> a(n); for(int i=0;i<a.size();i++){ cin >> a[i]; } ans = *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end()); cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:15: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'? 13 | ans = *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end()); | ^~~~~~~~~~~ | tuple_element a.cc:13:55: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? 13 | ans = *std::max_element(a.begin(), a.end()) - *std::min_element(a.begin(), a.end()); | ^~~~~~~~~~~ | tuple_element
s964064884
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> a(n); for (int i=0;i<n;i++){ cin >> a[i]; } sort(a..begin(),a.end()); cout << a[n-1]-a[0] << endl; }
a.cc: In function 'int main()': a.cc:10:10: error: expected unqualified-id before '.' token 10 | sort(a..begin(),a.end()); | ^
s539705882
p03694
Java
import java.util.Scanner; import java.util.List; import java.util.ArrayList; import java.util.Collections; class Main { public static void main(string args[]) { Scanner std = new Scanner(System.in); List<Integer> list = new ArrayList<>(); int N = std.nextInt(); for(int i = 0; i < N; i++) { int a = std.next(); list.add(a); } Integer x = Collections.max(list); Integer y = Collections.min(list); } }
Main.java:7: error: cannot find symbol public static void main(string args[]) { ^ symbol: class string location: class Main Main.java:14: error: incompatible types: String cannot be converted to int int a = std.next(); ^ 2 errors
s692313529
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; int a[N]; for(int i=0;i<N;i++){ cin>>a[i]; } sort(a.begin(),a.end()); cout<<a.at(N-1)-a.at(0)<<endl; }
a.cc: In function 'int main()': a.cc:13:10: error: request for member 'begin' in 'a', which is of non-class type 'int [N]' 13 | sort(a.begin(),a.end()); | ^~~~~ a.cc:13:20: error: request for member 'end' in 'a', which is of non-class type 'int [N]' 13 | sort(a.begin(),a.end()); | ^~~ a.cc:15:11: error: request for member 'at' in 'a', which is of non-class type 'int [N]' 15 | cout<<a.at(N-1)-a.at(0)<<endl; | ^~ a.cc:15:21: error: request for member 'at' in 'a', which is of non-class type 'int [N]' 15 | cout<<a.at(N-1)-a.at(0)<<endl; | ^~
s719902793
p03694
C++
include <iostream> #include <algorithm> using namespace std; int main(){ int N; cin>>N; int a[N]; for(int i=0;i<N;i++){ cin>>a[i]; } sort(a,a+N); cout<<a[N-1]-a[0]<<endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
s300307746
p03694
C++
using namespace std; #include <bits/stdc++.h> #define rep(i, s) for (int i = 0; i < s; ++i) #define repr(i, n) for(int i = n; i >= 0; i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define all(v) (v.begin(), v.end()) #define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i) #define VEC(a, n) vector<int>a(n) #define PQ(a) priority_queue<int>a #define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a #define PAIR pair<int, int> typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; #define EPS (1e-7) #define INF (1e10) #define PI (acos(-1)) const ll mod = 1000000007; int main(){ ios::sync_with_stdio(false); cin.tie(0); int N; cin>>N; VEC(A,N); rep(i,N) cin>>A[i]; sortall(A); cout<<A[N-1]-A[0]<<endl; }
a.cc: In function 'int main()': a.cc:28:3: error: 'sortall' was not declared in this scope; did you mean 'strtoll'? 28 | sortall(A); | ^~~~~~~ | strtoll
s408854660
p03694
C++
using namespace std; #include <bits/stdc++.h> #define rep(i, s) for (int i = 0; i < s; ++i) #define repr(i, n) for(int i = n; i >= 0; i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define all(v) (v.begin(), v.end()) #define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i) #define VEC(a, n) vector<int>a(n) #define PQ(a) priority_queue<int>a #define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a #define PAIR pair<int, int> typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; #define EPS (1e-7) #define INF (1e10) #define PI (acos(-1)) const ll mod = 1000000007; int main(){ ios::sync_with_stdio(false); cin.tie(0); int N; cin>>N; int A[N]; rep(i,N) cin>>A[i]; sort(A.begin(),A.end()); cout<<A[N-1]-A[0]<<endl; }
a.cc: In function 'int main()': a.cc:28:10: error: request for member 'begin' in 'A', which is of non-class type 'int [N]' 28 | sort(A.begin(),A.end()); | ^~~~~ a.cc:28:20: error: request for member 'end' in 'A', which is of non-class type 'int [N]' 28 | sort(A.begin(),A.end()); | ^~~
s175311605
p03694
C++
using namespace std; #include <bits/stdc++.h> #define rep(i, s) for (int i = 0; i < s; ++i) #define repr(i, n) for(int i = n; i >= 0; i--) #define FOR(i, m, n) for(int i = m; i < n; i++) #define all(v) (v.begin(), v.end()) #define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i) #define VEC(a, n) vector<int>a(n) #define PQ(a) priority_queue<int>a #define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a #define PAIR pair<int, int> typedef long long ll; typedef pair<ll, ll> l_l; typedef pair<int, int> i_i; #define EPS (1e-7) #define INF (1e10) #define PI (acos(-1)) const ll mod = 1000000007; int main(){ ios::sync_with_stdio(false); cin.tie(0); int N; cin>>N; int A[N]; rep(i,N) cin>>A[i]; sort(all(A)); cout<<A[N-1]-A[0]<<endl; }
a.cc: In function 'int main()': a.cc:6:19: error: request for member 'begin' in 'A', which is of non-class type 'int [N]' 6 | #define all(v) (v.begin(), v.end()) | ^~~~~ a.cc:28:8: note: in expansion of macro 'all' 28 | sort(all(A)); | ^~~ a.cc:6:30: error: request for member 'end' in 'A', which is of non-class type 'int [N]' 6 | #define all(v) (v.begin(), v.end()) | ^~~ a.cc:28:8: note: in expansion of macro 'all' 28 | sort(all(A)); | ^~~
s527331669
p03694
C++
#include <iostream> #include <vector> using namespace std; signed main() { int n; cin >> n; vector<int> vec(n); for(int i = 0; i < n; i++) cin >> vec.at(i); sort(vec.begin(), vec.end()); cout << vec.at(vec.size()-1) - vec.at(0) << endl; }
a.cc: In function 'int main()': a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'? 9 | sort(vec.begin(), vec.end()); | ^~~~ | short
s177801103
p03694
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void){ int N; cin >> N; vector<int>house(N,0); for(int i=0;i<N;i++){ cin >> house[i]; } sort(house.begin(),house,end()); int ans = 0; int now_house = house[0]; for(int i=1;i<N;i++){ ans += house[i] - now_house; now_house = house[i]; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:31: error: no matching function for call to 'end()' 15 | sort(house.begin(),house,end()); | ~~~^~ In file included from /usr/include/c++/14/bits/range_access.h:36, from /usr/include/c++/14/string:53, 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/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ /usr/include/c++/14/initializer_list:99:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:115:31: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 115 | template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept; | ^~~ /usr/include/c++/14/bits/range_access.h:115:31: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:116:37: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 116 | template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept; | ^~~ /usr/include/c++/14/bits/range_access.h:116:37: note: candidate expects 1 argument, 0 provided
s066176270
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,A[110]; cin >> N; for (i=0;i<N;i++){ cin >> A[i]; } sort(A,A+N); cout << A[N-1]-A[0] <<endl; }
a.cc: In function 'int main()': a.cc:7:8: error: 'i' was not declared in this scope 7 | for (i=0;i<N;i++){ | ^
s189661194
p03694
C++
#include <bits/stdc++.h> #define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i]; typedef long long int ll; using namespace std; int main(){ int n; cin >>n; vector<int> a(n); cinf(n,a); sort(a.begin(),a.end()); cout << a[m-1]-a[0]<< endl; }
a.cc: In function 'int main()': a.cc:11:19: error: 'm' was not declared in this scope 11 | cout << a[m-1]-a[0]<< endl; | ^
s602903246
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; int a[N]; for(int i=0;i<N;i++) cin>>a[i]; sort(a.begin(),a.end()); int ans = a[N-1] - a[0]; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:12: error: request for member 'begin' in 'a', which is of non-class type 'int [N]' 9 | sort(a.begin(),a.end()); | ^~~~~ a.cc:9:22: error: request for member 'end' in 'a', which is of non-class type 'int [N]' 9 | sort(a.begin(),a.end()); | ^~~
s891350309
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int> a[N]; for(int i=0;i<N;i++) cin>>a[i]; sort(a.begin(),a.end()); int ans = a[N-1] - a[0]; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:8:29: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 8 | for(int i=0;i<N;i++) cin>>a[i]; | ~~~^~~~~~ | | | | | std::vector<int> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<int>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<int>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<int>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<int>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~
s557213855
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int> a; for(int i=0;i<N;i++) a[i].push_back(); sort(a.begin(),a.end()); int ans = a[N-1] - a[0]; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:8:31: error: request for member 'push_back' in 'a.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} 8 | for(int i=0;i<N;i++) a[i].push_back(); | ^~~~~~~~~
s066927605
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int> a; for(i=0;i<N;i++) a[i].push_back(); sort(a.begin(),a.end()); int ans = a[N-1] - a[0]; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:8:9: error: 'i' was not declared in this scope 8 | for(i=0;i<N;i++) a[i].push_back(); | ^
s375565845
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; for (int i=0;i<N;i++){ cin >> a[i]; } sort(a,a+N); cout << a[N-1]-a[0] << endl; }
a.cc: In function 'int main()': a.cc:7:16: error: 'a' was not declared in this scope 7 | cin >> a[i]; | ^ a.cc:9:12: error: 'a' was not declared in this scope 9 | sort(a,a+N); | ^
s439503846
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,sum=0; cin >> n; vector<int> v(n); for(int i=0; i<n; i++) { cin >> v[i]; } sort(v.begin(),v.end()); reverse(v.begin(),end()); for(int i=0; i<n; i++) { sum+=v[i+1]-v[i]; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:12:24: error: no matching function for call to 'end()' 12 | reverse(v.begin(),end()); | ~~~^~ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ /usr/include/c++/14/initializer_list:99:5: note: candidate expects 1 argument, 0 provided In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: candidate expects 1 argument, 0 provided In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 1249 | end(valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1249:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 1265 | end(const valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1265:5: note: candidate expects 1 argument, 0 provided
s513294955
p03694
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int N,a; cin>>N; cin>>a; maxv=a;minv=a; for(int i=1;i<N;++i){ cin>>a; maxv=max(a,maxv); minv=min(a,minv); } cout<<maxv-minv<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'maxv' was not declared in this scope 9 | maxv=a;minv=a; | ^~~~ a.cc:9:16: error: 'minv' was not declared in this scope 9 | maxv=a;minv=a; | ^~~~
s436527509
p03694
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define Abs(x)((x) < 0 ? (x) * -1 : (x)) #define rep(x, y) for ((x) = 0; (x) < (y); (x)++) #define repin(x, y) for ((x) = 0; (x) <= (y); (x)++) #define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--) #define nepi(x, y, z) for ((x) = (y) - 1; (z) <= (x); (x)--) #define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++) #define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++) #define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z)) #define repis(x, y, z, s) for ((x) = (z); (x) < (y); (x) += (s)) #define repiins(x, y, z, s) for ((x) = (z); (x) <= (y); (x) += (s)) #define repit(x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++) #define nepit(x) for (__typeof((x).rbegin()) it = (x).rbegin(); it != (x).rend(); it++) #define All(x) (x).begin(),(x).end() #define Mem0(x) memset(x, 0, sizeof(x)) #define Mem1(x) memset(x, -1, sizeof(x)) #define Unique(v) v.resize(unique(All(v)) - v.begin()) #define peq(p0, p1)(p0.first == p1.first && p0.second == p1.second) #define End '\n' #define Out(x) cout<<(x)<<End #define OutP(p, sep, end) cout<<p.first<<sep<<p.second<<end template<typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; } template<typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; } template<typename T> using V = vector<T>; template<typename T> using VV = V<V<T> >; #define pb push_back #define mp make_pair #define X first #define Y second #define lb std::lower_bound #define ub std::upper_bound #define lbi(v, x) lb(All(v), (x))-v.begin() #define ubi(v, x) ub(All(v), (x))-v.begin() static const ll MOD = 1e9 + 7; static const double PI = 3.141592653589793; #define LOCAL 0 int main() { #if LOCAL freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); freopen("debug.txt", "w", stderr); #endif cin.tie(0); ios::sync_with_stdio(false); //std::cout.precision(18); int n; cin >> n; int ma = -1; int mi = INT_max; int x; int i; rep(i, n) { cin >> x; Max(ma, x); Min(mi, x); } Out(ma - mi); return 0; }
a.cc: In function 'int main()': a.cc:72:18: error: 'INT_max' was not declared in this scope; did you mean 'INT_MAX'? 72 | int mi = INT_max; | ^~~~~~~ | INT_MAX
s972472848
p03694
Java
import java.util.*; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List<Integer> list_a = new ArrayList<Integer>(); for(int i = 0; i < n; i++){ int din = sc.nextInt(); list_a.add(din); } Collections.sort(list_a); int ans = 0; for(int i = 1; i < n; i++){ //char c = (i == n - 1)? '\n' : ' '; //System.out.print(list_a.get(i)); //System.out.print(c); ans += list_a.get(i) - list_a.get(i - 1); } System.out.println(ans); } }
Main.java:3: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s065070606
p03694
C
#include<stdio.h> int main(){ int N, a, max = 0, min = 1001; scanf("%d", &N); for (i = 0; i < N; i++){ scanf("%d", &a); if(a > max){ max = a; } if(a < min){ min = a; } } printf("%d\n", max - min); return 0; }
main.c: In function 'main': main.c:8:8: error: 'i' undeclared (first use in this function) 8 | for (i = 0; i < N; i++){ | ^ main.c:8:8: note: each undeclared identifier is reported only once for each function it appears in
s273947426
p03694
C++
#include<iostream> using namespace std; int main() { int N; int a[110]; cin >>N; for(int i=0;i<N;i++) cin >>a[i]; sort(a,a+N); cout<<a[N-1]-a[0]<<endl; }
a.cc: In function 'int main()': a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a,a+N); | ^~~~ | short
s067930021
p03694
C++
#include<iostream> using namespace std; int n, max, min, a; int main() { cin >> n; max = 0; min = 99999999; for (int i = 0; i < n; i++) { cin >> a; if (a > max)max = a; if (a < min)min = a; } cout << max - min << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: reference to 'max' is ambiguous 8 | max = 0; | ^~~ 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:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:8: note: 'int max' 4 | int n, max, min, a; | ^~~ a.cc:9:9: error: reference to 'min' is ambiguous 9 | min = 99999999; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:13: note: 'int min' 4 | int n, max, min, a; | ^~~ a.cc:12:25: error: reference to 'max' is ambiguous 12 | if (a > max)max = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:8: note: 'int max' 4 | int n, max, min, a; | ^~~ a.cc:12:29: error: reference to 'max' is ambiguous 12 | if (a > max)max = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:8: note: 'int max' 4 | int n, max, min, a; | ^~~ a.cc:13:25: error: reference to 'min' is ambiguous 13 | if (a < min)min = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:13: note: 'int min' 4 | int n, max, min, a; | ^~~ a.cc:13:29: error: reference to 'min' is ambiguous 13 | if (a < min)min = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:13: note: 'int min' 4 | int n, max, min, a; | ^~~ a.cc:15:17: error: reference to 'max' is ambiguous 15 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:8: note: 'int max' 4 | int n, max, min, a; | ^~~ a.cc:15:23: error: reference to 'min' is ambiguous 15 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:13: note: 'int min' 4 | int n, max, min, a; | ^~~
s850904577
p03694
C++
#include<iostream> using namespace std; int n, max, min, a; int main() { cin >> n; max = -9999999; min = 99999999; for (int i = 0; i < n; i++) { cin >> a; if (a > max)max = a; if (a < min)min = a; } cout << max - min << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: reference to 'max' is ambiguous 8 | max = -9999999; | ^~~ 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:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:8: note: 'int max' 4 | int n, max, min, a; | ^~~ a.cc:9:9: error: reference to 'min' is ambiguous 9 | min = 99999999; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:13: note: 'int min' 4 | int n, max, min, a; | ^~~ a.cc:12:25: error: reference to 'max' is ambiguous 12 | if (a > max)max = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:8: note: 'int max' 4 | int n, max, min, a; | ^~~ a.cc:12:29: error: reference to 'max' is ambiguous 12 | if (a > max)max = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:8: note: 'int max' 4 | int n, max, min, a; | ^~~ a.cc:13:25: error: reference to 'min' is ambiguous 13 | if (a < min)min = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:13: note: 'int min' 4 | int n, max, min, a; | ^~~ a.cc:13:29: error: reference to 'min' is ambiguous 13 | if (a < min)min = a; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:13: note: 'int min' 4 | int n, max, min, a; | ^~~ a.cc:15:17: error: reference to 'max' is ambiguous 15 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:8: note: 'int max' 4 | int n, max, min, a; | ^~~ a.cc:15:23: error: reference to 'min' is ambiguous 15 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:4:13: note: 'int min' 4 | int n, max, min, a; | ^~~
s301816247
p03694
C++
#include<iostream> using namespace std; #define MAX 500000 #define SENTINEL 2000000000 int L[MAX/2 + 2], R[MAX/2+2]; int cnt; void merge(int A[], int n, int left, int mid, int right){ int n1 = mid - left; int n2 = right - mid; for( int i = 0; i < n1; i++ )L[i] = A[left + i]; for( int i = 0; i < n2; i++ )R[i] = A[mid + i]; L[n1] = R[n2] = SENTINEL; int i = 0, j = 0; for ( int k = left; k < right; k++ ){ cnt++; if(L[i] <= R[j]){ A[k] = L[i++]; }else{ A[k] = R[j++]; } } } void mergeSort(int A[], int n, int left, int right){ if( left+1 < right){ int mid = (left + right) / 2; mergeSort(A, n, left, mid); mergeSort(A, n, mid, right); merge(A, n, left, mid, right); } } int main(){ int n;cin>>n; int a, min=1001,max=01; for(int i=1;i<=n;i++){ cin>>a; if(min>A)min=a; if(max<a)max=a; } cou<<max-min<<endl; return 0; }
a.cc: In function 'int main()': a.cc:40:12: error: 'A' was not declared in this scope 40 | if(min>A)min=a; | ^ a.cc:43:3: error: 'cou' was not declared in this scope 43 | cou<<max-min<<endl; | ^~~
s293622879
p03694
C
#include <stdio.h> #include <climits> int main(void){ int n; scanf("%d", &n); int min = INT_MAX; int max = INT_MIN; for(int i = 0; i < n; i++){ int a; scanf("%d", &a); if(a < min) min = a; if(max < a) max = a; } printf("%d\n", max - min); return 0; }
main.c:2:10: fatal error: climits: No such file or directory 2 | #include <climits> | ^~~~~~~~~ compilation terminated.
s423847352
p03694
C++
#include<bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define int long long #define vec(a,n) vector<int> (a)((n)) #define Vec(a,n) vector<string> (a)((n)) using namespace std; signed main(){ int n; cin >> n; vec(a,n); REP(i,n){ cin >> a[i]; } sort(a.bebin(),a.end()); cout << a[n-1]-a[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:16: error: 'class std::vector<long long int>' has no member named 'bebin'; did you mean 'begin'? 15 | sort(a.bebin(),a.end()); | ^~~~~ | begin
s278140218
p03694
C++
#include<bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define int long long using namespace std; signed main(){ int n; cin >> n; vec(a,n); REP(i,n){ cin >> a[i]; } sort(a.bebin(),a.end()); cout << a[n-1]-a[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:13: error: 'a' was not declared in this scope 9 | vec(a,n); | ^ a.cc:9:9: error: 'vec' was not declared in this scope 9 | vec(a,n); | ^~~
s731097961
p03694
C++
#include<bits/stdc++.h> #include<vector> using namespace std; int n, a; int max = -1; int min = 1001; int main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> a; if(Min > a) Min = a; if(Max < a) Max = a; } cout << Max - Min << endl; }
a.cc: In function 'int main()': a.cc:11:8: error: 'Min' was not declared in this scope; did you mean 'min'? 11 | if(Min > a) Min = a; | ^~~ | min a.cc:12:8: error: 'Max' was not declared in this scope; did you mean 'max'? 12 | if(Max < a) Max = a; | ^~~ | max a.cc:14:11: error: 'Max' was not declared in this scope; did you mean 'max'? 14 | cout << Max - Min << endl; | ^~~ | max a.cc:14:17: error: 'Min' was not declared in this scope; did you mean 'min'? 14 | cout << Max - Min << endl; | ^~~ | min
s341408844
p03694
C++
#include<bits/stdc++.h> #include<vector> using namespace std; int n, a; int max = -1; int min = 1001; int main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> a; if(min > a) min = a; if(max < a) max = a; } cout << max - min << endl; }
a.cc: In function 'int main()': a.cc:11:8: error: reference to 'min' is ambiguous 11 | if(min > a) min = a; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ In file included from /usr/include/c++/14/algorithm:60: /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:5: note: 'int min' 6 | int min = 1001; | ^~~ a.cc:11:17: error: reference to 'min' is ambiguous 11 | if(min > a) min = a; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:5: note: 'int min' 6 | int min = 1001; | ^~~ a.cc:12:8: error: reference to 'max' is ambiguous 12 | if(max < a) max = a; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:5: note: 'int max' 5 | int max = -1; | ^~~ a.cc:12:17: error: reference to 'max' is ambiguous 12 | if(max < a) max = a; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:5: note: 'int max' 5 | int max = -1; | ^~~ a.cc:14:11: error: reference to 'max' is ambiguous 14 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: '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:5706:5: note: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:5:5: note: 'int max' 5 | int max = -1; | ^~~ a.cc:14:17: error: reference to 'min' is ambiguous 14 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidates are: '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:5686:5: note: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:6:5: note: 'int min' 6 | int min = 1001; | ^~~
s386393921
p03694
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int N; cin>>N; vector<int> vec[N]; for(int i=0;i<N;++i){ cin>>vec[i]; } sort(vec.begin(),vec.end()); cout<<vec[N-1]-vec[0]<<endl; }
a.cc: In function 'int main()': a.cc:12:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 12 | cin>>vec[i]; | ~~~^~~~~~~~ | | | | | std::vector<int> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<int>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<int>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<int>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<int>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ 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++/1
s873570383
p03694
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N; cin >> N; for(int i = 0; i < N; i++){ cin >> a.at(i); } sort(a.begin(), a.end()); cout << a.back() - a.front(); return 0; }
a.cc: In function 'int main()': a.cc:12:12: error: 'a' was not declared in this scope 12 | cin >> a.at(i); | ^ a.cc:14:8: error: 'a' was not declared in this scope 14 | sort(a.begin(), a.end()); | ^
s032645648
p03694
C++
#include <iostream> using namespace std; int main(void){ int n,a; cin >>n; for(int i=0;i<=n;i++){ cin >>a; } int min,max; for(int j=0;j<=n-2;j++){ if(a[j]<a[j+1]){ min=a[j]; } else{ min=a[j+1]; } for(int j=0;j<=n-2;j++){ if(a[j]<a[j+1]){ max=a[j+1]; } else{ max=a[j]; } cout <<max-min; return 0; }
a.cc: In function 'int main()': a.cc:13:13: error: invalid types 'int[int]' for array subscript 13 | if(a[j]<a[j+1]){ | ^ a.cc:13:18: error: invalid types 'int[int]' for array subscript 13 | if(a[j]<a[j+1]){ | ^ a.cc:14:18: error: invalid types 'int[int]' for array subscript 14 | min=a[j]; | ^ a.cc:17:18: error: invalid types 'int[int]' for array subscript 17 | min=a[j+1]; | ^ a.cc:21:13: error: invalid types 'int[int]' for array subscript 21 | if(a[j]<a[j+1]){ | ^ a.cc:21:18: error: invalid types 'int[int]' for array subscript 21 | if(a[j]<a[j+1]){ | ^ a.cc:22:18: error: invalid types 'int[int]' for array subscript 22 | max=a[j+1]; | ^ a.cc:25:18: error: invalid types 'int[int]' for array subscript 25 | max=a[j]; | ^ a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:12:28: note: to match this '{' 12 | for(int j=0;j<=n-2;j++){ | ^ a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s540114307
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int a[100],n; cin>>n; for (int i = 0; i < n; ++i) { cin>>a[i] sort(a,a+n); } printf("%d\n",a[n-1]-a[0] ); return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:9:26: error: expected ';' before 'sort' 9 | cin>>a[i] | ^ | ; 10 | sort(a,a+n); | ~~~~
s872369972
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int a[100],n; cin>>n; for (int i = 0; i < n; ++i) { cin>>a[i] sort(a,a+n) } printf("%d\n",a[n-1]-a[0] ); return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:9:26: error: expected ';' before 'sort' 9 | cin>>a[i] | ^ | ; 10 | sort(a,a+n) | ~~~~
s182453807
p03694
C++
#incllude<cstdio> #include<algorithm> using namespace std; int a[100001]; int main() { int n,i; scanf("%d",&n); for(int i=1;i<=n;i++)scanf("%d",&a[i]); sort(a+1,a+n+1); printf("%d\n",a[n]-a[1]); return 0; }
a.cc:1:2: error: invalid preprocessing directive #incllude; did you mean #include? 1 | #incllude<cstdio> | ^~~~~~~~ | include a.cc: In function 'int main()': a.cc:8:5: error: 'scanf' was not declared in this scope 8 | scanf("%d",&n); | ^~~~~ a.cc:11:5: error: 'printf' was not declared in this scope 11 | printf("%d\n",a[n]-a[1]); | ^~~~~~ a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 2 | #include<algorithm> +++ |+#include <cstdio> 3 | using namespace std;
s349047255
p03694
C++
#include<bits/stdc++.h> using namespace std; int a=0x7f7f7f7f,b=-0x3f3f3f3f,n; int main(){ cin>>n; for(i=1;i<=n;i++){ int x; cin>>x; a=min(a,x); b=max(b,x); } cout<<b-a<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'i' was not declared in this scope 6 | for(i=1;i<=n;i++){ | ^
s480995427
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,array[101]; cin>>a; for(int i=0;i<a;i++){ cin>>array[i]; } sort(arrray,array+a); cout<<array[a-1]-array[0]<<endl; }
a.cc: In function 'int main()': a.cc:10:8: error: 'arrray' was not declared in this scope; did you mean 'array'? 10 | sort(arrray,array+a); | ^~~~~~ | array
s086349693
p03694
C++
#include<iostream> #include<algorithm> #include<math.h> #include<cstdio> #include<ctype.h> #include<stdio.h> #include<set> #include<vector> #include<map> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<numeric> #include<string> typedef long long ll; using namespace std; ll gcd(ll a, ll b){ if(a<b){return gcd(b,a);} else if(a%b){return gcd(b,a%b);} else{return b;} } int main(){ int N,A,MIN=1001,MAX=-1; cin>>N; for(int i=1; i<=N; ++i) cin>>A; if(MIN>A) MIN=A; if(MAX<A) MAX=A; } cout<<MAX-MIN<<endl; }
a.cc:33:3: error: 'cout' does not name a type 33 | cout<<MAX-MIN<<endl; | ^~~~ a.cc:34:1: error: expected declaration before '}' token 34 | } | ^
s985009377
p03694
C++
#include<iostream> #include<vector> using namespace std; int main() { int N; cin >> N; vector<int> xs(N); for(int i = 0; i < N; i++) cin >> xs[i]; sort(xs.begin(), xs.end()); cout << xs[N-1] - xs[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(xs.begin(), xs.end()); | ^~~~ | short
s882032732
p03694
C
#include<stdio.h> int main(){ int n,min=1000,max=0,a,i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a); if(min>a) min=a; if(max<a) max=a; } printf("%d\n"max-min); }
main.c: In function 'main': main.c:13:16: error: expected ')' before 'max' 13 | printf("%d\n"max-min); | ~ ^~~ | )
s260021440
p03694
C++
#include "bits/stdc++.h" using namespace std; #define MOD 1000000007 #define FOR(i,a,b) for(long long i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define dump(x) cout << #x << " = " << (x) << endl; #define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; typedef long long ll; typedef pair<ll,ll> P; typedef vector<vector<P>> Graph; int main(){ int n; cin >> n; int v[n]; REP(i,n){ cin >> v[i]; } sort(v,v+n); cout << v[n-1] - v[0] << endl return 0; }
a.cc: In function 'int main()': a.cc:26:32: error: expected ';' before 'return' 26 | cout << v[n-1] - v[0] << endl | ^ | ; ...... 30 | return 0; | ~~~~~~
s775681687
p03694
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a; for (int i = 0; i < n; i++) { cin >> a[i]; } int m = *min_element(a, a+n); int M = *max_element(a, a+n); cout << M-m << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:28: error: no match for 'operator+' (operand types are 'std::vector<int>' and 'int') 14 | int m = *min_element(a, a+n); | ~^~ | | | | | int | std::vector<int> In file included from /usr/include/c++/14/string:48, 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_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:14:29: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:14:29: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 14 | int m = *min_element(a, a+n); | ^ In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:14:29: note: 'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:14:29: note: mismatched types 'const _CharT*' and 'std::vector<int>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:14:29: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:14:29: note: 'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:14:29: note: 'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:14:29: note: 'std::vector<int>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:14:29: note: 'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:14:29: note: 'std::vector<int>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:14:29: note: mismatched types 'const _CharT*' and 'std::vector<int>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:14:29: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:14:29: note: 'std::vector<int>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 14 | int m = *min_element(a, a+n); | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:14:29: note: 'std::vector<int>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 14 | int m = *min_element(a, a+n); | ^ a.cc:15:28: error: no match for 'operator+' (operand types are 'std::vector<int>' and 'int') 15 | int M = *max_element(a, a+n); | ~^~ | | | | | int | std::vector<int> /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterato
s860736385
p03694
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a; for (int i = 0; i < n; i++) { cin >> a[i]; } int m = min(a); int M = max(a); cout << M-m << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:14: error: no matching function for call to 'min(std::vector<int>&)' 14 | int m = min(a); | ~~~^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: template argument deduction/substitution failed: a.cc:14:14: note: 'std::vector<int>' is not derived from 'std::initializer_list<_Tp>' 14 | int m = min(a); | ~~~^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate expects 2 arguments, 1 provided a.cc:15:14: error: no matching function for call to 'max(std::vector<int>&)' 15 | int M = max(a); | ~~~^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed: a.cc:15:14: note: 'std::vector<int>' is not derived from 'std::initializer_list<_Tp>' 15 | int M = max(a); | ~~~^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided
s185937599
p03694
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a; for (int i = 0; i < n; i++) { cin >> a[i]; } int m = min(a.begin(), a.end()); int M = max(a.begin(), a.end()); cout << M-m << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:14: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization 14 | int m = min(a.begin(), a.end()); | ~~~^~~~~~~~~~~~~~~~~~~~ | | | const __gnu_cxx::__normal_iterator<int*, std::vector<int> > a.cc:15:14: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization 15 | int M = max(a.begin(), a.end()); | ~~~^~~~~~~~~~~~~~~~~~~~ | | | const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
s931044776
p03694
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { int n; cin >> n; int a[110]; for (int i = 0; i < n; i++) { cin >> a[i]; } int m = min(a, a+n); int M = max(a, a+n); cout << M-m << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:14: error: no matching function for call to 'min(int [110], int*)' 14 | int m = min(a, a+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: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: template argument deduction/substitution failed: a.cc:14:14: note: deduced conflicting types for parameter 'const _Tp' ('int [110]' and 'int*') 14 | int m = min(a, a+n); | ~~~^~~~~~~~ /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, 2 provided In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /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, 2 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: template argument deduction/substitution failed: a.cc:14:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int*' 14 | int m = min(a, a+n); | ~~~^~~~~~~~ a.cc:15:14: error: no matching function for call to 'max(int [110], int*)' 15 | int M = max(a, a+n); | ~~~^~~~~~~~ /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:15:14: note: deduced conflicting types for parameter 'const _Tp' ('int [110]' and 'int*') 15 | int M = max(a, a+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 /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:15:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int*' 15 | int M = max(a, a+n); | ~~~^~~~~~~~
s915479701
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<int>a(n); for(int i=0;i<n;i++){ cin>>a.at(i); } sort(a.begin(),a.end()); cout<<a(n-1)-a(0)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:8: error: no match for call to '(std::vector<int>) (int)' 12 | cout<<a(n-1)-a(0)<<endl; | ~^~~~~ a.cc:12:15: error: no match for call to '(std::vector<int>) (int)' 12 | cout<<a(n-1)-a(0)<<endl; | ~^~~
s719791370
p03694
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> using namespace std; int main (void) { int N; cin >>N; ans_max=0; ans_min=0; for (int i; i<=N-1; i++){ int j; cin >> k; asn_max=max(ans_max,k); asn_min=max(ans_min,k); } cout << ans_max-ans_min; }
a.cc: In function 'int main()': a.cc:10:3: error: 'ans_max' was not declared in this scope 10 | ans_max=0; | ^~~~~~~ a.cc:11:3: error: 'ans_min' was not declared in this scope; did you mean 'asin'? 11 | ans_min=0; | ^~~~~~~ | asin a.cc:13:19: error: 'k' was not declared in this scope 13 | int j; cin >> k; | ^ a.cc:14:5: error: 'asn_max' was not declared in this scope 14 | asn_max=max(ans_max,k); | ^~~~~~~ a.cc:15:5: error: 'asn_min' was not declared in this scope; did you mean 'asin'? 15 | asn_min=max(ans_min,k); | ^~~~~~~ | asin
s186050940
p03694
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n; cin>>n; int E[100]; for(int i=0;i<n;i++){ cin>>E[i]; } sort(E,E+n); cout<<s[0]+s[n-1]; }
a.cc: In function 'int main()': a.cc:12:15: error: 's' was not declared in this scope 12 | cout<<s[0]+s[n-1]; | ^
s251066292
p03694
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int N; int a[1100]; cin >> N; for(int i = 0; i < N;i++){ cin >> a[i]; } sort(a,a+n); int ans = a[N-1]-a[0]; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:12: error: 'n' was not declared in this scope 13 | sort(a,a+n); | ^
s949060829
p03694
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int N; cin >> N; vector<int> vc(N); for(int i=0;i<N;i++) cin >> vc[i]; sort(vc.begin(),vc.end()); cout << vc[N-1]-vc[0] << endl; }
a.cc: In function 'int main()': a.cc:8:5: error: 'vector' was not declared in this scope 8 | vector<int> vc(N); | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include<algorithm> +++ |+#include <vector> 4 | using namespace std; a.cc:8:12: error: expected primary-expression before 'int' 8 | vector<int> vc(N); | ^~~ a.cc:9:36: error: 'vc' was not declared in this scope 9 | for(int i=0;i<N;i++) cin >> vc[i]; | ^~ a.cc:10:10: error: 'vc' was not declared in this scope 10 | sort(vc.begin(),vc.end()); | ^~
s554232997
p03694
C++
#include<iostream> using namespace std; int main(){ int n; int a[1000]; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } sort(a,a+n); cout << a[n-1]-a[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(a,a+n); | ^~~~ | short
s780060087
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int ma=0;int mi=1000000000; for(int i=0;i<n;i++){ int a; cin>>a; ma=max(a,ma); mi=miny(a,mi); } cout<<ma-mi<<endl; }
a.cc: In function 'int main()': a.cc:11:12: error: 'miny' was not declared in this scope; did you mean 'mi'? 11 | mi=miny(a,mi); | ^~~~ | mi
s380731570
p03694
C++
#include <algorithm> #include <iostream> using namespace std; int main(){ int N, MAX=0, MIN=0; cin >> N; for(int i=0; i<N; i++){ cin >> int a; MAX = max(a, MAX); MIN = min(a, MIN); } cout << MAX - MIN << endl; }
a.cc: In function 'int main()': a.cc:9:24: error: expected primary-expression before 'int' 9 | cin >> int a; | ^~~ a.cc:10:27: error: 'a' was not declared in this scope 10 | MAX = max(a, MAX); | ^
s163588524
p03694
C++
#include <algorithm> #include <iostream> using namespace std; int main(){ int N, MAX=0, MIN=0; cin >> N; for(int i=0; i<N; i++){ cin >> a; MAX = max(a, MAX); MIN = min(a, MIN); } cout << MAX - MIN << endl; }
a.cc: In function 'int main()': a.cc:9:24: error: 'a' was not declared in this scope 9 | cin >> a; | ^
s552782310
p03694
C++
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <iostream> #include <sstream> #include <functional> #include <map> #include <string> #include <cstring> #include <vector> #include <queue> #include <stack> #include <deque> #include <set> #include <list> #include <numeric> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll> P; const double PI = 3.14159265358979323846; const double EPS = 1e-12; const ll INF = 1LL<<29; const ll mod = 1e9+7; #define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i)) #define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d)) #define all(v) (v).begin(), (v).end() #define pb(x) push_back(x) #define mp(x,y) make_pair((x),(y)) #define mset(m,v) memset((m),(v),sizeof(m)) #define chmin(x,y) (x=min(x,y)) #define chmax(x,y) (x=max(x,y)) #define fst first #define snd second #define UNIQUE(x) (x).erase(unique(all(x)),(x).end()) template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;} int main(){ cin>>n; vector<int> a(n); rep(i, n) cin>>a[i]; sort(all(a)); cout<<a[n-1]-a[0]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:42:14: error: 'n' was not declared in this scope; did you mean 'yn'? 42 | cin>>n; vector<int> a(n); rep(i, n) cin>>a[i]; sort(all(a)); | ^ | yn
s577074831
p03694
C++
#include <iostream> #include <math.h> #include <string> #include <string.h> #include <stdio.h> using namespace std; #define MAX 200000 #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) int main(){ int n,a; int min=1001,max=0; scanf("%d",&n); REP(i,n){ scanf("%d",&a); if(a<min)min=a; if(a>max)max=a } printf("%d\n",max-min); return 0; }
a.cc: In function 'int main()': a.cc:20:23: error: expected ';' before '}' token 20 | if(a>max)max=a | ^ | ; 21 | } | ~
s466511872
p03694
C++
clude <stdio.h> int main(){ int N; scanf("%d",&N); int i,a[100]={}; for(i=0;i<N;i++){ scanf("%d",&a[i]); printf("%d\n",a[i]); } int Max=0,Min=1000; for(i=0;i<N-1;i++){ if(Max<a[i]){ Max = a[i]; } if(a[i]<Min){ Min = a[i]; } } printf("%d %d\n",Max, Min ); printf("%d",Max-Min); return 0; }
a.cc:1:1: error: 'clude' does not name a type 1 | clude <stdio.h> | ^~~~~
s283222817
p03694
C++
#include<cstdio> #include<iostream> using namespace std; const int MAX_N = 100; int n, a[MAX_N]; int MAX = 0, MIN = 1000; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { if (a[i] > MAX) max = a[i]; if (a[i] < MIN) min = a[i]; } cout << MAX - MIN << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:42: error: overloaded function with no contextual type information 14 | if (a[i] > MAX) max = a[i]; | ^ a.cc:15:42: error: overloaded function with no contextual type information 15 | if (a[i] < MIN) min = a[i]; | ^
s732994718
p03694
C++
#include<cstdio> #include<iostream> using namespace std; const int MAX_N = 100; int n, a[MAX_N]; int max = 0, min = 1000; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { if (a[i] > max) max = a[i]; if (a[i] < min) min = a[i]; } cout << max - min << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:28: error: reference to 'max' is ambiguous 14 | if (a[i] > max) max = a[i]; | ^~~ 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:2: /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:5: note: 'int max' 7 | int max = 0, min = 1000; | ^~~ a.cc:14:33: error: reference to 'max' is ambiguous 14 | if (a[i] > max) max = a[i]; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:5: note: 'int max' 7 | int max = 0, min = 1000; | ^~~ a.cc:15:28: error: reference to 'min' is ambiguous 15 | if (a[i] < min) min = a[i]; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:14: note: 'int min' 7 | int max = 0, min = 1000; | ^~~ a.cc:15:33: error: reference to 'min' is ambiguous 15 | if (a[i] < min) min = a[i]; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:14: note: 'int min' 7 | int max = 0, min = 1000; | ^~~ a.cc:18:17: error: reference to 'max' is ambiguous 18 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:5: note: 'int max' 7 | int max = 0, min = 1000; | ^~~ a.cc:18:23: error: reference to 'min' is ambiguous 18 | cout << max - min << endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: '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:233:5: note: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:7:14: note: 'int min' 7 | int max = 0, min = 1000; | ^~~
s510798255
p03694
C
#include <iostream> using namespace std; int n, a, min = 1001, max = -1; int main() { cin >> n; for(int i = 1; i <= n; i++) { cin >> a; if(min > a) min = a; if(max < a) max = a; } cout << max - min << endl; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s264123082
p03694
Java
import java.util.Arrays; import java.util.Scanner;   public class Main {   public static void main(String[] args) {   Scanner sc = new Scanner(System.in); int N=sc.nextInt(); int a[]=new int[N]; for(int i=0;i<N;i++) { a[i]=sc.nextInt(); } Arrays.sort(a); System.out.println(a[N-1]-a[0]); } }
Main.java:3: error: illegal character: '\u00a0' ? ^ Main.java:5: error: illegal character: '\u00a0' ? ^ Main.java:7: error: illegal character: '\u00a0' ? ^ 3 errors
s600268448
p03694
C++
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N=sc.nextInt(); int a[]=new int[N]; for(int i=0;i<N;i++) { a[i]=sc.nextInt(); } Arrays.sort(a); System.out.println(a[N-1]-a[0]); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Arrays; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: expected unqualified-id before 'public' 4 | public class Main { | ^~~~~~
s771302807
p03694
Java
#include <bits/stdc++.h> using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n; int MAX=INT_MIN; int MIN=INT_MAX; int temp; for(int i=0;i<n;++i) { cin>>temp; MAX=max(MAX,temp); MIN=min(MIN,temp); } cout <<MAX-MIN<<endl; return 0; }
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:5: error: not a statement ios::sync_with_stdio(0); ^ Main.java:9: error: not a statement cin>>n; ^ Main.java:15: error: not a statement cin>>temp; ^ Main.java:19: error: not a statement cout <<MAX-MIN<<endl; ^ Main.java:3: error: unnamed classes are a preview feature and are disabled by default. int main(void) ^ (use --enable-preview to enable unnamed classes) Main.java:3: error: <identifier> expected int main(void) ^ Main.java:5: error: ';' expected ios::sync_with_stdio(0); ^ 9 errors
s283112101
p03694
C++
#include <iostream> #include <vector> using namespace std; int main(void){ int n; cin >> n; vector<int> a(n); for(int i=0;i<n;i++) cin >> a[i]; cout << *max_element(a.begin(),a.end()) - *min_element(a.begin(),a.end()) << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:12: error: 'max_element' was not declared in this scope 10 | cout << *max_element(a.begin(),a.end()) - *min_element(a.begin(),a.end()) << endl; | ^~~~~~~~~~~ a.cc:10:46: error: 'min_element' was not declared in this scope 10 | cout << *max_element(a.begin(),a.end()) - *min_element(a.begin(),a.end()) << endl; | ^~~~~~~~~~~
s283032351
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int a[N+1] for(int i=0;i<N+1;i++){ cin >> a[i]; } int max=a[0]; int min=a[0]; for(int i=0;i<N+1;i++){ if(a[i]>a[i+1])max=a[i+1]; if(a[i]<a[i+1])min=a[i+1]; } cout << max-min << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: expected initializer before 'for' 8 | for(int i=0;i<N+1;i++){ | ^~~ a.cc:8:15: error: 'i' was not declared in this scope 8 | for(int i=0;i<N+1;i++){ | ^ a.cc:12:11: error: 'a' was not declared in this scope 12 | int max=a[0]; | ^
s120324730
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int a[N+1] for(int i=0;i<N+1;i++){ cin >> a[i]; } int max=a[0]; int min=a[0]; for(int i=0;i<N+1;l++){ if(a[i]>a[i+1])max=a[i+1]; if(a[i]<a[i+1])min=a[i+1]; } cout << max-min << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: expected initializer before 'for' 8 | for(int i=0;i<N+1;i++){ | ^~~ a.cc:8:15: error: 'i' was not declared in this scope 8 | for(int i=0;i<N+1;i++){ | ^ a.cc:12:11: error: 'a' was not declared in this scope 12 | int max=a[0]; | ^ a.cc:15:21: error: 'l' was not declared in this scope 15 | for(int i=0;i<N+1;l++){ | ^
s616327257
p03694
C++
#include <bits/stdc++.h> using namespace std; map <int, bool> m; int main(){ int n, x; cin >> n >> x; vector <int> a; for(int i = 0; i < n; i++){ cin >> x; if(m[x]) continue; else{ a.push_back(x); m[x] =1; } } if(a.size() == 1) cout << 0; else{ int ans = 0; sort(a.begin(), a.end()); for(int i = 0; i < a.size() - 1; i++) ans += a[i+1] - a[i]; cout << ans; }
a.cc: In function 'int main()': a.cc:24:6: error: expected '}' at end of input 24 | } | ^ a.cc:6:19: note: to match this '{' 6 | int main(){ | ^
s863620496
p03694
C++
#include <bits/stdc++.h> using namespace std; map <int, bool> m; int main(){ int n, x; cin >> n >> x; vector <int> a; for(int i = 0; i < n; i++){ cin >> x; if(m[x]) continue; else{ a.push_back(x); m[x] =1; } } if(a.size() == 1) cout << 0; else{ }
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:6:15: note: to match this '{' 6 | int main(){ | ^
s624831866
p03694
C
#include <stdio.h> int main(void){ int n; int i; int a[100]; int max = 0,mim = 1000; scanf("%d\n",&n) for (i = 0; i <= n; i++) { scanf("%d ",&a[i]); if (max < a[i]) { max = a[i]; } if (mim > a[i]) { mim = a[i]; } } printf("%d\n",max - mim ); return 0; }
main.c: In function 'main': main.c:8:21: error: expected ';' before 'for' 8 | scanf("%d\n",&n) | ^ | ; 9 | for (i = 0; i <= n; i++) { | ~~~
s911940479
p03694
C++
#include <iostream> #include <vector> using namespace std; int main(){ int n; vector <int> a; cin >> n; int tmp; for(int i = 0; i < n; i++){ cin >> tmp; a.push_back(tmp); } sort(a.begin(), a.end()); cout << a[n-1] - a[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(a.begin(), a.end()); | ^~~~ | short
s910124514
p03694
C++
// 7/4 Tuesday #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n,ans; cin >> n; vector <int> A(n); for (int i = 0; i < n; i++) { cin >> A[i]; } sort(A.begin(), A.end()); ans = A.begin - A.end; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:23: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator-' 17 | ans = A.begin - A.end; | ~~~~~~~ ^ ~~~~~ | | | | | <unresolved overloaded function type> | <unresolved overloaded function type>
s938570523
p03694
Java
public class Main { public static void main(String[] args) { // write your code here Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List<Integer> points = new ArrayList<>(); for(int i=0; i<n; i++) { points.add(sc.nextInt()); } int min = points.get(0); for(int p : points) { min = Math.min(p, min); } int max = points.get(0); for(int p : points) { max = Math.max(p, max); } System.out.println(max - min); } }
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:7: error: cannot find symbol List<Integer> points = new ArrayList<>(); ^ symbol: class List location: class Main Main.java:7: error: cannot find symbol List<Integer> points = new ArrayList<>(); ^ symbol: class ArrayList location: class Main 4 errors
s558750417
p03694
C++
#include <stdio.h> #include <algorithm> #include <vector> #include <limits> using namespace std; int main() { int N; scanf("%d", &N); int ma = INT_MIN; int mi = INT_MAX; for (int i = 0; i < N; i++) { int t; scanf("%d", &t); mi = min(mi, t); ma = max(ma, t); } printf("%d", ma-mi); return 0; }
a.cc: In function 'int main()': a.cc:9:18: error: 'INT_MIN' was not declared in this scope 9 | int ma = INT_MIN; | ^~~~~~~ a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <limits> +++ |+#include <climits> 5 | using namespace std; a.cc:10:18: error: 'INT_MAX' was not declared in this scope 10 | int mi = INT_MAX; | ^~~~~~~ a.cc:10:18: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
s879279997
p03694
C++
#include <cstdio> #include <math.h> #include <algorithm> #include <vector> #include <iostream> #include <sstream> #include <string> #include <iomanip> #include <set> #include <map> using namespace std; #define EPS 1e-14 #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define REP(i,n) FOR(i, 0, n) #define PI 2*acos(0.0) #define ALL(a) (a).begin(),(a).end() #define DEBUG(x) cout<<#x <<": "<< x << "\n" #define DEBUG_ARR(a) REP(i, size(a)){ cout << #a << "[" << i << "]: " << a[i] << "\n"; } const int VX[] = { 0, 1, 0, -1 }; const int VY[] = { 1, 0, -1, 0 }; const long MOD = 1000000007; int main() { // --- I/O 高速化 --- cin.tie(0); ios::sync_with_stdio(false); // --- ここまで --- int n, a, a_max = 0, a_min = INT_MAX; cin >> n; REP(i, n) { cin >> a; if (a > a_max) a_max = a; if (a < a_min) a_min = a; } cout << a_max - a_min << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:32:38: error: 'INT_MAX' was not declared in this scope 32 | int n, a, a_max = 0, a_min = INT_MAX; | ^~~~~~~ a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 10 | #include <map> +++ |+#include <climits> 11 |
s759075260
p03694
C++
#Traveling AtCoDeer Problem import numpy as np n = int(input()) a = list(map(int, input().split())) print(max(a)-min(a))
a.cc:1:2: error: invalid preprocessing directive #Traveling 1 | #Traveling AtCoDeer Problem | ^~~~~~~~~ a.cc:2:1: error: 'import' does not name a type 2 | import numpy as np | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
s767529118
p03694
C++
#include<iostream> using namespace std; int main() { int arlong; cin >> arlong; int ar[arlong]; for (int i=0; i<arlong; i++) { cin >>ar[i]; } int maxv = INT_MIN; int minv = INT_MAX; for(int i = 0; i < arlong; ++i) { if( ar[i] > maxv ) maxv = ar[i]; if( ar[i] < minv ) minv = ar[i]; } cout << (INT_MAX-INT_MIN) <<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:16: error: 'INT_MIN' was not declared in this scope 12 | int maxv = INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include<iostream> +++ |+#include <climits> 2 | using namespace std; a.cc:13:16: error: 'INT_MAX' was not declared in this scope 13 | int minv = INT_MAX; | ^~~~~~~ a.cc:13:16: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
s593326950
p03694
C++
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProCon { class Program { static void Main(string[] args) { string[] input = Console.ReadLine().Split(' '); int min = 10000; int max = 0; for ( int i = 0; i < input.Length; ++i) { int t = int.Parse(input[i]); if (min > t) { min = t; } if(max < t) { max = t; } } Console.WriteLine(max - min); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.IO; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Linq; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Text; | ^~~~~~ a.cc:6:7: error: expected nested-name-specifier before 'System' 6 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:26: error: 'string' has not been declared 11 | static void Main(string[] args) | ^~~~~~ a.cc:11:35: error: expected ',' or '...' before 'args' 11 | static void Main(string[] args) | ^~~~ a.cc:30:6: error: expected ';' after class definition 30 | } | ^ | ; a.cc: In static member function 'static void ProCon::Program::Main(int*)': a.cc:13:13: error: 'string' was not declared in this scope 13 | string[] input = Console.ReadLine().Split(' '); | ^~~~~~ a.cc:13:20: error: expected primary-expression before ']' token 13 | string[] input = Console.ReadLine().Split(' '); | ^ a.cc:16:34: error: 'input' was not declared in this scope; did you mean 'int'? 16 | for ( int i = 0; i < input.Length; ++i) | ^~~~~ | int a.cc:18:25: error: expected primary-expression before 'int' 18 | int t = int.Parse(input[i]); | ^~~ a.cc:28:13: error: 'Console' was not declared in this scope 28 | Console.WriteLine(max - min); | ^~~~~~~
s703372395
p03694
C++
#include <iostream> using namespace std; int main(){ int N, m, M, i; cin >> N; m = 0; M = 0; for(int j =0; j++; j<N){ cin >> i; if (i < m){ m = i } else if(i > M){ M = i } } cout << M - m << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:6: error: expected ';' before '}' token 12 | m = i | ^ | ; 13 | } else if(i > M){ | ~ a.cc:14:6: error: expected ';' before '}' token 14 | M = i | ^ | ; 15 | } | ~
s445058536
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a[105]; cin>>n; for(int i=0;i<n;cin>>a[i++]); sort(a,a+n); cout<<a[n-1]-a[i]; }
a.cc: In function 'int main()': a.cc:8:24: error: 'i' was not declared in this scope 8 | cout<<a[n-1]-a[i]; | ^
s057424371
p03694
C++
#include<iosteram> #include<stdio.h> using namespace std; int main(){ int n; cin >> n; int house[n]; int min = 0; int max = 0; for(int i = 0; i < n; i++){ cin >> house[i]; if(i == 0){ min = house[0]; max = house[0]; } else { if(min > house[0]) min = house[0]; if(max < house[0]) max = house[0]; } } cout << max - min << endl; }
a.cc:1:9: fatal error: iosteram: No such file or directory 1 | #include<iosteram> | ^~~~~~~~~~ compilation terminated.
s068964231
p03694
C
#include<stdio.h> int main() { int a, N, i, max, min; max = 0; min = 1000; scanf("%d", &N); if(i = 0; i < N; i++){ scanf("%d", &a); if(max < a)max = a; if(min > a)min = a; } printf("%d\n", max - min); return 0; }
main.c: In function 'main': main.c:11:13: error: expected ')' before ';' token 11 | if(i = 0; i < N; i++){ | ~ ^ | )
s253249477
p03694
Java
public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); int number = Integer.parseInt(line); String[] in = br.readLine().split(" "); ArrayList<Integer> coordinate = new ArrayList<Integer>(); int min = 1000; int max =0; for(int i = 0; i < in.length ;i++){ coordinate.add(Integer.parseInt(in[i])); } for(int j =0; j < coordinate.size();j++){ if(min > coordinate.get(j)){ min = coordinate.get(j); //1000からmax値を下げていく } if(max < coordinate.get(j)){ max = coordinate.get(j); //0からmin値を上げていく } } System.out.println(max - min); } }
Main.java:2: error: cannot find symbol public static void main(String[] args) throws IOException { ^ symbol: class IOException location: class Main Main.java:3: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:7: error: cannot find symbol ArrayList<Integer> coordinate = new ArrayList<Integer>(); ^ symbol: class ArrayList location: class Main Main.java:7: error: cannot find symbol ArrayList<Integer> coordinate = new ArrayList<Integer>(); ^ symbol: class ArrayList location: class Main 6 errors
s933220156
p03694
C
#include<stdio.h> int main() { int N, a, MAX, MIN, i; MAX = 0; MIN = 1000; scanf("%d", &N); for(i = 0; i < N, i++){ scanf("%d", &a); if( a > MAX){ MAX = a; } if( a < MIN){ MIN = a; } } printf("%d", MAX - MIN); return 0; }
main.c: In function 'main': main.c:12:26: error: expected ';' before ')' token 12 | for(i = 0; i < N, i++){ | ^ | ;
s661444883
p03694
C++
#include<stdio.h> int main() { int N, a, MAX, MIN, i; MAX = 0; MIN = 1000; scanf("%d", &N); for(i = 0; i <= N, i++){ scanf("%d", &a); if( a > MAX){ MAX = a} if( a < MIN){ MIN = a} } printf("%d", MAX - MIN); return 0; }
a.cc: In function 'int main()': a.cc:12:23: error: expected ';' before ')' token 12 | for(i = 0; i <= N, i++){ | ^ | ; a.cc:15:8: error: expected ';' before '}' token 15 | MAX = a} | ^ | ; a.cc:17:8: error: expected ';' before '}' token 17 | MIN = a} | ^ | ;
s722382050
p03694
C++
#include<studio.h> int main() { int N, a, MAX, MIN, i; MAX = 0; MIN = 1000; scanf("%d", &N); for(i = 0; i <= N, i++){ scanf("%d", &a); if( a > MAX){ MAX = a} if( a < MIN){ MIN = a} } printf("%d", MAX - MIN); return 0; }
a.cc:1:9: fatal error: studio.h: No such file or directory 1 | #include<studio.h> | ^~~~~~~~~~ compilation terminated.
s200965762
p03694
C++
include<iostream> using namespace std; int main(){ int N; int min, max,a; min = 1010; max = -1; cin>>N; for(int i=0;i<N;i++){ cin>>a; if(min>a) min = a; if(max<a) max = a; } cout<<max-min<<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'min'? 8 | cin>>N; | ^~~ | min a.cc:16:9: error: 'cout' was not declared in this scope 16 | cout<<max-min<<endl; | ^~~~ a.cc:16:24: error: 'endl' was not declared in this scope 16 | cout<<max-min<<endl; | ^~~~
s610640895
p03694
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N; cin >> N; int a[N]; cout << a.max() - a.min(); }
a.cc: In function 'int main()': a.cc:10:19: error: request for member 'max' in 'a', which is of non-class type 'int [N]' 10 | cout << a.max() - a.min(); | ^~~ a.cc:10:29: error: request for member 'min' in 'a', which is of non-class type 'int [N]' 10 | cout << a.max() - a.min(); | ^~~
s543708432
p03694
C++
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> a(N); for (auto& ai : a) cin >> ai; int min = *min_element(a.begin(), a.end()); int max = *max_element(a.begin(), a.end()); cout << max - min << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:16: error: 'min_element' was not declared in this scope 12 | int min = *min_element(a.begin(), a.end()); | ^~~~~~~~~~~ a.cc:13:16: error: 'max_element' was not declared in this scope 13 | int max = *max_element(a.begin(), a.end()); | ^~~~~~~~~~~
s908769795
p03694
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Comparator; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.Stream; /** * * @author 97797 */ public class Main { public static void main(String[] args) { System.out.println(new Main().run(args, System.in)); } public String run(String[] args, InputStream in) { String result = null; try { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); int N = Integer.parseInt(reader.readLine()); List<Integer> list = reader.lines() .flatMap(s -> Stream.of( s.replaceAll("\\s+", " ").split(" "))) .limit(N).map(Integer::parseInt) //.sorted(Comparator.reverseOrder()) .sorted() .collect(Collectors.toList()); int min = list.get(0); int max = list.get(N-1); result = String.valueOf(max-min); } catch (IOException ex) { Logger.getLogger(abc064a.Main.class.getName()).log(Level.SEVERE, null, ex); } return result; } }
Main.java:38: error: package abc064a does not exist Logger.getLogger(abc064a.Main.class.getName()).log(Level.SEVERE, null, ex); ^ 1 error
s943889285
p03694
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int N; vector<int> pos; int temp; cin >> N; for (int i = 0; i < N; ++i) { cin >> temp; pos.push_back(temp); } int min = *min_element(pos.begin(), pos.end()); int max = *max_element(pos.begin(), pos.end()); cout >> max-min >> endl; return 0; }
a.cc: In function 'int main()': a.cc:19:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 19 | cout >> max-min >> endl; | ~~~~ ^~ ~~~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:19:10: note: candidate: 'operator>>(int, int)' (built-in) 19 | cout >> max-min >> endl; | ~~~~~^~~~~~~~~~ a.cc:19:10: 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:19:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> max-min >> 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:19:5: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 19 | cout >> max-min >> 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:19:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> max-min >> 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:19:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> max-min >> 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:19:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> max-min >> 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:19:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> max-min >> 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:19:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> max-min >> 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:19:17: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> max-min >> 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:19:17: required from here 19 | cout >> max-min >> 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) | ^~~~~~~~
s923474065
p03694
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; int max = -1; int min = 1001; for(i = 0; i < n; i++){ int a; cin >> a; if(a > max) max = a; if(a < min) min = a; } cout << max-min << endl; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i = 0; i < n; i++){ | ^
s265796345
p03694
C++
#include <iostream> using namespace std; int main(){ int n, a[100]={}, a,min=100; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; for(int j=0;j<i;j++){ a=a[i]-a[j]; if(a<0)a*=-1 if(min>=a)min=a; } } cout<<min; return 0; }
a.cc: In function 'int main()': a.cc:4:19: error: conflicting declaration 'int a' 4 | int n, a[100]={}, a,min=100; | ^ a.cc:4:8: note: previous declaration as 'int a [100]' 4 | int n, a[100]={}, a,min=100; | ^ a.cc:9:2: error: incompatible types in assignment of 'int' to 'int [100]' 9 | a=a[i]-a[j]; | ~^~~~~~~~~~ a.cc:10:5: error: ordered comparison of pointer with integer zero ('int*' and 'int') 10 | if(a<0)a*=-1 | ~^~ a.cc:10:9: error: invalid operands of types 'int [100]' and 'int' to binary 'operator*' 10 | if(a<0)a*=-1 | ~^~~~ a.cc:10:9: note: in evaluation of 'operator*=(int [100], int)'
s961060747
p03694
Java
import java.util.Scanner; import java.util.Arrays; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a[] = new int[n]; Arrays.sort(a[]); System.out.println(a[n-1] - a[0]); } }
Main.java:10: error: '.class' expected Arrays.sort(a[]); ^ 1 error
s798648496
p03694
Java
import java.util.Scanner; public class TravelingAtCoDeerProblem { public static void main(String[] args) { Scanner scan = new Scanner(System.in); scan.nextLine(); String[] ary = scan.nextLine().split(" "); scan.close(); int max = Integer.parseInt(ary[0]); int min = max; int value; for(int i=1; i<ary.length; i++) { value = Integer.parseInt(ary[i]); if(max < value) { max = value; } if(value < min) { min = value; } } System.out.println(max-min); } }
Main.java:3: error: class TravelingAtCoDeerProblem is public, should be declared in a file named TravelingAtCoDeerProblem.java public class TravelingAtCoDeerProblem { ^ 1 error
s970541923
p03694
C++
#include <iostream> #include <algorithm> int main(int argc, char const *argv[]) { int count,min,max,temp; min = 1000; max = 0; std::cin >> count; for (size_t i = 0; i < count; i++) { std::cin >> temp; min = min(min,temp); max = max(max,temp); } std::cout << max-min << '\n'; return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:11:26: error: 'min' cannot be used as a function 11 | min = min(min,temp); | ~~~^~~~~~~~~~ a.cc:12:26: error: 'max' cannot be used as a function 12 | max = max(max,temp); | ~~~^~~~~~~~~~
s903321535
p03694
C++
#include <iostream> #include<algorithms> using namespace std; int main() { int n, arr[100005]; cin >> n; for (int i = 0; i < n; i++) cin >> arr[i]; sort(arr,arr+n); cout << arr[n-1]-arr[0] << endl; return 0; }
a.cc:2:9: fatal error: algorithms: No such file or directory 2 | #include<algorithms> | ^~~~~~~~~~~~ compilation terminated.
s648546623
p03694
C++
#include <iostream> using namespace std; int main() { int n, arr[100005]; cin >> n; for (int i = 0; i < n; i++) cin >> arr[i]; sort(arr,arr+n); cout << arr[n-1]-arr[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:1: error: 'sort' was not declared in this scope; did you mean 'short'? 9 | sort(arr,arr+n); | ^~~~ | short