submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s365895766
p02258
C++
#include <vector> #include <iostream> #include <algorithm> #include <limits> using namespace std; int main() { int val = 0; cin >> val; int minVal = INT_MAX; int maxPro = INT_MIN; while (cin >> val) { minVal = std::min(minVal, val); maxPro = std::max(maxPro, val - minVal); } cout << maxPro << endl; retur...
a.cc: In function 'int main()': a.cc:12:22: error: 'INT_MAX' was not declared in this scope 12 | int minVal = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <limits> +++ |+#in...
s469830258
p02258
C++
#include <vector> #include <iostream> #include <algorithm> #include <limits> using namespace std; int main() { int val = 0; cin >> val; int minVal = INT_MAX; int maxPro = INT_MIN; while (cin >> val) { minVal = std::min(minVal, val); maxPro = std::max(maxPro, val - minVal); } cout << maxPro << endl; retur...
a.cc: In function 'int main()': a.cc:12:22: error: 'INT_MAX' was not declared in this scope 12 | int minVal = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <limits> +++ |+#in...
s537621559
p02258
C++
#include <vector> #include <iostream> #include <algorithm> #include <limits> using namespace std; int main() { int val = 0; cin >> val; int minVal = INT_MAX; int maxPro = -1; cin >> minVal; while (cin >> val) { maxPro = std::max(maxPro, val - minVal); minVal = std::min(minVal, val); } cout << maxPro << e...
a.cc: In function 'int main()': a.cc:12:22: error: 'INT_MAX' was not declared in this scope 12 | int minVal = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <limits> +++ |+#in...
s236689548
p02258
C++
#include <algorithm> #include <limits> #define INT_MAX 2147483647 #define INT_MIN -2147483647 using namespace std; int main() { int maxProf = -2000000000; int minVal = 0; cin >> minVal; int val = 0; while (cin >> val) { maxProf = std::max(maxProf, val - minVal); minVal = std::min(minVal, val); } cout << m...
a.cc: In function 'int main()': a.cc:12:9: error: 'cin' was not declared in this scope 12 | cin >> minVal; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <limits> +++ |+#include <iostream> 3 | ...
s270372906
p02258
C++
#include<iostream> #include<string.h> #include<algorithm> using namespace std; int a[200000]; int main(){ int n,i,j; int max; memset(b,0,sizeof(b)); memset(a,0,sizeof(a)); cin>>n; for(i=0;i<n;i++){ cin>>a[i]; } max=a[1]-a[0]; for(i=0;i<n;i++){ for(j=n-1;j>i;j--){ if(max<a[j]-a[i]){ max=a[j]-a[i]; ...
a.cc: In function 'int main()': a.cc:9:16: error: 'b' was not declared in this scope 9 | memset(b,0,sizeof(b)); | ^
s774035874
p02258
C++
#include<iostream> #include<algorithm> #include<numeric> #include<vector> #include<list> #include"my_util.h" using namespace std; int main() { int n; cin >> n; vector<int> v(n); for (int i=0; i<n; ++i) cin>>v[i]; int max = v[1] - v[0]; int min = v[0]; for (int i=0; i<n; ++i) { max = (max < (v[i]-m...
a.cc:7:9: fatal error: my_util.h: No such file or directory 7 | #include"my_util.h" | ^~~~~~~~~~~ compilation terminated.
s233302451
p02258
C++
#include<iostream> using namespace std; int r[200001], n; int max = -999999999; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> r[i]; } for (int i = 0; i < n - 1; i++) { for (int j = i+1; j < n; j++) { if (r[j] - r[i] > max) { max = r[j] - r[i]; } } } cout << max << endl; }
a.cc: In function 'int main()': a.cc:12:43: error: reference to 'max' is ambiguous 12 | if (r[j] - r[i] > max) { | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s130845902
p02258
C++
#include<iostream> using namespace std; int r[200001], n; int max =0; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> r[i]; } for (int i = 0; i < n - 1; i++) { for (int j = i+1; j < n; j++) { if (max == 0) { max = r[j] - r[i]; continue; } if (r[j] - r[i] > max) { max = r[j] - r[...
a.cc: In function 'int main()': a.cc:12:29: error: reference to 'max' is ambiguous 12 | if (max == 0) { | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/i...
s069194075
p02258
C++
#include<iostream> using namespace std; int r[200001], n,max; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> r[i]; } for (int i = 0; i < n - 1; i++) { for (int j = i+1; j < n; j++) { if (max == 0) { max = r[j] - r[i]; continue; } if (r[j] - r[i] > max) { max = r[j] - r[i]; }...
a.cc: In function 'int main()': a.cc:11:29: error: reference to 'max' is ambiguous 11 | if (max == 0) { | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/i...
s199505261
p02258
C++
#include<iostream> using namespace std; long r[200001], n,max; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> r[i]; } for (int i = 0; i < n - 1; i++) { for (int j = i+1; j < n; j++) { if (max == 0) { max = r[j] - r[i]; continue; } if (r[j] - r[i] > max) { max = r[j] - r[i]; ...
a.cc: In function 'int main()': a.cc:11:29: error: reference to 'max' is ambiguous 11 | if (max == 0) { | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/i...
s073734886
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main(int argc, const char * argv[]) { int R[MAX]; int n; cin >> n; for (int i = 0; i < n; i++){ cin >> R[i]; } long maxv = -20000000000; int minv = R[0]; for (in...
a.cc: In function 'int main(int, const char**)': a.cc:21:19: error: no matching function for call to 'max(long int&, int)' 21 | maxv = max(maxv, R[i]-minv); | ~~~^~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_c...
s961352862
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 = -20000000; int minv = R[0]; for(int i = 1 ; i < n ; i++){ minv = max(maxv, R[i] - minv); minv = min(maxv, R[i]); } ...
a.cc: In function 'int main()': a.cc:21:22: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 21 | cout << maxv << end; | ~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a....
s902860476
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 = -20000000; int minv = R[0]; for(int i = 1 ; i < n ; i++){ maxv = max(maxv, R[i] - minv); minv = min(maxv, R[i]); } ...
a.cc: In function 'int main()': a.cc:21:22: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 21 | cout << maxv << end; | ~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a....
s103507138
p02258
C++
<?php $n=trim(fgets(STDIN)); $R=[]; for($i=0;$i<$n;$i++) $R[]=trim(fgets(STDIN)); $max=$R[1]-$R[0]; $N=$n-1; for($i=0;$i<$N;$i++) for($j=$i+1;$j<$n;$j++) if($max<$m=$R[$j]-$R[$i]) $max=$m; print $max; ?>
a.cc:1:1: error: expected unqualified-id before '<' token 1 | <?php | ^ a.cc:3:1: error: '$R' does not name a type 3 | $R=[]; | ^~ a.cc:4:1: error: expected unqualified-id before 'for' 4 | for($i=0;$i<$n;$i++) $R[]=trim(fgets(STDIN)); | ^~~ a.cc:4:10: error: '$i' does not name a type 4...
s135778290
p02258
C++
#include<stdio.h> #include<iostream> using namespace std; int main(){ long int n; long int num[200000]; long int max=-1000000000; long int min=1000000000; long int sum; long int i; cin>>n; for(i=0;i<n;i++){ cin>>num[i]; } min=num[0]; for(i=1;i<n;i++){ sub=num[i]-min; if(num[i]<min){ min=num[i]; }...
a.cc: In function 'int main()': a.cc:17:17: error: 'sub' was not declared in this scope; did you mean 'sum'? 17 | sub=num[i]-min; | ^~~ | sum a.cc:25:15: error: 'sub' was not declared in this scope; did you mean 'sum'? 25 | cout<<sub<<endl; ...
s669998198
p02258
C++
#include <iostream> using namespace std; static const int MAX = 200000; int main() { int a[MAX],n; cin >> n; int max,tmp; max = -1000000000; for(int i=0;i<n;i++) { cin >> a[i]; } for(int j=1;j<n;j++) { for(int i=0;i<j;i++) { tmp = a[j] - a[i]; if(max < tmp) { max = tmp; } } } count ...
a.cc: In function 'int main()': a.cc:27:9: error: 'count' was not declared in this scope 27 | count << max << endl; | ^~~~~
s234879778
p02258
C++
#include <iostream> using namespace std; static const int MAX = 200000; int main() { int a[MAX],n; cin >> n; int max,tmp; max = -1000000000; for(int i=0;i<n;i++) { cin >> a[i]; } for(int i=1;i<n;i++) { tmp = a[i] - min; if(max < tmp) { max = tmp; } if(min < a[i]) { min = a[i]; } } cou...
a.cc: In function 'int main()': a.cc:18:28: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-' 18 | tmp = a[i] - min; | ~~~~~^~~~~ a.cc:23:20: error: parse error in template argument list 23 | if(min ...
s120826082
p02258
C++
#include <iostream> using namespace std; static const int MAX = 200000; int main() { int a[MAX],n; cin >> n; int max,tmp; int min=a[0]; max = -1000000000; for(int i=0;i<n;i++) { cin >> a[i]; } for(int i=1;i<n;i++) { tmp = a[i] - min; if(max < tmp) { max = tmp; } if(min < a[i]) { min = a[...
a.cc: In function 'int main()': a.cc:29:9: error: 'count' was not declared in this scope 29 | count << max << endl; | ^~~~~
s343798230
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 < 0; i++ ) cin >> R[i]; int maxv = -200000; //???????°??????????????????????????¨???? int minv = R[0]; for ( int i=1; i<n; i++ ) { // ??????R[i]???...
a.cc: In function 'int main()': a.cc:17:34: error: expected ';' before 'minv' 17 | maxv = max(maxv, R[i] - minv) // ?????§????????´??° | ^ | ; 18 | minv = min(minv, R[i]) // ????°????????????? | ~~~~ ...
s868795803
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 < 0; i++ ) cin >> R[i]; int maxv = -200000; //???????°??????????????????????????¨???? int minv = R[0]; for ( int i=1; i<n; i++ ) { // ??????R[i]???...
a.cc: In function 'int main()': a.cc:17:34: error: expected ';' before 'minv' 17 | maxv = max(maxv, R[i] - minv) // ?????§????????´??° | ^ | ; 18 | minv = min(minv, R[i]) // ????°????????????? | ~~~~ ...
s635859376
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:27:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 27 | return ; | ^~~~~~
s301738277
p02258
C++
#include<iostream> #include<algorythm> 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 min = R[0]; for (int i = 0; i < n; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } con << maxv <<...
a.cc:2:9: fatal error: algorythm: No such file or directory 2 | #include<algorythm> | ^~~~~~~~~~~ compilation terminated.
s828527476
p02258
C++
#include<iostream> #include<algorythm> 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 min = R[0]; for (int i = 0; i < n; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } con << maxv <<...
a.cc:2:9: fatal error: algorythm: No such file or directory 2 | #include<algorythm> | ^~~~~~~~~~~ compilation terminated.
s442464060
p02258
C++
#include<iostream> #include<algorythm> 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 min = R[0]; for (int i = 0; i < n; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } con << maxv <...
a.cc:2:9: fatal error: algorythm: No such file or directory 2 | #include<algorythm> | ^~~~~~~~~~~ compilation terminated.
s524003311
p02258
C++
#include<iostream> #include<algorythm> 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 min = R[0]; for (int i = 0; i < n; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } con << maxv...
a.cc:2:9: fatal error: algorythm: No such file or directory 2 | #include<algorythm> | ^~~~~~~~~~~ compilation terminated.
s434011976
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 min = R[0]; for (int i = 0; i < n; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } con << maxv...
a.cc: In function 'int main()': a.cc:13:41: error: 'minv' was not declared in this scope; did you mean 'min'? 13 | maxv = max(maxv, R[i] - minv); | ^~~~ | min a.cc:14:27: error: 'min' cannot be used as a funct...
s056360184
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 min = R[0]; for (int i = 0; i < n; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } cout << max...
a.cc: In function 'int main()': a.cc:13:41: error: 'minv' was not declared in this scope; did you mean 'min'? 13 | maxv = max(maxv, R[i] - minv); | ^~~~ | min a.cc:14:27: error: 'min' cannot be used as a funct...
s401445439
p02258
C++
#include<stdio.h> static const int Rt_MAX = 100000; int main() { int n; //????????° int Rt[Rt_MAX]; //?????? int max; //?????§?????? int min; //????°??????? //??\??? scanf("%d", &n); for (int i = 0; i < n; i++) { scanf_s("%d", &Rt[i]); } //?¨???? min = Rt[0]; //+1?????????????????? for (int i = 1; i ...
a.cc: In function 'int main()': a.cc:14:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 14 | scanf_s("%d", &Rt[i]); | ^~~~~~~ | scanf
s159094986
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N, R; int minvalue; int maxprofit = INT_MIN; cin >> N; cin >> minvalue; for (int i = 1;i < N;i++) { cin >> R; maxprofit = max(maxprofit, R - minvalue); minvalue = min(minvalue, R); } cout << maxprofit << endl; return 0;...
a.cc: In function 'int main()': a.cc:10:25: error: 'INT_MIN' was not declared in this scope 10 | int maxprofit = INT_MIN; | ^~~~~~~ a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <algorithm> ...
s796801709
p02258
C++
#include <iostream> #include <algorithm> #include <limits> using namespace std; int main() { int N, R; int minvalue; int maxprofit = INT_MIN; cin >> N; cin >> minvalue; for (int i = 1;i < N;i++) { cin >> R; maxprofit = max(maxprofit, R - minvalue); minvalue = min(minvalue, R); } cout << maxprofit <<...
a.cc: In function 'int main()': a.cc:11:25: error: 'INT_MIN' was not declared in this scope 11 | int maxprofit = INT_MIN; | ^~~~~~~ a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <limits> +++...
s497883481
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main(void){ int n, minv, maxv; cin >> n; int R[n]; for(int i=0; i<n; i++){ cin >> R[i]; } minv = R[0]; maxv = R[1] - R[0]; for(int i=1; i<n; i++){ maxv = max(R[i] - minv, maxv); minv = min(R[i], mi...
a.cc: In function 'int main()': a.cc:19:26: error: expected '}' at end of input 19 | cout << maxv << endl; | ^ a.cc:5:15: note: to match this '{' 5 | int main(void){ | ^
s478203118
p02258
C++
#include<iostream> #include<algoithm> usinf 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=0;i<n;i++) { maxv = max(maxv,R[i]-minv); minv = min(minv,R[i]); } cont << maxv e...
a.cc:2:9: fatal error: algoithm: No such file or directory 2 | #include<algoithm> | ^~~~~~~~~~ compilation terminated.
s118244850
p02258
C++
#include<iostream> #include<algotithm> 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 = -20000000; int mixv = 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:2:9: fatal error: algotithm: No such file or directory 2 | #include<algotithm> | ^~~~~~~~~~~ compilation terminated.
s566392785
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 = -20000000; int mixv = 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:12:38: error: 'minv' was not declared in this scope; did you mean 'mixv'? 12 | maxv = max(maxv,R[i]-minv); | ^~~~ | mixv
s119735331
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main(void){ int R[MAX], n; cin >> n; for ( int i = 0; i < n; i++ ) cin >> R[i]; int maxv = -2000000; 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:21:25: error: 'end1' was not declared in this scope 21 | cout << maxv << end1; | ^~~~
s711696584
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 = -20000000; int mixv = R[0]; for(int i=1;i<n ;i++){ maxv = max(maxv,R[i]-minv); minv = min(minv,R[i]); } cout << maxv << endl; return ...
a.cc: In function 'int main()': a.cc:12:38: error: 'minv' was not declared in this scope; did you mean 'mixv'? 12 | maxv = max(maxv,R[i]-minv); | ^~~~ | mixv
s751750408
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 = -2000000; int minv = R[0]; for(int i = 1; i < n i++) { maxv = max(maxv,R[i] - minv); minv = min(minv,R[i]); } c...
a.cc: In function 'int main()': a.cc:18:29: error: expected ';' before 'i' 18 | for(int i = 1; i < n i++) | ^~ | ;
s138856579
p02258
C++
#include<iostream> #include<algorithm> //alds1_1_d.cpp 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...
a.cc: In function 'int main()': a.cc:21:9: error: 'cont' was not declared in this scope; did you mean 'const'? 21 | cont << maxv << endl; | ^~~~ | const
s972950709
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 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:10:18: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow] 10 | int maxv=-20000000000; | ^~~~~~~~~~~~ a.cc:15:35: error: expected ')' before ';' token 15 | minv=m...
s925114493
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 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:11:18: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow] 11 | int maxv=-20000000000; | ^~~~~~~~~~~~ a.cc:16:35: error: expected ')' before ';' token 16 | minv=m...
s980098348
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 minv=R[0]; for(int i=1;i<n;i++){ maxv=max(maxv,R[i]-minv); minv=min(minv,R[i]; } cout << maxv << endl; retur...
a.cc: In function 'int main()': a.cc:11:18: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow] 11 | int maxv=-20000000000; | ^~~~~~~~~~~~ a.cc:16:35: error: expected ')' before ';' token 16 | minv=m...
s303775481
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX=200000; int main() { int R[MAX],n; cin >>n; for(inti=0;i<n;i++) cin>>R[i]; int maxv=-200000000; int minv=R[0]; for(inti=1;i<n;i++){ maxv=max(maxsv,R[i]-minv); minv=min(minv,R[i]); } cout<<maxv<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'inti' was not declared in this scope; did you mean 'int'? 11 | for(inti=0;i<n;i++) cin>>R[i]; | ^~~~ | int a.cc:11:12: error: 'i' was not declared in this scope 11 | for(inti=0;i<n;i++) cin>>R[i]; | ^ a.cc:16:5: error: 'inti' ...
s944062485
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX=200000; int main(){ int R[MAX],n; cin >> n; for(inti=0;i<n;i++) cin >> R[i]; int maxv=-2000000000; int minv=R[0]; for(inti=1;i<n;i++){ maxv=max(maxsv,R[i]-minv); minv=min(minv,R[i]); } cout<<maxv<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'inti' was not declared in this scope; did you mean 'int'? 10 | for(inti=0;i<n;i++) cin >> R[i]; | ^~~~ | int a.cc:10:12: error: 'i' was not declared in this scope 10 | for(inti=0;i<n;i++) cin >> R[i]; | ^ a.cc:15:5: error: 'in...
s254396346
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX=200000; int main(){ int R[MAX],n; cin >> n; for(inti=0;i<n;i++) cin >> R[i]; int maxv=-2000000000; int minv=R[0]; for(inti=1;i<n;i++){ maxv=max(maxsv,R[i]-minv); minv=min(minv,R[i]); } cout << maxv << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'inti' was not declared in this scope; did you mean 'int'? 10 | for(inti=0;i<n;i++) cin >> R[i]; | ^~~~ | int a.cc:10:12: error: 'i' was not declared in this scope 10 | for(inti=0;i<n;i++) cin >> R[i]; | ^ a.cc:15:5: error: 'in...
s544762534
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX=200000; int main(){ int R[MAX],n; cin >> n; for(inti=0;i<n;i++) cin >> R[i]; int maxv=-2000000000; int minv=R[0]; for(inti=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:10:5: error: 'inti' was not declared in this scope; did you mean 'int'? 10 | for(inti=0;i<n;i++) cin >> R[i]; | ^~~~ | int a.cc:10:12: error: 'i' was not declared in this scope 10 | for(inti=0;i<n;i++) cin >> R[i]; | ^ a.cc:15:5: error: 'in...
s335386203
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX=200000; int main(){ int R[MAX],n; cin >> n; for(inti=0;i<n;i++) cin >> R[i]; int maxv=-2000000000; int minv=R[0]; for(inti=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:10:5: error: 'inti' was not declared in this scope; did you mean 'int'? 10 | for(inti=0;i<n;i++) cin >> R[i]; | ^~~~ | int a.cc:10:12: error: 'i' was not declared in this scope 10 | for(inti=0;i<n;i++) cin >> R[i]; | ^ a.cc:15:5: error: 'in...
s349986786
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...
a.cc: In function 'int main()': a.cc:7:18: error: expected ']' before ',' token 7 | int R[MAX, n; | ^ | ] a.cc:10:42: error: 'R' was not declared in this scope 10 | for( int i = 0; i< n; i++)cin >> R[i]; | ...
s360234981
p02258
C++
using System; using System.IO; using System.Configuration; using System.Reflection; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AOJ { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadL...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.IO; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Configuration; ...
s006390331
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int LIMIT=20000; int main(){ //?????° int R[LIMIT]; int n; int ans=-1*10**9; int bottom; //??\??? cin >> n; for(int i=0;i<n;i++){ cin >> R[i]; } bottom=R[0]; //?¨???? for(int i=0;i<n;i++){ ans = max(ans,R[i]-bottom); bott...
a.cc: In function 'int main()': a.cc:10:23: error: invalid type argument of unary '*' (have 'int') 10 | int ans=-1*10**9; | ^~
s456403514
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int LIMIT=20000; int main(){ //?????° int R[LIMIT]; int n; int ans; int bottom; //??\??? cin >> n; for(int i=0;i<n;i++){ cin >> R[i]; } ans=10**9*-1 bottom=R[0]; //?¨???? for(int i=0;i<n;i++){ ans = max(ans,R[i]-bottom); ...
a.cc: In function 'int main()': a.cc:18:16: error: invalid type argument of unary '*' (have 'int') 18 | ans=10**9*-1 | ^~
s064534650
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int LIMIT=20000; int main(){ //?????° int R[LIMIT]; int n; int ans; int bottom; //??\??? cin >> n; for(int i=0;i<n;i++){ cin >> R[i]; } ans=10**9*(-1) bottom=R[0]; //?¨???? for(int i=0;i<n;i++){ ans = max(ans,R[i]-bottom);...
a.cc: In function 'int main()': a.cc:18:16: error: invalid type argument of unary '*' (have 'int') 18 | ans=10**9*(-1) | ^~
s589277831
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int LIMIT=20000; int main(){ //?????° int R[LIMIT]; int n; int ans; int bottom; //??\??? cin >> n; for(int i=0;i<n;i++){ cin >> R[i]; } ans=10**9; ans*=-1; bottom=R[0]; //?¨???? for(int i=0;i<n;i++){ ans = max(ans,R[i]-bo...
a.cc: In function 'int main()': a.cc:18:16: error: invalid type argument of unary '*' (have 'int') 18 | ans=10**9; | ^~
s181162290
p02258
C++
#include <bits/stdc++.h> #include<algorithm> using namespace std; int main(){ int n; cin >>n; int r[n]; for(int i=0;i<n;++i){ cin >>r[i]; } unsigned int ans[300000]; a[0]=-9999999999; for(int t=1;t<n;++t){ sort(r,r+t-1); ans[t]=r[t]-r[0]; } sort(ans,ans+n);...
a.cc: In function 'int main()': a.cc:13:4: error: 'a' was not declared in this scope 13 | a[0]=-9999999999; | ^
s351850046
p02258
C++
#include <bits/stdc++.h> using namespace std; int main(){ int R[MAX],n; cin >>n; for(int i=o;i<n;i++)cin >>R[i]; int maxv=-2000000000000; int minv=R[0]; for(int i=0;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:11: error: 'MAX' was not declared in this scope 5 | int R[MAX],n; | ^~~ a.cc:7:15: error: 'o' was not declared in this scope 7 | for(int i=o;i<n;i++)cin >>R[i]; | ^ a.cc:7:31: error: 'R' was not declared in this scope 7 | ...
s079711283
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 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:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow] 12 | int maxv = -20000000000 | ^~~~~~~~~~~~ a.cc:13:3: error: expected ',' or ';' before 'int' 13 | int minv = R[0] | ^...
s210243189
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 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:14:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-20000000000' to '1474836480' [-Woverflow] 14 | int maxv = -20000000000 | ^~~~~~~~~~~~ a.cc:15:3: error: expected ',' or ';' before 'int' 15 | int minv = R[0] | ^...
s368862884
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 << end1; re...
a.cc: In function 'int main()': a.cc:7:10: error: expected ']' before '}' token 7 | int R[MAX}, n; | ^ | ] a.cc: At global scope: a.cc:7:11: error: mixing declarations and function-definitions is forbidden 7 | int R[MAX}, n; | ^ a.cc:9:1: error: 'cin' does not name ...
s038583923
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 r...
a.cc: In function 'int main()': a.cc:17:23: error: expected ';' before '}' token 17 | minv = min(minv, R[i]) | ^ | ; 18 | } | ~ a.cc:20:21: error: expected ';' before 'return0' 20 | cout << maxv << endl | ...
s071413435
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; ...
a.cc: In function 'int main()': a.cc:22:1: error: 'return0' was not declared in this scope 22 | return0; | ^~~~~~~
s023212917
p02258
C++
#include <stdio.h> #include <stdlib.h> int main(void) { int n; int *Rt; int max; int i, j; scanf("%d", &n); Rt = (int *)malloc( sizeof(int) * n ); for (i = 0; i < n; i++) { scanf("%d", &Rt[i]); } max = Rt[1] - Rt[0]; for (i = 0; i < (n - 1); i++) { for (j = (i + 1); j < n; j++) { if ( Rt[j] - Rt[...
a.cc: In function 'int main()': a.cc:24:52: error: expected ';' before ':' token 24 | max = (Rt[j] - Rt[i]) > max : (Rt[j] - Rt[i]) ? max; | ^~ | ;
s404066065
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<<end1; return0; }
a.cc: In function 'int main()': a.cc:20:21: error: 'end1' was not declared in this scope 20 | cout<<maxv<<end1; | ^~~~ a.cc:22:9: error: 'return0' was not declared in this scope 22 | return0; | ^~~~~~~
s511736693
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 << end1; return 0...
a.cc: In function 'int main()': a.cc:20:25: error: 'end1' was not declared in this scope 20 | cout << maxv << end1; | ^~~~
s869304488
p02258
C++
#include<stdio.h> #include<algorithm> using namespace std; static const int MAX = 20000; int main(){ int R[MAX],n; cin >> n; for( int i=0; i < n; i++ ) cin >> R[i]??? int maxv = R[1] - R[0]??? int minv = R[0]; for( int i=1; i < n; i++){ if( ( R[i] - minv ) > maxv ) maxv = R[i] - minv; if( R[i] < minv ...
a.cc: In function 'int main()': a.cc:9:9: error: 'cin' was not declared in this scope 9 | 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...
s476794228
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 20000; int main(){ int R[MAX],n; cin >> n; for( int i = 0; i < n; i++ ) cin >> R[i]; int maxv = R[1] - R[0]; int minv = R[0]; for( int a = 1; a < n; i++){ if( ( R[a] - minv ) > maxv ) maxv = R[a] - minv; if( R[a] < minv...
a.cc: In function 'int main()': a.cc:15:32: error: 'i' was not declared in this scope 15 | for( int a = 1; a < n; i++){ | ^
s175640738
p02258
C++
#include <stdio.h> #include <iostream> #include <utility> #define MAX_N 200000 #define MAX_T 1000000000 int n; void solve(){ int tmax=0; int tmin=MAX_T+1; int difmax = -(MAX_T+1); int m[MAX_N]; scanf("%d",&n); for(int i = 0; i < n; i++){ scanf("%d",&m[i]); } for(int j = 0; j...
/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
s169188791
p02258
C++
#include <stdio.h> #include <iostream> #include <utility> #define MAX_N 200000 #define MAX_T 1000000000 int n; int main(){ int tmax=0; int tmin=MAX_T+1; int difmax = -(MAX_T+1); int sorted[MAX_N]; int original[MAX_N]; scanf("%d",&n); for(int i = 0; i < n; i++){ scanf("%d",&origi...
a.cc: In function 'int main()': a.cc:24:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 24 | std::sort(sorted,sorted+n); | ^~~~ | qsort
s479068529
p02258
C++
#include <iostream> using namespace std; int main() { const long long MAX_N=200000; long long max_dif,data,s[MAX_N]; bool ans=false; max_dif=0; cin>>data; for(int i=0;i<data;++i){ cin>>s[i]; } for(int i=1;i<data;++i){ if(s[i]>s[i-1]){ max_dif+=s[i]-s[i-1]; ans=true; } } cout<<(ans==tr...
a.cc: In function 'int main()': a.cc:24:39: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 24 | cout<<(ans==true)?max_dif:(-1)<<endl; | ~~~~^~~~~~
s685338237
p02258
C++
#include <bits\stdc++.h> using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; cin >> n; for (int i = 0; i < n; i++) cin R[i]; int maxv = -20000000000; 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; ...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s045425033
p02258
C++
#include <bits/stdc++.h> using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; cin >> n; for (int i = 0; i < n; i++) cin R[i]; int maxv = -20000000000; 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; ...
a.cc: In function 'int main()': a.cc:10:40: error: expected ';' before 'R' 10 | for (int i = 0; i < n; i++) cin R[i]; | ^~ | ; a.cc:11:20: warning: overflow in conversion from 'long int' to 'int' changes value from '-20...
s424497395
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; cin >> n; for (int i = 0; i < n; i++) cin R[i]; int maxv = -20000000000; 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:12:40: error: expected ';' before 'R' 12 | for (int i = 0; i < n; i++) cin R[i]; | ^~ | ; a.cc:13:20: warning: overflow in conversion from 'long int' to 'int' changes value from '-20...
s694040019
p02258
C++
#include "bits\stdc++.h" using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; cin >> n; for (int i = 0; i < n; i++) cin >> R[i]; int maxv = -20000000000; 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...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include "bits\stdc++.h" | ^~~~~~~~~~~~~~~ compilation terminated.
s815295062
p02258
C++
#include <bits\stdc++.h> using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; cin >> n; for (int i = 0; i < n; i++) cin >> R[i]; int maxv = -20000000000; 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...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s678138001
p02258
C++
#include <bits\stdc++.h> using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; cin >> n; for (int i = 0; i < n; i++) { cin >> R[i]; } int maxv = -20000000000; int minv = R[0]; for (int i = 1; i < n; i++) { maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } cout << maxv ...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s924829133
p02258
C++
#include <bits\stdc++.h> using namespace std; static const int MAX = 200000; int main() { int n, R[MAX]; cin >> n; for (int i = 0; i < n; i++) { cin >> R[i]; } int maxv = -20000000000; int minv = R[0]; for (int i = 1; i < n; i++) { maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } cout << maxv ...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s286706616
p02258
C++
#include<stdio.h> int main(void){ int n; lnt r[20005]; int i,j,max; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&r[i]); } max=r[1]-r[0]; for(i=0;i<n-1;i++){ for(j=i+1;j<n;j++){ if(max<r[j]-r[i]){max=r[j]-r[i];} } } printf("%d\n",max); return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'lnt' was not declared in this scope; did you mean 'int'? 5 | lnt r[20005]; | ^~~ | int a.cc:9:29: error: 'r' was not declared in this scope 9 | scanf("%d",&r[i]); | ^ a.cc:11:1...
s433027944
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX=2000; b int main() { int R[MAX],n; cin>>n; for(int i=0;i<n;i++) cin>>R[i]; int maxv=-10000; int minv=R[0]; for(int i=1;i<n;i++) { maxv=max(maxv,R[i]-minv); minv=min(minv,R[i]); } cout<<maxv; }
a.cc:5:28: error: 'b' does not name a type 5 | static const int MAX=2000; b | ^
s407617787
p02258
C++
// 1_1_D.cpp : ????????§??¶??°?????¨?¨?????????\??£?????? // #include "stdafx.h" #include<iostream> using namespace std; static const int MAX=2000; int main() { int R[MAX],n; cin>>n; for(int i=0;i<n;i++) cin>>R[i]; int max=-2000; int min=R[0]; for(int i=1;i<n;i++) { if(max<R[i]-min) max=R[i]-min; ...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s478008477
p02258
C++
// 1_1_D.cpp : ????????§??¶??°?????¨?¨?????????\??£?????? // #include "stdafx.h" #include<iostream> using namespace std; static const int MAX=2000; int main() { int R[MAX],n; cin>>n; for(int i=0;i<n;i++) cin>>R[i]; int max=-2000; int min=R[0]; for(int i=1;i<n;i++) { if(min>R[i]) min=R[i]; if(m...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s270131759
p02258
C++
#include <iostream> int main() { int n; std::cin >> n; int R[n]; for (int i = 0; i < n; i++) { std::cin >> R[i]; } int minv = R[0]; int maxv = R[1] - R[0]; for (int i = 2; i < n - 1; i++) { if (R[i] - minv > maxv) { maxv = R[i] - minv; } i...
a.cc: In function 'int main()': a.cc:25:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 25 | std::cout << maxv << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41, from a.cc:1:...
s678817684
p02258
C++
#include <cstdint> #include <vector> #include "problems.hpp" using namespace std; int maximum_profit(vector<int32_t> &vec) { int32_t max_val = INT32_MIN; int32_t min_val = INT32_MAX; for (auto iter = vec.begin(); iter != vec.end(); iter++) { max_val = max(max_val, *iter - min_val); min_val = min(min_va...
a.cc:4:10: fatal error: problems.hpp: No such file or directory 4 | #include "problems.hpp" | ^~~~~~~~~~~~~~ compilation terminated.
s374048995
p02258
C++
#include <cstdio> #include <algorithm> using namespace std; static const int MAX = 200005 int main(){ int n; scanf("%d", &n); int R[MAX]; for (int idx = 0; idx < n; idx++){ scanf("%d", &R[idx]); } long long res = (long long)R[1] - R[0]; int preMin = R[0]; for (int idx = 1; id...
a.cc:7:1: error: expected ',' or ';' before 'int' 7 | int main(){ | ^~~
s604912237
p02258
C++
#include <cstdio> #include <algorithm> using namespace std; static const int MAX = 200005; int main(){ int n; cin >> n; int R[MAX]; for (int idx = 0; idx < n; idx++){ cin >> R[idx]; } long long res = (long long)R[1] - R[0]; int preMin = R[0]; for (int idx = 1; idx < n...
a.cc: In function 'int main()': a.cc:9:5: error: 'cin' was not declared in this scope 9 | 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 namesp...
s675954082
p02258
C++
#include<iostream> int main(){ long a[200001],n,min=1000000000,max=-1000000000; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ if(a[i]<min) min=a[i]; if(a[i]-min>max) max=a[i]-min; } cout<<max<<'\n'; return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | 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 standard in...
s375116182
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int N = 10000; int a[N]; int x; int i,n,flag; int main(){ ios::sync_with_stdio(false); cin>>n; int ans; for (i=0;i<n;i++){ cin>>a[i]; } int minv=a[0]; int maxv; for (i=0;i<n;i++){ maxv = max(maxv,R...
a.cc: In function 'int main()': a.cc:18:25: error: 'R' was not declared in this scope 18 | maxv = max(maxv,R[i]-minv); | ^
s850071487
p02258
C++
#include <algorithm> using namespace std; static const int N = 10000; int a[N]; int x; int i,n,flag; int main(){ ios::sync_with_stdio(false); cin>>n; int ans; for (i=0;i<n;i++){ cin>>a[i]; } int minv=a[0]; int maxv=-20000; for (i=0;i<n;i++){ maxv = max(maxv,a[i]-minv); ...
a.cc: In function 'int main()': a.cc:8:5: error: 'ios' has not been declared 8 | ios::sync_with_stdio(false); | ^~~ a.cc:9:5: error: 'cin' was not declared in this scope 9 | cin>>n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding...
s983901625
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[i]...
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 ...
s887120545
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[i])...
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 ...
s814238625
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 = 1 ; i < n ; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i])...
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 ...
s287269598
p02258
C++
#include<iostream> #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 = 1 ; i < n ; i++){ maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]...
a.cc: In function 'int main()': a.cc:12:7: error: 'i' was not declared in this scope 12 | for(i = 0 ; i < n ; i++){ | ^ a.cc:19:7: error: 'i' was not declared in this scope 19 | for(i = 1 ; i < n ; i++){ | ^
s538011628
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n, r[]; cin >> n; for(int i = 0; i < n; ++i) cin >> r[]; int maxv = -200000000; int minv = r[0]; for(int j = 0; j < n; ++j) { maxv = max(maxv, r[j] - minv); minv = min(minv, r[j]); } cout << maxv << endl; }
a.cc: In function 'int main()': a.cc:6:10: error: storage size of 'r' isn't known 6 | int n, r[]; | ^ a.cc:10:39: error: expected primary-expression before ']' token 10 | for(int i = 0; i < n; ++i) cin >> r[]; | ^
s435234670
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n, r[]; cin >> n; for(int i = 0; i < n; ++i) cin >> r[n]; int maxv = -200000000; int minv = r[0]; for(int j = 0; j < n; ++j) { maxv = max(maxv, r[j] - minv); minv = min(minv, r[j]); } cout << maxv << endl; }
a.cc: In function 'int main()': a.cc:6:10: error: storage size of 'r' isn't known 6 | int n, r[]; | ^
s960522818
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n, r[]; cin >> n; for(int i = 0; i < n; ++i) cin >> r[i]; int maxv = -200000000; int minv = r[0]; for(int j = 0; j < n; ++j) { maxv = max(maxv, r[j] - minv); minv = min(minv, r[j]); } cout << maxv << endl; }
a.cc: In function 'int main()': a.cc:6:10: error: storage size of 'r' isn't known 6 | int n, r[]; | ^
s461133885
p02258
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n, r[]; cin >> n; for(int i = 0; i < n; ++i) { cin >> r[i]; } int maxv = -200000000; int minv = r[0]; for(int j = 0; j < n; ++j) { maxv = max(maxv, r[j] - minv); minv = min(minv, r[j]); } cout << maxv << endl...
a.cc: In function 'int main()': a.cc:6:10: error: storage size of 'r' isn't known 6 | int n, r[]; | ^
s117890816
p02258
C++
#include<stdio.h> #include<algorithm> using namespace std; static const int M = 200000; int main(){ int R[M],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:9:1: error: 'cin' was not declared in this scope 9 | 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 std; a....
s123240019
p02258
C++
#include<stdio.h> #include<algorithm> using namespace std; static const int M = 200000; int main(){ int R[M],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:9:1: error: 'cin' was not declared in this scope 9 | 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 std; ...
s245197736
p02258
C++
#include<stdio.h> #include<algorithm> using namespace std; static const int M = 200000; int main(){ int R[M],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:9:1: error: 'cin' was not declared in this scope 9 | 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 std; ...
s886553286
p02258
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { //??\??? Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] R = new int[n]; for(int i = 0; i < n; i++) { R[i] = sc.nextInt(); } //?¨????---------------------------------------------...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s973602548
p02258
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } int maxv,minv; for(int j = 1; j < n; j++){ maxv = max(maxv,a[j]- minv); minv = min(minv,a[j]) } cout << maxv << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: invalid types 'int[int]' for array subscript 9 | cin >> a[i]; | ^ a.cc:13:26: error: invalid types 'int[int]' for array subscript 13 | maxv = max(maxv,a[j]- minv); | ^ a.cc:14:26: error: invalid...
s125879753
p02258
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } int maxv = -200000,minv = a[0]; for(int j = 1; j < n; j++){ maxv = max(maxv,a[j]- minv); minv = min(minv,a[j]) } cout << maxv << endl; r...
a.cc: In function 'int main()': a.cc:9:17: error: invalid types 'int[int]' for array subscript 9 | cin >> a[i]; | ^ a.cc:11:32: error: invalid types 'int[int]' for array subscript 11 | int maxv = -200000,minv = a[0]; | ^ a.cc:13:26: error: in...
s630418777
p02258
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a[200000]; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; } int maxv = -200000,minv = a[0]; for(int j = 1; j < n; j++){ maxv = max(maxv,a[j]- minv); minv = min(minv,a[j]) } cout << maxv << end...
a.cc: In function 'int main()': a.cc:14:30: error: expected ';' before '}' token 14 | minv = min(minv,a[j]) | ^ | ; 15 | } | ~