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 identif...
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' i...
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...
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()); | ...
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 __...
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.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.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.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 memb...
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 += h...
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 /us...
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]; | ~~~^~~~~~ | | | | ...
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/inc...
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...
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); ...
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, ...
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, ...
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.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]; }...
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; | ^~~ | ...
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/bit...
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_...
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...
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]' f...
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 declare...
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...
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) ...
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::...
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++/...
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<i...
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/incl...
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 ...
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 | u...
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 <li...
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--) i...
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...
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; retur...
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] < ...
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; retur...
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 /us...
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-t...
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); } co...
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: no...
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.beg...
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]; ...
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....
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("...
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; | ~~~~~~~ ^ ~~~~~ | | | | ...
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 = poin...
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: erro...
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 <cl...
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) ...
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>' 1...
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]; ...
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 <clim...
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; ...
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.I...
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...
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<Int...
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)); ^...
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); retur...
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 '}' t...
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; ...
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 ...
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.m...
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; /** * * @au...
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_e...
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...
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 'in...
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....
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