submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s396698251 | p02258 | C++ | 2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<iostream>
#include<algorithm>
using namespace std;
#define MAX 200000
int main(){
int n,a[MAX],i;
cin >> n;
for(i=0;i<n;i++)cin >> a[i];
int maxv,minv;
maxv = -2000000000;
minv = a[0];
for(i=1;i<n;i++){
maxv ... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 2
| ^
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a... |
s251993357 | p02258 | C++ | #include<stdio.h>
int main()
{
int N,b,w;
b=0;w=0
while(scanf("%d",&N)!=EOF)
{
w=w+(N-b);
b=N;
}
peintf("%d\n",w};
return 0;
} | a.cc: In function 'int main()':
a.cc:7:8: error: expected ';' before 'while'
7 | b=0;w=0
| ^
| ;
8 | while(scanf("%d",&N)!=EOF)
| ~~~~~
a.cc:13:16: error: expected ')' before '}' token
13 | peintf("%d\n",w};
| ~ ^
| )
a.cc: At global ... |
s318607778 | p02258 | C++ | #include <sstream>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iterator>
#include <numeric>
#include <f... | a.cc: In function 'int main()':
a.cc:31:7: error: 'INT_MIN' was not declared in this scope
31 | M = INT_MIN;
| ^~~~~~~
a.cc:19:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
18 | #include <functional>
+++ |+#include <climits>
19 |
|
s437856871 | p02258 | C++ | #include <sstream>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iterator>
#include <numeric>
#include <f... | a.cc: In function 'int main(int, char**)':
a.cc:31:7: error: 'INT_MIN' was not declared in this scope
31 | M = INT_MIN;
| ^~~~~~~
a.cc:19:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
18 | #include <functional>
+++ |+#include <climits>... |
s073213397 | p02258 | C++ | #include <iostream>
#include <cmath>
#include <climits>
using namespace std;
int main()
{
int n,m = INT32_MIN;
long int rm;
cin >> n >> rm;
for(int i = 1;i < n;i++)
{
long int r;
cin >> r;
if(r - rm > m)
{
m = r - rm;
}
if(rm > r)
... | a.cc: In function 'int main()':
a.cc:7:15: error: 'INT32_MIN' was not declared in this scope; did you mean 'INT_MIN'?
7 | int n,m = INT32_MIN;
| ^~~~~~~~~
| INT_MIN
|
s002992948 | p02258 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.beg... | a.cc: In function 'int main()':
a.cc:36:21: error: 'R' was not declared in this scope
36 | if (prev <= R[i]) ???continue;
| ^
a.cc:36:27: error: expected primary-expression before '?' token
36 | if (prev <= R[i]) ???continue;
| ^
a.cc:36:28... |
s352123439 | p02258 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.beg... | a.cc: In function 'int main()':
a.cc:37:21: error: 'R' was not declared in this scope
37 | if (prev <= R[i]) ???continue;
| ^
a.cc:37:27: error: expected primary-expression before '?' token
37 | if (prev <= R[i]) ???continue;
| ^
a.cc:37:28... |
s075763045 | p02258 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.beg... | a.cc: In function 'int main()':
a.cc:37:21: error: 'R' was not declared in this scope
37 | if (prev <= R[i]) continue;
| ^
a.cc:44:16: error: 'R' was not declared in this scope
44 | prev = R[i];
| ^
|
s278558510 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namesapce 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[... | a.cc:3:7: error: expected nested-name-specifier before 'namesapce'
3 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:... |
s951466020 | p02258 | C++ | #include<stdio.h>
#include<math.h>
int max(int*,int);
int main()
{
int n, i;
scanf("%d", &n);
int R[200001];
for (i = 0; i <= n; i++)
{
scanf("%d", &R[i]);
}
printf("%d\n", max(R, n));
}
int max(int array[], int n)
{
int start, target;
int champion = -1000000000, challenger;
for (start = 0; start <= n ... | a.cc: In function 'int max(int*, int)':
a.cc:26:17: error: 'biggest' was not declared in this scope
26 | biggest=0;
| ^~~~~~~
|
s167316640 | p02258 | C++ | #include<stdio.h>
#include<math.h>
int max(int*,int);
int main()
{
int n, i;
scanf("%d", &n);
int R[200001];
for (i = 0; i <= n; i++)
{
scanf("%d", &R[i]);
}
printf("%d\n", max(R, n));
}
int max(int array[], int n)
{
int i,r=0,champion=-1000000000,k;
while(r!=n-1)
{
for(i=r;i<=n-1;i++)... | a.cc: In function 'int max(int*, int)':
a.cc:42:32: error: 'smallest' was not declared in this scope
42 | int challenger=biggest-smallest;
| ^~~~~~~~
a.cc:44:8: error: 'challenger' was not declared in this scope
44 | if(challenger>=champion) champion=challenger;
... |
s897210178 | p02258 | C++ | #include<stdio.h>
#include<math.h>
int max(int*, int);
int main()
{
int n, i;
scanf_s("%d", &n);
int R[200001];
for (i = 0; i <= n; i++)
{
scanf_s("%d", &R[i]);
}
printf("%d\n", max(R, n));
}
int max(int array[], int n)
{
int r = 0, i = r, champion = -1000000000, k, smallest = 1000000000, challenger;
w... | a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s939908585 | 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, T[i]);
}
cout <<... | a.cc: In function 'int main()':
a.cc:18:34: error: 'T' was not declared in this scope
18 | minv = min(minv, T[i]);
| ^
|
s907285809 | p02258 | C++ | /*http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_D*/
#include <iostream>
using namespace std;
int main() {
int n;
int max;
int min;
cin>>n;
cin>>min;
for(int i = 0; i < n-1; i++){
int r;
cin>>r;
int tmp=r-min;
if(i == 0 || max<tmp){
... | a.cc: In function 'int main()':
a.cc:20:16: error: 'min' cannot be used as a function
20 | min=min(min,r);
| ~~~^~~~~~~
|
s795467824 | p02258 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[])
{
cin >> n;
vector<int> c;
for (int i = 0; i < n; i++)
{
int r;
cin >> r;
c.emplace_back(r);
}
int res = c.front();
for (int i = 1; i < n; i++)
{
auto v = c[i] - c[i-1];
if (res > v)
... | a.cc: In function 'int main(int, char**)':
a.cc:8:10: error: 'n' was not declared in this scope
8 | cin >> n;
| ^
|
s133188005 | p02258 | C++ | import java.util.Scanner;
public class Main{
public static void main(String args[]){
int i,j,k,t,m,l;
Scanner sc=new Scanner(System.in);
t=Integer.parseInt(sc.next());
int n[]=new int[t+1];
int max[]=new int[t+1];
int Max[]=new int[t+1];
for(i=0;i<t;i++){
n[i]=Integer.parseInt(sc.next());
}
f... | 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{
| ^~~~~~
|
s622606386 | p02258 | C++ | n = int( input( ) )
mi = int( input( ) )
profit = 0 - 1000000000
n -= 1
i = 0
while i < n:
num = int( input( ) )
diff = num - mi
if profit < diff:
profit = diff
if num < mi:
mi = num
i += 1
print( profit ) | a.cc:1:1: error: 'n' does not name a type
1 | n = int( input( ) )
| ^
|
s737752092 | 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 = 1; i < n; ++i)
{
maxv = max(maxv,R[i] - minv);
minv = min(... | a.cc:3:2: error: invalid preprocessing directive #using
3 | #using namespace std;
| ^~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iost... |
s490409342 | 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 = 1; i < n; ++i)
{
maxv = max(maxv,R[i] - minv);
minv = min(... | a.cc:3:2: error: invalid preprocessing directive #using
3 | #using namespace std;
| ^~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iost... |
s387758545 | 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 = 1; i < n; ++i)
{
maxv = max(maxv,R[i] - minv);
minv = min(... | a.cc:3:2: error: invalid preprocessing directive #using
3 | #using namespace std;
| ^~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iost... |
s147715270 | p02258 | C++ | //2???n???200,000
//1???Rt???10
#include <iostream>
#include <vector>
#include <numeric>
int main(){
int N;
std::vector<int> R;
std::cin >> N;
R.resize(N);
for(int i =0; i<N; ++i){
std::cin >> R[i];
}
std::vector<int> R_min;
std::vector<int> R_max;
R_min[0] = R[0];
R_max[N-1] = R[N-1];
... | a.cc: In function 'int main()':
a.cc:32:23: error: 'numeric_limits' is not a member of 'std'
32 | int max_diff = std::numeric_limits<int>::min();
| ^~~~~~~~~~~~~~
a.cc:32:38: error: expected primary-expression before 'int'
32 | int max_diff = std::numeric_limits<int>::min();
... |
s729578617 | p02258 | C++ | //2???n???200,000
//1???Rt???10
#include <iostream>
#include <vector>
#include <limits>
int main(){
int N;
std::vector<int> R;
std::cin >> N;
R.resize(N);
for(int i =0; i<N; ++i){
std::cin >> R[i];
}
std::vector<int> R_min(N);
std::vector<int> R_max(N);
R_min[0] = R[0];
R_max[N-1] = ... | a.cc: In function 'int main()':
a.cc:47:55: error: expected ';' before '}' token
47 | max_diff = std::max(max_diff, R_max[i] - R_min[i])
| ^
| ;
48 | }
| ~ ... |
s897843316 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, in, min_d, max_d;
cin >> n; // n???
cin >> in; // ???????????????
min_d = in; // ?????????
max_d = INT_MIN; // ?????????
for (int i = 1; i < n; ++i) {
cin >> in;
max_d = max(max_d, in - min_d);
min_d = min(mi... | a.cc: In function 'int main()':
a.cc:11:11: error: 'INT_MIN' was not declared in this scope
11 | max_d = 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>
+++ |+#include ... |
s890145458 | p02258 | C++ |
#include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;
int main(){
int a[MAX];
int minv = 0;
int maxv = 0;
int n;
cin >> n;
for (int i = 0;i < n;i++){
cin >> a[i];
}
minv = a[0];
maxv = a[1] - a[0];
for(int i = 1;i... | a.cc: In function 'int main()':
a.cc:29:5: error: 'out' was not declared in this scope
29 | out << maxv << endl;
| ^~~
|
s844622845 | p02258 | C++ | import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.IOException;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.BufferedReader;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fm... |
s864337911 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int data_size;
cin >>data_size;
int r[data_size];
for(int i=0;i<data_size;i++)
cin>> r[i];
int min_value=r[0];
int diff_max=-1e10;
for(int j=1;j<data_size;j++){
if(diff_max<=r[j]-min_value);
if(r[i]>=min_value) min_value=r[i];
}
cout<<diff_... | a.cc: In function 'int main()':
a.cc:12:14: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+10' to '-2147483648' [-Woverflow]
12 | int diff_max=-1e10;
| ^~~~~
a.cc:15:14: error: 'i' was not declared in this scope
15 | if(r[i]>=min_value) min_value=r[i];
... |
s991514811 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int MAX = 200000;
int r[MAX],n;
for(int i=0 ; i<n ; i++){
cin>>r;
}
int maxdiff = -1000000000;
int minnum = r[0];
for(int i=1 ; i<n ; i++){
maxdiff = max(maxdiff, r[i]-minnum);
minnum = min(minnum, r[i]);
}
cout<<maxdif... | a.cc: In function 'int main()':
a.cc:12:20: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [MAX]')
12 | cin>>r;
| ~~~^~~
| | |
| | int [MAX]
| st... |
s314447148 | p02258 | C++ | import java.io.*;
class Main{
static final PrintWriter out=new PrintWriter(System.out);
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while(line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
i... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:8: error: 'final' does not name a type
5 | static final PrintWriter out=new PrintWriter(System.out);
| ^~~~~
a.cc:7:7: error: expected ':' bef... |
s375356801 | p02258 | C++ | import java.io.*;
class Main{
static final PrintWriter out=new PrintWriter(System.out);
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:8: error: 'final' does not name a type
5 | static final PrintWriter out=new PrintWriter(System.out);
| ^~~~~
a.cc:7:7: error: expected ':' bef... |
s850005508 | p02258 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args){
int max = -200000;
Scanner san = new Scanner(System.in);
int listCount = san.nextInt();
int[] list = new int[listCount];
for(int i = 0; i < listCount; i++){
list[i] = san.nextInt();
}
int min = list[0];
for(int i ... | 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 {
| ^~~~~~
|
s206610205 | p02258 | C++ | #include <iostream>
using namespace std;
int m(int R[i], int R[j]);
int main() {
int R[n];
int max;
cin >> n;
for(int i = 0; i < n-1; i++){
cin >> R[i];
}
for(int i = 0; i < n-2; i++){
for(j = 1; j < n-1; j++){
m(i, j);
}
}
return max;
}
int m(int R[i], int R[j]){
if(i = 0 && ... | a.cc:4:13: error: 'i' was not declared in this scope
4 | int m(int R[i], int R[j]);
| ^
a.cc:4:15: error: expected ')' before ',' token
4 | int m(int R[i], int R[j]);
| ~ ^
| )
a.cc:4:17: error: expected unqualified-id before 'int'
4 | int m(int R[i], ... |
s234393590 | p02258 | C++ | #include <iostream>
using namespace std;
int m(int R[i], int R[j]){
if(i = 0 && j=1){
max = R[j] - R[i];
}else{
max = max(max,R[j]-R[i]);
}
}
int main() {
int R[n];
int max;
cin >> n;
for(int i = 0; i < n-1; i++){
cin >> R[i];
}
for(int i = 0; i < n-2; i++){
for(j = 1; j < n-1; j++){
... | a.cc:4:13: error: 'i' was not declared in this scope
4 | int m(int R[i], int R[j]){
| ^
a.cc:4:15: error: expected ')' before ',' token
4 | int m(int R[i], int R[j]){
| ~ ^
| )
a.cc:4:17: error: expected unqualified-id before 'int'
4 | int m(int R[i], ... |
s394317248 | p02258 | C++ | #include <iostream>
using namespace std;
int m(int x, int y){
if(i = 0 && j=1){
max = y - x;
}else{
max = max(x, y);
}
}
int main() {
int R[n];
int max;
cin >> n;
for(int i = 0; i < n-1; i++){
cin >> R[i];
}
for(int i = 0; i < n-2; i++){
for(j = 1; j < n-1; j++){
m(R[i], R[j]);
... | a.cc: In function 'int m(int, int)':
a.cc:5:4: error: 'i' was not declared in this scope
5 | if(i = 0 && j=1){
| ^
a.cc:5:13: error: 'j' was not declared in this scope
5 | if(i = 0 && j=1){
| ^
a.cc:6:13: error: overloaded function with no contextual type information
6 | max = y... |
s452834507 | p02258 | C++ | #include <iostream>
using namespace std;
int main() {
int R[n];
int max;
cin >> n;
for(int i = 0; i < n; i++){
cin >> R[i];
}
for(int i = 0; i < n-1; i++){
for(j = 1; j < n; j++){
if(i = 0 && j=1){
max = R[j] - R[i];
}else{
max = max(max, R[j] - R[i]);
}
... | a.cc: In function 'int main()':
a.cc:5:9: error: 'n' was not declared in this scope
5 | int R[n];
| ^
a.cc:11:12: error: 'R' was not declared in this scope
11 | cin >> R[i];
| ^
a.cc:15:9: error: 'j' was not declared in this scope
15 | for(j = 1; j < n; j++){
| ... |
s493000392 | p02258 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
int R[n];
int m;
cin >> n;
for(int i = 0; i < n; i++){
cin >> R[i];
}
for(int i = 0; i < n-1; i++){
for(int j = 1; j < n; j++){
if(i = 0 && j=1){
m = R[j] - R[i];
}else{
m = max(max, R[j... | a.cc: In function 'int main()':
a.cc:18:16: error: lvalue required as left operand of assignment
18 | if(i = 0 && j=1){
| ~~^~~~
a.cc:21:18: error: no matching function for call to 'max(<unresolved overloaded function type>, int)'
21 | m = max(max, R[j] - R[i]);
| ... |
s420072752 | 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 = -200000
int minv = R[0]
for(int i = 1; j < n; i++){
maxv = max(maxv, R[i] - minv);
minv = min(m... | a.cc:6:1: error: expected ',' or ';' before 'int'
6 | int main() {
| ^~~
|
s402445351 | 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 = -200000
int minv = R[0]
for(int i = 1; j < n; i++){
maxv = max(maxv, R[i] - minv);
minv = min(... | a.cc: In function 'int main()':
a.cc:7:9: error: expected unqualified-id before 'int'
7 | int n,int R[MAX];
| ^~~
a.cc:11:12: error: 'R' was not declared in this scope
11 | cin >> R[i];
| ^
a.cc:15:5: error: expected ',' or ';' before 'int'
15 | int minv = R[0]
|... |
s955925927 | p02258 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main( ) {
int n;
cin >> n;
vector<int> R;
int buff;
for (int i = 0; i < n; i++) {
cin >> buff;
R.push_back(buff);
}
int min = R[0];
int max = R[0];
int score = 0;
for (int i = 1; i < n; i++) {
if (R[0] > R[i]) {
if (... | a.cc: In function 'int main()':
a.cc:21:21: error: expected ')' before ']' token
21 | if (min > R[i]]) {
| ~ ^
| )
a.cc:21:21: error: expected primary-expression before ']' token
a.cc:32:2: error: expected '}' at end of input
32 | }
| ^
a.cc:5:13: not... |
s000028674 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int n, maxv = -INT_MAX, minv, r;
int main() {
cin >> n;
cin >> r;
minv = r;
for (int i = 1; i < n; ++i) {
cin >> r;
maxv = max(maxv, r - minv);
minv = min(minv, r);
}
cout << maxv << endl;
} | a.cc:5:16: error: 'INT_MAX' was not declared in this scope
5 | int n, maxv = -INT_MAX, minv, r;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <algorithm>
+++ |+#include <climits>
3 | using nam... |
s549443567 | p02258 | C++ | #include <stdio.h>
//#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
using namespace std;
int main(int **argc) {
int n;
cin >> n;
int mn = INT_MAX;
int mx = -1;
int diffMax = -1;
for (int i = 0;i<n;i++) {
int tmp;
cin >> tmp;
diffMax = max(tmp - mn, diffMax);
mn = min(mn, tmp);
}
... | a.cc:8:5: warning: first argument of 'int main(int**)' should be 'int' [-Wmain]
8 | int main(int **argc) {
| ^~~~
a.cc:8:5: warning: 'int main(int**)' takes only zero or two arguments [-Wmain]
a.cc: In function 'int main(int**)':
a.cc:13:18: error: 'INT_MAX' was not declared in this scope
13 | ... |
s583359003 | p02258 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
long i,n,min=LONG_MAX,marginmax=-1,R;
cin >> n;
for(i=0;i<n;i++){
cin >> R;
if(R<min) min=R;
else if(R-min > marginmax) marginmax = R-min;
}
cout << marginmax << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:22: error: 'LONG_MAX' was not declared in this scope
6 | long i,n,min=LONG_MAX,marginmax=-1,R;
| ^~~~~~~~
a.cc:3:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <v... |
s357325259 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s439452590 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s584323204 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s406731947 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s854647347 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s395542576 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s044601865 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s868807514 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s487740381 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s586282374 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.emplace_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto ... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, 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>
+++ |... |
s121520249 | p02258 | C++ | #include <iostream>
#include <vector>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.push_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
{
for (auto j = ... | a.cc: In function 'int main()':
a.cc:14:24: error: 'INT_MIN' was not declared in this scope
14 | int num, 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>
+++ |... |
s242282818 | p02258 | C++ | #include <iostream>
#include <vector>
#include <limits>
template<typename T>
T Input()
{
T value;
std::cin >> value;
return value;
}
int main()
{
int num, max = INT_MIN;
std::vector<int> arr;
std::cin >> num;
for (auto i = 0; i < num; ++i)
arr.push_back(Input<int>());
for (auto i = 0; i < arr.size(); ++i)
... | a.cc: In function 'int main()':
a.cc:15:24: error: 'INT_MIN' was not declared in this scope
15 | int num, max = 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>
+++ |... |
s995061705 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
int m = INT_MAX - 1;
int d = -INT_MAX - 1;
int x;
for (int i = 0; i < n; ++i) {
cin >> x;
if (i == 0) {
m = x;
continue;
}
d = max(d, x - m);
if (x < m) {
m = x;
}
}
... | a.cc: In function 'int main()':
a.cc:10:11: error: 'INT_MAX' was not declared in this scope
10 | int m = INT_MAX - 1;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <algorithm>
+++ |+#include <climits>... |
s799339251 | p02258 | C++ | min = 10**9
difmax=-10**9
cnt=0
n = STDIN.gets.split[0].to_i
0.upto(n-1) {|i|
n = STDIN.gets.split[0].to_i
dif = n - min
if n < min
min = n
end
difmax = dif if dif > difmax
}
p difmax | a.cc:1:1: error: 'min' does not name a type
1 | min = 10**9
| ^~~
a.cc:16:1: error: 'p' does not name a type
16 | p difmax
| ^
|
s808687015 | p02258 | C++ | #!/usr/bin/env python3
# input
n = int(input())
R = []
for i in range(n):
R.append(int(input()))
# calc
maximum = -10**6
for i in range(n):
for j in range(i+1, n):
if R[j] - R[i] > maximum:
maximum = R[j] - R[i]
# output
print(maximum) | a.cc:1:2: error: invalid preprocessing directive #!
1 | #!/usr/bin/env python3
| ^
a.cc:2:3: error: invalid preprocessing directive #input
2 | # input
| ^~~~~
a.cc:8:3: error: invalid preprocessing directive #calc
8 | # calc
| ^~~~
a.cc:15:3: error: invalid preprocessing directive #ou... |
s261454510 | p02258 | C++ | #include <iostream>
using namespace std;
int main()
{
int n;
int i,j;
int *p;
int pro = -1000000000;
int min;
cin >> n;
p = new int [n];
for(i=0;i<n;i++){
cin >> p[i];
}
min = p[0];
for( j=1; j<n; j++ ){
if(max < p[j]-min){
max = p[j] - min;
}
if(min > p[j]){
min = ... | a.cc: In function 'int main()':
a.cc:21:19: error: the value of 'p' is not usable in a constant expression
21 | if(max < p[j]-min){
| ^~~
a.cc:8:8: note: 'p' was not declared 'constexpr'
8 | int *p;
| ^
a.cc:21:8: error: parse error in template argument list
21 | ... |
s366707768 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
int num;
int input;
int lst[200000];
int small;
int large;
int maximum;
cin >> num;
for(int i = 0; i < num; i++)
{
cin >> lst[i];
}
maximum = lst[1] - lst[0];
small = lst[0];
large = lst[0];
for (int i = 0; i < num; i++)
... | a.cc: In function 'int main()':
a.cc:26:28: error: no matching function for call to 'min(<unresolved overloaded function type>, int&)'
26 | small = min(min, lst[i]);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/includ... |
s861893717 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
int num;
int input;
int lst[200000];
int small;
int large;
int maximum;
cin >> num;
for(int i = 0; i < num; i++)
{
cin >> lst[i];
}
maximum = -20000000
small = lst[0];
large = lst[0];
for (int i = 0; i < num; i++)
{
max... | a.cc: In function 'int main()':
a.cc:19:28: error: expected ';' before 'small'
19 | maximum = -20000000
| ^
| ;
20 | small = lst[0];
| ~~~~~
|
s069173840 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n,ans = INT_MIN,minnum = INT_MAX,tmp;
cin >> n;
for(int i= 0;i<n;i++){
cin >> tmp;
if(i!=0) ans = max(ans,tmp - minnum);
minnum = min(tmp,minnum);
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:5:19: error: 'INT_MIN' was not declared in this scope
5 | int n,ans = INT_MIN,minnum = INT_MAX,tmp;
| ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <algor... |
s990681067 | p02258 | C++ | #include <queue>
#include <cstdio>
#include <limits>
#include <algorithm>
int main()
{
int n, MAX = std::numeric_limits<int>::min();
std::queue<int> R;
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
int temp;
scanf("%d", &temp);
R.push(temp)... | a.cc: In function 'int main()':
a.cc:22:17: error: invalid use of member function 'std::queue<_Tp, _Sequence>::size_type std::queue<_Tp, _Sequence>::size() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; size_type = long unsigned int]' (did you forget the '()' ?)
22 | MAX = R.size >... |
s757371683 | p02258 | C++ | #include <stdio.h>
int main(void)
{
int n;
int ans = 0;
scanf("%d", &n);
int r[n];
for(int i = 0; i < n; i++){
scanf("%d", &x[i]);
}
for(int i = 0; i < n; i++){
for(int j = n - 1; j > i; j--){
if(ans < r[j] - r[i]){
ans = r[j] - r[i];
}
}
}
printf("%d\n", ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:10:30: error: 'x' was not declared in this scope
10 | scanf("%d", &x[i]);
| ^
|
s409963895 | p02258 | C++ | #include <stdio.h>
int main(void)
{
int n;
int ans = 0;
scanf("%d", &n);
int r[n];
for(int i = 0; i < n; i++){
scanf("%d", &x[i]);
}
for(int i = 0; i < n; i++){
for(int j = n - 1; j > i; j--){
if(ans < r[j] - r[i]){
ans = r[j] - r[i];
}
}
}
printf("%d\n", ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:10:30: error: 'x' was not declared in this scope
10 | scanf("%d", &x[i]);
| ^
|
s505888858 | p02258 | C++ | #include <stdio.h>
int main(void)
{
int n;
int ans = 0;
scanf("%d", &n);
int r[n];
for(int i = 0; i < n; i++){
scanf("%d", &x[i]);
}
for(int i = 0; i < n; i++){
for(int j = n - 1; j > i; j--){
if(ans < r[j] - r[i]){
ans = r[j] - r[i];
}
}
}
printf("%d\n", ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:10:30: error: 'x' was not declared in this scope
10 | scanf("%d", &x[i]);
| ^
|
s933442452 | p02258 | C++ | #include <stdio.h>
int main(void)
{
int n, ans, min;
scanf("%d", &n);
int r[n];
for(int i = 0; i < n; i++){
scanf("%d", &r[i]);
}
ans = r[1] - r[0];
min = -1000000000;
max = r[0];
for(int i = 0; i < n; i++){
if(min > r[i]){
min = r[i];
}else{
int temp = r[i] - min;
if(ans < temp){
ans = tem... | a.cc: In function 'int main()':
a.cc:13:9: error: 'max' was not declared in this scope
13 | max = r[0];
| ^~~
|
s612622701 | 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++ ) { // ????????§??... | a.cc: In function 'int main()':
a.cc:15:14: error: expected ';' before '-' token
15 | for ( int i - 1; i < n; i++ ) { // ????????§?????? R[i] ?????????????????°??????????????????
| ^~
| ;
a.cc:15:25: error: expected ')' before ';' token
15 | for ( int i - 1; i < n; i++ ... |
s934767646 | p02258 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
int main(){
int n;
std::cin >> n;
if (n == 0)[
std::cout << 0 << std::endl;
return 0;
}
long price, min_price;
long max_diff = -1 * 10e+9;
std::cin >> min_price;
while(std::cin >> price){
min_price = std::min(min_price, price);
... | a.cc: In function 'int main()':
a.cc:9:5: error: capture of non-variable 'std'
9 | std::cout << 0 << std::endl;
| ^~~
In file included from /usr/include/c++/14/bits/requires_hosted.h:31,
from /usr/include/c++/14/iostream:38,
from a.cc:1:
/usr/include/x86_64-linux-gnu/... |
s459916422 | p02258 | C++ | #include <stdio.h>
int main(void)
{
int n, R[200000], i, j, max;
scanf("%d", &n);
for(i = 0; i < n; i++)
scanf("%d", &R[i]);
max = R[1] - R[0]
for(i = 2; i < n; i++){
for(j = 0; j < i; j++){
if (max < R[i] - R[j]){
max = R[i] - R[j];
}
}
}
printf("%d\n", max); | a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before 'for'
12 | max = R[1] - R[0]
| ^
| ;
13 |
14 | for(i = 2; i < n; i++){
| ~~~
a.cc:14:24: error: expected ';' before ')' token
14 | for(i = 2; i < n; i++){
... |
s864282389 | p02258 | C++ | n = int(raw_input())
maxv = -1*10**9
minv = int(raw_input())
for j in range(n-1):
num = int(raw_input())
diff = num - minv
maxv = max(maxv,diff)
minv = min(minv,num)
print maxv | a.cc:1:2: error: 'n' does not name a type
1 | n = int(raw_input())
| ^
|
s712084377 | p02258 | C++ | n = int(raw_input())
max = -10^9
min = 10^9
ans = -10^9
for i in range(n-1):
x[i] = int(raw_input())
for s in range(n-1):
for t in range(n-1):
if ans < (x[n-1-s]-x[n-1-t]):
ans=x[n-1-s]-x[n-1-t]
print ans | a.cc:1:1: error: 'n' does not name a type
1 | n = int(raw_input())
| ^
|
s172758202 | p02258 | C++ | n =int(raw_input())
max= -10^9
for i in range(0,n):
x=int(raw_input())
if min>x:
min=x
if max<(x -min):
max=x-min
print max | a.cc:1:1: error: 'n' does not name a type
1 | n =int(raw_input())
| ^
|
s335146158 | p02258 | C++ | #include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
int n;
cin >> n;
cin.ignore();
vector<int> vr;
for (int i = 0; i < n; i++)
{
int t;
cin >> t;
vr.push_back(t);
}
in... | a.cc: In function 'int main()':
a.cc:36:17: error: 'profitf' was not declared in this scope; did you mean 'profit'?
36 | cout << profitf << endl;
| ^~~~~~~
| profit
|
s612577778 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;
int main(void){
int n;
cin >> n;
int maxv = -2000000000;
int minv = R[0];
for(int i = 1; i < n; i++){
int number;
cin >> number;
maxv = max(maxv, number - minv);
min... | a.cc: In function 'int main()':
a.cc:14:16: error: 'R' was not declared in this scope
14 | int minv = R[0];
| ^
|
s756936408 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;
int main(void){
int n;
// First input, determines how many values there are
cin >> n;
// Initialise max value
int maxv = -2000000000;
// Initialise min value to first element
int min... | a.cc: In function 'int main()':
a.cc:17:16: error: cannot convert 'std::istream' {aka 'std::basic_istream<char>'} to 'int' in initialization
17 | int minv = cin;
| ^~~
| |
| std::istream {aka std::basic_istream<char>}
|
s131650700 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int N;
vector<int> R;
cin >> N;
for(int i=0;i<N;i++) {
int r;
cin >> r;
R.push_back(r);
}
int max_p = R[1] - R[0];
int min_r = R[0];
for(int i=1;i<N;i++) {
min_r = min(min_r,R[i-1]);
max_p = max(max_p,R[i]-... | a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
7 | vector<int> R;
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <algorithm>
+++ |+#include <vector>
3 | using na... |
s739331283 | 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 = -MAX
int minx = R[0]
for ( int i = 1; i < n; i++ ) {
maxv = max(maxv, R[i] - minv)
minv = min(minv, R[i])
cout... | a.cc: In function 'int main()':
a.cc:10:44: error: expected ';' before 'int'
10 | for ( int i = 0; i < n; i++ ) cin >> R[i]
| ^
| ;
11 |
12 | int maxv = -MAX
| ~~~ ... |
s057690251 | 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 = -MAX;
int minx = R[0];
for ( int i = 1; i < n; i++ ) {
... | a.cc: In function 'int main()':
a.cc:16:29: error: 'minv' was not declared in this scope; did you mean 'minx'?
16 | maxv = max(maxv, R[i] - minv);
| ^~~~
| minx
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:6:12: note:... |
s204055669 | 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 = -MAX;
int minv = R[0];
for ( int i = 1; i < n; i++ ) {
... | a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s390229470 | p02258 | C++ | #include "iostream"
using namespace std;
void main() {
int num;
int min;
int sa = -1000000000;
cin >> num;
//????????????????´?
cin >> min;
//2????????\??????????´?
for (int i = 1; i < num; i++) {
int a;
cin >> a;
if (a - min > sa) {
sa = a - min;
}
if (a < min) {
min = a;
}
}
cout <... | a.cc:5:1: error: '::main' must return 'int'
5 | void main() {
| ^~~~
|
s307119064 | p02258 | C++ | n = input()
R = []
for i in range(n):
R.append(input())
min_v = R[0]
max_v = -pow(10, 2)
for i in range(1, n):
temp = R[i] - min_v
if (temp >= max_v):
max_v = temp
temp = R[i]
if (min_v >= temp):
min_v = temp
print max_v | a.cc:1:1: error: 'n' does not name a type
1 | n = input()
| ^
|
s626198539 | p02258 | C++ | #include <iostream>
using namespace std;
int n;
int R[200000];
int maxdR, mdR, dR;
int main(void)
{
cin >> n;
for(int i=0;i<n-1;i++){
dR = R[n-i-1]-R[n-i-2];
if (i==0){
mdR = dR;
maxdR = mdR;
}else{
if (mdR>0){
mdR += dR;
}else{
mdR = dR;
}
if (mdR>maxdR){
maxdR = mdR;
}
}... | a.cc: In function 'int main()':
a.cc:30:17: error: 'dp1' was not declared in this scope
30 | cout << dp1 << endl;
| ^~~
|
s671944566 | p02258 | C++ | #include <iostream>
using namespace std;
int n;
int R[200000];
int maxdR, mdR, dR;
int main(void)
{
cin >> n;
for(int i=0;i<n;i++){
cin >> R[i];
}
for(int i=0;i<n-1;i++){
dR = R[n-i-1]-R[n-i-2];
if (i==0){
mdR = dR;
maxdR = mdR;
}else{
if (mdR>0){
mdR += dR;
}else{
mdR = dR;
}
... | a.cc: In function 'int main()':
a.cc:33:17: error: 'dp1' was not declared in this scope
33 | cout << dp1 << endl;
| ^~~
|
s345203912 | p02258 | C++ | #include <iostream>
using namespace std;
int n;
int R[200000];
int maxdR, mdR, dR;
int main(void)
{
cin >> n;
for(int i=0;i<n;i++){
cin >> R[i];
}
mdR = R[n-i-1]-R[n-i-2];
maxdR = mdR;
for(int i=1;i<n-1;i++){
dR = R[n-i-1]-R[n-i-2];
if (mdR>0){
mdR += dR;
}else{
mdR = dR;
}
if (mdR>maxdR)... | a.cc: In function 'int main()':
a.cc:16:19: error: 'i' was not declared in this scope
16 | mdR = R[n-i-1]-R[n-i-2];
| ^
|
s896227483 | p02258 | C++ | #include <iostream>
using namespace std;
int n;
int r[200005];
int main()
{
cin >>n;
for(int i=0;i<n;i++) cin >> r[i];
int ans = INT_MAX;
int min = r[0];
for(int i=1;i<n;i++) {
if(r[i] - min > ans) ans = r[i]-min;
if(r[i] < min) min = r[i];
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:11: error: 'INT_MAX' was not declared in this scope
12 | int ans = 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>
+++ |+#include <climits>
... |
s780245140 | p02258 | C++ | int n, ans = INT32_MIN;
cin >> n;
int *p = new int[n];
for (int i = 0; i < n; i++) cin >> p[i];
for (int i = n - 1; i > 0; i--) {
for (int j = i - 1; j >= 0; j--) {
if ((p[i] - p[j]) > ans) ans = p[i] - p[j];
}
}
cout << ans << "\n";
delete[] p;
return 0; | a.cc:1:14: error: 'INT32_MIN' was not declared in this scope
1 | int n, ans = INT32_MIN;
| ^~~~~~~~~
a.cc:2:9: error: 'cin' does not name a type
2 | cin >> n;
| ^~~
a.cc:5:9: error: expected unqualified-id before 'for'
5 | for (int i = 0; i < n; i++) cin >> p... |
s425825170 | p02258 | C++ | #include <iostream>
using namespace std;
int main()
{
int n, ans = INT32_MIN;
cin >> n;
int *p = new int[n];
for (int i = 0; i < n; i++) cin >> p[i];
for (int i = n - 1; i > 0; i--) {
for (int j = i - 1; j >= 0; j--) {
if ((p[i] - p[j]) > ans) ans = p[i] - p[j];
}
}
cout << ans << "\n";
delete[] p;
... | a.cc: In function 'int main()':
a.cc:6:22: error: 'INT32_MIN' was not declared in this scope
6 | int n, ans = INT32_MIN;
| ^~~~~~~~~
|
s214800497 | p02258 | C++ | import java.util.Scanner;
public class doll
{
public static void main(String[] args)
{
Scanner In = new Scanner(System.in);
int n;
do
{
n = In.nextInt();
}while(n >= 2 && n >= 200000);
int []a = new int[n];
for(int i = 0; i < n; i++)
{
do
{
a[i] = In.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 doll
| ^~~~~~
|
s787431380 | p02258 | C++ | #include<bits/stdc++.h>
using namespace std;
int N;
int main(){
cin >> N;
int maxi=-1,mini=1000000009;
int res = 0;
for(int i=0;i<N;i++){
int a; cin >> a; maxi = max( maxi,a ); min = min( mini, a );
res = max( res, abs( maxi-a ) , abs( mini-a ) );
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:10:59: error: overloaded function with no contextual type information
10 | int a; cin >> a; maxi = max( maxi,a ); min = min( mini, a );
| ^
In file included from /usr/include/c++/14/algorithm:60,
fro... |
s846407661 | p02258 | C++ | #include<bits/stdc++.h>
using namespace std;
int N;
int main(){
cin >> N;
int maxi=-1,mini=1000000009;
int res = 0;
for(int i=0;i<N;i++){
int a; cin >> a; maxi = max( maxi,a ); mini = min( mini, a );
res = max( res, abs( maxi-a ) , abs( mini-a ) );
}
cout << res << endl;
} | In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int... |
s976086452 | p02258 | C++ | #include<bits/stdc++.h>
using namespace std;
int N;
int main(){
cin >> N;
int mini=1000000009;
int res = -mini;
for(int i=0;i<N;i++){
res = max( res, a-mini );
int a; cin >> a; mini = min( mini, a );
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'a' was not declared in this scope
10 | res = max( res, a-mini );
| ^
|
s785133934 | p02258 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
int main(){
cin >> N;
ll mini=LLONGMAX;
ll res = -mini;
for(int i=0;i<N;i++){
int a; cin >> a;
res = max( res, a-mini );
mini = min( mini, a );
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'LLONGMAX' was not declared in this scope; did you mean 'LLONG_MAX'?
7 | ll mini=LLONGMAX;
| ^~~~~~~~
| LLONG_MAX
a.cc:12:11: error: no matching function for call to 'min(ll&, int&)'
12 | mini = min( mini, a );
| ~~~^~~~~~~... |
s363477908 | p02258 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
int main(){
cin >> N;
cin >> mini;
ll res = -1000000000000LL;
for(int i=1;i<N;i++){
int a; cin >> a;
res = max( res, a-mini );
mini = min( mini, a );
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:7:8: error: 'mini' was not declared in this scope
7 | cin >> mini;
| ^~~~
|
s190282442 | p02258 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
int main(){
cin >> N;
cin >> mini;
ll res = -1000000000000LL;
for(int i=1;i<N;i++){
int a; cin >> a;
res = max( res, a-mini );
mini = min( mini, (ll)a );
}
cout << res << endl;
} | a.cc: In function 'int main()':
a.cc:7:8: error: 'mini' was not declared in this scope
7 | cin >> mini;
| ^~~~
|
s391111872 | p02258 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
int main() {
int minv=2000000, maxv=-2000000;
int itmp=0, p=0, p0=0;
scnaf("%d",&p0);
while (p0>p) {
scanf("%d",itmp);
max(maxv,itmp-minv);
min(minv,itmp);
p++;
}
printf("%d",maxv);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
8 | scnaf("%d",&p0);
| ^~~~~
| scanf
a.cc:11:20: warning: ignoring return value of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]', declared wit... |
s022894187 | p02258 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
int main() {
int minv=2000000, maxv=-2000000;
int itmp=0, p=0, p0=0;
scnaf("%d",&p0);
while (p0>p) {
scanf("%d",&itmp);
max(maxv,itmp-minv);
min(minv,itmp);
p++;
}
printf("%d",maxv);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
8 | scnaf("%d",&p0);
| ^~~~~
| scanf
a.cc:11:20: warning: ignoring return value of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]', declared wit... |
s510768833 | p02258 | C++ | #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int N,*A;
cin >> N;
A = (int *)malloc(sizeof(int)*N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
int min = 200000;
int plf = -200000;
for (int i = 1; i < N; i++) {... | a.cc: In function 'int main()':
a.cc:21:21: error: 'l' was not declared in this scope
21 | if (min > A[l-1]) min = A[l-1];
| ^
a.cc:22:14: error: 'l' was not declared in this scope
22 | if(A[l] - min > plf) plf = A[l] - min;
| ^
|
s835233544 | p02258 | C++ | #include "stdafx.h"
#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main()
{
int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
cin >> n;
int *r = new int[n];
for (int i = 0; i < n; i++) {
cin >> r[i];
if (i == 0) minv = r[i];
else {
maxd = max(maxd, r[i] - minv);
minv ... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s419976506 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
cin >> n;
int *r = new int[n];
for (int i = 0; i < n; i++) {
cin >> r[i];
if (i == 0) minv = r[i];
else {
maxd = max(maxd, r[i] - minv);
minv = min(minv, r[i]);
}
}
cout << max... | a.cc: In function 'int main()':
a.cc:7:23: error: 'INT_MAX' was not declared in this scope
7 | int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #in... |
s075283988 | p02258 | C++ | #include "stdafx.h"
#include <iostream>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cctype>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <regex>
using namespace std;
int main()
{
int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
cin >> n;
int *r = new ... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s965137155 | p02258 | C++ | #include "stdafx.h"
#include <iostream>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cctype>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <regex>
using namespace std;
int main()
{
int n, minv = INT_MAX, maxd = INT_MIN, dis = 0;
cin >> n;
int *r = new ... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.