submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s772502206
p02258
C++
#include <iostream> static const int MAX = 200000; int main() { int n, R[MAX]; std::cin >> n; for (int i = 0; i < n; ++i) { std::cin >> R[i]; } int maxv = -2147483648; int minv = R[i]; for (int i = 1; i < n; ++i) { if (R[i] - minv > maxv) maxv = R[i] - minv; ...
a.cc: In function 'int main()': a.cc:13:18: error: 'i' was not declared in this scope 13 | int minv = R[i]; | ^
s300386967
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int nNum = 0; cin >> nNum; int nProfit = INT_MIN, nInprice = INT_MAX; int nTemp = 0; for (int i = 0; i < nNum; ++i) { cin >> nTemp; nProfit = max(nProfit, nTemp - nInprice); nInprice = min(nInprice, nTemp); } cout << nProfit << en...
a.cc: In function 'int main()': a.cc:9:23: error: 'INT_MIN' was not declared in this scope 9 | int nProfit = INT_MIN, nInprice = INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include...
s653065666
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int nNum = 0; cin >> nNum; int nProfit = INT_MIN, nInprice = INT_MAX; int nTemp = 0; for (int i = 0; i < nNum; ++i) { cin >> nTemp; nProfit = max(nProfit, nTemp - nInprice); nInprice = min(nInprice, nTemp); } cout << nProfit << en...
a.cc: In function 'int main()': a.cc:9:23: error: 'INT_MIN' was not declared in this scope 9 | int nProfit = INT_MIN, nInprice = INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include...
s839724420
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main() { int R[MAX], n; cin >> n; for ( int i = 0; i < n; i++ ) cin >> R[i]; // int maxv = -20000000000; int maxv = numeric_limits<int>::min(); int minv = R[0]; for ( int i = 1; i < n; i++ ) ...
a.cc: In function 'int main()': a.cc:13:16: error: 'numeric_limits' was not declared in this scope 13 | int maxv = numeric_limits<int>::min(); | ^~~~~~~~~~~~~~ a.cc:13:31: error: expected primary-expression before 'int' 13 | int maxv = numeric_limits<int>::min(); | ...
s107332029
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main() { int R[MAX], n; cin >> n; for(int i =0; i<n; i++) cin >> R[i]; int maxv = -2000000000; int minv = R[0]; for(int i =1; i<n; i++){ maxv = max(maxv, R[i] - minv); minv = min(min...
a.cc: In function 'int main()': a.cc:14:26: error: 'r' was not declared in this scope 14 | minv = min(minv, r[i]); | ^
s848230759
p02258
C++
#include <iostream> #include <algorithm> #define INT_MAX 2147483647 int main(void){ int n; int val; int max_profit = -INT_MAX; int minv; std::cin >> n; std::cin >> minv; for(int i=0; i<n-1; i++){ std::cin >> val; max_profit = max(max_profit, val - minv); minv = min(minv, val); } ...
a.cc: In function 'int main()': a.cc:17:20: error: 'max' was not declared in this scope; did you mean 'std::max'? 17 | max_profit = max(max_profit, val - minv); | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, from a.cc:...
s098880347
p02258
C++
#include <iostream> #include <algorithm> #define INT_MAX 2147483647 int main(void){ int n; int val; int max_profit = -INT_MAX; int minv; std::cin >> n; std::cin >> minv; for(int i=0; i<n-1; i++){ std::cin >> val; max_profit = max(max_profit, val - minv); minv = min(minv, val); } ...
a.cc: In function 'int main()': a.cc:17:20: error: 'max' was not declared in this scope; did you mean 'std::max'? 17 | max_profit = max(max_profit, val - minv); | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, from a.cc:...
s258299036
p02258
C++
#include <iostream> #include <algorithm> int main(void){ int n; int val; int max_profit = -INT_MAX; int minv; std::cin >> n; std::cin >> minv; for(int i=0; i<n-1; i++){ std::cin >> val; max_profit = std::max(max_profit, val - minv); minv = std::min(minv, val); } std::cout << max...
a.cc: In function 'int main()': a.cc:8:21: error: 'INT_MAX' was not declared in this scope 8 | int max_profit = -INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <algorithm> +++ |+#in...
s146601648
p02258
C++
#include <iostream> using namespace std; int main() { int n, max, tmp; cin >> n; int input[n]; for(int i = 0; i < n; i++) { cin >> tmp; input[i] = tmp; } max = -1000000000; minR = input[0]; for(int i = 1; i < n; i++) { if(minR > input[i]) min = input[i]; if(max < input[i]-minR) max = input[i]-...
a.cc: In function 'int main()': a.cc:16:9: error: 'minR' was not declared in this scope 16 | minR = input[0]; | ^~~~ a.cc:20:38: error: overloaded function with no contextual type information 20 | min = input[i]; | ^
s202337419
p02258
C++
#include <iostream> using namespace std; int main() { int n, max, tmp; cin >> n; int input[n]; for(int i = 0; i < n; i++) { cin >> tmp; input[i] = tmp; } max = -1000000000; int minR = input[0]; for(int i = 1; i < n; i++) { if(minR > input[i]) min = input[i]; if(max < input[i]-minR) max = inpu...
a.cc: In function 'int main()': a.cc:20:38: error: overloaded function with no contextual type information 20 | min = input[i]; | ^
s219391855
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main() { vector<int> r; int n; cin>>n; int t; for (int i = 0; i <n ; ++i) { cin>>t; r.push_back(t); } int minv=r[0]; int maxv=-2000000000; for(int i=1;i<r.size();i++){ maxv=max(maxv,r[i]-minv...
a.cc: In function 'int main()': a.cc:8:5: error: 'vector' was not declared in this scope 8 | vector<int> r; | ^~~~~~ 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.c...
s675636382
p02258
C++
import sys input_amount = int(input()) values = [int(input()) for i in range(input_amount)] maxv = - sys.maxsize - 1 minv = values[0] for value in enumerate(values): maxv = max(maxv, value - minv) minv = min(minv, value) print(maxv)
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s660477728
p02258
C++
#include<cstdio> #include<algorithm> using namespace std; int main(){ int num=0; scanf("%d",&num); int x[num]; int max,min; scanf(" %d",&x[0]); scanf(" %d",&x[1]); max=x[1]-x[0]; if(x[1]<x[0]){ min=x[1]; }else{ min=x[0]; } for(int i=2;i<num;i++){ ...
a.cc: In function 'int main()': a.cc:23:17: error: expected primary-expression before '>' token 23 | if(x[i]=>min&&x[i]-min>max){ | ^
s444302706
p02258
C++
int main(){ int n; cin >> n; int count=0; int a[200000]; int Mid=0; int mid=0; for(int i=0;i<n;i++){ cin >> a[i]; if (a[Mid]<a[i]){ Mid=i; } if (a[mid]>a[i]){ mid=i; } } int frommax=-1000000000; int frommin=-10000000...
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> n; | ^~~ a.cc:20:17: error: 'max' was not declared in this scope 20 | frommax=max(frommax,a[Mid]-a[i]); | ^~~ a.cc:23:17: error: 'max' was not declared in this scope 23 ...
s798664004
p02258
C++
int largest(int a,int b,int c) { int max1 = (a >= b ? a : b); int max2 = (b >= c ? b : c); return (max1 >= max2 ? max1 : max2); } int main() { int n; std::vector<int> r; std::cin >> n; for(int i=0; i < n; i++){ int x; std::cin >> x; r.push_back(x); } int mx = r[1] - r[0]; while(r.s...
a.cc: In function 'int main()': a.cc:12:8: error: 'vector' is not a member of 'std' 12 | std::vector<int> r; | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | int largest(int a,int b,int c) a...
s723846527
p02258
C++
#include<iostream> #include<vector> #include<algorithm> int largest(int a,int b,int c) { int max1 = (a > b ? a : b); int max2 = (b > c ? b : c); return (max1 > max2 ? max1 : max2); } int main() { int n; std::vector<int> r; std::cin >> n; for(int i=0; i < n; i++){ int x; std::cin >> x; r...
a.cc: In function 'int main()': a.cc:26:5: error: 'print' was not declared in this scope; did you mean 'printf'? 26 | print(r); | ^~~~~ | printf
s288741065
p02258
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, r[200100], maxv = -1000000000, minv; cin>>n; for(int i = 0; i < n; i++){ cin>>r[i]; } int minv = r[0]; for(int j = 1; j < n; j++){ if(r[j] - minv > maxv) maxv = r[j] - minv; if(r[j] < minv) minv = r[j]; } cout<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: redeclaration of 'int minv' 10 | int minv = r[0]; | ^~~~ a.cc:5:47: note: 'int minv' previously declared here 5 | int n, r[200100], maxv = -1000000000, minv; | ^~~~ a.cc:15:13:...
s129413705
p02258
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, r[200100], maxv = -1000000000, minv; cin>>n; for(int i = 0; i < n; i++){ cin>>r[i]; } int minv = r[0]; for(int j = 1; j < n; j++){ if(r[j] - minv > maxv) maxv = r[j] - minv; if(r[j] < minv) minv = r[j]; } cout<<max<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: redeclaration of 'int minv' 10 | int minv = r[0]; | ^~~~ a.cc:5:47: note: 'int minv' previously declared here 5 | int n, r[200100], maxv = -1000000000, minv; | ^~~~ a.cc:15:13:...
s488445947
p02258
C++
#include <iostream> #include <algorithm> #include <numeric> #include <iomanip> #include <vector> #include <cmath> #include <cstdint> #include <string> using namespace std; int main() { int count; std::vector<int> X; cin >> count; for (int i = 0; i < count; ++i) { int x; cin >> x; X.push_back(x); ...
a.cc: In function 'int main()': a.cc:21:11: error: 'INT_MIN' was not declared in this scope 21 | int d = INT_MIN; | ^~~~~~~ a.cc:8:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 7 | #include <cstdint> +++ |+#include <climits> 8...
s630134081
p02258
C++
intMax = -100000000 inputData = int(input()) inputList = list() count = 0 while count < inputData: inputList.append(int(input())) count = count + 1 inputDataMax = intMax inputDataMin = inputList[0] count2 = 1 while count2 < inputData: inputDataMax = max(inputDataMax, inputList[count2] - inputDataMin) ...
a.cc:1:1: error: 'intMax' does not name a type 1 | intMax = -100000000 | ^~~~~~
s531939897
p02258
C++
#include<iostream> #include<algorithm> using namespase std; static const int MAX = 200000; int main(){ int R[MAX],n; cin>>n; for(int i=0;i<n;i++)cin >> R[i]; int maxv=-2000000000; int minv=R[0]; for(int i=1;i<n;i++){ maxv=max(maxv,R[i]-minv); minv=min(minv,R[i]); } cont << maxv << endl; return 0; }
a.cc:3:7: error: expected nested-name-specifier before 'namespase' 3 | using namespase std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin>>n; | ^~~ | std::cin In file included fr...
s083539443
p02258
C++
#include<iostream> #include<algorithm> using namespase std; static const int MAX = 200000; int main(){ int R[MAX],n; cin >> n; for(int i=0;i<n;i++) cin >> R[i]; int maxv = -2000000000; int minv = R[0]; for(int i=1;i<n;i++){ maxv = max(maxv,R[i]-minv); minv = min(minv,R[i]); } cout << maxv << endl; r...
a.cc:3:7: error: expected nested-name-specifier before 'namespase' 3 | using namespase std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin >> n; | ^~~ | std::cin In file included ...
s968278343
p02258
C++
#include<iostream> #include<algorithm> using namespase std; static const int MAX = 200000; int main(){ int R[MAX],n,cin,max,min,cout; cin >> n; for(int i=0;i<n;i++) cin >> R[i]; int maxv = -2000000000; int minv = R[0]; for(int i=1;i<n;i++){ maxv = max(maxv,R[i]-minv); minv = min(minv,R[i]); } cout <<...
a.cc:3:7: error: expected nested-name-specifier before 'namespase' 3 | using namespase std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:16:27: error: 'max' cannot be used as a function 16 | maxv = max(maxv,R[i]-minv); | ~~~^~~~~~~~~~~~~~~~ a.cc:17:27:...
s175244636
p02258
C++
#include<iostream> #include<algarithm> using namespace std; static const int MAX = 200000; int main(){ int R[MAX], n; cin >> n; for (int i = 0; i < n; i++ ) cin >> R[i]; int maxv = -2000000000; int minv = R[0]; for (int i = 0; i < n; i++ ){ maxv = max(maxv, R[i] - minv ); minv = min(minv, R[i]); } co...
a.cc:2:9: fatal error: algarithm: No such file or directory 2 | #include<algarithm> | ^~~~~~~~~~~ compilation terminated.
s400126839
p02258
C++
#include<stdio.h> #include<iostream> #include<vector> #include<algorithm> #include<string> #include<string.h> #include<math.h> #include<utility> #include<map> using namespace std; typedef long long int ll; typedef long double ld; typedef vector<ll> vi; typedef vector<string> vs; typedef pair<ll,ll> P; typedef vector<P>...
a.cc: In function 'int main()': a.cc:33:15: error: 'i' was not declared in this scope 33 | REP(n,i){ | ^ a.cc:17:32: note: in definition of macro 'REP' 17 | #define REP(i,n) for(int i=0;i<n;i++) | ^
s051680204
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 200000; int main(){ int R[MAX],n; cin >> n; for(int i = 0;i < n;i++) cin >> R[i]; int maxv = -2000000000; int minv R[0]; for(int i = 1;i < n;i++){ maxv = max(maxv,R[i] - minv); minv = min(minv,R[i]); } cout << maxv << endl; return 0...
a.cc: In function 'int main()': a.cc:13:10: error: expected initializer before 'R' 13 | int minv R[0]; | ^ a.cc:16:24: error: 'minv' was not declared in this scope 16 | maxv = max(maxv,R[i] - minv); | ^~~~
s723659536
p02258
C++
/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
s531561135
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 200000; int main(){ int R[MAX],n; cin >> n; for(int i = 0;i < n;i++) cin >> R[i]; int maxv = -2000000000; int minv R[0]; for(int i = 1;i < n;i++){ maxv = max(maxv,R[i] - minv); minv = min(minv,R[i]); } cout << maxv << endl; return 0...
a.cc: In function 'int main()': a.cc:13:10: error: expected initializer before 'R' 13 | int minv R[0]; | ^ a.cc:16:24: error: 'minv' was not declared in this scope 16 | maxv = max(maxv,R[i] - minv); | ^~~~
s345818950
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 200000; int main(){ int R[MAX],n; cin >> n; for(int i = 0;i < n;i++) cin >> R[i]; int maxv = -2000000000; int minv R[0]; for(int i = 1;i < n;i++){ maxv = max(maxv,R[i] - minv); minv = min(minv,R[i]); } cout << maxv << endl; return 0...
a.cc: In function 'int main()': a.cc:13:10: error: expected initializer before 'R' 13 | int minv R[0]; | ^ a.cc:16:24: error: 'minv' was not declared in this scope 16 | maxv = max(maxv,R[i] - minv); | ^~~~
s046835104
p02258
C++
#include<stdio.h> #include<iostream> #include<vector> #include<algorithm> #include<string> #include<string.h> #include<math.h> #include<utility> #include<map> using namespace std; typedef long long int ll; typedef long double ld; typedef vector<ll> vi; typedef vector<string> vs; typedef pair<ll,ll> P; typedef vector<P>...
a.cc: In function 'int main()': a.cc:32:9: error: expected initializer before 'cin' 32 | cin << num << endl; | ^~~ a.cc:33:9: error: 'MIN' was not declared in this scope 33 | MIN = num; | ^~~
s160561815
p02258
C++
int main() { int n; scanf("%d", &n); int R[200000]; for (int i = 0; i < n; i++) scanf("%d", R + i); int max = (int)0x80000000; int min = R[0]; for (int i = 1; i < n; i++) { if (R[i] - min > max) max = R[i] - min; if (R[i] < min) min = R[i]; } /* for (int i = 0; i < n; i++) { for (int j = i + 1...
a.cc: In function 'int main()': a.cc:4:9: error: 'scanf' was not declared in this scope 4 | scanf("%d", &n); | ^~~~~ a.cc:31:9: error: 'printf' was not declared in this scope 31 | printf("%d\n", max); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; t...
s251242109
p02258
C++
#include<iostream> int main() { int n,R[200]; std::cin>>n; for(int i=0;i<n;i++){ std::cin>>R[i]; } int max=-10**12; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if((R[j]-R[i])>max){ max=R[j]-R[i]; } } } std::cout<<max; return 0; }
a.cc: In function 'int main()': a.cc:10:21: error: invalid type argument of unary '*' (have 'int') 10 | int max=-10**12; | ^~~
s368167165
p02258
C++
#include<cmath> int main(){ int A[200000]={0}; int n,max=-1000000000,tmp=0; std::cin>>n; for(int i=0;i<n;i++){ std::cin>>A[i]; } for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ tmp=A[j]-A[i]; if(tmp>max){ max=tmp; } } } std::cout<<max<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:6:8: error: 'cin' is not a member of 'std' 6 | std::cin>>n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<cmath> +++ |+#include <iostream> 2 | a.cc:8:10: error: ...
s986180971
p02258
C++
#include <iostream> #include<algorithm> using namespace std; static const int MAX = 200000; int main() { int R[MAX],n; cin >>n; for ( int i = 0; i < n; i++ ) cin >> R[i]; int maxv = -2000000000; int minv = R[0]; for ( int i = 1; i < n; i++ ) { maxv = ma...
a.cc:19:18: error: stray '#' in program 19 | return 0;# | ^
s943133735
p02258
C++
int main() { cin >> n; int R[n]; for (int t = 0; t < n; t++) { cin >> R[t]; } max = R[1] - R[0]; int tmp; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { tmp = R[j] - R[i]; if(max < tmp) { max = tmp; } } ...
a.cc: In function 'int main()': a.cc:2:5: error: 'cin' was not declared in this scope 2 | cin >> n; | ^~~ a.cc:2:12: error: 'n' was not declared in this scope 2 | cin >> n; | ^ a.cc:5:16: error: 'R' was not declared in this scope 5 | cin >> R[t]; | ...
s362473568
p02258
C++
#include <iostream.h> int main() { cin >> n; int R[n]; for (int t = 0; t < n; t++) { cin >> R[t]; } int max = R[1] - R[0]; int tmp; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { tmp = R[j] - R[i]; if(max < tmp) { max = tm...
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s445532580
p02258
C++
#include "stdafx.h" #include <iostream> using namespace std; int main() { int n; cin >> n; int R[200000]; for (int t = 0; t < n; t++) { cin >> R[t]; } int max = R[1] - R[0]; int tmp; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { tmp = R[j] - R[i]; if (max < tmp) { max = tmp; } ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s717750817
p02258
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; int maxv = -1000000000; int minv, Rj; for (int j = 0; j < n; j++) { cin >> Rj; if(j == 0) { minv = Rj; } else { if (minv < Rj) { minv = Rj; } } ...
a.cc: In function 'int main()': a.cc:19:30: error: expected ')' before '{' token 19 | if(maxv < (Rj - minv) { | ~ ^~ | ) a.cc:22:9: error: expected primary-expression before '}' token 22 | } | ^
s800568304
p02258
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int r[n]; for(int i = 0;i < n;i++) cin >> r[i]; int maxr = r[1] - r[0]; int minr = min(r[1],r[0]); for(int i = 2;i < n;i++){ maxr = max(maxr,r[i]-minr); minr = min(minr,r[i]); } cout << maxr << endl; } s
a.cc:20:1: error: 's' does not name a type 20 | s | ^
s810006871
p02258
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int r[n]; for(int i = 0;i < n;i++) cin >> r[i]; int maxr = r[1] - r[0]; int minr = min(r[1],r[0]); for(int i = 2;i < n;i++){ maxr = max(maxr,r[i]-minr); minr = min(minr,r[i]); } cout << maxr << endl; } s
a.cc:20:1: error: 's' does not name a type 20 | s | ^
s003529201
p02258
C++
#include<stdc++.h> using namespace std; int main() { long long s,n,minn=999999999999,maxn=-999999999999; scanf("%lld",&n); for(long long i=0;i<n;i++){ scanf("%lld",&s); maxn=max(maxn,s-minn); minn=min(s,minn); } printf("%lld\n",maxn); return 0; }
a.cc:2:9: fatal error: stdc++.h: No such file or directory 2 | #include<stdc++.h> | ^~~~~~~~~~ compilation terminated.
s735377105
p02258
C++
#include "stdio.h" #include <math.h> int main() { int n,R; int diff = (int)pow(10, 9)*-1-1; int Min = (int)pow(10, 9) + 1; scanf_s("%d ", &n); for (int i = 0; i < n; i++) { scanf_s("%d", &R); if (Min > R) { Min = R; } if (diff < R - Min) { diff = R - Min; } } printf("%d", diff); return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 8 | scanf_s("%d ", &n); | ^~~~~~~ | scanf
s907585223
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX =200000000 int main(){ int R[MAX],n; cin>>n; for(int i=0;i<n;i++)cin>>R[i]; int maxv =-2000000000; int minv =R[0]; for(int i=1;i<n;i++){ maxv =max(maxv,R[i]-minv) minv =min(minv,R[i]); } cout << maxv << endl; return 0; }
a.cc:5:1: error: expected ',' or ';' before 'int' 5 | int main(){ | ^~~
s674738945
p02258
C++
#include "stdio.h" #include <math.h> int main() { int n,R; int diff = (int)pow(10, 9)*-1-1; int Min = (int)pow(10, 9) + 1; scanf_s("%d ", &n); for (int i = 0; i < n; i++) { scanf_s("%d", &R); if (diff < R - Min) { diff = R - Min; } if (Min > R) { Min = R; } } printf("%d", diff); return 0; } ...
a.cc: In function 'int main()': a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 8 | scanf_s("%d ", &n); | ^~~~~~~ | scanf
s054142949
p02258
C++
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; #define PB push_back using LL = lo...
a.cc: In function 'int main()': a.cc:27:14: error: initializer in range-based 'for' loop 27 | for(int i=0: i<n: i++){ | ^ a.cc:27:21: error: found ':' in nested-name-specifier, expected '::' 27 | for(int i=0: i<n: i++){ | ^ | :: a.cc:2...
s792972473
p02258
C++
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; #define PB push_back //using LL = ...
a.cc: In function 'int main()': a.cc:27:14: error: initializer in range-based 'for' loop 27 | for(int i=0: i<n: i++){ | ^ a.cc:27:21: error: found ':' in nested-name-specifier, expected '::' 27 | for(int i=0: i<n: i++){ | ^ | :: a.cc:2...
s610973112
p02258
C++
#include <vector> #include <iostream> #include <algorithm> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \ << " " << __FILE__ << endl; ...
a.cc: In function 'int main()': a.cc:24:14: error: initializer in range-based 'for' loop 24 | for(int i=0: i<n: i++){ | ^ a.cc:24:21: error: found ':' in nested-name-specifier, expected '::' 24 | for(int i=0: i<n: i++){ | ^ | :: a.cc:2...
s891775808
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; #define dump(x) cerr << #x << " = " << (x) << endl; int main() { //cin.tie(0); //ios::sync_with_stdio(false); int n; cin >> n; int v[MAX]; for(int i=0; i<n; i++){ cin >> v[i]; } int...
a.cc: In function 'int main()': a.cc:23:17: error: 'INT_MAX' was not declared in this scope 23 | int maxv = -INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <algorithm> +++ |+#include <...
s324211747
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; #define dump(x) cerr << #x << " = " << (x) << endl; int main() { //cin.tie(0); //ios::sync_with_stdio(false); int n; cin >> n; int v[MAX]; for(int i=0; i<n; i++){ cin >> v[i]; } int...
a.cc: In function 'int main()': a.cc:23:18: error: 'INT_MAX' was not declared in this scope 23 | int maxv = -(INT_MAX); | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <algorithm> +++ |+#includ...
s575915120
p02258
C++
#include <iostream> #include <algorithm> using namespace std; #define IINF (INT_MAX) static const int MAX = 200000; #define dump(x) cerr << #x << " = " << (x) << endl; int main() { //cin.tie(0); //ios::sync_with_stdio(false); int n; cin >> n; int v[MAX]; for(int i=0; i<n; i++){ cin ...
a.cc: In function 'int main()': a.cc:4:15: error: 'INT_MAX' was not declared in this scope 4 | #define IINF (INT_MAX) | ^~~~~~~ a.cc:24:17: note: in expansion of macro 'IINF' 24 | int maxv = -IINF; | ^~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; th...
s094956279
p02258
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n, num[200000]; cin >>n; for(int i = 0; i < n; i++){ cin >> num[i]; } int minv = num[0], maxv = -200000000; for(int i = 1; i<n; i++){ mav = max(maxv, R[i] - minv); minv = min(minv, R[i]); } ...
a.cc: In function 'int main()': a.cc:13:9: error: 'mav' was not declared in this scope; did you mean 'maxv'? 13 | mav = max(maxv, R[i] - minv); | ^~~ | maxv a.cc:13:25: error: 'R' was not declared in this scope 13 | mav = max(maxv, R[i] - minv); | ...
s767706430
p02258
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n, num[200000]; cin >>n; for(int i = 0; i < n; i++){ cin >> num[i]; } int minv = num[0], maxv = -200000000; for(int i = 1; i<n; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } ...
a.cc: In function 'int main()': a.cc:13:26: error: 'R' was not declared in this scope 13 | maxv = max(maxv, R[i] - minv); | ^
s116853141
p02258
C++
#include<iostreeam> #include<algorithm> using namespace std; static const int MAX = 2000000; int main(){ int R[MAX],n; cin >> n; for(int i = 0; i < n; i++ )cin >> R[i]; int maxv = -2000000000; int minv = R[0]; for(int = i ; i < n; i++){ maxv =max(maxv,R[i]-minv); minv = min(minv,R[i]); } cout << maxv << e...
a.cc:1:9: fatal error: iostreeam: No such file or directory 1 | #include<iostreeam> | ^~~~~~~~~~~ compilation terminated.
s399612963
p02258
C++
#include<iostreeam> #include<algorithm> using namespace std; static const int MAX = 2000000; int main(){ int R[MAX],n; cin >> n; for(int i = 0; i < n; i++)cin >> R[i]; int maxv = -2000000000; int minv = R[0]; for(int = i ; i < n; i++){ maxv =max(maxv,R[i]-minv); minv = min(minv,R[i]); } cout << maxv << en...
a.cc:1:9: fatal error: iostreeam: No such file or directory 1 | #include<iostreeam> | ^~~~~~~~~~~ compilation terminated.
s009515727
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 200000; int main(){ int R[MAX],n; cin >> n; for ( int i = 0;i < n; i++ )cin >> r[i]; int maxv = -2000000000; int minv = R[0]; for (int i = 1; i < n; i++ ){ maxv = max(maxv, R[i] - minv); minv = min(minv,R[i]); } cout...
a.cc: In function 'int main()': a.cc:10:37: error: 'r' was not declared in this scope 10 | for ( int i = 0;i < n; i++ )cin >> r[i]; | ^
s596613106
p02258
C++
#include <bits/stdc++.h> using namespace std; long long n,a[1000000],x,y,max; int main(){ cin>>n; for(x=0;x<n;x++){ cin>>a[x]; for(y=x-1;y>=0;y--){ if(x==1&&y==0){ max=a[x]-a[y]; } if (max<a[x]-a[y]){ max=a[x]-a[y]; } } } cout<<max<<endl; }
a.cc: In function 'int main()': a.cc:10:29: error: reference to 'max' is ambiguous 10 | max=a[x]-a[y]; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s565562025
p02258
C++
#include <bits/stdc++.h> using namespace std; long long n,a[1000000],x,y,max; int main(){ cin>>n; for(x=0;x<n;x++){ cin>>a[x]; for(y=x-1;y>=0;y--){ if(x==1&&y==0){ max=a[x]-a[y]; } if (max<a[x]-a[y]){ max=a[x]-a[y]; } } } cout<<max<<endl; }
a.cc: In function 'int main()': a.cc:10:29: error: reference to 'max' is ambiguous 10 | max=a[x]-a[y]; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s319733164
p02258
C++
2 1000000000 1
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 | ^
s140686546
p02258
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; int r[ n ]; for( int i = 0; i < n; i++ ) { cin >> r[ i ]; } for( int i = 0; i < n - 1; i++ ) { ; } cout << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 18 | cout << max << endl; | ~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a....
s292895829
p02258
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; int r[ n ]; for( int i = 0; i < n; i++ ) { cin >> r[ i ]; } for( int i = 0; i < n - 1; i++ ) { r[ i ]; } cout << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 18 | cout << max << endl; | ~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a....
s515355853
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; int main() { long int arr[200010]={0}; long int arrmin=1000000000; int n=0; schanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&arr[i]); if(i==0) continue; if(i==1) long int dmax=arr[1]-arr[0]; if(arr[i-1]<arr[i...
a.cc: In function 'int main()': a.cc:10:5: error: 'schanf' was not declared in this scope; did you mean 'scanf'? 10 | schanf("%d",&n); | ^~~~~~ | scanf a.cc:11:9: error: 'i' was not declared in this scope 11 | for(i=0;i<n;i++){ | ^ a.cc:16:13: error: 'dmax' was not declar...
s021217410
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; int main() { long int arr[200010]={0}; long int arrmin=1000000000; int n=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&arr[i]); if(i==0) continue; if(i==1) long int dmax=arr[1]-arr[0]; if(arr[i-1]<arr[i]...
a.cc: In function 'int main()': a.cc:11:9: error: 'i' was not declared in this scope 11 | for(i=0;i<n;i++){ | ^ a.cc:16:13: error: 'dmax' was not declared in this scope 16 | dmax=max(arr[i]-arrmin,dmax); | ^~~~ a.cc:21:18: error: 'dmax' was not declared in this scop...
s505172589
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; int main() { long int arr[200010]={0}; long int arrmin=1000000000; int n=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&arr[i]); if(i==0) continue; if(i==1) long int dmax=arr[1]-arr[0]; if(arr[i-1]<ar...
a.cc: In function 'int main()': a.cc:16:13: error: 'dmax' was not declared in this scope 16 | dmax=max(arr[i]-arrmin,dmax); | ^~~~ a.cc:21:18: error: 'dmax' was not declared in this scope 21 | printf("%d",&dmax); | ^~~~
s969361865
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; int main() { long int arr[200010]={0}; long int arrmin; long int dmax; int n=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%ld",&arr[i]); if(i==0){ arrmin=a[0]; continue; } if...
a.cc: In function 'int main()': a.cc:15:20: error: 'a' was not declared in this scope 15 | arrmin=a[0]; | ^
s142610603
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; const int MAX = 200010 int main() { int min; int dmax=-2000000000; int var; int n=0; scanf("%d",&n); lo for(int i=0;i<n;i++){ scanf("%d",&var); if(i==1) min=var; dmax=max(var-min,dmax); min=min(var,...
a.cc:6:1: error: expected ',' or ';' before 'int' 6 | int main() | ^~~
s992677710
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; const int MAX = 200010 int main() { int min; int dmax=-2000000000; int var; int n=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&var); if(i==1) min=var; dmax=max(var-min,dmax); min=min(var,min); ...
a.cc:6:1: error: expected ',' or ';' before 'int' 6 | int main() | ^~~
s189720423
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; int main() { int min; int dmax=-2000000000; int var; int n=0; scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%d",&var); if(i==0) min=var; dmax=max(var-min,dmax); min=min(var,min); } printf("%d\n"...
a.cc: In function 'int main()': a.cc:16:16: error: 'min' cannot be used as a function 16 | min=min(var,min); | ~~~^~~~~~~~~
s068571529
p02258
C++
#include<iostream> #include<algorithm> int main() { int R[MAX], n; cin >> n; for ( int i = 0; i < n; i++ ) cin >> R[i]; int maxv = -2000000000 int minv = R[0] for ( int i = 1; i < n; i++ ) { maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } cout << maxv << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'MAX' was not declared in this scope 5 | int R[MAX], n; | ^~~ a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostre...
s180993752
p02258
C++
#include<iostream> #include<algorithm> int main() { int R[MAX], n; cin >> n; for ( int i = 0; i < n; i++ ) cin >> R[i]; int maxv = -2000000000 int minv = R[0] for ( int i = 1; i < n; i++ ) { maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } cout << maxv << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'MAX' was not declared in this scope 5 | int R[MAX], n; | ^~~ a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostre...
s084829352
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 200000; int main() { int R[MAX], n; cin >> n; for ( int i = 0; i < n; i++ ) cin >> R[i]; int maxv = -2000000000 int minv = R[0] for ( int i = 1; i < n; i++ ) { maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]);...
a.cc: In function 'int main()': a.cc:12:3: error: expected ',' or ';' before 'int' 12 | int minv = R[0] | ^~~ a.cc:14:20: error: 'i' was not declared in this scope 14 | for ( int i = 1; i < n; i++ ) { | ^
s901367264
p02258
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <map> #include <stdio.h> using namespace std; using ll = long long; map <int ,int> mpa,mpb; int main (){ int N; cin >> N; int R[N]; for(int i=0;i<N;i+...
a.cc: In function 'int main()': a.cc:24:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 24 | ans=max(R[i]-min_a,ans); | ^~~ | abs a.cc:28:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 28 | cout << ans << endl; | ^~~ | ...
s363311436
p02258
C++
/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
s118280298
p02258
C++
#include <iostream> using namespace std; int main(void){ int n, R[200001]; cin >> n; for(int i = 0; i < n; i++){ cin >> R[i]; } int minv = R[0]; int maxv = -1000000001; for(int j = i + 1; j < n; j++){ if(R[j] - minv > maxv) maxv = R[j] - minv; if(R[j] < minv) minv = R...
a.cc: In function 'int main()': a.cc:11:17: error: 'i' was not declared in this scope 11 | for(int j = i + 1; j < n; j++){ | ^
s764908562
p02258
C++
#include <iostream> #include <queue> #include <stack> #include <cstdio> #include <vector> #include <sstream> using namespace std; const int N_MAX = numeric_limits<int>::max(); int maxprofit(vector<int> arr){ int tmp_min = arr[0]; int max_profit = -N_MAX; for(int i=1; i<arr.size(); i++){ max_profit = max(ma...
a.cc:10:19: error: 'numeric_limits' was not declared in this scope 10 | const int N_MAX = numeric_limits<int>::max(); | ^~~~~~~~~~~~~~ a.cc:10:34: error: expected primary-expression before 'int' 10 | const int N_MAX = numeric_limits<int>::max(); | ^~~...
s659540454
p02258
C++
#include <stdio.h> int main() { int n=0; scanf("%d", &n); int maxdiff=-200000 int prev=0, now=0; for(int i=0; i<n; i++) { scanf("%d", now); maxdiff = now - prev; prev = now; } printf("%d", maxdiff); }
a.cc: In function 'int main()': a.cc:8:5: error: expected ',' or ';' before 'int' 8 | int prev=0, now=0; | ^~~ a.cc:10:21: error: 'now' was not declared in this scope 10 | scanf("%d", now); | ^~~ a.cc:11:25: error: 'prev' was not declared in this scope 11 | ...
s545508663
p02258
C++
#include <stdio.h> int main() { int n=0; scanf("%d", &n); int maxdiff=-200000 int prev=0, now=0; for(int i=0; i<n; i++) { scanf("%d", &now); maxdiff = now - prev; prev = now; } printf("%d", maxdiff); }
a.cc: In function 'int main()': a.cc:8:5: error: expected ',' or ';' before 'int' 8 | int prev=0, now=0; | ^~~ a.cc:10:22: error: 'now' was not declared in this scope 10 | scanf("%d", &now); | ^~~ a.cc:11:25: error: 'prev' was not declared in this scope 11 | ...
s101882717
p02258
C++
#include <stdio.h> int main() { int n=0; scanf("%d", &n); int maxdiff=-200000, diff=0; int prev=0, now=0; scanf("%d", &prev); for(int i=1; i<n; i++) { scanf("%d", &now); diff = now - prev; if(diff > max_diff) maxdiff = diff; prev = now; } ...
a.cc: In function 'int main()': a.cc:15:19: error: 'max_diff' was not declared in this scope; did you mean 'maxdiff'? 15 | if(diff > max_diff) maxdiff = diff; | ^~~~~~~~ | maxdiff
s576033185
p02258
C++
#include <stdio.h> int main() { int n=0; scanf("%d", &n); int maxdiff=-200000, diff=0; int prev=0, now=0; scanf("%d", &prev); for(int i=1; i<n; i++) { scanf("%d", &now); diff = now - prev; if(diff > max_diff) { maxdiff = diff; } prev = now; } ...
a.cc: In function 'int main()': a.cc:15:19: error: 'max_diff' was not declared in this scope; did you mean 'maxdiff'? 15 | if(diff > max_diff) { maxdiff = diff; } | ^~~~~~~~ | maxdiff
s324795375
p02258
C++
#include <stdio.h> int main() { int n=0; scanf("%d", &n); int maxdiff=-200000, diff=0; int prev=0, now=0; scanf("%d", &prev); for(int i=1; i<n; i++) { scanf("%d", &now); diff = now - prev; if(diff > max_diff) maxdiff = diff; prev = now; } ...
a.cc: In function 'int main()': a.cc:15:19: error: 'max_diff' was not declared in this scope; did you mean 'maxdiff'? 15 | if(diff > max_diff) maxdiff = diff; | ^~~~~~~~ | maxdiff
s951296013
p02258
C++
#include <stdio.h> #include <algorithm> static const int MAX = 200000; int main() { int n, R[MAX]; scanf("%d", &n); for ( int i=0; i<n, i++) scanf("%d", &R[i]); int maxv = -2000000000; int minv = R[0]; for (int j=1; j<n-1; j++) { for (int i=0; i<j-1; i++) { ma...
a.cc: In function 'int main()': a.cc:9:28: error: expected ';' before ')' token 9 | for ( int i=0; i<n, i++) scanf("%d", &R[i]); | ^ | ; a.cc:16:20: error: 'max' was not declared in this scope; did you mean 'std::max'? 16 | maxv = ...
s338230698
p02258
C++
#include <stdio.h> #include <algorithm> static const int MAX = 200000; int main() { int n, R[MAX]; scanf("%d", &n); for ( int i=0; i<n, i++) scanf("%d", &R[i]); int maxv = -2000000000; int minv = R[0]; for (int j=1; j<n-1; j++) { for (int i=0; i<j-1; i++) { ma...
a.cc: In function 'int main()': a.cc:9:28: error: expected ';' before ')' token 9 | for ( int i=0; i<n, i++) scanf("%d", &R[i]); | ^ | ; a.cc:16:20: error: 'max' was not declared in this scope; did you mean 'std::max'? 16 | maxv = ...
s135639597
p02258
C++
#include <stdio.h> #include <algorithm> static const int MAX = 200000; int main() { int n, R[MAX]; scanf("%d", &n); for ( int i=0; i<n; i++) scanf("%d", &R[i]); int maxv = -2000000000; int minv = R[0]; for (int j=1; j<n-1; j++) { for (int i=0; i<j-1; i++) { ma...
a.cc: In function 'int main()': a.cc:16:20: error: 'max' was not declared in this scope; did you mean 'std::max'? 16 | maxv = max(maxv, R[j] - R[i]); | ^~~ | std::max In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /u...
s205970978
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; scanf("%d", &n); for(int i=0; i<n; i++) scanf("%d", &R[i]); int maxv = -2000000000; int minv = R[0]; for (int i=1; i<n; i++) { maxv = maxv(maxv, R[i] - ...
a.cc: In function 'int main()': a.cc:16:20: error: 'maxv' cannot be used as a function 16 | maxv = maxv(maxv, R[i] - minv); | ~~~~^~~~~~~~~~~~~~~~~~~ a.cc:17:20: error: 'minv' cannot be used as a function 17 | minv = minv(minv, R[i]) | ~~~~^~~~~~~~~~~~
s885379225
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; scanf("%d", &n); for(int i=0; i<n; i++) scanf("%d", &R[i]); int maxv = -2000000000; int minv = R[0]; for (int i=1; i<n; i++) { maxv = maxv(maxv, R[i] - ...
a.cc: In function 'int main()': a.cc:16:20: error: 'maxv' cannot be used as a function 16 | maxv = maxv(maxv, R[i] - minv); | ~~~~^~~~~~~~~~~~~~~~~~~ a.cc:17:20: error: 'minv' cannot be used as a function 17 | minv = minv(minv, R[i]); | ~~~~^~~~~~~~~~~~
s567062798
p02258
C++
// // Created by yoshihito.hotta on 2018/06/10. // #include <iostream> using namespace std; int main() { int n; cin >> n; int *r; r = new int[n]; for (int i = 0; i < n; i++){ cin >> r[i] ; } int minr; int maxv; minr = r[0]; maxv = -1000000000000; for (int i = 0;...
a.cc: In function 'int main()': a.cc:22:13: warning: overflow in conversion from 'long int' to 'int' changes value from '-1000000000000' to '727379968' [-Woverflow] 22 | maxv = -1000000000000; | ^~~~~~~~~~~~~~ a.cc:33:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka ...
s857521377
p02258
C++
// // Created by yoshihito.hotta on 2018/06/10. // #include <iostream> using namespace std; int main() { int n; cin >> n; int *r; r = new int[n]; for (int i = 0; i < n; i++){ cin >> r[i] ; } int minr; int maxv; minr = r[0]; maxv = - INT_MIN; for (int i = 0; i < ...
a.cc: In function 'int main()': a.cc:22:15: error: 'INT_MIN' was not declared in this scope 22 | maxv = - INT_MIN; | ^~~~~~~ a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <iostream> +++ |+#include <climi...
s729696313
p02258
C++
// // Created by yoshihito.hotta on 2018/06/10. // #include <iostream> using namespace std; int main() { int n; cin >> n; int *r; r = new int[n]; for (int i = 0; i < n; i++){ cin >> r[i] ; } int minr; int maxv; minr = r[0]; maxv = - INT_MIN; for (int i = 0; i < ...
a.cc: In function 'int main()': a.cc:22:15: error: 'INT_MIN' was not declared in this scope 22 | maxv = - INT_MIN; | ^~~~~~~ a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <iostream> +++ |+#include <climi...
s212550308
p02258
C++
// // Created by yoshihito.hotta on 2018/06/10. // #include <iostream> #include <climits> using namespace std; int main() { int n; cin >> n; int *r; r = new int[n]; for (int i = 0; i < n; i++){ cin >> r[i] ; } int minr; int maxv; minr = r[0] maxv = - INT_MIN; fo...
a.cc: In function 'int main()': a.cc:22:16: error: expected ';' before 'maxv' 22 | minr = r[0] | ^ | ; 23 | maxv = - INT_MIN; | ~~~~
s495125528
p02258
C++
#include <iostream> #include <string> using namespace std; int main() { int n_col; cin >> n_col; int* p_currency; p_currency = new int[n_col]; for(int i=0; i<n_col; i++){ cin >> p_currency[i]; } int max_profit = p_currency[1] - p_currency[0]; //cout << "first max_profit: " << max_profit << "\n"; int min =...
a.cc: In function 'int main()': a.cc:25:26: error: 'min' cannot be used as a function 25 | min = min(min, p_currency[i]); | ~~~^~~~~~~~~~~~~~~~~~~~
s411351997
p02258
C++
#include <iostream> #include <string> using namespace std; int main() { int n_col; cin >> n_col; int* p_currency; p_currency = new int[n_col]; for(int i=0; i<n_col; i++){ cin >> p_currency[i]; } int max_profit = p_currency[1] - p_currency[0]; //cout << "first max_profit: " << max_profit << "\n"; int min =...
a.cc: In function 'int main()': a.cc:25:26: error: 'min' cannot be used as a function 25 | min = min(min, p_currency[i]); | ~~~^~~~~~~~~~~~~~~~~~~~
s344312804
p02258
C++
#include<stdio.h> #include<algorithm> using namespace std; static const int MAX = 200000; int main() { int R[MAX], n; cin >> n; for(i = 0 ; i < n ; i++){ cin >> R[i];; } int maxv = -2000000000; int minv = R[0]; for(i = 0 ; i < n ; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[...
a.cc: In function 'int main()': a.cc:10:3: error: 'cin' was not declared in this scope 10 | cin >> n; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<algorithm> +++ |+#include <iostream> 3 | using namespace ...
s158228398
p02258
C++
#include<stdio.h> #include<bits/stdc++.h> int main(void){ int i,N,j,max,big; scanf("%d",&N); int array[N]; for(i=0;i<N;i++){ scanf("%d",&array[i]); } int ans = 0,min_ = array[0]; for(int i = 1; i < N; ++i){ min_ = min(min_, array[i]); ans = max(ans, array[i] - min_); } if(ans ==...
a.cc: In function 'int main()': a.cc:17:12: error: 'min' was not declared in this scope; did you mean 'std::min'? 17 | min_ = min(min_, array[i]); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/...
s538645036
p02258
C++
#include<stdio.h> #include<bits/stdc++.h> int main(void){ int i,N,j,max,big; scanf("%d",&N); int array[N]; for(i=0;i<N;i++){ scanf("%d",&array[i]); } int ans = 0,min_ = array[0]; for(int i = 1; i < N; ++i){ min_ = min(min_, array[i]); ans = max(ans, array[i] - min_); } if(ans ==...
a.cc: In function 'int main()': a.cc:17:12: error: 'min' was not declared in this scope; did you mean 'std::min'? 17 | min_ = min(min_, array[i]); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/...
s971925797
p02258
C++
#include<stdio.h> #include<bits/stdc++.h> int main(void){ int i,N,j,max,big; scanf("%d",&N); int array[N]; for(i=0;i<N;i++){ scanf("%d",&array[i]); } int ans = 0,min_ = array[0]; for(int i = 1; i < N; ++i){ min_ = min(min_, array[i]); ans = max(ans, array[i] - min_); } if(ans ==...
a.cc: In function 'int main()': a.cc:17:12: error: 'min' was not declared in this scope; did you mean 'std::min'? 17 | min_ = min(min_, array[i]); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/...
s418895860
p02258
C++
#include<stdio.h> #include<bits/stdc++.h> int main(void){ int i,N,j,max,big; scanf("%d",&N); int array[N]; for(i=0;i<N;i++){ scanf("%d",&array[i]); } int ans = 0,min_ = array[0]; for(int i = 1; i < N; ++i){ min_ = min(min_, array[i]); ans = max(ans, array[i] - min_); } if(ans ==...
a.cc: In function 'int main()': a.cc:17:12: error: 'min' was not declared in this scope; did you mean 'std::min'? 17 | min_ = min(min_, array[i]); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/...
s603302087
p02258
C++
#include<stdio.h> #include<bits/stdc++.h> int main(void){ int N,j,max,big; scanf("%d",&N); int array[1000000]; for(int i=0;i<N;i++){ scanf("%d",&array[i]); } int ans = 0,min_ = array[0]; for(int i = 1; i < N; ++i){ min_ = min(min_, array[i]); ans = max(ans, array[i] - min_); } i...
a.cc: In function 'int main()': a.cc:17:12: error: 'min' was not declared in this scope; did you mean 'std::min'? 17 | min_ = min(min_, array[i]); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/...
s759807196
p02258
C++
#include<stdio.h> #include<bits/stdc++.h> int main(void){ int N,j; scanf("%d",&N); int array[1000000]; for(int i=0;i<N;i++){ scanf("%d",&array[i]); } int ans = 0,min_ = array[0]; for(int i = 1; i < N; ++i){ min_ = min(min_, array[i]); ans = max(ans, array[i] - min_); } if(ans ==...
a.cc: In function 'int main()': a.cc:17:12: error: 'min' was not declared in this scope; did you mean 'std::min'? 17 | min_ = min(min_, array[i]); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/...
s635397991
p02258
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; int* a = new int[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int max = INT_MIN; int result = 0; for (int i = n - 1; i > 0; i--) { for (int j = i - 1; j >= 0; j--) { result = a[i] - a[j]; if (result > max) max = resul...
a.cc: In function 'int main()': a.cc:16:19: error: 'INT_MIN' was not declared in this scope 16 | int max = 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> +++ |+#includ...
s323340054
p02258
C++
#include <iostream> using namespace std; int main() { int n; cin >> n; int* a = new int[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int max = INT_MIN; int result = 0; for (int i = n - 1; i > 0; i--) { for (int j = i - 1; j >= 0; j--) { result = a[i] - a[j]; if (result > max) max = resul...
a.cc: In function 'int main()': a.cc:16:19: error: 'INT_MIN' was not declared in this scope 16 | int max = 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> +++ |+#includ...
s761421633
p02258
C++
#include <stdio.h> int main(){ int A[20000],i,max=-9999999999,min,a; scanf("%d",&a); for(i=0;i<a;i++) scanf("%d",&A[i]); min=A[0]; for(i=1;i<a-i++){ if(A[i]-min>max) max=A[i]-min; if(A[i]<min) min=A[i]; } printf("%d\n",max); return 0; }
a.cc: In function 'int main()': a.cc:3:22: warning: overflow in conversion from 'long int' to 'int' changes value from '-9999999999' to '-1410065407' [-Woverflow] 3 | int A[20000],i,max=-9999999999,min,a; | ^~~~~~~~~~~ a.cc:11:18: error: expected ';' before ')' token 11 | for(i=1;i...