submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s346218413
p03694
Java
#include<stdio.h> #include<iostream> #include<vector> #include<math.h> #include<queue> #include<map> #include<algorithm> #include<string.h> #include<functional> #include<limits.h> #include<stdlib.h> #include<cmath> #include<cstring> #include<set> #include<climits> #include<deque> #include <iomanip> #include<utility> us...
Main.java:1: error: illegal character: '#' #include<stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include<stdio.h> ^ Main.java:2: error: illegal character: '#' #include<iostream> ^ Main.java:3: error: illegal character: '#' #include<vector> ^ Main.java:4: error: illegal character: '...
s780664009
p03694
C++
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで #include <bits/stdc++.h> #define mod 1000000007 #define INF LLONG_MAX #define ll long long #define ln cout<<endl #define Yes cout<<"Yes"<<endl #define No cout<<"No"<<endl #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++) #define rep(i,n) REP(i,0,n) #defi...
a.cc: In function 'int main()': a.cc:28:15: error: 'class std::vector<long long int>' has no member named 'length' 28 | cout<<v[v.length()-1]-v[0]<<endl; | ^~~~~~
s180467080
p03694
Java
import java.util.Scanner; public class Main { static Scanner scanner; public static void main(String[] args) { scanner = new Scanner(System.in); int n=gi(); int[] A=new int[n]; for(int i=0; i<n;i++) { A[i]=gi(); } Arrays.parallelSort(A); ...
Main.java:17: error: cannot find symbol Arrays.parallelSort(A); ^ symbol: variable Arrays location: class Main 1 error
s374157886
p03694
C
#include <stdio.h> int main(void) { int n,a[1000],max,min,i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } max=a[0]; min=a[0]; for(i=0;i<n;i++){ if(max=<a[i]) max=a[i]; else if(min=>a[i]) min=a[i]; } printf("...
main.c: In function 'main': main.c:17:17: error: expected expression before '<' token 17 | if(max=<a[i]) max=a[i]; | ^ main.c:18:22: error: expected expression before '>' token 18 | else if(min=>a[i]) min=a[i]; | ^
s348756313
p03694
C++
#include<iostream> #include<algorithm> #include<math.h> #include<string> #include<tuple> #include<vector> #include<cstdlib> #include<cstdint> #include<stdio.h> #include<cmath> #include<limits> #include<iomanip> #include<ctime> #include<climits> #include<random> #include<queue> #include<map> using namespace std; tem...
a.cc: In function 'int main()': a.cc:57:13: error: request for member 'begin' in 'A', which is of non-class type 'int [n]' 57 | #define bgn begin() | ^~~~~ a.cc:59:26: note: in expansion of macro 'bgn' 59 | #define SORT(a) sort((a).bgn,(a).en) | ^~~ a.cc:201:9: not...
s260021759
p03694
C++
#include<iostream> #include<algorithm> #include<math.h> #include<string> #include<tuple> #include<vector> #include<cstdlib> #include<cstdint> #include<stdio.h> #include<cmath> #include<limits> #include<iomanip> #include<ctime> #include<climits> #include<random> #include<queue> #include<map> using namespace std; tem...
a.cc: In function 'int main()': a.cc:196:9: error: 'A' was not declared in this scope 196 | min=A[0]; | ^
s660201151
p03694
C++
#include<iostream> #include<vector> 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 << abs(a[n - 1] - a[0]) << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(a.begin(),a.end()); | ^~~~ | short
s017719512
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,i,x; cin >> n; int number[n]; for (i = 1; i <= N; i++) { cin >> number[i]; } int max,min= 0; max = min = number[0]; for(x = 1; x <= N; x++) { if(number[x] > max) max = number[x]; if(number[x] < min) min = number[x]; } cout << max-min<< endl; }
a.cc: In function 'int main()': a.cc:8:19: error: 'N' was not declared in this scope 8 | for (i = 1; i <= N; i++) | ^ a.cc:16:17: error: 'N' was not declared in this scope 16 | for(x = 1; x <= N; x++) | ^
s820536493
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,i,x; cin >> n; int number[n]; for (i = 1; i <= n; i++) { cin >> number[i]; } int max,min= 0; max = min = number[0]; / for(x = 1; x <= n; x++) { if(number[x] > max) max = number[x]; if(number[x] < min) min = number[x]; } cout << max-min<< endl; }
a.cc: In function 'int main()': a.cc:15:1: error: expected primary-expression before '/' token 15 | / | ^ a.cc:16:1: error: expected primary-expression before 'for' 16 | for(x = 1; x <= n; x++) | ^~~ a.cc:16:23: error: expected ';' before ')' token 16 | for(x = 1; x <= n; x++) | ...
s249727135
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,i,x; cin >> n; int number[n]; for (i = 1; i <= n; i++) { cin >> number[i]; } int max,min= 0; max = min = number[0]; / for(x = 1; x <= n; x+) { if(number[x] > max) max = number[x]; if(number[x] < min) min = number[x]; } cout << max-min<< endl; }
a.cc: In function 'int main()': a.cc:15:1: error: expected primary-expression before '/' token 15 | / | ^ a.cc:16:1: error: expected primary-expression before 'for' 16 | for(x = 1; x <= n; x+) | ^~~ a.cc:16:22: error: expected primary-expression before ')' token 16 | for(x = 1; x <= n; x+) | ...
s445012145
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,a,i,x; cin >> n; int number[n]; for (i = 1; i <= n; i++) { cin >> number[i]; } int max,min= 0; max = min = number[0]; / for(x = 1; x <= n; x+) { if(number[x] > max) max = number[x]; if(number[x] < min) min = number[x]; } cout << max-min<< endl; }
a.cc: In function 'int main()': a.cc:15:1: error: expected primary-expression before '/' token 15 | / | ^ a.cc:16:1: error: expected primary-expression before 'for' 16 | for(x = 1; x <= n; x+) | ^~~ a.cc:16:22: error: expected primary-expression before ')' token 16 | for(x = 1; x <= n; x+) | ...
s278314298
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int res=v[0]; for(int i=0 ; i<N ; i++){ res=min(res,v[i]); } int res1 = v[o]; for(int i=0 ; i<N; i++){ res1= max(res1,v[i]); } cout << res1-res<<endl; }
a.cc: In function 'int main()': a.cc:5:9: error: 'v' was not declared in this scope 5 | int res=v[0]; | ^ a.cc:6:17: error: 'N' was not declared in this scope 6 | for(int i=0 ; i<N ; i++){ | ^ a.cc:9:15: error: 'o' was not declared in this scope 9 | int res1 = v[o]; ...
s756083653
p03694
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n=Integer.parseInt(sc.next()); int[] a=new int[n]; for(int i=0;i<n;i++){ a[i]=Integer.parseInt(sc.next()); } Array.sort(a); System.out.println(a[n-1]-a[0]); } }...
Main.java:12: error: cannot find symbol Array.sort(a); ^ symbol: variable Array location: class Main 1 error
s532120471
p03694
C++
#include <iostream> #include <vector> #define REP(i, n) for (int i = 0; i < (n); i++) using namespace std; void solve(long long N, std::vector<long long> a){ sort(a.begin(), a.end()); cout << a[N - 1] - a[0] << '\n'; } int main(){ cin.tie(0); ios::sync_with_stdio(false); long long N; scanf("%l...
a.cc: In function 'void solve(long long int, std::vector<long long int>)': a.cc:7:5: error: 'sort' was not declared in this scope; did you mean 'short'? 7 | sort(a.begin(), a.end()); | ^~~~ | short
s516443241
p03694
C++
#include <bits/stdc++.h> using namespace std; int n; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n; int a[n]; REP(i, 0, n) cin >> a[i]; sort(a, a + n); cout << a[n - 1] - a[0]; }
a.cc: In function 'int main()': a.cc:12:13: error: 'i' was not declared in this scope 12 | REP(i, 0, n) cin >> a[i]; | ^ a.cc:12:9: error: 'REP' was not declared in this scope 12 | REP(i, 0, n) cin >> a[i]; | ^~~
s205373995
p03694
Java
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=sc.nextInt(); for(int i=1;i<N;i++){ int Min; int Max; if(Min>a)Min=a; if(Max<a)Max=a; System.out.println(Max-Min);} } }
Main.java:4: error: <identifier> expected Scanner sc=new.Scanner(System.in); ^ 1 error
s433871962
p03694
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ int N =sc.nextInt(); int a=sc.nextInt(); for(int i=1;i<N;i++){ int Min; int Max; if(Min>a)Min=a; if(Max<a)Max=a; System.out.println(Max-Min);} } }
Main.java:4: error: cannot find symbol int N =sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:5: error: cannot find symbol int a=sc.nextInt(); ^ symbol: variable sc location: class Main 2 errors
s270826005
p03694
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ int N = sc.nextInt(); int a = sc.nextInt(); for(int i=1;i<N;i++){ int Min=a; int Max=a; System.out.println(Max-Min);} } }
Main.java:4: error: cannot find symbol int N = sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:5: error: cannot find symbol int a = sc.nextInt(); ^ symbol: variable sc location: class Main 2 errors
s681275371
p03694
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ int N,a,Min,Max; for(int i=1;i<N;i++){ if(Min>a)Min=a; if(Max<a)Max=a; System.out.println(Max-Min);} } }
Main.java:5: error: variable N might not have been initialized for(int i=1;i<N;i++){ ^ Main.java:6: error: variable Min might not have been initialized if(Min>a)Min=a; ^ Main.java:6: error: variable a might not have been initialized if(Min>a)Min=a; ^ Main.java:7: ...
s538338781
p03694
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ int N =sc.nextInt(); int a=sc.nextInt(); int Min; int Max; for(int i=1;i<N;i++){ if(Min>a)Min=a; if(Max<a)Max=a; System.out.println(Max-Min);} } }
Main.java:4: error: cannot find symbol int N =sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:5: error: cannot find symbol int a=sc.nextInt(); ^ symbol: variable sc location: class Main 2 errors
s651885557
p03694
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ int N =sc.nextInt(); int a=sc.nextInt(); int Min; int Max; for(int i=1;i<N;i++){ if(Min>a)Min=a; if(Max<a)Max=a; System.out.println(Max-Min);} } }
Main.java:4: error: cannot find symbol int N =sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:5: error: cannot find symbol int a=sc.nextInt(); ^ symbol: variable sc location: class Main 2 errors
s772974934
p03694
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ int N =sc.nextInt(); int a=sc.nextInt(); for(int i=1;i<N;i++){ int Min; int Max; if(Min>a)Min=a; if(Max<a)Max=a;} System.out.println(Max-Min);} }
Main.java:4: error: cannot find symbol int N =sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:5: error: cannot find symbol int a=sc.nextInt(); ^ symbol: variable sc location: class Main Main.java:11: error: cannot find symbol System.out.println(Max-Min);} ...
s850961415
p03694
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ int N =sc.nextInt(); int a=sc.nextInt(); for(int i=1;i<N;i++){ int Min; int Max; if(Min>a)Min=a; if(Max<a)Max=a;} System.out.println(Max-Min);}
Main.java:11: error: reached end of file while parsing System.out.println(Max-Min);} ^ 1 error
s010465856
p03694
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int ctoi(const char c) { if ('0' <= c && c <= '9') return (c - '0'); return -1; } vector<int> input(int n) { vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); } return vec...
a.cc: In function 'int main()': a.cc:89:11: error: 's' was not declared in this scope 89 | cout << s[n-1]-s[0] << endl; | ^
s312684929
p03694
C
#include <stdio.h> int main (void) { int n , min = 10000 , max = 0; scanf("%d",&n); int a[n]; for(int i = 0;i < n; i ++){ scanf("%d",&a[i]); if(min>a[i]){ min = a[i]; } if(max<a[i]){ max = a[i]; }} printf("%d",max - min); return 0;
main.c: In function 'main': main.c:18:2: error: expected declaration or statement at end of input 18 | return 0; | ^~~~~~
s395648627
p03694
C++
#include <iostream> #include <vector> #include <cstdlib> using namespace std; int main(void) { int N;cin>>N; vector<int> A(N); for (int i = 0; i < N; i++) cin>>A[i]; vector<int> index(N); for (int i = 0 ;i < N; i++) index.push_back(i); int mi = 1e9; do { int cur = 0; for (in...
a.cc: In function 'int main()': a.cc:19:14: error: 'next_permutation' was not declared in this scope 19 | } while (next_permutation(A.begin(), A.end())); | ^~~~~~~~~~~~~~~~
s840146844
p03694
C++
#include<iostream> #include<algorithm> using namespace std; int main(void) { int n; cin>>n; vector<int> a(n); for(int i=0;i<n;i++){ cin>>a[i]; } int mx=*max_element(a.begin(),a.end()); int mi=*min_element(a.begin(),a.end()); cout<<mx-mi<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<int> a(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include<algorithm> +++ |+#include <vector> 3 | a.cc:...
s019021947
p03694
C++
#include<bits/stdc++.h> using namespace std; int main() { int N; cin>>N; vector<int> vec(N); for(int i=0;i<N;i++) { cin>>vec.at(i); } sort(vec); int ans=vec.at(N)-vec.at(1); cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: no matching function for call to 'sort(std::vector<int>&)' 11 | sort(vec); | ~~~~^~~~~ 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/in...
s596848266
p03694
C++
#include<bits/stdc++.h> using namespace std; int main() { int N; cin>>N; vector(N) vec; for(i=0;i<N;i++) { cin>>vec.at(i); } sort(vec); int ans=vec.at(N)-vec.at(1); cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: class template argument deduction failed: 7 | vector(N) vec; | ^ a.cc:7:11: error: no matching function for call to 'vector(int&)' In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, ...
s780192955
p03694
C++
// #include <iostream> #include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++) { cin >> v.at(i); } sort(v.begin(), v.end()); cout << v.end() - v.begin() << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(v.begin(), v.end()); | ^~~~ | short
s710853210
p03694
C++
#include<iostream> using namespace std; int main(){ int N,min,max; max = 0; min = 1000; cin >> N; long a[N]; for(int i=0;i<N;i++){ cin >> a[i]; min = min(a[i],min); max = max(a[i],max); } cout << max-min << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:14: error: 'min' cannot be used as a function 12 | min = min(a[i],min); | ~~~^~~~~~~~~~ a.cc:13:14: error: 'max' cannot be used as a function 13 | max = max(a[i],max); | ~~~^~~~~~~~~~
s048865392
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> t(N); for(int i = 0; i < N; i++){ cin >> t.at(i); } cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl; }
a.cc: In function 'int main()': a.cc:13:82: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 13 | cout << (*max_element(t.begin(), t.end())) - (*min_element(t.begin(), t.end()))< endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s361401304
p03694
C++
#include<iostream> 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: In function 'int main()': a.cc:7:3: error: 'sort' was not declared in this scope; did you mean 'short'? 7 | sort(A, A + n); | ^~~~ | short
s090712163
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; return 0; }
a.cc: In function 'int main()': a.cc:11:13: error: 'A' was not declared in this scope 11 | int ans = A[N - 1] - A[0]; | ^
s306151864
p03694
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int INF= 1e9+5; typedef long long ll; typedef vector<int> vi; typedef vector<vector<int>>vvi; int main(){ int n;cin>>n; vi a(n); rep(i,n)cin>>a[i]; MIN=a[0]...
a.cc: In function 'int main()': a.cc:16:3: error: 'MIN' was not declared in this scope 16 | MIN=a[0],MAX=a[0]; | ^~~ a.cc:16:12: error: 'MAX' was not declared in this scope 16 | MIN=a[0],MAX=a[0]; | ^~~
s601100003
p03694
C++
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define dump(x) cout << x << '\n' typedef int64_t Int; const double pi = M_PI; using namespace std; int main() { int N; cin >> N; int a[N]; for (int i = 0; i < N; i++) { cin >> a[i]; } sort(a[0], a[N - 1]); cout << a[N - 1] - 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:2: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAcc...
s493391466
p03694
C++
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; for(int i=1;i<=n;i++)cin>>a[i]; sort(a+1,a+n+1); cout<<a[n]-a[1]; return 0; }
a.cc: In function 'int main()': a.cc:7:35: error: 'a' was not declared in this scope 7 | for(int i=1;i<=n;i++)cin>>a[i]; | ^ a.cc:8:14: error: 'a' was not declared in this scope 8 | sort(a+1,a+n+1); | ^
s720863340
p03694
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a[] = new a[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:6: error: cannot find symbol int a[] = new a[n]; ^ symbol: class a location: class Main 1 error
s172568315
p03694
C++
#include <bits/stdc++.h> #define rep(i,m,n) for(int i=m; i<n; i++) #define ci(n) cin >> n #define co(n) cout << n << endl using namespace std; int main(){ long n; cin >> n; int [n]; rep(i,0,n) cin >> a[i]; sort(a, a+n); co(a[n-1]-a[0]); return 0; }
a.cc: In function 'int main()': a.cc:10:7: error: structured binding declaration cannot have type 'int' 10 | int [n]; | ^~~ a.cc:10:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:10:8: error: conflicting declaration 'auto n' 10 | int [n]; | ^ a.cc:8...
s814733439
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> a(n); int i; for(i=0;i<n;i++){ cin >> a[i]; } sort(a.begin(), a.end(),); cout << a[n-1]-a[0]; }
a.cc: In function 'int main()': a.cc:12:27: error: expected primary-expression before ')' token 12 | sort(a.begin(), a.end(),); | ^
s329958040
p03694
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> a(n); int i; for(i=0;i<n;i++){ cin >> a[i]; } sort(a.begin(), a.end(),); cout >> a[n-1]-a[0]; }
a.cc: In function 'int main()': a.cc:12:27: error: expected primary-expression before ')' token 12 | sort(a.begin(), a.end(),); | ^ a.cc:13:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allo...
s483841710
p03694
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <limits.h> #define REP(i,n) for(i=0;i<n;i++) #define MOD 1000000007 //prototype declaration int iin(); long long llin(); double din(); char cin(); void stin(char *s); void iout(int i); void llout(long long i); void dout(double i); ...
main.c: In function 'sortAsc': main.c:169:38: error: passing argument 4 of 'qsort' makes pointer from integer without a cast [-Wint-conversion] 169 | qsort(a, sizeof(a), sizeof(int), sizeof(int), asc); | ^~~~~~~~~~~ | | | ...
s676331796
p03694
C++
#include <iostream> using namespace std; int main(void) { int N, a[101], i; cin >> N; for(i=1; i<=N; i++){ cin >> a[i]; } sort(a+1, a+N+1); cout << a[N]-a[1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(a+1, a+N+1); | ^~~~ | short
s840784043
p03694
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; vector<int> A(N); for (int i=0; i<N; i++){ cin >> A[i]; } int MAX, MIN; MAX = *max_element(A.begin(), A.end()); MIN = *min_element(A.begin(), A.end()); cout << MAX-MIN << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:10: error: 'max_element' was not declared in this scope 15 | MAX = *max_element(A.begin(), A.end()); | ^~~~~~~~~~~ a.cc:16:10: error: 'min_element' was not declared in this scope 16 | MIN = *min_element(A.begin(), A.end()); | ^~~~~~~~~~~
s178746581
p03694
C++
#include<stdio.h> int main(){ int a[100]; int n, bufx, bufm; scanf("%d", &n); for(int i = 0; i < n; i++){ scanf("%d", a[i]); } for(i = 1; i < n; i++){ if(a[i] < a[0]){ bufx = a[0]; a[0] = a[i]; a[i] = bufx; }else if(a[i] > a[n - 1]){ bufm = a[n - 1]; a[n - 1] = a[i]...
a.cc: In function 'int main()': a.cc:9:7: error: 'i' was not declared in this scope 9 | for(i = 1; i < n; i++){ | ^
s589470587
p03694
C++
#include <cstdio> #include <algorithm> int main() { int N; scanf("%d", &N); int a[105]; for(int i = 0; i < N; i++) { scanf("%d", &a[i]) } sort(a,a+N) printf("%d", a[N - 1] - a[0]); }
a.cc: In function 'int main()': a.cc:13:23: error: expected ';' before '}' token 13 | scanf("%d", &a[i]) | ^ | ; 14 | } | ~ a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 15 | sort(a,...
s134077153
p03694
C++
#include <cstdio> #include <algorithm> int main(){ int N, a[100]; scanf("%d", &N); for(int i=0; i<N; i++){ scanf("%d", &a[i]); } sort(a, a+n); printf("%d", a[N-1]-a[0]); }
a.cc: In function 'int main()': a.cc:9:13: error: 'n' was not declared in this scope 9 | sort(a, a+n); | ^ a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 9 | sort(a, a+n); | ^~~~ | std::sort In file included from /usr/include/c++/14/algori...
s343275133
p03694
C++
#include<cstdio> #include<algorithm> int main(){ int n; scanf("%d",&n); int a[100]; for(int i=0;i<n;i++){ scanf("%d",&a[i]); } sort(a,a+n); print("%d",a[n-1]-a[0]); }
a.cc: In function 'int main()': a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 11 | sort(a,a+n); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from a.cc:2: /usr/include/c++/14/pstl/glue_algorithm_def...
s607696492
p03694
C++
#include <cstdio> #include <algorithm> int main(){ int N, a[100]; scanf("%d", &N); for(int i=0; i<N; i++){ scanf("%d", a[i]); } sort(a, a+n); printf("%d", a[N-1]-a[0]); }
a.cc: In function 'int main()': a.cc:9:13: error: 'n' was not declared in this scope 9 | sort(a, a+n); | ^ a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 9 | sort(a, a+n); | ^~~~ | std::sort In file included from /usr/include/c++/14/algori...
s331095561
p03694
C++
#include <cstdio> #include <algorithm> int main(){ int N, a[100]; scnf("%d", &N); for(int i=0; i<N; i++){ scanf("%d", a[i]); } sort(a, a+n); printf("%d", a[N-1]-a[0]); }
a.cc: In function 'int main()': a.cc:5:3: error: 'scnf' was not declared in this scope; did you mean 'scanf'? 5 | scnf("%d", &N); | ^~~~ | scanf a.cc:9:13: error: 'n' was not declared in this scope 9 | sort(a, a+n); | ^ a.cc:9:3: error: 'sort' was not declared in this scope...
s356240363
p03694
C++
#include<cstdio> #include<algorithm> int main(){ int n; scanf("%d",&n); int a[100]; for(int i=0;i<n;i++){ scanf("%d",a[i]); } sort(a,a+n); print("%d",a[n-1]-a[0]); }
a.cc: In function 'int main()': a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 11 | sort(a,a+n); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from a.cc:2: /usr/include/c++/14/pstl/glue_algorithm_def...
s350072252
p03694
C++
#include<iostream> #include<vector> using namespace std; int main(void) { int N; cin>>N; Vector<int> pos(N); for(int i=0;i<N;i++) { cin>>pos[i]; } int a,b; int max,min; for(int i=0;i<N;i++) { if(max<pos[i]) max=pos[i]; } min=max; for(int i=0;i<N;i++) { ...
a.cc: In function 'int main()': a.cc:13:3: error: 'Vector' was not declared in this scope 13 | Vector<int> pos(N); | ^~~~~~ a.cc:13:10: error: expected primary-expression before 'int' 13 | Vector<int> pos(N); | ^~~ a.cc:17:10: error: 'pos' was not declared in this scope 17 | cin>...
s205303846
p03694
C++
#include<iostream> #include<vector> using namespace std; int main(void) { int N; cin>>N; Vector<int> pos(N); int a,b; int max,min; for(int i=0;i<N;i++) { if(max<pos[i]) max=pos[i]; } min=max; for(int i=0;i<N;i++) { if(pos[i]<min) min=pos[i]; } cout<...
a.cc: In function 'int main()': a.cc:13:3: error: 'Vector' was not declared in this scope 13 | Vector<int> pos(N); | ^~~~~~ a.cc:13:10: error: expected primary-expression before 'int' 13 | Vector<int> pos(N); | ^~~ a.cc:20:12: error: 'pos' was not declared in this scope 20 | if(m...
s335248621
p03694
C++
#include<iostream> #include<vector> using namespace std; int main(void) { int N; Vector<int> pos(N); int a,b; int max,min; for(int i=0;i<N;i++) { if(max<pos[i]) max=pos[i]; } min=max; for(int i=0;i<N;i++) { if(pos[i]<min) min=pos[i]; } cout<<max-min<<endl...
a.cc: In function 'int main()': a.cc:10:3: error: 'Vector' was not declared in this scope 10 | Vector<int> pos(N); | ^~~~~~ a.cc:10:10: error: expected primary-expression before 'int' 10 | Vector<int> pos(N); | ^~~ a.cc:17:12: error: 'pos' was not declared in this scope 17 | if(m...
s366081960
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]; } int ma=a[0],mi=a[0]; for(i=1;i<n;i++){ ma=max(ma,a[i]); mi=min(mi,a[i]); } cout<<ma-mi; }
a.cc: In function 'int main()': a.cc:12:7: error: 'i' was not declared in this scope; did you mean 'mi'? 12 | for(i=1;i<n;i++){ | ^ | mi
s868560097
p03694
C++
#include <bits/stdc++.h> using namespace std; using int64 = long long; #define int int64 #define rep(i, n) for(int i=0; i<n; i++) #define FOR(i, a, b) for(int i=a; i<b; i++) #define SORT(x) sort(x.begin(), x.end()) #define GSORT(x) sort(x.begin(), x.end(), greater<int>()) #define mk make_pair #define fi first #define s...
a.cc: In function 'int main()': a.cc:37:14: error: expected '}' at end of input 37 | return 0; | ^ a.cc:23:15: note: to match this '{' 23 | signed main() { | ^
s102301924
p03694
C++
#include <bits/stdc+.h> using namespace std; int main(){ int N; cin >> N; int L=0,U=1000,x; for(int i=0;i<N;i++){ cin >> x; L=max(L,x); U=min(U,x); } cout << L-U; }
a.cc:1:10: fatal error: bits/stdc+.h: No such file or directory 1 | #include <bits/stdc+.h> | ^~~~~~~~~~~~~~ compilation terminated.
s426642649
p03694
C++
#include <bits/stdc++.h> // imports every library in c++ using namespace std; // ; is essential | says that you are USING the libraries int N, max, min; stack<int> A; int main() { cin >> N; for ( int i=0; i<N; i++ ) { cin >> max; A.push(max); } max = 0; min = 0; for ( int i=0; i...
a.cc: In function 'int main()': a.cc:9:16: error: reference to 'max' is ambiguous 9 | cin >> max; | ^~~ 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/...
s800509311
p03694
C++
int N, max, min; stack<int> A; int main() { cin >> N; for ( int i=0; i<N;; i++ ) { cin >> max; A.push(max); } max = 0; min = 0; for ( int i=0; i<N; i++ ) { if (A.top() > max ) { max = A.top(); } if (A.top() < min ) { min = A.top(); ...
a.cc:3:1: error: 'stack' does not name a type 3 | stack<int> A; | ^~~~~ a.cc: In function 'int main()': a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'min'? 5 | cin >> N; | ^~~ | min a.cc:6:24: error: expected primary-expression before ';' token 6 | fo...
s752758075
p03694
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; int main(){ int n; cin>>n; int mn=1000,mn=0; rep(i,n){ int a; cin>>a; mn=min(mn,a); mx=max(mx,a); } cout<<mx-mn<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:21: error: redeclaration of 'int mn' 9 | int mn=1000,mn=0; | ^~ a.cc:9:13: note: 'int mn' previously declared here 9 | int mn=1000,mn=0; | ^~ a.cc:13:17: error: 'mx' was not declared in this scope; did you mean 'm...
s266079372
p03694
C++
#include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0) #define ll long long int #define ld long double #define fr first #define se second #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define sz(v) (int)v.size() #define sunq(v) so...
a.cc: In function 'int main()': a.cc:49:11: error: 's' was not declared in this scope 49 | cout << s[n-1] - s[0] << endl; | ^
s208145437
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k;cin>>n>>k;int ans=0;vector<int>v; for(int x=0;x<n;x++){ int a;cin>>a;v.push_back(a); } sort(v.begin(),v.end()); int ans=v[n-1]-v[0]; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:13: error: redeclaration of 'int ans' 9 | int ans=v[n-1]-v[0]; | ^~~ a.cc:4:31: note: 'int ans' previously declared here 4 | int n,k;cin>>n>>k;int ans=0;vector<int>v; | ^~~
s451314732
p03694
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int x, arr[105]; cin >> x; for(int i=1; I<=x;i++){ cin >> arr[i]; } sort(arr+1, arr+1+x); cout << arr[x]-arr[1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: 'I' was not declared in this scope 7 | for(int i=1; I<=x;i++){ | ^
s863540872
p03694
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int x, arr[105]; cin >> x; for(int i=1; i<+n;i++){ cin >> arr[i]; } sort(arr+1, arr+1+n); cout << arr[n]-arr[1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: 'n' was not declared in this scope 7 | for(int i=1; i<+n;i++){ | ^ a.cc:10:19: error: 'n' was not declared in this scope 10 | sort(arr+1, arr+1+n); | ^
s030603234
p03694
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int x, arr[105]; cin >> x; for(int i=1; I<+n;i++){ cin >> arr[i]; } sort(arr+1, arr+1+n); cout << arr[n]-arr[1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: 'I' was not declared in this scope 7 | for(int i=1; I<+n;i++){ | ^ a.cc:7:17: error: 'n' was not declared in this scope 7 | for(int i=1; I<+n;i++){ | ^ a.cc:10:19: error: 'n' was not declared in this scope 10 | sort(ar...
s962478633
p03694
C++
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #include <numeric> typedef long long Int; #define rep(i,a,b) for(Int i=a;i<b;++i) #define rrep(i,a,b) for(Int i=a;i>=b;--i) using namespace std; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false); int N, vector<int> A(N); rep(i, 0, N) ci...
a.cc: In function 'int main()': a.cc:13:24: error: invalid declarator before 'A' 13 | int N, vector<int> A(N); | ^ a.cc:14:25: error: 'A' was not declared in this scope 14 | rep(i, 0, N) cin >> A[i]; | ^ a.cc:15:26: error: 'A' was not declared in ...
s754593547
p03694
C++
#include <iostream>
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s205137313
p03694
C++
ource Code Copy Copy #include <bits/stdc++.h> using namespace std; int N, a, maks = 0, mins = 1100; int main() { cin >> N; for (int i = 1; i <= N; i++) { cin >> a; if (a > maks) { maks = a; } if (a < mins) { mins = a; } ...
a.cc:1:1: error: 'ource' does not name a type 1 | ource Code | ^~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:5: /usr/include...
s778808027
p03694
C++
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int k; set<int> s; int t = n; while(t--) { cin>>k; s.insert(k); } int d = *(s.end()-1) - *s.begin(); cout<<d<<endl;
a.cc: In function 'int main()': a.cc:17:26: error: no match for 'operator-' (operand types are 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} and 'int') 17 | int d = *(s.end()-1) - *s.begin(); | ~~~~...
s628091181
p03694
C++
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> #define ff first #define ss second #define ll long long #define vi vector<int> #define vii vector<vi> #defi...
a.cc: In function 'int main()': a.cc:77:13: error: a function-definition is not allowed here before '{' token 77 | void Main() { | ^ a.cc:90:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 90 | int main() { | ^~ a.cc:90:9: note: remove pa...
s361544321
p03694
Java
import java.io.*; import java.util.StringTokenizer; import java.util.Arrays; import static java.lang.Math.*; public class Main { public static void main(String[] args) { new Main().solve(); } private void solve() { try(InputReader in = new InputReader(System.in); PrintWriter out = new PrintWrite...
Main.java:64: error: reached end of file while parsing } ^ 1 error
s701954701
p03694
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double using namespace std; signed main(){ int a; vector<int> b(a); rep(i,a) cin>>b.at(i); sor...
a.cc: In function 'int main()': a.cc:15:16: error: request for member 'size' in 'a', which is of non-class type 'long long int' 15 | cout<<b.at(a.size()-1)-b.at(0); | ^~~~
s859411545
p03694
C++
#include<bits/stdc++.h> using namesapce std; int main(){ int a,b[10000000]; cin>>a; for(int i=0;i<a:i++){ cin>>b[i]; } sort(b,b+a); cout<b[a-1]-b[0]<<"\n"; }
a.cc:2:7: error: expected nested-name-specifier before 'namesapce' 2 | using namesapce std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>a; | ^~~ | std::cin In file included from /usr/include/x86_64-l...
s422104533
p03694
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { int N; cin >> N; vector<int> vec(N); for (int i = 0; i < N; i++){ cin >> vec[i]; } cout << max...
a.cc: In function 'int main()': a.cc:14:16: error: no matching function for call to 'max(std::vector<int>&)' 14 | cout << max(vec) - min(vec) << endl; | ~~~^~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s482652201
p03694
C++
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i) #define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i) #define debug(x) cerr << #x << " = " << x << "\n" #define debugv(x) \ rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ") #define all(x) x....
a.cc: In function 'void solve()': a.cc:26:7: error: no matching function for call to 'sort(vi&)' 26 | sort(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...
s383730409
p03694
C++
#include <iostream> #include <math.h> using namespace std; int 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(n-1) - vec.at(0) << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'vector' was not declared in this scope 7 | vector<int> vec(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <math.h> +++ |+#include <vector> 3 | using ...
s198813194
p03694
C++
#include <iostream> #include <math.h> using namespace std; int 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(n-1) - vec.at(0) << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: 'vector' was not declared in this scope 7 | vector<int> vec(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <math.h> +++ |+#include <vector> 3 | using ...
s321254373
p03694
C++
#include <iostream> #include <math.h> using namespace std; int main() { int n; vector<int> vec(n); for(int i=0;i<n;i++){ cin >>vec.at(i); } sort(vec.begin(),vec.end()); cout << vec.at(n-1) - vec.at(0) << endl; }
a.cc: In function 'int main()': a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<int> vec(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <math.h> +++ |+#include <vector> 3 | using ...
s240480777
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; set<int> set; int a; for(int i = 0;i < n;i++) { cin >> a; set.insert(a); } cout << *rbegin() - *begin() << endl; }
a.cc: In function 'int main()': a.cc:12:18: error: no matching function for call to 'rbegin()' 12 | cout << *rbegin() - *begin() << endl; | ~~~~~~^~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-l...
s820699209
p03694
C++
int N, A, min = 1001, max = 01; int main(){ std::cin >> N; for(int i = 1; i <= N; i++){ std::cin >> A; if(min > A) min = A; if(max < A) max = A; } std::cout << max -min << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:4:10: error: 'cin' is not a member of 'std' 4 | std::cin >> N; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:6:14: error: 'cin' is not a me...
s057072858
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> hou(n); for(int i=0;i<n;i++){ cin>>house[i]; } sort(hou.begin(),hou.end()); cout<<hou[n-1]-hou[0]<<endl; }
a.cc: In function 'int main()': a.cc:9:12: error: 'house' was not declared in this scope; did you mean 'hou'? 9 | cin>>house[i]; | ^~~~~ | hou
s744575452
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int hou[n]; for(int i=0;i<n;i++){ cin>>house[i]; } sort(hou.begin(),hou.end()); cout<<hou[n-1]-hou[0]<<endl; }
a.cc: In function 'int main()': a.cc:9:12: error: 'house' was not declared in this scope; did you mean 'hou'? 9 | cin>>house[i]; | ^~~~~ | hou a.cc:11:12: error: request for member 'begin' in 'hou', which is of non-class type 'int [n]' 11 | sort(hou.begin(),hou.end()); ...
s718988637
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int house[n]; for(int i=0;i<n;i++){ cin>>house[i]; } sort(house.begin(),house.end()); cout<<house[n-1]-house[0]<<endl; }
a.cc: In function 'int main()': a.cc:11:14: error: request for member 'begin' in 'house', which is of non-class type 'int [n]' 11 | sort(house.begin(),house.end()); | ^~~~~ a.cc:11:28: error: request for member 'end' in 'house', which is of non-class type 'int [n]' 11 | sort(house.begin(),h...
s569307457
p03694
C++
#include <bits/stdc++.h> #define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) #define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++) #define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--) #define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--) #define ALL(v) (v).begin(),(v).end() #define MOD 100000...
a.cc: In function 'int main()': a.cc:33:14: error: 's' was not declared in this scope 33 | count += s.at(i+1)-s.at(i) ; | ^
s345720559
p03694
C++
#include <iostream> #include <vector> int N; using namespace std; int main(){ cin >> N; int maxa = -1; mina = 10000; vector<int> a(N); for(int i = 0; i < N; i++){ cin >> a[i]; if(a[i] <= mina) mina = a[i]; if(a[i] >= maxa) maxa = a[i]; } cout << maxa - mina; }
a.cc: In function 'int main()': a.cc:10:18: error: 'mina' was not declared in this scope 10 | int maxa = -1; mina = 10000; | ^~~~
s559617872
p03694
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> v(N); for (int i=0;i<N;i++){ cin >> v[i]; } v.sort(v.begin(),v.end()); cout << v[N-1]-v[0] << endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'class std::vector<int>' has no member named 'sort' 11 | v.sort(v.begin(),v.end()); | ^~~~
s703029470
p03694
C++
#include <iostream> #include <cstdlib> #include <algorithm> #include <vector> #include <string> #include <cmath> #include <cassert> #include <functional> #include <string> #include <sstream> #include <cctype> using namespace std; int main(){ int N; cin >> N; int min = 1000; max = 0; for(int i = 0; i > N; i++){ ...
a.cc: In function 'int main()': a.cc:17:25: error: overloaded function with no contextual type information 17 | int min = 1000; max = 0; | ^ a.cc:22:12: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>' 22 | if(tmp > max) t...
s590419037
p03694
C++
#include <iostream> #include <numeric> #include <math.h> #include <algorithm> #include <float.h> #include <limits> #include <vector> #include <string.h> #define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++) #define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--) #define MOD 1000000007 #define ll long long #defin...
a.cc: In function 'int main()': a.cc:50:3: error: 'vecor' was not declared in this scope 50 | vecor<int> a(n); | ^~~~~ a.cc:50:9: error: expected primary-expression before 'int' 50 | vecor<int> a(n); | ^~~ a.cc:52:19: error: 'a' was not declared in this scope 52 | rep(i,0,n) cin>>a[...
s162318460
p03694
C++
#include<iostream> using namespace std; int main(){ int n,i; cin >> n; int a[n]; for( i = 0; i < n; i++){ cin >> a[i]; } sort(a, a+n); int ans = a[n-1] - a[0]; cout << ans << 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(a, a+n); | ^~~~ | short
s080222086
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()); int ans = a.at(0) - a.at(n - 1); cout << ans < endl; }
a.cc: In function 'int main()': a.cc:13:15: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 13 | cout << ans < endl; | ~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-...
s215612167
p03694
C++
#include <iostream> int main() { int n = 0; cin >> n; int maxi = 0, mini = 100000; int buf = 0; for (int i=0; i<n; i++) { std::cin >> buf; if (buf > maxi) maxi = buf; if (buf < mini) mini = buf; } std::cout << maxi - mini << endl; retunr 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to sta...
s134583479
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; vector<int> b(a); for(int i=0;i<s;i++) cin>>b.at(i); sort(b.begin(),b.end()); cout<<b.at(a-1)-b.at(0)<<endl; }
a.cc: In function 'int main()': a.cc:8:17: error: 's' was not declared in this scope 8 | for(int i=0;i<s;i++) | ^
s771424914
p03694
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; vector<int> b(a); for(int i=0;i<s;i++) cin>>b.at(i); sort(b.begin(),b.end()); cout<<b.at(a-1)-b.at(0)<<endl; }
a.cc: In function 'int main()': a.cc:8:17: error: 's' was not declared in this scope 8 | for(int i=0;i<s;i++) | ^
s315114557
p03694
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); i++) #define repf(i,a,b) for (int i = (a); i < (b); i++) #define repi(i,a,b) for (int i = (a); i <= (b); i++) #define repr(i,a,b) for (int i = (a); i >= (b); i--) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define debug...
a.cc: In function 'int main()': a.cc:23:24: error: 'i' was not declared in this scope 23 | vi a(N); cin >> a.at(i); | ^
s262089050
p03694
C++
#include<iostream> using namespace std; int main(){ int a, b, Mma=-1, min=1001; cin >> a; for(i=0;i<a;i++) { cin >> b; if(min>b) min=b; if(Mma<b) Mma=b; } cout << Mma-min <<endl; }
a.cc: In function 'int main()': a.cc:6:7: error: 'i' was not declared in this scope 6 | for(i=0;i<a;i++) { | ^
s068167924
p03694
C++
#include<iostream> using namespace std; int main(){ int a, b, Mma=-1, min=1001; cin >> a; for(i=0;i<a;i++){ cin >> b; if(min>b) min=b; if(Mma<b) Mma=b; } cout << Mma-min <<endl; }
a.cc: In function 'int main()': a.cc:6:7: error: 'i' was not declared in this scope 6 | for(i=0;i<a;i++){ | ^
s894108480
p03694
C++
#include<iostream> using namespace std; int main(){ int a, b, Mma=-1, min=1001; cin >> a; for(i=0;i<a;i++){ cin >> b; if(min>b) min=b; if(Mma<b) Mma=b; } cout << Mma+min <<endl; }
a.cc: In function 'int main()': a.cc:6:7: error: 'i' was not declared in this scope 6 | for(i=0;i<a;i++){ | ^
s011234394
p03694
C++
#include<iostream> using namespace std; int main(){ int a,b[1000],Mma=-1,min=1001; cin >> a; for(i=0;i<a;i++){ cin >> b; if(min>b) min=b; if(Mma<b) Mma=b; } cout << Mma+min <<endl; }
a.cc: In function 'int main()': a.cc:6:7: error: 'i' was not declared in this scope 6 | for(i=0;i<a;i++){ | ^ a.cc:7:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [1000]') 7 | cin >> b; | ~~~ ^~ ~ | | | ...
s619198749
p03694
C++
#include<iostream> using namespace std; int main(){ int a,b[1000],Mma=-1,min=1001; cin >> a; for(i=0;i<a;i++){ cin >>b; if(min>b) min=b; if(Mma<b)Mma=b; } cout << Mma+min <<endl; }
a.cc: In function 'int main()': a.cc:7:7: error: 'i' was not declared in this scope 7 | for(i=0;i<a;i++){ | ^ a.cc:8:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [1000]') 8 | cin >>b; | ~~~ ^~~ | | | | ...
s226146274
p03694
C++
#include<its/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.at(n-1)-a.at(0)<<endl; }
a.cc:1:9: fatal error: its/stdc++.h: No such file or directory 1 | #include<its/stdc++.h> | ^~~~~~~~~~~~~~ compilation terminated.