submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s709451524
p02258
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> using namespace std; int main(){ int A[200001]; int n; for (int i = 0; i < n; i++) { scanf("%d",&A[i]); } int mini = A[0]; int maxcost = A[1]-A[0]; for (int i = 1; i < n-1; i++) { mini = min(min...
a.cc: In function 'int main()': a.cc:21:37: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-' 21 | maxcost = max(maxcost,A[i+1]-min); | ~~~~~~^~~~ a.cc:24:21: error: no match for 'operator<' (operand types are 'std::ba...
s505722697
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]; } int minR = R[0]; int maxv = INT_MIN; for(int i = 1; i < n; i++){ maxv = max(maxv, R[i] - minR); minR = min(minR, R[i]); } cout << maxv << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:20: error: 'INT_MIN' was not declared in this scope 14 | int maxv = INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#incl...
s596781152
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; int n, a[200007]; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", a + i); int s = 0, ret = -999999999; for(int i = 1; i <= n; i++) { if(d[i - 1] > d[i]) ret = max(ret, d[i] - d[s]), s = i; } printf("%d\n", ret); }
a.cc: In function 'int main()': a.cc:10:20: error: 'd' was not declared in this scope 10 | if(d[i - 1] > d[i]) ret = max(ret, d[i] - d[s]), s = i; | ^
s220258211
p02258
C++
#include <stdio.h> #include <algorithm> using namespace std; int n, m, a, r = -999999999; int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { scanf("%d", &a); r = max(r, a - m): m = min(m, a); } printf("%d\n", r); }
a.cc: In function 'int main()': a.cc:9:34: error: expected ';' before ':' token 9 | r = max(r, a - m): | ^ | ;
s294960570
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 = (minv, R[i]); } cout << m...
a.cc: In function 'int main()': a.cc:25:1: error: 'rerurn' was not declared in this scope 25 | rerurn 0; | ^~~~~~
s309136600
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]); } cout <...
a.cc: In function 'int main()': a.cc:25:1: error: expected primary-expression before '?' token 25 | ????????????return 0; | ^ a.cc:25:2: error: expected primary-expression before '?' token 25 | ????????????return 0; | ^ a.cc:25:3: error: expected primary-expression before '?' token 25 | ??????????...
s675369774
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]); } cou...
a.cc: In function 'int main()': a.cc:25:1: error: expected primary-expression before '?' token 25 | ????????????return 0; | ^ a.cc:25:2: error: expected primary-expression before '?' token 25 | ????????????return 0; | ^ a.cc:25:3: error: expected primary-expression before '?' token 25 | ??????????...
s462580800
p02258
C++
#include <stdio.h> #include <vector> int main() { int n; scanf("%d", &n); std::vector<int> d; for (int i = 0; i < n; i++) { int b; scanf("%d", &b); d.push_back(b); } int profit = INT_MIN; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { if (profit < d[j] - d[i]) profit = d[j] - d...
a.cc: In function 'int main()': a.cc:15:22: error: 'INT_MIN' was not declared in this scope 15 | int profit = INT_MIN; | ^~~~~~~ a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <vector> +++ |+#in...
s262654342
p02258
C++
#include <stdio.h> #include <vector> #include <limits> int main() { int n; scanf("%d", &n); std::vector<int> d; for (int i = 0; i < n; i++) { int b; scanf("%d", &b); d.push_back(b); } int profit = INT_MIN; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { if (profit < d[j] - d[i])...
a.cc: In function 'int main()': a.cc:16:22: error: 'INT_MIN' was not declared in this scope 16 | int profit = 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> +++ |+#in...
s412282027
p02258
C++
#include <iostream> using namespace std; int main??? int id; int max; int num[id]; cin >> id; for(int i = 0; i <= id; i++){ cin >> num[i]; } max = num[0]; for(int i = 0; i < id;i++){ if(max < num[i]) max = nu...
a.cc:4:9: error: expected initializer before '?' token 4 | int main??? | ^ a.cc:7:18: error: 'id' was not declared in this scope; did you mean 'void'? 7 | int num[id]; | ^~ | void a.cc:8:10: error: 'cin' does not name a type 8 | c...
s079995788
p02258
C++
#include<iiostream> #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 = R[1] - R[0]; int minv = R[0]; for (int j = 1; j < n; j++){ maxv = max(maxv, R[j]); minv = mi...
a.cc:1:9: fatal error: iiostream: No such file or directory 1 | #include<iiostream> | ^~~~~~~~~~~ compilation terminated.
s147704910
p02258
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int n; int m; cin >> n; int maxv = -1000000000; int minv = 1000000000; for (int i = 1; i < n; i++) { cin >> m maxv = max(maxv, m - minv); minv = min(minv, m); } cout << maxv << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:25: error: expected ';' before 'maxv' 15 | cin >> m | ^ | ; 16 | maxv = max(maxv, m - minv); | ~~~~
s789321167
p02258
C++
Beta paiza.IO ??°???????????? ?????§ ??????????????? ??\??¬??? ???????????¢?????? ?????°?????? ??? C++ Split Button! Main.cpp ??? + Success  3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ...
a.cc:16:4: error: extended character ° is not valid in an identifier 16 | ??°???????????? | ^ a.cc:19:6: error: extended character § is not valid in an identifier 19 | ?????§ | ^ a.cc:25:4: error: stray '\' in program 25 | ??\??¬??? | ^ a.cc:25:7: error: extended character ¬ is n...
s216209576
p02258
C++
#include <iostream> using namespace std; static const int MAX = 200000; void main() { int n,rt[MAX]; cin >> n; for(int i=0;i<n;i++) cin >> rt[i]; for(int j=1;j<n;j++){ for(int i=0;i<j;i++){ maxv = maxv<rt[j]-rt[i] : rt[j]-rt[i] ? maxv; } } }
a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:13:25: error: 'maxv' was not declared in this scope 13 | maxv = maxv<rt[j]-rt[i] : rt[j]-rt[i] ? maxv; | ^~~~
s351591801
p02258
C++
#include <iostream> using namespace std; static const int MAX = 200000; void main() { int n,rt[MAX]; cin >> n; for(int i=0;i<n;i++) cin >> rt[i]; for(int j=1;j<n;j++){ for(int i=0;i<j;i++){ maxv = maxv<rt[j]-rt[i] : rt[j]-rt[i] ? maxv; } } }
a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:13:25: error: 'maxv' was not declared in this scope 13 | maxv = maxv<rt[j]-rt[i] : rt[j]-rt[i] ? maxv; | ^~~~
s208624985
p02258
C++
#include <iostream> using namespace std; static const int MAX = 200000; int main() { int n,rt[MAX]; cin >> n; for(int i=0;i<n;i++) cin >> rt[i]; int maxv = rt[1] - rt[0]; for(int j=1;j<n;j++){ for(int i=0;i<j;i++){ maxv = maxv<rt[j]-rt[i] : rt[j]-rt[i] ? maxv; } } return 0; }
a.cc: In function 'int main()': a.cc:14:48: error: expected ';' before ':' token 14 | maxv = maxv<rt[j]-rt[i] : rt[j]-rt[i] ? maxv; | ^~ | ;
s631033222
p02258
C++
#include <algorithm> #include <iostream> #include <typeinfo> int main() { int total_time; std::cin >> total_time; int min_price; std::cin >> min_price; int max_profit = std::numeric_limits<int>::min(); for (auto t = 1; t < total_time; t++) { int price; std::cin >> price; max_profit = std::max(...
a.cc: In function 'int main()': a.cc:11:25: error: 'numeric_limits' is not a member of 'std' 11 | int max_profit = std::numeric_limits<int>::min(); | ^~~~~~~~~~~~~~ a.cc:11:40: error: expected primary-expression before 'int' 11 | int max_profit = std::numeric_limits<int>::min(); ...
s346293339
p02258
C++
#include<iostream> #include<cstdio> using namespace std; void main() { int n, a[200000], min; long long int ben = -10000000000; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { if (i) { if (min > a[i]) min = a[i]; if (ben < a[i] - min) ben = a[i] - min; } else ...
a.cc:5:1: error: '::main' must return 'int' 5 | void main() { | ^~~~
s763900799
p02258
C++
#include <iostream> int main(){ int n; while(std::cin >> n){ int *array = new int[n]; for(int i = 1; i < n;i++){ std::cin >> array[i]; } int maxv = array[1] - array[0]; int minj; if(maxv < 0){ minj = array[0]; }else{ minj = array[1]; } for(int j = 2; j < ...
a.cc: In function 'int main()': a.cc:23:12: error: 'max' was not declared in this scope; did you mean 'std::max'? 23 | if(max < array[j] - array[i]){ | ^~~ | std::max In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_c...
s354811572
p02258
C++
#include <iostream> int main(void) { int i; int n; cin >> n; int r[n]; for (i = 0; i < n; i++) { cin >> r[i]; } int min = r[0]; int ret = -99999; for (i = 1; i < n; i++) { int tmp = r[i] - min; ret = (tmp > ret) ? tmp : ret; min = (r[i] < min) ? r...
a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | 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 ...
s957810896
p02258
C++
#include <iostream> #include <climts> using namespace std; int main(void) { int i; int n; int r[200000]; cin >> n; for (i = 0; i < n; i++) { cin >> r[i]; } int min = r[0]; int ret = INT_MIN; for (i = 1; i < n; i++) { int tmp = r[i] - min; ret = (tmp > ret)...
a.cc:2:10: fatal error: climts: No such file or directory 2 | #include <climts> | ^~~~~~~~ compilation terminated.
s759524039
p02258
C++
#include <iostream> #include <limts.h> using namespace std; int main(void) { int i; int n; int r[200000]; cin >> n; for (i = 0; i < n; i++) { cin >> r[i]; } int min = r[0]; int ret = INT_MIN; for (i = 1; i < n; i++) { int tmp = r[i] - min; ret = (tmp > ret...
a.cc:2:10: fatal error: limts.h: No such file or directory 2 | #include <limts.h> | ^~~~~~~~~ compilation terminated.
s080705320
p02258
C++
#include <iostream> using namespace std; #define NUMBER 200000 int main(){ int ary[NUMBER]; int min_register[NUMBER]; int n; cin >> n; //????´???°????????? cin >> ary[0]; //1?????????????´?????????? int min=ary[0]; min_register[0] = min; int max = -1000000001; for(int i = 1; i < n; i++){ cin >> ary[i...
a.cc: In function 'int main()': a.cc:25:26: error: 'max' cannot be used as a function 25 | max = max(max,ary[i] - min_register[i-1]); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s582849246
p02258
C++
#include<iostream> #include<vector> using namespace std; int M(vector<int> A){ int m = 0; int d = A[1] - A[0]; while(m < A.size()){ for(int i = m + 1; i < A.size(); i++){ if(A[i] - A[m] < 0) m = i, break; if(A[i] - A[m] > d) d = A[i] - A[m]; } break; } return d; } int main(){ int n; cin >> n; vect...
a.cc: In function 'int M(std::vector<int>)': a.cc:10:52: error: expected primary-expression before 'break' 10 | if(A[i] - A[m] < 0) m = i, break; | ^~~~~
s419727592
p02258
C++
#include<iostream> #include<vector> using namespace std; int MaxProfit(vector<int> A){ int start_number = 0; int profit = A[1] - A[0]; while(1){ int i; for(i = start_number + 1; i < A.size(); i++){ if(A[i] - A[start_number] < 0){ start_number = i; break; } if(A[i] - A[start_number] > d){ pr...
a.cc: In function 'int MaxProfit(std::vector<int>)': a.cc:15:53: error: 'd' was not declared in this scope 15 | if(A[i] - A[start_number] > d){ | ^
s339075232
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 200000; int main() { intR[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 ...
a.cc: In function 'int main()': a.cc:7:5: error: 'intR' was not declared in this scope; did you mean 'int'? 7 | intR[max], n; | ^~~~ | int a.cc:7:16: error: 'n' was not declared in this scope 7 | intR[max], n; | ^ a.cc:10:40: error: 'R' was not declared in this s...
s037767974
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...
a.cc: In function 'int main()': a.cc:7:14: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int' 7 | int R[max], n; | ^ a.cc:7:9: error: size of array 'R' has non-integral type '<unresolved overloaded function type>' 7 | int R[max], n; |...
s611997127
p02258
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int R[MAX],n; cin >> n; for(int i= 0; i< n; i++) cin >> R[i]; int maxv = -2000000000000; int minv = min[R]; 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:9: error: 'MAX' was not declared in this scope 5 | int R[MAX],n; | ^~~ a.cc:9:12: error: 'R' was not declared in this scope 9 | cin >> R[i]; | ^ a.cc:10:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-2...
s052387141
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 = -2000000000000; int minv = min[R]; for(int i=0; i< n; i++){ maxv=max(maxv,R[i]-minv); minv=min(minv,R[i]); } cout <...
a.cc: In function 'int main()': a.cc:11:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-2000000000000' to '1454759936' [-Woverflow] 11 | int maxv = -2000000000000; | ^~~~~~~~~~~~~~ a.cc:12:17: error: invalid types '<unresolved overloaded function type>[int [2000...
s172829062
p02258
C++
#include <stdio.h> main(){ int n; int rt[200000]; int prof,x,minp; int i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&rt[i]); } prof = rt[1]-rt[0]; minp = rt[0] for(i=1;i<n;i++){ x = rt[i]-minp; if(prof<x){ prof=x; } if(minp>rt[i]){ minp = rt[i]; } } p...
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:12:15: error: expected ';' before 'for' 12 | minp = rt[0] | ^ | ; 13 | for(i=1;i<n;i++){ | ~~~ a.cc:...
s755143334
p02258
C++
#define _USE_MATH_DEFINES #include <iostream> #include <iomanip> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <cstring> #include <cmath> #include <cfloat> #include <map> #include <queue> #include <stack> #include <list> #include <string> #include <set> #include <complex> #incl...
a.cc: In function 'int main()': a.cc:126:25: error: no matching function for call to 'min(long long int&, int&)' 126 | minv=min(minv,r); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s562833229
p02258
C++
#define _USE_MATH_DEFINES #include <iostream> #include <iomanip> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <cstring> #include <cmath> #include <cfloat> #include <map> #include <queue> #include <stack> #include <list> #include <string> #include <set> #include <complex> #incl...
a.cc: In function 'int main()': a.cc:126:25: error: no matching function for call to 'min(long long int&, int&)' 126 | minv=min(minv,r); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s335828885
p02258
C++
#include<iostream> #include<algorithm> using namespace name std; static const int MAX = 20000; int main(int argc, char const *argv[]) { /* code */ int R[MAX], n; cin >> n; for (int i = 0; i < count; i++) { /* code */ cin >> R[i]; } int maxv = -200000000000; int minv = R[0]; for (int i = 0; i ...
a.cc:3:17: error: 'name' is not a namespace-name 3 | using namespace name std; | ^~~~ a.cc:3:21: error: expected ';' before 'std' 3 | using namespace name std; | ^~~~ | ; a.cc:3:22: error: 'std' does not name a type 3 | using namespac...
s703739991
p02258
C++
#include<iostream> #include<algorithm> using namespace name std; static const int MAX = 20000; int main() { /* code */ int R[MAX], n; cin >> n; for (int i = 0; i < count; i++) { /* code */ cin >> R[i]; } int maxv = -200000000000; int minv = R[0]; for (int i = 0; i < count; i++) { /* code ...
a.cc:3:17: error: 'name' is not a namespace-name 3 | using namespace name std; | ^~~~ a.cc:3:21: error: expected ';' before 'std' 3 | using namespace name std; | ^~~~ | ; a.cc:3:22: error: 'std' does not name a type 3 | using namespac...
s571056278
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 20000; int main() { /* code */ int R[MAX], n; cin >> n; for (int i = 0; i < count; i++) { /* code */ cin >> R[i]; } int maxv = -200000000000; int minv = R[0]; for (int i = 0; i < count; i++) { /* code */ ...
a.cc: In function 'int main()': a.cc:11:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<' 11 | for (int i = 0; i < count; i++) { | ~~^~~~~~~ a.cc:15:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-2...
s974455332
p02258
C++
#include<iostream> #include<algorithm> using namespace name std; static const int MAX = 20000; int main() { /* code */ int R[MAX], n; cin >> n; for (int i = 0; i < n; i++) { /* code */ cin >> R[i]; } int maxv = -200000000000; int minv = R[0]; for (int i = 0; i < n; i++) { /* code */ m...
a.cc:3:17: error: 'name' is not a namespace-name 3 | using namespace name std; | ^~~~ a.cc:3:21: error: expected ';' before 'std' 3 | using namespace name std; | ^~~~ | ; a.cc:3:22: error: 'std' does not name a type 3 | using namespac...
s070590367
p02258
C++
#include<iostream> #include<algorithm> using namespace std; static const int MAX = 20000; int main() { /* code */ int R[MAX], n; cin >> n; for (int i = 0; i < n; i++) { /* code */ cin >> R[i]; } int maxv = -200000000000; int minv = R[0]; for (int i = 0; i < n; i++) { /* code */ maxv =...
a.cc: In function 'int main()': a.cc:15:14: warning: overflow in conversion from 'long int' to 'int' changes value from '-200000000000' to '1863462912' [-Woverflow] 15 | int maxv = -200000000000; | ^~~~~~~~~~~~~ a.cc:21:27: error: expected ';' before '}' token 21 | minv = min(minv, R[i]) ...
s692352863
p02258
C++
#include<iostream> #include<math.h> #include<stdlib.h> #define INF -99999999999; using namespace std; class answer { public: int s, e, ans; answer(){ s = 0; e = 0; ans = 0; } answer(int a, int b, int c) { s = a; e = b; ans = c; } void show3(void) { cout << s << " " << e << " " << ans; } void show1(void) {...
a.cc: In function 'answer fun2(int*, int, int, int)': a.cc:5:13: warning: overflow in conversion from 'long int' to 'int' changes value from '-99999999999' to '-1215752191' [-Woverflow] 5 | #define INF -99999999999; | ^~~~~~~~~~~~ a.cc:23:23: note: in expansion of macro 'INF' 23 | int l...
s044023381
p02258
C++
#include "stdafx.h" #include<iostream> using namespace std; int main(){ int n,p[200010],M; cin>>n; for(int i=0;i<n;i++){ cin>>p[i]; } M=p[1]-p[0]; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ if(p[j]-p[i]>M)M=p[j]-p[i]; } } cout<<M<<endl; return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s171735001
p02258
C++
#include <iostream> using namespace std; int main() { int n, *a; cin >> n; a = new int[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int c = n, f, d; int max = a[1] - a[0]; int min = while (c - 2) { } delete [] a; cout << max << endl; return 0; ...
a.cc: In function 'int main()': a.cc:15:5: error: expected primary-expression before 'while' 15 | while (c - 2) { | ^~~~~
s209782323
p02258
C++
import sys INF = (sys.maxint)/3 def MaximumProfit(R_list): minR = INF maxD = -INF for R in R_list: maxD = max(maxD, R - minR) minR = min(minR, R) return maxD def main(): n = input() R_list = [] for i in range(n): R_list.append(input()) print MaximumProfit(R_list) if __name__ == '__main__': main()
a.cc:19:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 19 | if __name__ == '__main__': | ^~~~~~~~~~ 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'
s354113761
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=-1000000000; int minv=R[0]; for(i=1;i<n;i++){ maxv=(maxv,R[i]-minv); minv=(minv,R[i]); } cout << maxv << endl; ...
a.cc: In function 'int main()': a.cc:12:38: error: expected ';' before 'int' 12 | for(int i=0; i<n ; i++) cin >> R[i] | ^ | ; 13 | 14 | int maxv=-1000000000; | ~~~ a.cc:17:7: erro...
s504917608
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=-1000000000; int minv=R[0]; for(i=1;i<n;i++){ maxv=(maxv,R[i]-minv); minv=(minv,R[i]); } cout << maxv << endl; ...
a.cc: In function 'int main()': a.cc:12:38: error: expected ';' before 'int' 12 | for(int i=0; i<n ; i++) cin >> R[i] | ^ | ; 13 | 14 | int maxv=-1000000000; | ~~~ a.cc:17:7: erro...
s941897115
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=-1000000000; int minv=R[0]; for(int i=1;i<n;i++){ maxv=(maxv,R[i]-minv); minv=(minv,R[i]); } cout << maxv << endl; ...
a.cc: In function 'int main()': a.cc:12:38: error: expected ';' before 'int' 12 | for(int i=0; i<n ; i++) cin >> R[i] | ^ | ; 13 | 14 | int maxv=-1000000000; | ~~~ a.cc:19:4: erro...
s784546035
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=-1000000000; int minv=R[0]; for(i=1;i<n;i++){ maxv=(maxv,R[i]-minv); minv=(minv,R[i]); } cout << maxv << endl; ...
a.cc: In function 'int main()': a.cc:17:7: error: 'i' was not declared in this scope 17 | for(i=1;i<n;i++){ | ^
s910378609
p02258
C++
#include <iostream> using namespace std; int main() { int a, no[200000] = { 0 }; int max = -200000; cin >> a; for(int i = 0;i < a;i++) { cin >> no[i]; } for(int i = 0;i < a - 1;i++) { for(int j = i + 1;j < a;j++){ if(a[i] - a[j] > max) max = ...
a.cc: In function 'int main()': a.cc:18:17: error: invalid types 'int[int]' for array subscript 18 | if(a[i] - a[j] > max) | ^ a.cc:18:24: error: invalid types 'int[int]' for array subscript 18 | if(a[i] - a[j] > max) | ^ a.cc:19:24: error...
s709228755
p02258
C++
#include <iostream> using namespace std; int main() { int a, no[200000] = { 0 }, i, j; int max = -200000; cin >> a; for(i = 0;i < a;i++) cin >> no[i]; for(i = 0;i < a - 1;i++) { for(j = i + 1;j < a;j++){ if(a[i] - a[j] > max) max = a[i] - a...
a.cc: In function 'int main()': a.cc:17:17: error: invalid types 'int[int]' for array subscript 17 | if(a[i] - a[j] > max) | ^ a.cc:17:24: error: invalid types 'int[int]' for array subscript 17 | if(a[i] - a[j] > max) | ^ a.cc:18:24: error...
s022229812
p02258
C++
#include <stdio.h> int main(){ int t, m, n, nn, k, z; int rt[200000] n=0;m=-999999; scanf("%d\n",&t); for(;t-1>n;n++){ scanf("%d\n",&rt[n]); } n=0; for(;t-1>n;n++){ nn=n+1; k=rt[n]; for(;t-1>nn;nn++){ z=k-rt[nn]; if(z > m){ m=z; } ...
a.cc: In function 'int main()': a.cc:6:4: error: expected initializer before 'n' 6 | n=0;m=-999999; | ^ a.cc:9:21: error: 'rt' was not declared in this scope; did you mean 't'? 9 | scanf("%d\n",&rt[n]); | ^~ | t a.cc:14:9: error: 'rt' was not...
s994034676
p02258
C++
#include <iostream> using namespace std; int main() { int a, no[2000], i, j; int max = -200000; cin >> a; for(i = 0;i < a;i++) cin >> no[i]; for(i = 0;i < a - 1;i++) { for(j = i + 1;j < a;j++){ if(a[i] - a[j] > max) max = a[i] - a[j];...
a.cc: In function 'int main()': a.cc:17:17: error: invalid types 'int[int]' for array subscript 17 | if(a[i] - a[j] > max) | ^ a.cc:17:24: error: invalid types 'int[int]' for array subscript 17 | if(a[i] - a[j] > max) | ^ a.cc:18:24: error...
s984717885
p02258
C++
#include <stdio.h> int main(){ int t, m, n, a, k, z; int rt[200000]={ 0 }; n=0;m=-20000; scanf("%d\n",&t); for(;t>n;n++){ scanf("%d\n",&rt[n]); } n=0; for(;t>n;n++){ nn=n+1; k=rt[n]; for(;t>a;a++){ z=k-rt[a]; if(z > m){ m=z; } ...
a.cc: In function 'int main()': a.cc:13:7: error: 'nn' was not declared in this scope; did you mean 'n'? 13 | nn=n+1; | ^~ | n
s241045531
p02258
C++
#include <iostream> using namespace std; int main() { int a, no[20000] = {0}; int max = -200000, i, j; cin >> a; for(i = 0;i < a;i++) cin >> no[i]; for(i = 0;i < a - 1;i++) { for(j = i + 1;j < a;j++){ if(a[i] - a[j] > max) { max...
a.cc: In function 'int main()': a.cc:17:17: error: invalid types 'int[int]' for array subscript 17 | if(a[i] - a[j] > max) { | ^ a.cc:17:24: error: invalid types 'int[int]' for array subscript 17 | if(a[i] - a[j] > max) { | ^ a.cc:18:24: e...
s527093570
p02258
C++
include<stdio.h> int main (void) { int r[200000], n, min, p = 0, i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } for (i = 0; i < n; i++) { if (i > 0) { if (r[i] - min > p) { p = r[i] - min; } else if (r[i] < min) { min = r[i]; } } else { ...
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~
s540671546
p02258
C++
#include<stdio.h> int main(void){ int x[200000]; int n, i, j, k, a, max; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d", &x[i]); } for(j=n-1;j>=0;j--){ for(k=j;k>=0;k--){ a=x[j]-x[k]; if(x>max) max=a; } } printf("%d\n", max); return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(x>max) | ~^~~~
s909711229
p02258
C++
#include<stdio.h> int main(void){ int x[200000]; int n, i, j, k, a, max; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d", &x[i]); } for(j=n-1;j>=0;j--){ for(k=j;k>=0;k--){ a=x[j]-x[k]; if(x>max) max=a; } } printf("%d\n", max); return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(x>max) | ~^~~~
s508743878
p02258
C++
#include<stdio.h> int main(void){ int x[200000]; int n, i, j, k, a, max; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d", &x[i]); } for(j=n-1;j>=0;j--){ for(k=j;k>=0;k--){ a=x[j]-x[k]; if(x>max) max=a; } } printf("%d\n", max); return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(x>max) | ~^~~~
s007422987
p02258
C++
#include<stdio.h> int main(void) { int x[200000]; int n, i, j, a, maxv=-1000000000, minv=x[0]; scanf("%d", &n); for(i=0;i<n;i++){ scanf("%d", &x[i]); } for(j=1;j<n;j++){ minv=min(minv,x[i]); maxv=max(maxv,x[i]-minv); } printf("%d\n", maxv); return 0; }
a.cc: In function 'int main()': a.cc:11:6: error: 'min' was not declared in this scope; did you mean 'minv'? 11 | minv=min(minv,x[i]); | ^~~ | minv a.cc:12:6: error: 'max' was not declared in this scope; did you mean 'maxv'? 12 | maxv=max(maxv,x[i]-minv); | ^~~ | maxv
s811841857
p02258
C++
#include <stdio.h> int main() { int n,i,j,a; int a[n],maxv; scanf ("%d", &n); for (i = 0; i < n; i++) scanf ("%d", &a[i]); for (i = 0; i < n-1; i++) { for (j = 1; j < n; j++) { a = a[j] -a[i]; if (a > maxv) { maxv = a; } } } printf("%d\n", ); return 0; }
a.cc: In function 'int main()': a.cc:5:6: error: conflicting declaration 'int a [n]' 5 | int a[n],maxv; | ^ a.cc:4:12: note: previous declaration as 'int a' 4 | int n,i,j,a; | ^ a.cc:10:19: error: invalid types 'int[int]' for array subscript 10 | scanf ("%d", &a[i]); | ...
s451220853
p02258
C++
#include <bits\stdc++.h> #define rep(i,o,u) for(int i = o;i <= u; i++) using namespace std; int main(){ int n; cin >> n; int a[200005]; rep(i,1,n){ cin >> a[i]; } int mn = a[1],mx = -2000000000; rep(i,2,n){ mx = max(mx,a[i]-mn); mn = min(mn,a[i]); } cout << mx << endl; return 0; }
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s494952712
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000 int main(){ int n; int R[MAX]; 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:6:1: error: expected ',' or ';' before 'int' 6 | int main(){ | ^~~
s416207720
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main(){ int n; int R[MAX]; 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:11:8: error: 'i' was not declared in this scope 11 | for (i = 0, i < n, i++) cin >> R[i]; | ^ a.cc:14:3: error: expected primary-expression before 'int' 14 | int minv = R[0]; | ^~~ a.cc:13:26: error: expected ')' before 'int' 13 | int maxv = -2000...
s108142626
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main(){ int n; int R[MAX]; 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:11:20: error: expected ';' before '<' token 11 | for (int i = 0, i < n, i++) cin >> R[i]; | ^~ | ; a.cc:11:21: error: expected primary-expression before '<' token 11 | for (int i = 0, i < n, i++) cin >> R[i]; | ...
s117892367
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main(){ int n; int R[MAX]; 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:11:20: error: expected ';' before '<' token 11 | for (int i = 0, i < n, i++) cin >> R[i]; | ^~ | ; a.cc:11:21: error: expected primary-expression before '<' token 11 | for (int i = 0, i < n, i++) cin >> R[i]; | ...
s713286354
p02258
C++
#include <iostream> #include <algorithm> using namespace std; static const int MAX = 200000; int main(){ int n; int R[MAX]; 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:17:35: error: expected primary-expression before '?' token 17 | maxv = max(maxv, R[i] - minv)??? | ^ a.cc:17:36: error: expected primary-expression before '?' token 17 | maxv = max(maxv, R[i] - minv)??? | ...
s029565576
p02258
C++
#include <stdio.h> #define n 200000 int main() { int n,i,j,b; int a[n],maxv; scanf ("%d", &n); for (i = 0; i < n; i++) { scanf ("%d", &a[i]); } for (i = 0; i < n-1; i++) { for (j = 1; j < n; j++) { b = a[j] -a[i]; if (b > maxv) { maxv = b; } } } printf("%d\n", maxv); return 0; }
a.cc: In function 'int main()': a.cc:2:11: error: expected unqualified-id before numeric constant 2 | #define n 200000 | ^~~~~~ a.cc:5:6: note: in expansion of macro 'n' 5 | int n,i,j,b; | ^ a.cc:2:11: error: lvalue required as unary '&' operand 2 | #define n 200000 | ...
s444847004
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); ...
a.cc:25:2: error: expected class-name at end of input 25 | ~ | ^
s927109915
p02258
C++
int GetMaxProfit(int R[], int N) { int max, min; min = R[0]; max = R[1] - R[0]; for (int i = 1; i < N; ++i) { max = std::max(R[i] - min, max); min = std::min(R[i], min); } return max; } int main() { int N; int R[200000]; scanf("%d", &N); for (int i = 0; i < N; +...
a.cc: In function 'int GetMaxProfit(int*, int)': a.cc:6:20: error: 'max' is not a member of 'std' 6 | max = std::max(R[i] - min, max); | ^~~ a.cc:7:20: error: 'min' is not a member of 'std' 7 | min = std::min(R[i], min); | ^~~ a.cc: In function '...
s291853324
p02258
C++
#include <stdio.h> int main() { int n, i, x, y, min2, max=1, min=1000*1000*1000; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%d",&x); if(min>x) {min2=min; min=x;} if(min<x && max<x) {max=x; y=min} if(max==1 && i+1==n) {max=min; y=min2;} } printf("%d\n", max-y); return 0; }
a.cc: In function 'int main()': a.cc:12:36: error: expected ';' before '}' token 12 | if(min<x && max<x) {max=x; y=min} | ^ | ;
s429645994
p02258
C++
#include <stdio.h> int main(){ int t, m, n, x, y, k, z; int rt[200000]={ 0 }; scanf("%d",&t); for(n=0;t>n;n++){ scanf("%d",&rt[n]); } x=0 for(n=0;t-1>n;n++){ x = n+1; k = rt[n]; for(;t>x;x++){ z = rt[x]-k; if(x == 0){ m = z; x = ...
a.cc: In function 'int main()': a.cc:11:6: error: expected ';' before 'for' 11 | x=0 | ^ | ; 12 | for(n=0;t-1>n;n++){ | ~~~ a.cc:12:21: error: expected ';' before ')' token 12 | for(n=0;t-1>n;n++){ | ^ | ; a.cc:28:2: err...
s857819691
p02258
C++
#include <stdio.h> int main(){ int t, m, n, x, y, k, z; int rt[200000]={ 0 }; scanf("%d",&t); for(n=0;t>n;n++){ scanf("%d",&rt[n]); } x=0 for(n=0;t-1>n;n++){ x = n+1; k = rt[n]; for(;t>x;x++){ z = rt[x]-k; if(x == 0){ m = z; x = ...
a.cc: In function 'int main()': a.cc:11:6: error: expected ';' before 'for' 11 | x=0 | ^ | ; 12 | for(n=0;t-1>n;n++){ | ~~~ a.cc:12:21: error: expected ';' before ')' token 12 | for(n=0;t-1>n;n++){ | ^ | ;
s637489200
p02258
C++
#include <stdio.h> int main(){ int t, m, n, x, y, k, z; int rt[200000]={ 0 }; scanf("%d",&t); for(n=0;t>n;n++){ scanf("%d",&rt[n]); } x=0; for(n=0;t-1>n;n++){ x = n+1; k = rt[n]; for(;t>x;x++){ z = rt[x]-k; if(x == 0){ m = z; x =...
a.cc: In function 'int main()': a.cc:25:5: error: expected '}' at end of input 25 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s566066702
p02258
C++
#include <stdio.h> int main(){ int t, m, n, x, y, k, z; int rt[200000]={ 0 }; scanf("%d",&t); for(n=0;t>n;n++){ scanf("%d",&rt[n]); } x=0; for(n=0;t-1>n;n++){ x = n+1; k = rt[n]; for(;t>x;x++){ z = rt[x]-k; if(x == 0){ m = z; x =...
a.cc: In function 'int main()': a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s441690841
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 = -200000000; 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:20:16: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 20 | cout << maxv <<end; | ~~~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/inc...
s398301763
p02258
C++
#include <iostream> using namespace std; static const int MAX_COUNT = 20000; void main() { int n; int R[MAX_COUNT]; cin >> n; for (int i = 0; i < n; i++) { cin >> R[i]; } int max = R[1] - R[0]; int min = R[0]; for (int i = 2; i < n; i++) { if (max < R[i] - min) max = R[i] - min; if (min > R[i...
a.cc:6:1: error: '::main' must return 'int' 6 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:32:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 32 | return; | ^~~~~~
s114820691
p02258
C++
#include <iostream> #include <stdio.h> using namespace std; static const int MAX_COUNT = 200000; void main() { int n; int R[MAX_COUNT]; cin >> n; for (int i = 0; i < n; i++) { cin >> R[i]; } int max = R[1] - R[0]; int min = R[0]; for (int i = 1; i < n; i++) { if (max < R[i] - min) max = R[i] - m...
a.cc:7:1: error: '::main' must return 'int' 7 | void main() | ^~~~
s314324824
p02258
C++
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; const int N =200000+5; int a[N]; int main() { int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; long long maxv=-2e9; long long minv=a[0]; for(int i=1;i<n;i++) { maxv=max(maxv,a[i]-minv); min...
a.cc: In function 'int main()': a.cc:18:17: error: no matching function for call to 'min(long long int&, int&)' 18 | minv=min(minv,a[i]); | ~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s146088322
p02258
C++
#include <iostream> #include <vector> int main(int const argc, char const** argv){ int n; std::cin >> n; std::vector<int> vec(n); for(int i = 0; i<n; ++i){ std::cin >> vec[i]; } int max = INT_MIN; for(int i = 0; i<n; ++i){ for(int j = i; j<n; ++j){ int r = vec[j] - vec[i]; if(max<r){...
a.cc: In function 'int main(int, const char**)': a.cc:12:13: error: 'INT_MIN' was not declared in this scope 12 | int max = INT_MIN; | ^~~~~~~ a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <vector> +++ |+#inc...
s032419152
p02258
C++
#include <iostream> void int main(int argc, char const *argv[]) { /* code */ int values[10000]; int a; int i=0; while(cin>>values[i]){ cout << values[i++] << flush; } return 0; }
a.cc:2:1: error: two or more data types in declaration of 'main' 2 | void int main(int argc, char const *argv[]) { | ^~~~
s692945365
p02258
C++
#include <iostream> int main(int argc, char const *argv[]) { /* code */ int values[10000]; int a; int i=0; while(cin>>values[i]){ cout << values[i++] << flush; } return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | while(cin>>values[i]){ | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern...
s455693583
p02258
C++
#include<iostream> #include<algorihm> 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 = -200000000; int minv = R[0]; for ( int i = 1; i < n; i++ ) { maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]);...
a.cc:2:9: fatal error: algorihm: No such file or directory 2 | #include<algorihm> | ^~~~~~~~~~ compilation terminated.
s078619990
p02258
C++
#include<iostream> 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 = -200000000; int minv = R[0]; for ( int i = 1; i < n; i++ ) { maxv = max(maxv, R[i] - minv); minv = min(minv, R[i]); } cout << ma...
a.cc: In function 'int main()': a.cc:7:9: error: reference to 'max' is ambiguous 7 | int R[max], n; | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, ...
s022901293
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 = -200000000; 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:7:9: error: reference to 'max' is ambiguous 7 | int R[max], n; | ^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidates are: 'template<class _Tp, class _Compare> const...
s286120978
p02258
C++
#include <iostream> #include <math.h> #include <sstream> using namespace std; int main() { string str; getline(cin, str); int num; stringstream num_ss(str); num_ss >> num; int counter = 0; int* ary = new int[num]; for (int i = 0; i < num; i++) { getline(cin, str); stringstream tmp_ss(str); tmp_ss >> ar...
a.cc: In function 'int main()': a.cc:23:17: error: 'getMaxProfit' was not declared in this scope 23 | cout << getMaxProfit(ary, num) << endl; | ^~~~~~~~~~~~
s160992078
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=0; i<n; i++) { maxv = max(maxv, R[i] -minv]); minv = min(minv, R[i]); ...
a.cc: In function 'int main()': a.cc:10:36: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 10 | for(int i = 0; i < n; i++) { cin > R[i]; } | ~~~ ^ ~~~~ | | | | ...
s683280144
p02258
C++
n = int(input()) stack = [] for _ in range(n): stack.append(int(input())) length = len(stack) candidate = [-float('inf')] for i in range(1, length // 2 + 1): for r1, r2 in zip(stack[::1], stack[i::1]): if r2 - r1 > candidate[0]: candidate.append(r2 - r1) if i - length != i: for ...
a.cc:7:21: warning: multi-character character constant [-Wmultichar] 7 | candidate = [-float('inf')] | ^~~~~ a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s553210285
p02258
C++
#include <iostream> #define MAX_N 200000 using namespace std; int main(void) { int n; int profits[MAX_N+1]; cin >> n; for(int i=0; i < n; i++) { cin >> profits[i]; } int _max = -2000000000; int _min = profits[0]; for(int i = 1; i < n; i++) { _max = max(_max, profits[i] - _min); _min = min(_min, profits...
a.cc: In function 'int main()': a.cc:18:44: error: expected ')' before ';' token 18 | _min = min(_min, profits[i]; | ~ ^ | )
s163051613
p02258
C++
#include<iostream> #include<cstdio> using namespace std; const int MAX_N = 200000; int R[MAX_N]; int main() { int n; int max = -1000000000; cin >> n; for(int i=0;i<n;i++){ scanf("%d",&R[i]); } minr = R[0]; for(int i=1;i<n;i++){ if(max < R[i] - minr){ max = R[i]-minr; } if(R[i] < minr){ minr = R...
a.cc: In function 'int main()': a.cc:18:9: error: 'minr' was not declared in this scope 18 | minr = R[0]; | ^~~~
s895131861
p02258
C++
#include <iostream> #include <algorithm> static const int MAX=200000; int main{ int R[MAX],n; cin >> n; for(int i=0;i<n;i++){ int maxv=-20000000000; int manv=min(minv,R[i]); } cout << maxv << endl; return 0; }
a.cc:5:5: error: cannot declare '::main' to be a global variable 5 | int main{ | ^~~~ a.cc:6:1: error: expected primary-expression before 'int' 6 | int R[MAX],n; | ^~~ a.cc:6:1: error: expected '}' before 'int' a.cc:5:9: note: to match this '{' 5 | int main{ | ^ a.cc:8:1: error...
s314357024
p02258
C++
#include <iostream> #include <algorithm> 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:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | 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 ...
s543963074
p02258
C++
#include <iostream> 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 = -2000000000, minv = R[0]; for(int i=1 i<n; i++){ if(maxv < R[i] - minv) maxv = R[i] - minv; if(minv > R[i]) minv = R[...
a.cc: In function 'int main()': a.cc:12:16: error: expected ';' before 'i' 12 | for(int i=1 i<n; i++){ | ^~ | ;
s358567890
p02258
C++
#include <iostream> int main() { int n; std::cin >> n; int base = INT_MAX; int input; int maxProfit = INT_MIN; for (int i = 0; i < n; i++) { std::cin >> input; if (input - base > maxProfit) { maxProfit = input - base; } if (input < base) { base = input; } } std::cout << maxProfit << std::e...
a.cc: In function 'int main()': a.cc:7:20: error: 'INT_MAX' was not declared in this scope 7 | int base = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#inclu...
s815365203
p02258
C++
#include <iostream> int main() { int n; int inputMaximum = (int)std::pow(10, 9); std::cin >> n; int minimumValue = inputMaximum + 1; int nextValue; int maxProfit = -inputMaximum - 1; for (int i = 0; i < n; i++) { std::cin >> nextValue; if (i >= 1 && nextValue - minimumValue > maxProfit)//????????´??° ...
a.cc: In function 'int main()': a.cc:7:38: error: 'pow' is not a member of 'std' 7 | int inputMaximum = (int)std::pow(10, 9); | ^~~
s182939671
p02258
C++
#include <iostream> #include <algorithm> using namaspace std; static count int MAX=200000; int main(){ int R[MAX],n; cin >>n; for(int i=1;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:4:7: error: expected nested-name-specifier before 'namaspace' 4 | using namaspace std; | ^~~~~~~~~ a.cc:6:8: error: 'count' does not name a type 6 | static count int MAX=200000; | ^~~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'MAX' was not declared in this scope 9 | ...
s360792972
p02258
C++
int main() { int n; scanf("%d",&n); int Rt[n]; for (int i = 0; i < n; i++) { scanf("%d", &Rt[i]); } int max = Rt[1] - Rt[0]; for (int j = 1; j < n; j++) { int min = Rt[0]; for (int i = 1; i < j; i++) { if (Rt[i] < min) { min = Rt[i]; } } if (Rt[j] - min > max) { ...
a.cc: In function 'int main()': a.cc:3:3: error: 'scanf' was not declared in this scope 3 | scanf("%d",&n); | ^~~~~ a.cc:24:3: error: 'printf' was not declared in this scope 24 | printf("%d", max); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by ...
s638296902
p02258
C++
#include<cstdio> #include<iostream> using namespace:std; int main() { int n; scanf("%d",&n); int Rt[n]; for (int i = 0; i < n; i++) { scanf("%d", &Rt[i]); } int max = Rt[1] - Rt[0]; for (int j = 1; j < n; j++) { int min = Rt[0]; for (int i = 1; i < j; i++) { if (Rt[i] < min) { ...
a.cc:3:16: error: expected identifier before ':' token 3 | using namespace:std; | ^ a.cc:3:16: error: expected ';' before ':' token 3 | using namespace:std; | ^ | ; a.cc:3:16: error: expected unqualified-id before ':' token
s131200171
p02258
C++
#include<cstdio> #include<iostream> using namespace:std; int main() { int n; scanf("%d",&n); int Rt[n]; for (int i = 0; i < n; i++) { scanf("%d", &Rt[i]); } int max = Rt[1] - Rt[0]; for (int j = 1; j < n; j++) { int min = Rt[0]; for (int i = 1; i < j; i++) { if (Rt[i] < min) { ...
a.cc:3:16: error: expected identifier before ':' token 3 | using namespace:std; | ^ a.cc:3:16: error: expected ';' before ':' token 3 | using namespace:std; | ^ | ; a.cc:3:16: error: expected unqualified-id before ':' token
s820632789
p02258
C++
#include<cstdio> #include<iostream> using namespace:std; int main() { int n; scanf("%d",&n); int Rt[n]; for (int i = 0; i < n; i++) { scanf("%d", &Rt[i]); } int max = Rt[1] - Rt[0]; for (int j = 1; j < n; j++) { int min = Rt[0]; for (int i = 1; i < j; i++) { if (Rt[i] < min) { ...
a.cc:3:16: error: expected identifier before ':' token 3 | using namespace:std; | ^ a.cc:3:16: error: expected ';' before ':' token 3 | using namespace:std; | ^ | ; a.cc:3:16: error: expected unqualified-id before ':' token
s269602506
p02258
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int n; scanf("%d",&n); int Rt[n]; for (int i = 0; i < n; i++) { scanf("%d", &Rt[i]); } int maxv = Rt[1] - Rt[0]; int minv = Rt[0]; for (int j = 1; j < n; j++) { minv = min(minv, Rt[j-1]); maxv = max(maxv, Rt[j] - ...
a.cc:3:2: error: stray '\20' in program 3 | u<U+0010>sing namespace std; | ^~~~~~~~ a.cc:3:1: error: 'u' does not name a type 3 | using namespace std; | ^ a.cc: In function 'int main()': a.cc:17:12: error: 'min' was not declared in this scope; did you mean 'std::min'? 17 | minv = min(minv, ...
s557319599
p02258
C++
#include <iostream> #include <vector> #include <algorithm> #define INPUT_FROM_FILE (0) #if INPUT_FROM_FILE #include <fstream> #endif int main(int argc, char **argv) { #if INPUT_FROM_FILE std::ifstream ifs("test.txt"); #endif int n = 0; int max_v = INT_MIN; int min_v = INT_MAX; #if INPUT_FROM_FILE ifs >> n; #e...
a.cc: In function 'int main(int, char**)': a.cc:16:21: error: 'INT_MIN' was not declared in this scope 16 | int max_v = INT_MIN; | ^~~~~~~ a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <algorithm>...
s793927944
p02258
C++
#include <iostream> #include <vector> #include <algorithm> #include <limits> #define INPUT_FROM_FILE (0) #if INPUT_FROM_FILE #include <fstream> #endif int main(int argc, char **argv) { #if INPUT_FROM_FILE std::ifstream ifs("test.txt"); #endif int n = 0; int max_v = INT_MIN; int min_v = INT_MAX; #if INPUT_FROM_...
a.cc: In function 'int main(int, char**)': a.cc:17:21: error: 'INT_MIN' was not declared in this scope 17 | int max_v = INT_MIN; | ^~~~~~~ a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <limits> ...
s335225048
p02258
C++
#include <vector> #include <iostream> #include <algorithm> 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; return 0; }
a.cc: In function 'int main()': a.cc:11:22: error: 'INT_MAX' was not declared in this scope 11 | int minVal = INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include <algorithm> +++ |+...