submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s372084398 | p02258 | C | #include<stdio.h>
#define TMIN 2
#define TMAX 200000
#define nMIN 1
#define nMAX 1000000
int main(){
int n[nMAX],Time,i,max=0,sub;
scanf("%d",&Time);
if(TMIN<=Time&&Time<=TMAX){
for(i=0;i<Time;i++){
scanf("%d",&n[i]);
if(nMINE<=n[i]&&n[i]<=nMAX)
}
max=n[i-1];
sub=n[i-1]-n[i-2];
for(i=Time-2;i>=0;i--){
if(max<n[i]&... | main.c: In function 'main':
main.c:16:4: error: 'nMINE' undeclared (first use in this function); did you mean 'nMIN'?
16 | if(nMINE<=n[i]&&n[i]<=nMAX)
| ^~~~~
| nMIN
main.c:16:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:1: error: expected expr... |
s107080333 | p02258 | C | #include<stdio.h>
#define TMIN 2
#define TMAX 200000
#define nMIN 1
#define nMAX 1000000
int main(){
int n[nMAX],Time,i,max=0,sub;
scanf("%d",&Time);
if(TMIN<=Time&&Time<=TMAX){
for(i=0;i<Time;i++){
scanf("%d",&n[i]);
if(nMINE<=n[i]&&n[i]<=nMAX)
}
max=n[i-1];
sub=n[i-1]-n[i-2];
for(i=Time-2;i>=0;i--){
if(max<n[i]&... | main.c: In function 'main':
main.c:16:4: error: 'nMINE' undeclared (first use in this function); did you mean 'nMIN'?
16 | if(nMINE<=n[i]&&n[i]<=nMAX)
| ^~~~~
| nMIN
main.c:16:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:1: error: expected expr... |
s167740304 | p02258 | C | #include<stdio.h>
#define TMIN 2
#define TMAX 200000
#define nMIN 1
#define nMAX 1000000
int main(){
int n[nMAX],Time,i,max=0,sub;
scanf("%d",&Time);
if(TMIN<=Time&&Time<=TMAX){
for(i=0;i<Time;i++){
scanf("%d",&n[i]);
if(nMINE<=n[i]&&n[i]<=nMAX)exit(1);
}
max=n[i-1];
sub=n[i-1]-n[i-2];
for(i=Time-2;i>=0;i--){
if(m... | main.c: In function 'main':
main.c:16:4: error: 'nMINE' undeclared (first use in this function); did you mean 'nMIN'?
16 | if(nMINE<=n[i]&&n[i]<=nMAX)exit(1);
| ^~~~~
| nMIN
main.c:16:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:28: error: impl... |
s073939357 | p02258 | C | #include<stdio.h>
#define TMIN 2
#define TMAX 200000
#define nMIN 1
#define nMAX 1000000
int main(){
int n[nMAX],Time,i,max=0,sub;
scanf("%d",&Time);
if(TMIN<=Time&&Time<=TMAX){
for(i=0;i<Time;i++){
scanf("%d",&n[i]);
if(nMINE>=n[i]||n[i]>=nMAX)exit(1);
}
max=n[i-1];
sub=n[i-1]-n[i-2];
for(i=Time-2;i>=0;i--){
if(m... | main.c: In function 'main':
main.c:16:4: error: 'nMINE' undeclared (first use in this function); did you mean 'nMIN'?
16 | if(nMINE>=n[i]||n[i]>=nMAX)exit(1);
| ^~~~~
| nMIN
main.c:16:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:28: error: impl... |
s070573202 | p02258 | C | #include<stdio.h>
#define TMIN 2
#define TMAX 200000
#define nMIN 1
#define nMAX 1000000000
int main(){
int n[nMAX],Time,i,max=0,sub;
scanf("%d",&Time);
if(TMIN<=Time&&Time<=TMAX){
for(i=0;i<Time;i++){
scanf("%d",&n[i]);
if(nMINE>n[i]||n[i]>nMAX)exit(1);
}
max=n[i-1];
sub=n[i-1]-n[i-2];
for(i=Time-2;i>=0;i--){
if(... | main.c: In function 'main':
main.c:16:4: error: 'nMINE' undeclared (first use in this function); did you mean 'nMIN'?
16 | if(nMINE>n[i]||n[i]>nMAX)exit(1);
| ^~~~~
| nMIN
main.c:16:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:26: error: implic... |
s123066196 | p02258 | C | #include<stdio.h>
#define nMIN 2
#define nMAX 200000
#define RtMIN 1
#define RtMAX 1000000000
int main(){
int n[nMAX],Time,i,max=0,sub;
scanf("%d",&Time);
if(TMIN<=Time&&Time<=TMAX){
for(i=0;i<Time;i++){
scanf("%d",&n[i]);
//if(nMIN>n[i]||n[i]>nMAX)exit(1);
}
max=n[i-1];
sub=n[i-1]-n[i-2];
for(i=Time-2;i>=0;i--){
... | main.c: In function 'main':
main.c:13:4: error: 'TMIN' undeclared (first use in this function); did you mean 'nMIN'?
13 | if(TMIN<=Time&&Time<=TMAX){
| ^~~~
| nMIN
main.c:13:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:22: error: 'TMAX' undecla... |
s011017983 | p02258 | C | #include<stdio.h>
#include<stdlib.h>
int main() {
int i,j,a[200000],max=0;
scanf("%d",&n);
if(n<2 || 2000000<n) exit(0);
for(i=0;i<n;i++) {
scanf("%d",&a[i]);
if(a[i]<1 || 1000000000<a[I]) exit(0);
}
max=a[1]-a[0];
for(i=0;i<n;i++) {
for(j=1;j<n;j++) {
if(a[j]-a[i]>max)
max=a[j]-a[i];
}
}
printf("%d",ma... | main.c: In function 'main':
main.c:6:15: error: 'n' undeclared (first use in this function)
6 | scanf("%d",&n);
| ^
main.c:6:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:35: error: 'I' undeclared (first use in this function)
11 | ... |
s083001116 | p02258 | C | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s347518115 | p02258 | C | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int a[1000000], n;
int main()
{
cin >> n;
for(int i = 0; i < n; i++) cin >> a[i];
int ans = INT_MIN, m = a[0];
for(int i = 1; i < n; i++) ans = max(ans, a[i] - m), m = min(m, a[i]) ;
if(ans < 0) ans = -1;
cout << ans << endl;
r... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s876077235 | p02258 | C | #include <stdio.h>
int main(){
int A[2000000],i,n,maxv,minv;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
maxv=A[1]-A[0]
minv=A[0];
for(i=1;i<n;i++){
if(maxv<A[i]-minv)
maxv=A[i]-minv;
if(minv>A[i])minv=A[i];
}
printf("%d\n",maxv);
return 0;
}
| main.c: In function 'main':
main.c:9:17: error: expected ';' before 'minv'
9 | maxv=A[1]-A[0]
| ^
| ;
10 | minv=A[0];
| ~~~~
|
s485302317 | p02258 | C | #include <stdio.h>
int main(void) {
int n,i,j,r[200001],max = -999999999,min = 999999999;
scanf(" %d",&n);
for(i = 0; i < n; i++)scanf(" %d",&r[i]);
for(i = 0; i < n - 1; i++){
if(min > r[i])min = r[i];
if(max < r[i])max = r[i];
if(max - min > dif)dif = max - min;
}
printf("%d\n",max);
}
| main.c: In function 'main':
main.c:11:20: error: 'dif' undeclared (first use in this function)
11 | if(max - min > dif)dif = max - min;
| ^~~
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
|
s319099553 | p02258 | C | *最大の利益*/
#include <stdio.h>
#define N 200000
int main(){
int i, j, n, max;
int a[N];
scanf("%d" ,&n);
for (i=0; i<n; i++){
scanf("%d", &a[i]);
}
max = a[1]-a[0];
for (i=0; i<n; i++){
for (j=i+1; j<n; j++){
if (a[j]-a[i] > max)
max = a[j]-a[i];
}
}
printf("%d\n", max);
... | main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
1 | *最大の利益*/
| ^
In file included from /usr/include/stdio.h:47,
from main.c:2:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
28 | ... |
s352032158 | p02258 | C | include <stdio.h>
#define N 200005
int main(void){
int n,r[N],i,j,d,c,max,min;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&r[i]);
}
max=1;
min=1000000000;
d=r[1]-r[0];
for(i=1;i<n;i++){
if(r[i]>max){
max=r[i];
for(j=0;j<i;j++){
if(r[j]<min){
min=r[j];
}
}
c=max-m... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s532480927 | p02258 | C | #include <stdio.h>
main(){
int count;
int i,j;
int R[20;
int max;
scanf("%d",&count);
if(count<2)return 0;
for(i=0;i<count;i++){
scanf("%d",&R[i]);
}
max=R[1]-R[0];
for(i=1;i<count;i++){
for(j=2;j<count;j++){
if(j<i)continue;
else if(max<R[j]-R[i])max=R[j]-R[i];
}
}
... | main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:11: error: expected ']' before ';' token
6 | int R[20;
| ^
| ]
main.c:28:1: error: expected declaration or statement at end of input
28 | }
|... |
s348713683 | p02258 | C | #include<iostream>
using namespace std;
#define NMAX 200000
int main(){
int N;
long long R[NMAX];
long long max[NMAX];
long long ans;
cin>>N;
for(int i=0;i<N;i++){
cin>>R[i];
}
max[N-1]=-1;
max[N-2]=R[N-1];
for(int i=N-3;i>=0;i--){
if(max[i+1]<R[i+1]) max[i]=R[i+1];
else max[i]=max[i+1];
}
ans... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s502293753 | p02258 | C | #include<stdio.h>
int main(){
int i,j,n,Max=0;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
for(i=n;i>1;i--){
for(j=i-1;j>0;j--){
if(A[i]>A[j]){
if(Max<A[i]-A[j]){
Max=A[i]-A[j}
}
}
printf("%d\n",Max);
return 0;
}
| main.c: In function 'main':
main.c:15:37: error: expected ']' before '}' token
15 | Max=A[i]-A[j}
| ^
| ]
main.c:15:37: error: expected ';' before '}' token
15 | Max=A[i]-A[j}
... |
s545099236 | p02258 | C | #include<stdio.h>
int main(){
int i,j,n,Max=0;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
for(i=n;i>1;i--){
for(j=i-1;j>0;j--){
if(A[i]>A[j]){
if(Max<A[i]-A[j]){
Max=A[i]-A[j};
}
}
printf("%d\n",Max);
return 0;
}
| main.c: In function 'main':
main.c:15:37: error: expected ']' before '}' token
15 | Max=A[i]-A[j};
| ^
| ]
main.c:15:37: error: expected ';' before '}' token
15 | Max=A[i]-A[j};
... |
s537691897 | p02258 | C | #include<stdio.h>
int main(){
int i,j,n,Max=0;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
for(i=n;i>1;i--){
for(j=i-1;j>0;j--){
if(A[i]>A[j]){
if(Max<A[i]-A[j]){
Max=A[i]-A[j];
}
}
printf("%d\n",Max);
return 0;
}
| main.c: In function 'main':
main.c:20:17: error: expected declaration or statement at end of input
20 | }
| ^
main.c:20:17: error: expected declaration or statement at end of input
|
s346606009 | p02258 | C | #include<stdio.h>
int main(){
int i,j,n,Max=0;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
for(i=n;i>1;i--){
for(j=i-1;j>0;j--){
if(A[i]>A[j]){
if(Max<A[i]-A[j]){
Max=A[i]-A[j];}
}
}
printf("%d\n",Max);
return 0;
}
| main.c: In function 'main':
main.c:20:17: error: expected declaration or statement at end of input
20 | }
| ^
|
s130596127 | p02258 | C |
#include<stdio.h>
int main(){
int i,j,n,Max,min;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
mini=A[1];
Max=A[2]-A[1];
for(i=n;i>2;i--){
for(j=i;j>1;j--){
if(mini<A[i]){ mini=A[i];
if(A[i]>A[j-1]){
if(Max<A[i]-A[j-1]){
Max=A[i]-A[j-1];}}
}
}}
printf("%d... | main.c: In function 'main':
main.c:12:9: error: 'mini' undeclared (first use in this function); did you mean 'min'?
12 | mini=A[1];
| ^~~~
| min
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
|
s044593828 | p02258 | C |
#include<stdio.h>
int main(){
int i,j,n,Max,min;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
mini=A[1];
Max=A[2]-A[1];
for(i=n;i>2;i--){
for(j=i;j>1;j--){
if(min<A[i]){
mini=A[i];
if(A[i]>A[j-1]){
if(Max<A[i]-A[j-1]){
Max=A[i]-A[j-1];}}
}
}}
printf("%d\n",Max)... | main.c: In function 'main':
main.c:12:9: error: 'mini' undeclared (first use in this function); did you mean 'min'?
12 | mini=A[1];
| ^~~~
| min
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
|
s303643232 | p02258 | C |
#include<stdio.h>
int main(){
int i,j,n,Max,min;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
min=A[1];
Max=A[2]-A[1];
for(i=n;i>2;i--){
for(j=i;j>1;j--){
if(min<A[i]){
mini=A[i];
if(A[i]>A[j-1]){
if(Max<A[i]-A[j-1]){
Max=A[i]-A[j-1];}}
}
}}
printf("%d\n",Max);... | main.c: In function 'main':
main.c:17:1: error: 'mini' undeclared (first use in this function); did you mean 'min'?
17 | mini=A[i];
| ^~~~
| min
main.c:17:1: note: each undeclared identifier is reported only once for each function it appears in
|
s417207289 | p02258 | C | #include <stdio.h>
int main(void) {
int i, n, val, tmin, trange;
scanf("%d\n", &n);
scanf("%d\n", &tmin);
for(i=1,trange=INT_MIN;i<size;i++) {
scanf("%d\n", &val);
if(tmin > val) {
tmin = val;
} else if(trange < val-tmin) {
trange = val - tmin;
}
}
printf("%d\n", trange);
return 0;
} | main.c: In function 'main':
main.c:8:24: error: 'INT_MIN' undeclared (first use in this function)
8 | for(i=1,trange=INT_MIN;i<size;i++) {
| ^~~~~~~
main.c:2:1: note: 'INT_MIN' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>'
1 | #i... |
s462223138 | p02258 | C | #include<stdio.h>
int main(){
int i,j,n,Max=0;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
//Max=A[2]-A[1];
for(i=n;i>2;i--){
for(j=i;j>1;j--){
//if(A[j-1]<A[1]){
if(A[i]>A[j-1]){
if(Max<A[i]-A[j-1... | main.c:21:20: error: expected declaration specifiers or '...' before string constant
21 | printf("%d\n",Max);
| ^~~~~~
main.c:21:27: error: unknown type name 'Max'
21 | printf("%d\n",Max);
| ^~~
main.c:22:13: error: expected identifi... |
s298184107 | p02258 | C | #include<stdio.h>
int main(){
long int i,j,n,Max,count=0;
long int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
//Max=A[2]-A[1];
for(i=n;i>=2;i--){
if(count==1) break;
for(j=i;j>1;j--){
if(A[i]>A[j-1]){
Max=A[i]-A[j... | main.c:26:4: error: expected identifier or '(' before 'for'
26 | for(i=n;i>=2;i--){
| ^~~
main.c:26:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
26 | for(i=n;i>=2;i--){
| ^~
main.c:26:18: error: expected '=', ',', ';', 'asm' or '__attribute__' befo... |
s812586836 | p02258 | C | #include<stdio.h>
int main(){
long int i,j,n,Max,key=0,count=0;
long int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
Max=A[2]-A[1];
for(i=n;i>=2;i--){
//if(A[i]>Max){
for(j=i;j>1;j--){
if(count==0){
if(Max<A[i]-A[j-1]){
Ma... | main.c: In function 'main':
main.c:30:9: error: expected declaration or statement at end of input
30 | }
| ^
|
s572113484 | p02258 | C | #include<stdio.h>
int main(){
long int i,j,n,Max,key=0,count=0;
long int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
Max=A[2]-A[1];
for(i=n;i>=2;i--){
for(j=i;j>1;j--){
if(count==0){
if(Max<A[i]-A[j-1]){
Max=A[i]-A[j-1];
key=... | main.c: In function 'main':
main.c:30:9: error: expected declaration or statement at end of input
30 | }
| ^
main.c:30:9: error: expected declaration or statement at end of input
|
s266019231 | p02258 | C | #include<stdio.h>
#include<iostream>
int main(){
int N,i,j;
long long int R[200000],m=0;
scanf("%d",&N);
for(i=0;i<N;++i)scanf("%d",&R[i]);
for(i=0;i<N;++i){
for(j=i;j<N;++j){
if(R[j]-R[i]>m)m=R[j]-R[i];
}
}
printf("%d\n",m);
} | main.c:2:9: fatal error: iostream: No such file or directory
2 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s333748916 | p02258 | C | #include<stdio.h>
int main(){
int i,j,n,Max,key=0,count=1;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
Max=A[2]-A[1];
key2=A[n];
for(i=n;i>=2;i--){
if(key2<=A[i]){
for(j=i,count=1;j>1;j--){
if(key>A[j-1]){
if(Max<A[i]-A[j-1]){
... | main.c: In function 'main':
main.c:13:2: error: 'key2' undeclared (first use in this function); did you mean 'key'?
13 | key2=A[n];
| ^~~~
| key
main.c:13:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:13: error: expected declaration or statement at... |
s853834963 | p02258 | C | #include<stdio.h>
int main(){
int i,j,n,Max,key=0,count=1;
int A[200001];
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d",&A[i]);
}
Max=A[2]-A[1];
key2=A[n];
for(i=n;i>=2;i--){
if(key2<=A[i]){
for(j=i,count=1;j>1;j--){
if(key>A[j-1]){
if(Max<A[i]-A[j-1]){
... | main.c: In function 'main':
main.c:13:2: error: 'key2' undeclared (first use in this function); did you mean 'key'?
13 | key2=A[n];
| ^~~~
| key
main.c:13:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:13: error: expected declaration or statement at... |
s529279782 | p02258 | C | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
long[] data = new long[n];
long max = 0;
for(int i = 0 ; i < n ; i++){
data[i]=scan.nextInt();
}
for(int i = n-1 ; i >= 0 ; i --){
for(int j = 0 ; j ... | main.c:1:1: error: unknown type name 'import'
1 | import java.util.Scanner;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.Scanner;
| ^
main.c:2:1: error: unknown type name 'public'
2 | public class Main {
| ^~... |
s959570523 | p02258 | C++ | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int a[N], min, max;
for (int i=0; i<N; i++)
cin >> a[i];
max = INT_MIN;
min = a[0];
for (int i=1; i<N; i++) {
max = (max < a[i]-min)? a[i]-max: max;
min = (min > a[i])? a[i]: min;
}
cout << max << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:15: error: 'INT_MIN' was not declared in this scope
12 | max = INT_MIN;
| ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include <iostream>
+++ |+#include <climi... |
s576793536 | p02258 | C++ | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int a[N], min, max;
for (int i=0; i<N; i++)
cin >> a[i];
max = numeric_limits<int>::min();
min = a[0];
for (int i=1; i<N; i++) {
max = (max < a[i]-min)? a[i]-max: max;
min = (min > a[i])? a[i]: min;
}
cout << max << endl;
retu... | a.cc: In function 'int main()':
a.cc:12:15: error: 'numeric_limits' was not declared in this scope
12 | max = numeric_limits<int>::min();
| ^~~~~~~~~~~~~~
a.cc:12:30: error: expected primary-expression before 'int'
12 | max = numeric_limits<int>::min();
| ... |
s423711308 | p02258 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<long> nums(n);
for (int i = 0; i < n; i++) cin >> nums[i];
int ans = 0;
for (int i = 0; i < n - 1; i++) {
for (int j = i + 1; j < n; j++) {
ans = max(ans, nums[j] - nums[i]);
... | a.cc: In function 'int main()':
a.cc:16:22: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
16 | ans = max(ans, nums[j] - nums[i]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/1... |
s310867965 | p02258 | C++ | using namespace std;
int main()
{
int n;
vector<int> r;
//input
cin>>n; r.resize(n);
for(int i=0;i<n;i++) cin>>r[i];
//process
int max=-INT_MAX;
int minR=INT_MAX;
int dif;
for(int i=0;i<n;i++){
if(r[i]<minR){
minR=r[i];
for(int j=i+1;j<n;j++){
dif=r[j]-r[i];
if(dif<max) brea... | a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
5 | vector<int> r;
| ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
+++ |+#include <vector>
1 | using namespace std;
a.cc:5:10: error... |
s531438314 | p02258 | C++ | √#include<iostream>
using namespace std;
int Max = 200000;
int main(){
int A[Max], n, i;
int maxv, minv;
cin >> n;
for(i = 0; i < n; i++) {
cin >> A[i];
}
maxv = A[1] - A[0];
minv = A[0];
for(i = 1; i < n; i++) {
maxv = (maxv > (A[i] - minv))?maxv:(A[i] - minv);
minv = (minv < A[i])?minv... | a.cc:1:1: error: extended character √ is not valid in an identifier
1 | √#include<iostream>
| ^
a.cc:1:2: error: stray '#' in program
1 | √#include<iostream>
| ^
a.cc:1:1: error: '\U0000221a' does not name a type
1 | √#include<iostream>
| ^
a.cc: In function 'int main()':
a.cc:9:3: error:... |
s964247797 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespase std;
static const int MAX = 200000;
int main(){
int R[MAX], n;
cin >> n;
for( int i = 0; i < n; i++ ) cin >> R[i];
int maxv = -2000000000; //十分小さい値を初期値に設定
int minv = R[0];
for( int i = 1; i < n; i++ ){ //ここで毎回R[i]を読み込めば配列は不要
... | a.cc:3:7: error: expected nested-name-specifier before 'namespase'
3 | using namespase std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:5: 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:... |
s182699171 | p02258 | C++ | n=int(raw_input().strip())
lst=[]
minval=0x3f3f3f3f
ans=-0x3f3f3f3f
for i in xrange(n):
val=int(raw_input().strip())
if(i>1):
#print val,minval
ans=max(ans,val-minval)
minval = min(minval, val)
print ans
| a.cc:8:10: error: invalid preprocessing directive #print
8 | #print val,minval
| ^~~~~
a.cc:1:1: error: 'n' does not name a type
1 | n=int(raw_input().strip())
| ^
|
s376975787 | p02258 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long int n,a,b=-1000000000,s,i;
cin>>n>>s;
for(a=s,i=1;i<n;i++){
cin>>s;
b=max(b,s-a);
a=min(a,s);
}
cout<<b<<endl;
}
| a.cc:4:1: error: extended character is not valid in an identifier
4 | long int n,a,b=-1000000000,s,i;
| ^
a.cc:4:1: error: extended character is not valid in an identifier
a.cc:5:1: error: extended character is not valid in an identifier
5 | cin>>n>>s;
| ^
a.cc:5:1: error: extended charact... |
s262816813 | p02258 | C++ | #include<stdio.h>
int a[200000];
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
int minl=a[1];
int maxl=-1000000000;
for(int i=2;i<=n;i++)
{
if((a[i]-minl)>maxl)
{
maxl=a[i]-minl;
}
if(a[i]<minl)
{
minl=a[i];
}
}
printf("%d\n",maxl);
return 0;
}
| a.cc:13:1: error: extended character is not valid in an identifier
13 |
| ^
a.cc:22:1: error: extended character is not valid in an identifier
22 | minl=a[i];
| ^
a.cc:26:1: error: extended character is not valid in an identifier
26 |
| ^
a.cc: In function 'int main()':
a.cc:13:1: ... |
s348065103 | p02258 | C++ | #include <iostream>
#include <algorithm>
static const int MAX_PROFIT = -2000000000;
static const int MAX_NUN = 200000;
int main(int argc, char const *argv[])
{
int R[MAX_NUM], n;
std::cin >> n;
for(int i = 0;i < n;i++) std::cin >> R[n];
int maxv = MAX_PROFIT;
int minv = R[0];
for(int i... | a.cc: In function 'int main(int, const char**)':
a.cc:9:11: error: 'MAX_NUM' was not declared in this scope; did you mean 'MAX_NUN'?
9 | int R[MAX_NUM], n;
| ^~~~~~~
| MAX_NUN
a.cc:13:42: error: 'R' was not declared in this scope
13 | for(int i = 0;i < n;i++) std::cin >> R... |
s867102074 | p02258 | C++ | // 時系列
// 計算量 O(n^2) のアルゴリズムを避ける
#include <iostream>
using namespace std;
auto larger(int j, int k) {
if (j >= k)
return j;
else
return k;
}
auto smaller(int j, int k) {
if (j <= k)
return j;
else
return k;
}
int main() {
int n, minv, maxv;
array<int> R;
cin >> n;
for (auto it = 0; i... | a.cc: In function 'int main()':
a.cc:23:12: error: wrong number of template arguments (1, should be 2)
23 | array<int> R;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale... |
s280683450 | p02258 | C++ | // 時系列
// 計算量 O(n^2) のアルゴリズムを避ける
#include <iostream>
using namespace std;
auto larger(int j, int k) {
if (j >= k)
return j;
else
return k;
}
auto smaller(int j, int k) {
if (j <= k)
return j;
else
return k;
}
int main() {
int n, minv, maxv;
array<int> R;
cin >> n;
for (auto it = 0; i... | a.cc: In function 'int main()':
a.cc:23:12: error: wrong number of template arguments (1, should be 2)
23 | array<int> R;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale... |
s702301874 | p02258 | C++ | // 時系列
// 計算量 O(n^2) のアルゴリズムを避ける
#include <iostream>
using namespace std;
int larger(int j, int k) {
if (j >= k)
return j;
else
return k;
}
int smaller(int j, int k) {
if (j <= k)
return j;
else
return k;
}
int main() {
int n, minv, maxv;
array<int> R;
cin >> n;
for (auto it = 0; it ... | a.cc: In function 'int main()':
a.cc:23:12: error: wrong number of template arguments (1, should be 2)
23 | array<int> R;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale... |
s591088753 | p02258 | C++ | // 時系列
// 計算量 O(n^2) のアルゴリズムを避ける
#include <iostream>
using namespace std;
int larger(int j, int k) {
if (j >= k)
return j;
else
return k;
}
int smaller(int j, int k) {
if (j <= k)
return j;
else
return k;
}
int main() {
int n, minv, maxv;
int R[];
cin >> n;
for (auto it = 0; it < n; ... | a.cc: In function 'int main()':
a.cc:23:7: error: storage size of 'R' isn't known
23 | int R[];
| ^
|
s311296068 | p02258 | C++ | //cで提出 事故る
#include<iostream>
#include<algorithm> //min,max
static const int MAX = 200000;
//static 存在し続ける
//const 値を書き換えない
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; ... | a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
12 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked... |
s548398201 | p02258 | C++ | //cで提出 事故る
#include<iostream>
#include<algorithm> //min,max
usint namespace std; //cin cout
static const int MAX = 200000;
//static 存在し続ける
//const 値を書き換えない
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];... | a.cc:4:1: error: 'usint' does not name a type; did you mean 'uint'?
4 | usint namespace std; //cin cout
| ^~~~~
| uint
a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
13 | cin >> n;
| ^~~
| std::cin
In file inclu... |
s148862576 | p02258 | C++ | #include<iostream>
using namespace std;
int main(){
long long n,r,maxv=-1000000000,min=1000000000;
cin >> n;
for (int i=0;i<n;i++) {
cin >> r;
if (r > max) max = r-min
if (r < min) min = r
}
cout << max << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator>'
10 | if (r > max) max = r-min
| ~~^~~~~
a.cc:10:30: error: overloaded function with no contextual type information
10 | i... |
s581642021 | p02258 | C++ | #include<iostream>
using namespace std;
int main(){
long n,r,maxv=-1000000000,min=1000000000;
cin >> n;
for (int i=0;i<n;i++) {
cin >> r;
if (r > max) max = r-min
if (r < min) min = r
}
cout << max << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: invalid operands of types 'long int' and '<unresolved overloaded function type>' to binary 'operator>'
10 | if (r > max) max = r-min
| ~~^~~~~
a.cc:10:30: error: overloaded function with no contextual type information
10 | if (r ... |
s556124009 | p02258 | C++ | #include<iostream>
using namespace std;
int main(){
int n,maxn=200000,r[maxn];
cin >> n;
for( int i=0; i<n; i++) cin >> r[i];
int maxv = -1000000000;
int minv = 1000000000
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:14:5: error: expected ',' or ';' before 'for'
14 | for( int i=0; i<n; i++ ) {
| ^~~
a.cc:14:19: error: 'i' was not declared in this scope
14 | for( int i=0; i<n; i++ ) {
| ^
|
s954525531 | p02258 | C++ | #include "stdio.h"
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
int a[200000], n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int maxv = -2000000;
int minv = a[0];
for (int i = 0; i < n; i++) {
maxv = max(maxv, a[i] - minv);
minv = min(minv, a[i]);
}... | a.cc: In function 'int main()':
a.cc:21:3: error: 'cont' was not declared in this scope; did you mean 'const'?
21 | cont << maxv << endl;
| ^~~~
| const
|
s072655018 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main() {
int a[200000], n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int maxv = -2000000;
int minv = a[0];
for (int i = 0; i < n; i++) {
maxv = max(maxv, a[i] - minv);
minv = min(minv, a[i]);
}
cont << maxv <<... | a.cc: In function 'int main()':
a.cc:20:3: error: 'cont' was not declared in this scope; did you mean 'const'?
20 | cont << maxv << endl;
| ^~~~
| const
|
s185532700 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main() {
int R[200000], n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> R[i];
}
int maxv = -2000000;
int minv = R[0];
for (int i = 0; i < n; i++) {
maxv = max(maxv, R[i] - minv);
minv = min(minv, R[i]);
}
cont << maxv <<... | a.cc: In function 'int main()':
a.cc:20:3: error: 'cont' was not declared in this scope; did you mean 'const'?
20 | cont << maxv << endl;
| ^~~~
| const
|
s106266804 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 200000;
int main(){
int R[MAX], n;
cin >> n;
for(int i = 0;i < n;i++) cin >> R[i];
int maxv = -2000000000;
int minv = R[0];
for(int i = 1;i < n;i++)
{
maxv = max(maxv, R[i] - minv);
minv = min(minv, R[i]);
}
cout << ma... | a.cc: In function 'int main()':
a.cc:19:25: error: 'end1' was not declared in this scope
19 | cout << maxv << end1;
| ^~~~
|
s717545605 | 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 = -1e10;
int minv = R[0];
for (int i = 0; i < n; i++) {
maxv = max(maxv, R[i] - minv);
minv =... | a.cc:24:1: error: unterminated comment
24 | /*
| ^
a.cc: In function 'int main()':
a.cc:12:16: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+10' to '-2147483648' [-Woverflow]
12 | int maxv = -1e10;
| ^~~~~
|
s738053869 | p02258 | C++ | n = int(input())
ls = [int(input()) for _ in range(n)]
small = 200000
big = 0
for i in range(len(ls)-1):
if ls[i] < small:
small = ls[i]
big = ls[i+1]
if ls[i+1] > big:
big = ls[i+1]
print(big-small)
| a.cc:1:1: error: 'n' does not name a type
1 | n = int(input())
| ^
|
s817687922 | 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 = 0; //制約を下回る値
int minv = R[0];
//max()は2つの引数のうち大きい方を、
//min()は小さい方を返す
for(int i = 1;i < n;i++){ //毎回R[i]を読み込... | a.cc: In function 'int main()':
a.cc:7:11: error: 'Max' was not declared in this scope; did you mean 'MAX'?
7 | int R[Max], n;
| ^~~
| MAX
a.cc:10:36: error: 'R' was not declared in this scope
10 | for(int i = 0;i < n;i++)cin >> R[i];
| ... |
s681426524 | p02258 | C++ | #include <iostream>
using namespace std;
static const int MAX =200000;
int main()
{
int n, buff[MAX];
cin >> n;
for(int i=0;i<n;i++) cin >> buff[i];
int max=-1*10**10, min=10000;
int val=0;
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
val=buff[j]-buff[i];
if(val>max) max=val;
}
}
cout <<max ... | a.cc: In function 'int main()':
a.cc:14:23: error: invalid type argument of unary '*' (have 'int')
14 | int max=-1*10**10, min=10000;
| ^~~
|
s302702579 | p02258 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
unsigned int n;
int ans = INT_MIN;
int min = INT_MIN;
cin >> n;
for (unsigned int i = 0; i < n; ++i) {
int x;
cin >> x;
if (min > INT_MIN)
ans = max(ans, x - min);
min = min(min, x);
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:19: error: 'INT_MIN' was not declared in this scope
9 | int ans = INT_MIN;
| ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <cmath>
+++ |+#include <c... |
s978829543 | p02258 | C++ | #include <iostream>
#include <climits>
#include <algorithm>
using namespace std;
int main()
{
unsigned int n;
int ans = INT_MIN;
int min = INT_MIN;
cin >> n;
for (unsigned int i = 0; i < n; ++i) {
int x;
cin >> x;
if (min > INT_MIN)
ans = max(ans, x - min);
min = min(min, x);
}
cout << ans << endl;
... | a.cc: In function 'int main()':
a.cc:18:26: error: 'min' cannot be used as a function
18 | min = min(min, x);
| ~~~^~~~~~~~
|
s033660812 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;
int main(int argc, char const *argv[])
{
int R[MAX], n;
cin >> n;
for ( int i = 0; i < n; i++ ){ cin >> R[i]; }
int maxv = - MAX;
int minimum = R[0];
for(int i = 1; i < n; i++)
{
... | a.cc: In function 'int main(int, const char**)':
a.cc:18:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
18 | maxv = max(maxv, R[i]-min);
| ~~~~^~~~
|
s141425605 | p02258 | C++ |
#include<iostream>
#include<cmath>
#include<iomanip>
#include<string>
#include<vector>
using namespace std;
int main(){
vector<long long> a;
long long n,r;
cin>>n;
int maxv=-2000000000, minv=2000000000;
for(int i=0; i<n; i++){
cin>>r;
maxv=max(maxv, r-minv);
... | a.cc: In function 'int main()':
a.cc:19:17: error: no matching function for call to 'max(int&, long long int)'
19 | maxv=max(maxv, r-minv);
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s189500300 | p02258 | C++ | #include <bits/stdc++.h>
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 = - 10 ** 10;
int minv = R[0];
for (int i = 1; i < n; i++) {
maxv = max(maxv, R[i]-minv);
minv = min(minv, R[i]);
}
cout << max... | a.cc: In function 'int main()':
a.cc:10:20: error: invalid type argument of unary '*' (have 'int')
10 | int maxv = - 10 ** 10;
| ^~~~
|
s537854154 | 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 = R[0];
int minv = R[0];
for(int i = 1; i < n; i++) {
maxv = max(maxv, R[i]);
minv = min(minv, R[i... | a.cc: In function 'int main()':
a.cc:16:30: error: expected ')' before ';' token
16 | minv = min(minv, R[i];)
| ~ ^
| )
a.cc:16:31: error: expected primary-expression before ')' token
16 | minv = min(minv, R[i];)
| ... |
s544272823 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
static const int MAX = 20000;
int main(){
int R[MAX], n;
cin >> n;
for ( int i = 0; i < n; i++) cin >> R[i];
int maxv = -2000000000;
int minv = R[0];
for ( int i = 1; i < n; i++){
maxv = max(maxv, R[i] - minv);
minv = min(minv, R[i])
... | a.cc: In function 'int main()':
a.cc:17:27: error: expected ';' before '}' token
17 | minv = min(minv, R[i])
| ^
| ;
18 | }
| ~
a.cc:20:9: error: invalid operands of types '<unresolved overloaded function type>' ... |
s051299568 | 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];
}
minv = R[0]
for (int j=1 j<=n-1; j++{
maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
minv = ((minv < R[j])? minv : R[j]);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
12 | minv = R[0]
| ^~~~
a.cc:13:22: error: 'j' was not declared in this scope
13 | for (int j=1 j<=n-1; j++{
| ^
|
s678164690 | 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];
}
minv = R[0]
for (int j=1 j<=n-1; j++){
maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
minv = ((minv < R[j])? minv : R[j]);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
12 | minv = R[0]
| ^~~~
a.cc:13:22: error: 'j' was not declared in this scope
13 | for (int j=1 j<=n-1; j++){
| ^
|
s271088591 | 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];
}
minv = R[0];
for (int j=1 j<=n-1; j++){
maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
minv = ((minv < R[j])? minv : R[j]);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
12 | minv = R[0];
| ^~~~
a.cc:13:13: error: expected ';' before 'j'
13 | for (int j=1 j<=n-1; j++){
| ^~
| ;
a.cc:14:3: error: 'maxv' was not declared in this scope
14 | m... |
s514549903 | 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];
}
minv = R[0];
for (int j=1 j<=n-1; j++){
maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
minv = ((minv < R[j])? minv : R[j]);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
12 | minv = R[0];
| ^~~~
a.cc:13:13: error: expected ';' before 'j'
13 | for (int j=1 j<=n-1; j++){
| ^~
| ;
a.cc:14:3: error: 'maxv' was not declared in this scope
14 | m... |
s336038882 | 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];
}
minv = R[0];
maxv = R[0];
for (int j=1 j<=n-1; j++){
maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
minv = ((minv < R[j])? minv : R[j]);
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:5: error: 'minv' was not declared in this scope
12 | minv = R[0];
| ^~~~
a.cc:13:5: error: 'maxv' was not declared in this scope
13 | maxv = R[0];
| ^~~~
a.cc:14:13: error: expected ';' before 'j'
14 | for (int j=1 j<=n-1; j++){
| ... |
s626375185 | p02258 | C++ | #include<iostream>
using namespace std;
int main(){
int n, minv, maxv;
cin >> n;
int R[n];
for(int i=0; i<n; i++){
cin >> R[i];
}
minv = R[0];
maxv = R[0];
for (int j=1 j<=n-1; j++){
maxv = ((maxv > R[j]-minv)? maxv : R[j]-minv);
minv = ((minv < R[j])? minv : R[j]);
}
r... | a.cc: In function 'int main()':
a.cc:14:13: error: expected ';' before 'j'
14 | for (int j=1 j<=n-1; j++){
| ^~
| ;
|
s649733533 | p02258 | C++ | #include <iostream>
int main(int argc, char *argv[])
{
int n;
std::cin >> n;
int r[n];
for (int t = 0; t <= n - 1; t++)
{
std::cin >> r[t];
}
int max;
max = INT_MIN;
for (int i = 0; i <= n - 2; i++)
{
for (int j = i + 1; j <= n - 1; j++)
{
if (max < r[j] - r[i])
{
ma... | a.cc: In function 'int main(int, char**)':
a.cc:13:9: error: 'INT_MIN' was not declared in this scope
13 | max = INT_MIN;
| ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include <iostream>
+++ |+#include <climits... |
s153612412 | p02258 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,dif;
cin >> n;
int[] r = new int[n];
int currentMax = r[1] - r[0];
for(int i = 1;i < n;i++){
for(int j = 0;j < i;j++){
dif = r[i] - r[j];
if(dif > currentMax){
currentMax = dif;
}
}
}
cout << dif << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:12: error: structured binding declaration cannot have type 'int'
6 | int[] r = new int[n];
| ^~
a.cc:6:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:12: error: empty structured binding declaration
a.cc:6:15: erro... |
s755305974 | p02258 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,dif;
cin >> n;
int r[] = new int[n];
int currentMax = r[1] - r[0];
for(int i = 1;i < n;i++){
for(int j = 0;j < i;j++){
dif = r[i] - r[j];
if(dif > currentMax){
currentMax = dif;
}
}
}
cout << dif << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:19: error: initializer fails to determine size of 'r'
6 | int r[] = new int[n];
| ^~~~~~~~~~
a.cc:6:19: error: array must be initialized with a brace-enclosed initializer
|
s241870474 | p02258 | C++ | int main(){
int n,dif;
cin >> n;
int* r = new int[n];
for(int i = 0;i < n; i++){
cin >> r[i];
}
int currentMax = r[1] - r[0];
for(int i = 1;i < n;i++){
for(int j = 0;j < i;j++){
dif = r[i] - r[j];
if(dif > currentMax){
currentMax = dif;
}
}
}
cout << currentMax << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
3 | cin >> n;
| ^~~
a.cc:18:9: error: 'cout' was not declared in this scope
18 | cout << currentMax << endl;
| ^~~~
a.cc:18:32: error: 'endl' was not declared in this scope
18 | ... |
s653413038 | p02258 | C++ | #include<bits/stdc++.h>
int main(){
int n,dif;
cin >> n;
int* r = new int[n];
for(int i = 0;i < n; i++){
cin >> r[i];
}
int currentMax = r[1] - r[0];
for(int i = 1;i < n;i++){
for(int j = 0;j < i;j++){
dif = r[i] - r[j];
if(dif > currentMax){
currentMax = dif;
}
}
}
cout << currentMax <<... | a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> n;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:... |
s181841335 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int r[200000],n;
cin>>n;
for(int i=0;i<n;i++){
cin>>r[i];
}
int maxv=-200000;
int minv=r[0];
for(int i=1;i<n;i++){
maxv=max(maxv,r[i]-minv);
minv=min(minv,r[i];)
}
cout<<maxv<<endl;
r... | a.cc: In function 'int main()':
a.cc:15:27: error: expected ')' before ';' token
15 | minv=min(minv,r[i];)
| ~ ^
| )
a.cc:15:28: error: expected primary-expression before ')' token
15 | minv=min(minv,r[i];)
| ... |
s585315629 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
long long r[200000],n;
cin>>n;
for(int i=0;i<n;i++){
cin>>r[i];
}
int maxv=-200000;
int minv=r[0];
for(int i=1;i<n;i++){
maxv=max(maxv,r[i]-minv);
minv=min(minv,r[i]);
}
cout<<maxv<<endl;... | a.cc: In function 'int main()':
a.cc:14:17: error: no matching function for call to 'max(int&, long long int)'
14 | maxv=max(maxv,r[i]-minv);
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s119100673 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
r[200000],n;
cin>>n;
for(int i=0;i<n;i++){
cin>>r[i];
}
int maxv=-2000000000;
int minv=r[0];
for(int i=1;i<n;i++){
maxv=max(maxv,r[i]-minv);
minv=min(minv,r[i]);
}
cout<<maxv<<endl;
... | a.cc: In function 'int main()':
a.cc:7:5: error: 'r' was not declared in this scope
7 | r[200000],n;
| ^
a.cc:7:15: error: 'n' was not declared in this scope
7 | r[200000],n;
| ^
|
s452001923 | p02258 | C++ | #include <iostream>
using namespace std;
int main() {
int min, max;
int max_delta;
cin >> n;
int i;
for (i = 1; i < n; i++) {
if (i == 1) {
min = n;
max = n;
} else {
if (min > n) {
min = n;
} else if (max < n) {
... | a.cc: In function 'int main()':
a.cc:9:12: error: 'n' was not declared in this scope
9 | cin >> n;
| ^
|
s555506027 | 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 = R[1] - R[0];
int minv = R[0];
for (int i = 1; i < n; i++) {
maxv = max(maxv,R[i] - minv);
minv = min(minv,R[... | a.cc: In function 'int main()':
a.cc:7:12: error: expected ']' before '}' token
7 | int R[MAX},n;
| ^
| ]
a.cc: At global scope:
a.cc:7:13: error: mixing declarations and function-definitions is forbidden
7 | int R[MAX},n;
| ^
a.cc:9:3: error: 'cin' does n... |
s909112288 | p02258 | C++ | #include<iostream>
#include
using namespace std;
int main(){
long n, minv=0, maxv=-2000000000;
cin >> n;
int r[n];
for(int i=0;i<n;i++){
cin >> r[i];
}
minv = r[0];
for(int i=0;i<n;i++){
maxv = max(maxv, r[i]-minv);
minv = min(minv, r[i]);
}
cout << ... | a.cc:2:9: error: #include expects "FILENAME" or <FILENAME>
2 | #include
| ^
a.cc: In function 'int main()':
a.cc:15:19: error: no matching function for call to 'min(long int&, int&)'
15 | minv = min(minv, r[i]);
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/1... |
s067234617 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
long n, minv=0, maxv=-2000000000;
cin >> n;
int r[n];
for(int i=0;i<n;i++){
cin >> r[i];
}
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:15:19: error: no matching function for call to 'min(long int&, int&)'
15 | minv = min(minv, r[i]);
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s830097382 | p02258 | C++ | #include <iostream>
using namespace std;
array<int,200000> A;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)
cin>>A[i];
int a=0;
int m=1<<30;
for(int i=0;i<n;i++){
a=max(a,A[i]-m);
m=min(m,A[i]);
// cout<<"a"<<a<<" m"<<m<<endl;
}
cout<<a<<endl;
... | a.cc:4:19: error: aggregate 'std::array<int, 200000> A' has incomplete type and cannot be defined
4 | array<int,200000> A;
| ^
a.cc:2:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
1 | #include <iostream>
+++ |+#include <arra... |
s579648721 | p02258 | C++ | #include <iostream>
#include <limits.h>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int N, r, i;
int min=INT_MAX, ans=INT_MIN;
cin >> N;
rep(i,N) {
cin >> r;
if(r-min > max) max = r-min;
... | a.cc: In function 'int main()':
a.cc:16:18: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
16 | if(r-min > max) max = r-min;
| ~~~~~~^~~~~
a.cc:16:33: error: overloaded function with no contextual type information
16 | if(r... |
s899200800 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
long long R[200000];
int i, N, max=0;
cin >> N;
for(i=0;i<N;i++) {
cin >> R[i];
}
for(i=0;i<N;i++){
for(j=i+1;j<N;j++) {
max = max(max,R[j]-R[i])
}
}
cout << max << endl;
} | a.cc: In function 'int main()':
a.cc:14:13: error: 'j' was not declared in this scope
14 | for(j=i+1;j<N;j++) {
| ^
a.cc:15:36: error: 'max' cannot be used as a function
15 | max = max(max,R[j]-R[i])
| ^
|
s665132708 | p02258 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
long long R[200000];
int i, j, N, m=0;
cin >> N;
for(i=0;i<N;i++) {
cin >> R[i];
}
for(i=0;i<N;i++){
for(j=i+1;j<N;j++) {
m = max(m,R[j]-R[i])
}
}
cout << m << endl;
} | a.cc: In function 'int main()':
a.cc:15:20: error: no matching function for call to 'max(int&, long long int)'
15 | m = max(m,R[j]-R[i])
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
... |
s707448564 | p02258 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int n;
int t[200000];
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&t[i]);
}
int ans=INT_MIN;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
ans=max(ans,t[j]-t[i]);
}
}
cout << ans << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:12:17: error: 'INT_MIN' was not declared in this scope
12 | int ans=INT_MIN;
| ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include<cstdio>
+++ |+#include <clim... |
s688153491 | p02258 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<math.h>
#include<stack>
#include<sstream>
#include <typeinfo>
#include<sstream>
#include<queue>
using namespace std;
int main(){
int N;cin>>N;
int mini=INT_MAX;
int ans=-1;
for(int i=0;i<N;i++){
int t;
cin>>t;
if(mini>... | a.cc: In function 'int main()':
a.cc:17:26: error: 'INT_MAX' was not declared in this scope
17 | int mini=INT_MAX;
| ^~~~~~~
a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
10 | #include<queue>
++... |
s891677596 | p02258 | C++ | #include<iostream>
using namespace std;
int main(){
int N,R[200000],h;
int min=1000000000,max;
long dis=LONG_MIN;
cin >>N;
for(int t=1;t<=N;t++){
cin >> R[t];
}
for(int t=1;t<N;t++){
if(min>R[t]){
min=R[t];
max=-1;
for(int i=t+1;i<=N;i++) if(max<R[i]) max=R[i];
if((max-min... | a.cc: In function 'int main()':
a.cc:6:14: error: 'LONG_MIN' was not declared in this scope
6 | long dis=LONG_MIN;
| ^~~~~~~~
a.cc:2:1: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include<iostream>
+++ |+#include <climi... |
s037802074 | p02258 | C++ | #include <iostream>
using namespace std;
int main()
{
long n, r, d = LONG_MIN, max_r = LONG_MIN, min_r, i;
cin >> n >> min_r;
for(i = 1; i < n; ++i){
cin >> r;
if( r > max_r )
max_r = r;
d = max_r - min_r;
if( r < min_r ) {
min_r = r;
}
}
cout << d << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:5:24: error: 'LONG_MIN' was not declared in this scope
5 | long n, r, d = LONG_MIN, max_r = LONG_MIN, min_r, i;
| ^~~~~~~~
a.cc:2:1: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
... |
s865432214 | p02258 | C++ | int main()
{
ios::sync_with_stdio(false);
long n, r, k, d = LONG_MIN, min_r, i;
cin >> n >> min_r;
for(i = 1; i < n; ++i){
cin >> r;
k = r - min_r;
if( k > d )
d = k;
if( r < min_r )
min_r = r;
}
cout << d << "\n";
return 0;
} | a.cc: In function 'int main()':
a.cc:3:9: error: 'ios' has not been declared
3 | ios::sync_with_stdio(false);
| ^~~
a.cc:5:27: error: 'LONG_MIN' was not declared in this scope
5 | long n, r, k, d = LONG_MIN, min_r, i;
| ^~~~~~~~
a.cc:1:1: note: 'LONG... |
s482064753 | p02258 | C++ | #include <iostream>
using namespace std;
int main(){
int N,R,max;
cin >> N;
int array[N];
for(int i=0; i<N;i++){
cin >>array[i];
}
max0;
for(int i=0; i<N-1; i++){
for(int j=i+1; j<N; j++){
if(max > (array[j]-array[i])){
max = array[j]-array[i]);
}
}
}
cout << max << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:9: error: 'max0' was not declared in this scope; did you mean 'max'?
11 | max0;
| ^~~~
| max
a.cc:15:56: error: expected ';' before ')' token
15 | max = array[j]-array[i]);
| ... |
s827039843 | p02258 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
int array[N];
for(int i=0; i<N;i++){
cin >>array[i];
}
max=array[1]-array[0];
for(int i=0; i<N-1; i++){
for(int j=i+1; j<N; j++){
if(max < (array[j]-array[i])){
max = array[j]-array[i];
}
}
}
cout << max << endl;
return 0;
... | a.cc: In function 'int main()':
a.cc:11:29: error: overloaded function with no contextual type information
11 | max=array[1]-array[0];
| ^
a.cc:14:52: error: the value of 'array' is not usable in a constant expression
14 | if(max < (array[j]-array[... |
s114265744 | p02258 | C++ | #include <iostream>
using namespace std;
int main(){
int N,max,tmp;
cin >> N;
int array[N];
for(int i=0; i<N;i++){
cin >>array[i];
}
max=array[1]-array[0];
for(int i=0; i<N-1; i++){
for(int j=i+1; j<N; j++){
tmp = array[j]-array[i];
if(max < tmp{
max = tmp;
}
}
}
cout << max << endl;
retur... | a.cc: In function 'int main()':
a.cc:15:37: error: expected ')' before '{' token
15 | if(max < tmp{
| ~ ^
| )
a.cc:18:17: error: expected primary-expression before '}' token
18 | }
| ... |
s307416477 | p02258 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<sstream>
#include<string>
#include<math.h>
using namespace std;
int main()
{
int a[200000];
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
long long int ans = -9999999999999999999;
for (int i = 0; ... | a.cc:20:30: warning: integer constant is so large that it is unsigned
20 | long long int ans = -9999999999999999999;
| ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:20:29: warning: overflow in conversion from '__int128' to 'long long int' changes value from '-0x8... |
s325378996 | p02258 | C++ | #include <iostream>
using namespace std;
int main() {
long n, a;
cin >> n >> a;
long mini = a;
long dif = INT_MIN;
for (int i = 1; i < n; i++) {
cin >> a;
dif = max(dif, a - mini);
mini = min(mini, a);
}
cout << dif << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:14: error: 'INT_MIN' was not declared in this scope
10 | long dif = 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>
+++ |+#include <climits... |
s264788726 | p02258 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
static const int MAX =200000;
int main(){
int R[MAX] ,n;
cin >> n;
for(int j=0;j<n;j++)cin >> R[j];
int maxnum=-2000000000;
int minnum=R[0];
for(int i=1;i<=MAX;i++){
maxnum=max(maxnum,R[i]-minnum);
minnum=min(minnum,R[i]);
}
count << maxnum <<endl;
... | a.cc: In function 'int main()':
a.cc:20:7: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
20 | count << maxnum <<endl;
| ~~~~~~^~~~~~~~~
|
s192007234 | p02258 | C++ | #include "stdafx.h"
#include<iostream>
using namespace std;
static const int MAX = 200000;
int _tmain(int argc, _TCHAR* argv[])
{
int R[MAX];
int N;
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> R[i];
}
int max = -999999999;
for (int i = 0; i < N-1; i++)
{
for (int j = i + 1; j < N; j++)
{
if (max < ... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s863580381 | p02258 | C++ | #include "stdafx.h"
#include<iostream>
using namespace std;
static const int MAX = 200000;
int main()
{
int R[MAX];
int N;
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> R[i];
}
int max = -999999999;
for (int i = 0; i < N-1; i++)
{
for (int j = i + 1; j < N; j++)
{
if (max < R[j] - R[i])
{
max ... | 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.