buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
change_count
int64
0
100
/// // File: alds1_1_c.cpp // Author: ymiyamoto // // Created on Mon Nov 13 02:50:09 2017 // #include <cmath> #include <cstdint> #include <iostream> using namespace std; bool is_prime(uint32_t num) { for (uint32_t i = 2; i <= sqrt(num); i++) { if (num % 2 == 0) { return false; } } return true; }...
/// // File: alds1_1_c.cpp // Author: ymiyamoto // // Created on Mon Nov 13 02:50:09 2017 // #include <cmath> #include <cstdint> #include <iostream> using namespace std; bool is_prime(uint32_t num) { for (uint32_t i = 2; i <= sqrt(num); i++) { if (num % i == 0) { return false; } } return true; }...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
121
2
#include <iostream> #include <math.h> #include <stdio.h> int isPrime(int x) { if (x == 1) return 0; if (x == 2) return 1; if (x % 2 == 0 && x != 2) { return 0; } for (int i = 3; i < sqrt(x); i += 2) { if (x % i == 0) return 0; } return 1; } int main() { int n, num; int sum = 0...
#include <iostream> #include <math.h> #include <stdio.h> int isPrime(int x) { if (x == 1) return 0; if (x == 2) return 1; if (x % 2 == 0 && x != 2) { return 0; } for (int i = 3; i <= sqrt(x); i += 2) { if (x % i == 0) return 0; } return 1; } int main() { int n, num; int sum = ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
155
2
#include <complex> #include <iostream> using namespace std; bool isPrimeNumber(int n) { if (n == 2) return true; if (n < 2 || n % 2 == 0) return false; int i = 3; while (i < sqrt(n)) if (n % i == 0) return false; else i += 2; return true; } int main() { int n, count = 0, tm...
#include <complex> #include <iostream> using namespace std; bool isPrimeNumber(int n) { if (n == 2) return true; if (n < 2 || n % 2 == 0) return false; int i = 3; while (i <= sqrt(n)) if (n % i == 0) return false; else i += 2; return true; } int main() { int n, count = 0, t...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19]]
1
131
2
a=sorted(map(int,input().split())) while a[1]%a[0]!=0: a[0],a[1]=a[1]%a[0],a[0] return a[0]
a=sorted(map(int,input().split())) while a[1]%a[0]!=0: a[0],a[1]=a[1]%a[0],a[0] print((a[0]))
[["-", 36, 36, 36, 36, 0, 656, 0, 37, 0, 38], ["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 23, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 23, 0, 25], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
59
6
a,b = map(int,input().split()) while a % b != 0: a,b = b, a % b print(a // b)
a,b = map(int,input().split()) while a % b != 0: a,b = b, a % b print(b)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676]]
5
38
2
def lcd(a,b): ##return least common multiple of a and b if a > b: return lcd(a-b,b) elif a < b: return lcd(b-a,a) elif a == b: return a a,b = input().split() print(lcd(a,b))
def lcd(a,b): ##return least common multiple of a and b if a > b: return lcd(a-b,b) elif a < b: return lcd(b-a,a) elif a == b: return a a,b = map(int,input().split()) print(lcd(a,b))
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
64
5
natural = list(map(int, input().split())) natural.sort x = natural[1] y = natural[0] while (y != 0): x, y = y, x % y print(x,y) print(x)
natural = list(map(int, input().split())) natural.sort x = natural[1] y = natural[0] while (y != 0): x, y = y, x % y print(x)
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
58
6
def gdc(x, y): if x % y == 0: return y else: return gdc(x, x%y) if __name__ == '__main__': x, y = [int(i) for i in input().split(" ")] print(gdc(x, y))
def gdc(x, y): if x % y == 0: return y else: return gdc(y, x%y) if __name__ == '__main__': x, y = [int(i) for i in input().split(" ")] print(gdc(x, y))
[["-", 8, 196, 0, 37, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 37, 0, 652, 3, 4, 0, 22]]
5
67
2
x, y = map(int, input().split()) while x > 0 : x, y = y, x % y print(x)
x, y = map(int, input().split()) while y > 0 : x, y = y, x % y print(x)
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 0, 22]]
5
34
2
a,b=sorted(list(map(int, input().split()))) m=b%a while m>1: b=a a=m m=b%a print(a)
a,b=sorted(list(map(int, input().split()))) m=b%a while m>=1: b=a a=m m=b%a print(a)
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20]]
5
47
2
a,b=[int(x) for x in input().split()] x = max(a,b) y = min(a,b) while x % y >0: res = x % y x = y y = res print(res)
a,b=[int(x) for x in input().split()] x = max(a,b) y = min(a,b) res = y while x%y>0: res = x%y x = y y = res print(res)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22]]
5
58
3
x,y = list(map(int,input().split())) ###??????x >= y if y>x:x,y = y,x while x % y !=0: y = x%y if y > x:x,y = y,x print(y)
x,y = list(map(int,input().split())) ###??????x >= y if y>x:x,y = y,x while x % y !=0: x = x%y if y>x:x,y = y,x print(y)
[["-", 0, 52, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 662, 31, 22]]
5
60
2
def gcd(a,b): if(b): return gcd(a,a%b) return a l = input().split() if(int(l[0]) > int(l[1])): print(gcd(int(l[0]),int(l[1]))) else: print(gcd(int(l[1]),int(l[0])))
def gcd(a,b): if(b): return gcd(b,a%b) return a l = input().split() if(int(l[0]) > int(l[1])): print(gcd(int(l[0]),int(l[1]))) else: print(gcd(int(l[1]),int(l[0])))
[["-", 64, 196, 0, 37, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 37, 0, 652, 3, 4, 0, 22]]
5
96
2
x, y = map(int, input().split()) if x > y : pass else : x, y = y, x while x % y != 0 : y = x % y x = y print(y)
x, y = map(int, input().split()) if x > y : pass else : x, y = y, x while x % y != 0 : d = x % y x = y y = d print(y)
[["-", 0, 52, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 52, 8, 196, 0, 1, 0, 662, 12, 22]]
5
50
5
def gcd(x, y): if x < y: x = tmp x = y y = tmp while y > 0: r = x % y x = y y = r return x if __name__ == '__main__': a, b = [int(x) for x in input().split()] print (gcd(a, b))
def gcd(x, y): if x < y: tmp = x x = y y = tmp while y > 0: r = x % y x = y y = r return x if __name__ == '__main__': a, b = [int(x) for x in input().split()] print (gcd(a, b))
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22]]
5
76
4
def gcd(x, y): if x < y: tmp = x x = y y = tmp while y > 0: r = x % y x = y y = r return x x_y = input() tmp = list(map(int, x_y.split())) x = tmp[0] y = tmp[1] gcd(x, y)
def gcd(x, y): if x < y: tmp = x x = y y = tmp while y > 0: r = x % y x = y y = r return print(x) x_y = input() tmp = list(map(int, x_y.split())) x = tmp[0] y = tmp[1] gcd(x, y)
[["+", 0, 14, 8, 196, 0, 37, 0, 652, 63, 22], ["+", 8, 196, 0, 37, 0, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 37, 0, 652, 3, 4, 0, 25]]
5
78
3
x, y = sorted(list(map(int, input().split())), reverse=True) while 1: if x % y == 0: print(y) break else: a = y b = x % y x = a y = b print(x, y)
x, y = sorted(list(map(int, input().split())), reverse=True) while 1: if x % y == 0: print(y) break else: a = y b = x % y x = a y = b
[["-", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
63
6
a = list(map(int, input().split())) t , u = a[0],a[0] def c(x,y): if x % y: return(c(y,x%y)) else: return(y) print(c(t,u))
a = list(map(int, input().split())) t , u = a[0],a[1] def c(x,y): if x % y: return(c(y,x%y)) else: return(y) print(c(t,u))
[["-", 0, 1, 0, 662, 12, 432, 0, 206, 206, 612], ["+", 0, 1, 0, 662, 12, 432, 0, 206, 206, 612]]
5
69
2
list=[int(i) for i in input().split()] if list[0]>list[1]: a=list[0] b=list[1] else: b=list[0] a=list[1] if a%b==0: print (b) else: while b>0: c=a%b a=b b=c print(b)
list=[int(i) for i in input().split()] if list[0]>list[1]: a=list[0] b=list[1] else: b=list[0] a=list[1] if a%b==0: print(b) else: while b>0: c=a%b a=b b=c print(a)
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
88
2
list=[int(i) for i in input().split()] if list[0]>list[1]: a=list[0] b=list[1] else: b=list[0] c=list[1] if a%b==0: print (b) else: while a%b!=0: c=a%b a=b b=c print(c)
list=[int(i) for i in input().split()] if list[0]>list[1]: a=list[0] b=list[1] else: b=list[0] a=list[1] if a%b==0: print(b) else: while b>0: c=a%b a=b b=c print(a)
[["-", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 8, 196, 0, 52, 15, 666, 0, 657, 31, 22], ["-", 8, 196, 0, 52, 15, 666, 0, 657, 17, 109], ["-", 75, 76, 8, 196, 0, 52, 15, 666, 667, 79], ["+", 75, 76, 8, 196, 0, 52, 15, 666, 667, 47], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 2...
5
90
8
a, b = map(int, input().split()) if b > a: t = b b = a a = b while not b == 0: t = b b = a % b a = t print(a)
a, b = map(int, input().split()) if b > a: t = b b = a a = t while not b == 0: t = b b = a % b a = t print(a)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22]]
5
51
2
a,b = map(int, input().split()) if b > a: t = b b = a a = t while b != 0: t = b b = a % b a = b print(a)
a,b = map(int, input().split()) if b > a: t = b b = a a = t while b != 0: t = b b = a % b a = t print(a)
[["-", 0, 52, 8, 196, 0, 1, 0, 662, 12, 22], ["+", 0, 52, 8, 196, 0, 1, 0, 662, 12, 22]]
5
50
2
a, b = list(map(int,input().split())) while True: print(a, b) if min(a, b) == 1: print(1) break elif 1 < b < a: a = a % b elif 1 < a < b: b = b % a else: print(max(a, b)) break
a, b = list(map(int,input().split())) while True: if min(a, b) == 1: print(1) break elif 1 < b < a: a = a % b elif 1 < a < b: b = b % a else: print(max(a, b)) break
[["-", 0, 52, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
79
6
r, m, v, n; main(i) { for (scanf("%d%d", &n, &m); i < n; m = m < v ? m : v, i++) if (scanf("%d", &v), r < v - m) r = v - m; r = !printf("%d\n", r); }
r = -2e9, m, v, n; main(i) { for (scanf("%d%d", &n, &m); i < n; m = m < v ? m : v, i++) if (scanf("%d", &v), r < v - m) r = v - m; r = !printf("%d\n", r); }
[["+", 36, 36, 0, 30, 0, 1, 0, 11, 17, 32], ["+", 36, 36, 0, 30, 0, 1, 0, 11, 12, 13]]
0
83
2
#include <iostream> using ll = long long; using namespace std; int main() { int n, R[200000]; cin >> n; for (int i = 0; i < n; i++) { scanf("%d", &R[i]); } int maxv = -2000000000; int minv = R[0]; for (int j = 0; j < n; ++j) { maxv = max(maxv, R[j] - minv); minv = min(minv, R[j]); } cout ...
#include <iostream> using ll = long long; using namespace std; int main() { int n, R[200000]; cin >> n; for (int i = 0; i < n; i++) { scanf("%d", &R[i]); } int maxv = -2000000000; int minv = R[0]; for (int j = 1; j < n; ++j) { maxv = max(maxv, R[j] - minv); minv = min(minv, R[j]); } cout ...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
125
2
#include <cstdio> #include <iostream> using namespace std; int a[200010]; int main() { int n, minh, maxh = -2000000000; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", &a[i]); minh = a[0]; for (int i = 0; i <= n; i++) { maxh = max(maxh, a[i] - minh); minh = min(minh, a[i]); } printf("...
#include <cstdio> #include <iostream> using namespace std; int a[200010]; int main() { int n, minh, maxh = -2000000000; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", &a[i]); minh = a[0]; for (int i = 1; i < n; i++) { maxh = max(maxh, a[i] - minh); minh = min(minh, a[i]); } printf("%...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
128
4
#include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #in...
#include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <algorithm> #include <bitset> #in...
[["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
247
6
#include <iostream> using namespace std; int main() { int n, tag, minv, i, j; int *p; cin >> n; p = new int[n]; for (i = 0; i < n; i++) cin >> p[i]; tag = p[1] - p[0]; minv = p[0]; for (i = 0; i < n; i++) { if (p[i] - minv > tag) tag = p[i] - minv; if (minv > p[i]) minv = p[i]; ...
#include <iostream> using namespace std; int main() { int n, tag, minv, i, j; int *p; cin >> n; p = new int[n]; for (i = 0; i < n; i++) cin >> p[i]; tag = p[1] - p[0]; minv = p[0]; for (i = 1; i < n; i++) { if (p[i] - minv > tag) tag = p[i] - minv; if (minv > p[i]) minv = p[i]; ...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
1
143
2
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <vector> #define rep(i, n) Rep(i, 0, n) #define Rep(i, k, n) for (int i = k; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define vi vector<int> #define vii vector<int, int> #define Sort(v) sort(v.begin()...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <vector> #define rep(i, n) Rep(i, 0, n) #define Rep(i, k, n) for (int i = k; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define vi vector<int> #define vii vector<int, int> #define Sort(v) sort(v.begin()...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
181
4
#include <cstdio> #include <iostream> #include <math.h> using namespace std; int main() { int n; cin >> n; int r[n]; for (int i = 0; i < n; i++) cin >> r[i]; // 4,3,2 int ancer = -2000000000; int minv = r[0]; for (int i = 0; i < n - 1; i++) { ancer = max(ancer, r[i] - minv); minv = min(minv, ...
#include <cstdio> #include <iostream> #include <math.h> using namespace std; int main() { int n; cin >> n; int r[n]; for (int i = 0; i < n; i++) cin >> r[i]; // 4,3,2 int ancer = -2000000000; int minv = r[0]; for (int i = 1; i < n; i++) { ancer = max(ancer, r[i] - minv); minv = min(minv, r[i]...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
117
4
#include <iostream> //#include <algorithm> static const int MAX_PROFIT = -2000000000; static const int MAX_NUM = 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 = 1; ...
#include <iostream> //#include <algorithm> static const int MAX_PROFIT = -2000000000; static const int MAX_NUM = 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[i]; int maxv = MAX_PROFIT; int minv = R[0]; for (int i = 1; ...
[["-", 8, 1, 0, 16, 12, 69, 341, 342, 0, 22], ["+", 8, 1, 0, 16, 12, 69, 341, 342, 0, 22]]
1
141
2
package main import ( "fmt" ) func isPrime(N int) int{ if N < 2 { return 0 } if N == 2 { return 1 } else if N % 2 == 0 { return 0 } for i := 3; i*i < N; i+=2 { if N % i == 0 { return 0 } } return 1 } func main(){ var N, In int var count int fmt.Scanf("%d",&N); for i := 0; i < N; i++ { fmt...
package main import ( "fmt" ) func isPrime(N int) int{ //H := false if N < 2 { return 0 } if N == 2 { return 1 } else if N % 2 == 0 { return 0 } for i := 3; i*i <= N; i+=2 { if N % i == 0 { return 0 } } return 1 } func main(){ var N, In int var count int fmt.Scanf("%d",&N); for i := 0; i <...
[["-", 8, 196, 0, 7, 0, 430, 15, 16, 17, 18], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 17, 19], ["-", 0, 435, 8, 196, 0, 7, 8, 196, 0, 165], ["+", 0, 435, 8, 196, 0, 7, 8, 196, 0, 165]]
7
161
4
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var Arr = (input.trim()).split("\n").map(Number); Arr.shift(); var min = Arr[0]; var fx = Arr[0] - Arr[1]; Arr.shift(); Arr.forEach(function(v) { fx = Math.max(fx, v - min); min = Math.min(min, v); }); console.log(fx);
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var Arr = (input.trim()).split("\n").map(Number); Arr.shift(); var min = Arr[0]; var fx = Arr[1] - Arr[0]; Arr.shift(); Arr.forEach(function(v) { fx = Math.max(fx, v - min); min = Math.min(min, v); }); console.log(fx);
[["-", 0, 198, 0, 200, 51, 16, 31, 69, 71, 555], ["+", 0, 198, 0, 200, 51, 16, 31, 69, 71, 555], ["-", 0, 198, 0, 200, 51, 16, 12, 69, 71, 555], ["+", 0, 198, 0, 200, 51, 16, 12, 69, 71, 555]]
2
120
4
function main() { var n = input[0]; var maxv = -1000000000; var minv = input[1]; var profit; for (j = 1; j <= n; j++) { maxv = Math.max(maxv, input[j] - minv); minv = Math.min(minv, input[j]); } console.log(maxv); } var input = ''; process.stdin.resume(); process.stdin.setEncoding('utf8'); proces...
function main() { var n = input[0]; var maxv = -1000000000; var minv = input[1]; for (j = 2; j <= n; j++) { maxv = Math.max(maxv, input[j] - minv); minv = Math.min(minv, input[j]); } console.log(maxv); } var input = ''; process.stdin.resume(); process.stdin.setEncoding('utf8'); process.stdin.on('da...
[["-", 0, 493, 0, 435, 8, 556, 0, 198, 0, 217], ["-", 0, 435, 8, 556, 0, 198, 0, 200, 141, 22], ["-", 0, 493, 0, 435, 8, 556, 0, 198, 0, 35], ["-", 8, 556, 0, 7, 10, 1, 0, 11, 12, 555], ["+", 8, 556, 0, 7, 10, 1, 0, 11, 12, 555]]
2
168
5
fscanf(STDIN,'%d',$count); $max=1-10**9; for($i=0;$i<$count;$i++) { fscanf(STDIN,'%d',$n); if($i===0){ $min = $n; }else if($i===1){ $max=$n-$min; } if($max<$n-$min){ $max=$n-$min; } if($n<$min){ $min=$n; } } echo $max . PHP_EOL;
<?php fscanf(STDIN,'%d',$count); $max=1-10**9; for($i=0;$i<$count;$i++) { fscanf(STDIN,'%d',$n); if($i===0){ $min = $n; }else if($i===1){ $max=$n-$min; } if($max<$n-$min){ $max=$n-$min; } if($n<$min){ $min=$n; } } echo $max . PHP_EOL;
[["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]]
6
130
1
fscanf(STDIN, '%d', $count); $max=1-10**9; for($i=0;$i<$count;$i++) { fscanf(STDIN, '%d',$n); if($i===0){ $min=$n; }else { if($n-$min>$max){ $max=$n-$min; } } if($min>$n) { $min=$n; } } echo $max . PHP_EOL;
<?php fscanf(STDIN, '%d', $count); $max=1-10**9; for($i=0;$i<$count;$i++) { fscanf(STDIN, '%d',$n); if($i===0){ $min=$n; }else { if($n-$min>$max){ $max=$n-$min; } } if($min>$n) { $min=$n; } } echo $max . PHP_EOL;
[["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]]
6
114
1
$n = trim(fgets(STDIN)); $max = -200000000000000; $min = trim(fgets(STDIN)); for ($j = 1; $j < $n; $j++) { $R = trim(fgets(STDIN)); $max = max($max, $R - $min); $min = min($min, $R); } echo $max, PHP_EOL;
<?php $n = trim(fgets(STDIN)); $max = -200000000000000; $min = trim(fgets(STDIN)); for ($j = 1; $j < $n; $j++) { $R = trim(fgets(STDIN)); $max = max($max, $R - $min); $min = min($min, $R); } echo $max, PHP_EOL;
[["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]]
6
91
1
<?php $n = fgets(STDIN); $m = array(); $count = 0; while ($n > $count) { $m[] = trim(fgets(STDIN)); $count++; } $max = -PHP_INT_MAX; $tmpmin = PHP_INT_MAX; for ($i = 1; $i < $n; $i++) { if($max < $m[$i] - $tmpmin){ $max = $m[$i] - $tmpmin; } if($tmpmin >= $m[$i]){ $tmp...
<?php $n = fgets(STDIN); $m = array(); $count = 0; while ($n > $count) { $m[] = trim(fgets(STDIN)); $count++; } $max = -PHP_INT_MAX; $tmpmin = $m[0]; for ($i = 1; $i < $n; $i++) { if($max < $m[$i] - $tmpmin){ $max = $m[$i] - $tmpmin; } if($tmpmin >= $m[$i]){ $tmpmin = ...
[["-", 36, 36, 0, 493, 0, 1, 0, 11, 12, 141], ["+", 0, 1, 0, 11, 12, 69, 0, 606, 0, 607], ["+", 0, 1, 0, 11, 12, 69, 0, 606, 0, 141], ["+", 0, 493, 0, 1, 0, 11, 12, 69, 0, 70], ["+", 0, 493, 0, 1, 0, 11, 12, 69, 0, 612], ["+", 0, 493, 0, 1, 0, 11, 12, 69, 0, 73]]
6
137
6
import java.util.Scanner; public class Main { public static int get_max_profit(int[] a) { if (a.length == 0) return 0; int max = Integer.MIN_VALUE; int min = a[0]; for (int i = 0; i < a.length; i++) { max = Math.max(a[i] - min, max); min = Math.min(a[i], min); } return max;...
import java.util.Scanner; public class Main { public static int get_max_profit(int[] a) { if (a.length == 0) return 0; int max = Integer.MIN_VALUE; int min = a[0]; for (int i = 1; i < a.length; i++) { max = Math.max(a[i] - min, max); min = Math.min(a[i], min); } return max;...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
183
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int number[] = new int[n]; for (int i = 0; i < n; i++) { int x = scanner.nextInt(); number[i] = x; } int min = number[0]; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int number[] = new int[n]; for (int i = 0; i < n; i++) { int x = scanner.nextInt(); number[i] = x; } int min = number[0]; ...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["-", 0, 57, 15, 15, 0, 16, 12, 16, 17, 33], ["-", 0, 57, 15, 15, 0, 16, 12, 16, 12, 22]]
3
175
4
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] r = new int[n]; int min = 1000000000; for (int i = 0; i < n; i++) { r[i] = sc.nextInt(); } int maxProfit = r[0] - r[1]; fo...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] r = new int[n]; int min = 1000000000; for (int i = 0; i < n; i++) { r[i] = sc.nextInt(); } int maxProfit = r[1] - r[0]; fo...
[["-", 0, 503, 49, 200, 51, 16, 31, 504, 71, 499], ["+", 0, 503, 49, 200, 51, 16, 31, 504, 71, 499], ["-", 0, 503, 49, 200, 51, 16, 12, 504, 71, 499], ["+", 0, 503, 49, 200, 51, 16, 12, 504, 71, 499]]
3
186
4
import java.io.*; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class Main { static String a; public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] ...
import java.io.*; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class Main { static String a; public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] ...
[["-", 8, 196, 0, 503, 49, 200, 51, 509, 119, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 509, 119, 22], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
225
4
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; /** * Created by martin-d28jp-love on 15/04/01. */ public class Main { public static void main(String[] args) { // int[] input = input(); int[] input = mockuop(); int inputLength = input.lengt...
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; /** * Created by martin-d28jp-love on 15/04/01. */ public class Main { public static void main(String[] args) { int[] input = input(); // int[] input = mockuop(); int inputLength = input.lengt...
[["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["-", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499]]
3
442
8
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO ????????????????????????????????????????????? int n, i, j, a, maxv, minv; Scanner sc = new Scanner(System.in); n = Integer.parseInt(sc.next()); int r[] = new int[n]; for (i = 0; i < n; i++) { ...
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO ????????????????????????????????????????????? int n, i, j, a, maxv, minv; Scanner sc = new Scanner(System.in); n = Integer.parseInt(sc.next()); int r[] = new int[n]; for (i = 0; i < n; i++) { ...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
179
2
import java.util.Scanner; public class Main { public static void main(String args[]) { int i, j, k, t, min, minv, maxv, l; Scanner sc = new Scanner(System.in); t = Integer.parseInt(sc.next()); int n[] = new int[t + 1]; for (i = 0; i < t; i++) { n[i] = Integer.parseInt(sc.next()); } ...
import java.util.Scanner; public class Main { public static void main(String args[]) { int i, j, k, t, min, minv, maxv, l; Scanner sc = new Scanner(System.in); t = Integer.parseInt(sc.next()); int n[] = new int[t + 1]; for (i = 0; i < t; i++) { n[i] = Integer.parseInt(sc.next()); } ...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
184
2
import java.io.BufferedReader; import java.io.IOException; 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[] array = new...
import java.io.BufferedReader; import java.io.IOException; 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[] array = new...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
238
2
import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { // Scanner sc = new Scanner(new System.in); // Scanner sc = new Scanner(new File("in1.txt")); // Scanner sc = new Scanner(new File("in2...
import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { // Scanner sc = new Scanner(new System.in); // Scanner sc = new Scanner(new File("in1.txt")); // Scanner sc = new Scanner(new File("in2...
[["-", 49, 200, 51, 230, 3, 4, 0, 230, 39, 78], ["+", 49, 200, 51, 230, 3, 4, 0, 230, 39, 78], ["-", 3, 4, 0, 230, 3, 4, 0, 5, 0, 62], ["-", 3, 4, 0, 230, 3, 4, 0, 5, 0, 491], ["+", 3, 4, 0, 230, 3, 4, 0, 509, 500, 22], ["+", 3, 4, 0, 230, 3, 4, 0, 509, 0, 131], ["+", 3, 4, 0, 230, 3, 4, 0, 509, 119, 22]]
3
188
8
import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { // Scanner sc = new Scanner(new System.in); // Scanner sc = new Scanner(new File("in1.txt")); // Scanner sc = new Scanner(new File("in2...
import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // BufferedReader br = new BufferedReader(new FileReader("in1.txt...
[["-", 49, 200, 51, 230, 3, 4, 0, 230, 39, 78], ["+", 49, 200, 51, 230, 3, 4, 0, 230, 39, 78], ["-", 3, 4, 0, 230, 3, 4, 0, 5, 0, 62], ["-", 3, 4, 0, 230, 3, 4, 0, 5, 0, 491], ["+", 3, 4, 0, 230, 3, 4, 0, 509, 500, 22], ["+", 3, 4, 0, 230, 3, 4, 0, 509, 0, 131], ["+", 3, 4, 0, 230, 3, 4, 0, 509, 119, 22]]
3
188
8
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.nextLine()); int[] r = new int[n]; for (int i = 0; i < n; i++) { r[i] = Integer.parseInt(scan.nextLine()); } int max = r[1] - r[0]; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.nextLine()); int[] r = new int[n]; for (int i = 0; i < n; i++) { r[i] = Integer.parseInt(scan.nextLine()); } int max = r[1] - r[0]; ...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
180
2
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int size = sc.nextInt(); int b = sc.nextInt(); int max = b; int out = 0; int min = b; int sec = -100; int thr = -100; for (int i = 1; i <= size - 1; i++) { int num ...
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int size = sc.nextInt(); int b = sc.nextInt(); int max = b; int out = 0; int min = b; int sec = -1000000000; int thr = -1000000000; for (int i = 1; i <= size - 1; i++) { ...
[["-", 8, 196, 0, 503, 49, 200, 51, 91, 439, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 91, 439, 499], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
195
6
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { int n = Integer.parseInt(br.readLine()); int v...
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { int n = Integer.parseInt(br.readLine()); Array...
[["-", 0, 246, 8, 196, 0, 503, 39, 506, 0, 507], ["-", 0, 246, 8, 196, 0, 503, 49, 200, 141, 22], ["-", 0, 246, 8, 196, 0, 503, 49, 200, 0, 32], ["-", 0, 246, 8, 196, 0, 503, 49, 200, 51, 499], ["-", 8, 196, 0, 246, 8, 196, 0, 503, 0, 35], ["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 4...
3
238
7
import java.io.*; import java.util.*; class Main { void run() throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(in.readLine()); int[] menber = new int[num]; for (int i = 0; i < num; i++) { menber[i] = Integer.parseInt(in.re...
import java.io.*; import java.util.*; class Main { void run() throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(in.readLine()); int[] menber = new int[num]; for (int i = 0; i < num; i++) { menber[i] = Integer.parseInt(in.re...
[["-", 8, 196, 0, 7, 8, 196, 0, 57, 0, 95]]
3
207
1
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.read...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.read...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
184
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner std = new Scanner(System.in); int n = Integer.parseInt(std.next()); int minval = Integer.parseInt(std.next()); ; int maxpro = (int)-1e+9; int nextval = 0; for (int i = 2; i < n; i++) { nex...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner std = new Scanner(System.in); int n = Integer.parseInt(std.next()); int minval = Integer.parseInt(std.next()); ; int maxpro = (int)-1e+9; int nextval = 0; for (int i = 1; i < n; i++) { nex...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
146
2
import java.io.IOException; import java.util.Scanner; class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.out.println(" "); Scanner scan = new Scanner(System.in); int times = scan.nextInt(); int num[] = new int[times]; int max = 0; i...
import java.io.IOException; import java.util.Scanner; class Main { public static void main(String[] args) throws NumberFormatException, IOException { // System.out.println(" "); Scanner scan = new Scanner(System.in); int times = scan.nextInt(); int num[] = new int[times]; int max = 0; i...
[["-", 0, 1, 0, 11, 12, 16, 31, 504, 71, 499], ["+", 0, 1, 0, 11, 12, 16, 31, 504, 71, 499], ["-", 0, 1, 0, 11, 12, 16, 12, 504, 71, 499], ["+", 0, 1, 0, 11, 12, 16, 12, 504, 71, 499]]
3
187
4
import java.util.Scanner; public class Main { public static void main(String[] arges) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); int v = Integer.parseInt(line); int[] vs = new int[v]; for (int i = 0; i < v; i++) { String line2 = sc.nextLine(); vs[i] = Integer...
import java.util.Scanner; public class Main { public static void main(String[] arges) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); int v = Integer.parseInt(line); int[] vs = new int[v]; for (int i = 0; i < v; i++) { String line2 = sc.nextLine(); vs[i] = Integer...
[["+", 64, 196, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 196, 0, 1, 0, 11, 12, 16, 12, 22], ["-", 0, 1, 0, 492, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 492, 3, 4, 0, 16, 12, 22]]
3
188
4
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.nextLine()); double Rj = 0; double Ri = 0; double newR; double maxProfit = -100000; double tmpProfit = -100000; double tmp = 0; in...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.nextLine()); double Rj = 0; double Ri = 0; double newR; double maxProfit = -1000000000; double tmpProfit = -1000000000; double tmp = 0;...
[["-", 8, 196, 0, 503, 49, 200, 51, 91, 439, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 91, 439, 499], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
227
6
import java.io.*; class Main { public static int maxv(int x, int y) { if (x >= y) { return x; } else { return y; } } public static int minv(int x, int y) { if (x <= y) { return x; } else { return y; } } public static void main(String[] args) { BufferedR...
import java.io.*; class Main { public static int maxv(int x, int y) { if (x >= y) { return x; } else { return y; } } public static int minv(int x, int y) { if (x <= y) { return x; } else { return y; } } public static void main(String[] args) { BufferedR...
[["+", 8, 196, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 499], ["+", 8, 196, 0, 7, 15, 16, 12, 23, 0, 25], ["+", 0, 23, 0, 16, 31, 504, 71, 16, 17, 72], ["+", 0, 23, 0, 16, 31, 504, 71, 16, 12, 499]]
3
250
6
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] r = new int[n]; for (int i = 0; i < n; i++) { r[i] = stdIn.nextInt(); } int min = r[0]; int maxp = r[1] - r[0]; for (int i = 1;...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] r = new int[n]; for (int i = 0; i < n; i++) { r[i] = stdIn.nextInt(); } int min = r[0]; int maxp = r[1] - r[0]; for (int i = 1;...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
165
2
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] r = new int[n]; for (int i = 0; i < n; i++) { r[i] = sc.nextInt(); } int maxv = r[1] - r[0]; int minv = r[0]; for (int j = 2; j < n...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] r = new int[n]; for (int i = 0; i < n; i++) { r[i] = sc.nextInt(); } int maxv = r[1] - r[0]; int minv = r[0]; for (int j = 1; j < n...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
157
2
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO ????????????????????????????????????????????? Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int[] arr = new int[num]; for (int i = 0; i < num; i++) { arr[i] = sc.nextInt(); }...
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO ????????????????????????????????????????????? Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int[] arr = new int[num]; for (int i = 0; i < num; i++) { arr[i] = sc.nextInt(); } ...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
181
2
import java.util.Scanner; public class Main { public static void main(String[] args) { //??\??? Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] R = new int[n]; for (int i = 0; i < n; i++) { R[i] = sc.nextInt(); } //?¨????--------------------------------------------...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] R = new int[n]; for (int i = 0; i < n; i++) { R[i] = sc.nextInt(); } int minv = 2000000000; int maxp = -2000000000; int t; ...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 15, 15, 0, 16, 31, 504, 71, 16, 17, 33], ["+", 15, 15, 0, 16, 31, 504, 71, 16, 12, 499], ["+", 64, 1, 0, 11, 12, 504, 71, 16, 17, 33], ["+", 64, 1, 0, 11, 12, 504, 71, 16, 12, 499]]
3
166
6
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int rt[] = new int[n]; int diff[] = new int[n]; for (int i = 0; i < n; i++) { rt[i] = Integer.parseInt(sc.next()); } int minv =...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.next()); int rt[] = new int[n]; int diff[] = new int[n]; for (int i = 0; i < n; i++) { rt[i] = Integer.parseInt(sc.next()); } int minv =...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
180
2
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Scanner scanner = new Scanner(System.in); in...
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Scanner scanner = new Scanner(System.in); in...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 91, 17, 33], ["+", 8, 196, 0, 503, 49, 200, 51, 91, 439, 499]]
3
197
5
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int[] arr = new int[num]; for (int i = 0; i < num; i++) { arr[i] = sc.nextInt(); } int max = -2000000000; int min = arr[0]; for (int i =...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int[] arr = new int[num]; for (int i = 0; i < num; i++) { arr[i] = sc.nextInt(); } int max = -2000000000; int min = arr[0]; for (int i =...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
153
2
import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int min = 1000000000; int max = -1000000000; for (int i = 0; i < n; i++) { int r = sc.nextInt(); if (i == 1) { ...
import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int min = 1000000000; int max = -1000000000; for (int i = 0; i < n; i++) { int r = sc.nextInt(); if (i == 0) { ...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499]]
3
130
2
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = Integer.parseInt(sc.nextLine()); } int min = arr[0]; int ma...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = Integer.parseInt(sc.nextLine()); } int min = arr[0]; int ma...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
179
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int data[] = new int[n]; int minv, maxv; for (int i = 0; i < n; i++) { data[i] = scan.nextInt(); } scan.close(); maxv = data[1...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int data[] = new int[n]; int minv, maxv; for (int i = 0; i < n; i++) { data[i] = scan.nextInt(); } scan.close(); maxv = data[1...
[["-", 8, 196, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
171
2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int max = -1000000000, res, min = 0, num; int n = sc.nextInt(); for (int i = 1; i < n; i++) { num = sc.nextInt(); if (i == 0) { min = num; } else { ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int max = -1000000000, res, min = 0, num; int n = sc.nextInt(); for (int i = 0; i < n; i++) { num = sc.nextInt(); if (i == 0) { min = num; } else { ...
[["-", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 7, 502, 503, 49, 200, 51, 499]]
3
136
2
import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int t = sc.nextInt(); int[] R = inpNum(t); int mp = maxProfit(R); System.out.println(mp); sc.close(); } private static int maxProfit(int[] R) { int max_p...
import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int t = sc.nextInt(); int[] R = inpNum(t); int mp = maxProfit(R); System.out.println(mp); sc.close(); } private static int maxProfit(int[] R) { int max_p...
[["-", 8, 196, 0, 1, 0, 11, 12, 492, 141, 22], ["+", 8, 196, 0, 1, 0, 11, 12, 492, 141, 22]]
3
215
2
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static final int BIG_NUM = 2000000000; public static void main(String[] args) { int max = BIG_NUM, min = -BIG_NUM; BufferedReader br = new BufferedReader(new InputStreamReader(System.in...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static final int BIG_NUM = 2000000000; public static void main(String[] args) { int max = -BIG_NUM, min = BIG_NUM; BufferedReader br = new BufferedReader(new InputStreamReader(System.in...
[["+", 8, 196, 0, 503, 49, 200, 51, 91, 17, 33], ["-", 8, 196, 0, 503, 49, 200, 51, 91, 17, 33]]
3
164
2
#include <stdio.h> int main(void) { int n, t; int max, min; int a[200000]; int i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &t); a[i] = t; } max = a[1] - a[0]; min = a[0]; for (i = 0; i < n; i++) { if (max < a[i] - min) { max = a[i] - min; } if (min > a[i]...
#include <stdio.h> int main(void) { int n, t; int max, min; int a[200000]; int i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &t); a[i] = t; } max = a[1] - a[0]; min = a[0]; for (i = 1; i < n; i++) { if (max < a[i] - min) { max = a[i] - min; } if (min > a[i]...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
0
157
2
#include <stdio.h> #define MAX 200000 int main(void) { int R[MAX], n; int i; int maxv, minv; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", R[i]); } maxv = -2000000000; minv = R[0]; for (i = 1; i < n; i++) { maxv = maxv > R[i] - minv ? maxv : R[i] - minv; minv = minv < R[i] ? ...
#include <stdio.h> #define MAX 200000 int main(void) { int R[MAX], n; int i; int maxv, minv; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } maxv = -2000000000; minv = R[0]; for (i = 1; i < n; i++) { maxv = maxv > R[i] - minv ? maxv : R[i] - minv; minv = minv < R[i] ?...
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
140
1
#include <stdio.h> int main() { int n, i, A[200000], j, max = -9999999999, min; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", A[i]); min = A[0]; for (j = 1; j < n; j++) { if (max < A[j] - min) max = A[j] - min; if (min > A[j]) min = A[j]; } printf("%d\n", max); return ...
#include <stdio.h> int main() { int n, i, A[200000], j, max = -9999999999, min; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &A[i]); min = A[0]; for (j = 1; j < n; j++) { if (max < A[j] - min) max = A[j] - min; if (min > A[j]) min = A[j]; } printf("%d\n", max); return...
[["+", 8, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
132
1
#include <math.h> #include <stdio.h> #include <stdlib.h> #define MAX 200000 int main() { int R[MAX], n, i; int minv; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &R[i]); int maxv = -2000000000; minv = R[0]; for (i = 0; i < n; i++) { maxv = fmax(maxv, R[i] - minv); minv = fmin(minv, R...
#include <math.h> #include <stdio.h> #include <stdlib.h> #define MAX 200000 int main() { int R[MAX], n, i; int minv; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &R[i]); int maxv = -2000000000; minv = R[0]; for (i = 1; i < n; i++) { maxv = fmax(maxv, R[i] - minv); minv = fmin(minv, R...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
0
130
2
#include <stdio.h> #include <stdlib.h> int main() { int n, min, max = 0; scanf("%d", &n); int R[n]; scanf("%d", &R[0]); min = R[0]; for (int i = 1; i < n; i++) { scanf("%d", &R[i]); (R[i] - min) < max ? (max = max) : (max = R[i] - min); (R[i]) < min ? (min = R[i]) : (min = min); } printf("%...
#include <stdio.h> #include <stdlib.h> int main() { int n, min, max = -1000000000; scanf("%d", &n); int R[n]; scanf("%d", &R[0]); min = R[0]; for (int i = 1; i < n; i++) { scanf("%d", &R[i]); (R[i] - min) < max ? (max = max) : (max = R[i] - min); (R[i]) < min ? (min = R[i]) : (min = min); } ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
0
149
2
#include <stdio.h> int min(int a, int b) { if (a > b) { return b; } else { return a; } } int max(int a, int b) { if (a < b) { return b; } else { return a; } } int main() { int a[200000]; int ans, small, diff, x; scanf("%d", &x); for (int i = 0; i < x; i++) { scanf("%d", &a[i...
#include <stdio.h> int min(int a, int b) { if (a > b) { return b; } else { return a; } } int max(int a, int b) { if (a < b) { return b; } else { return a; } } int main() { int a[200000]; int ans, small, diff, x; scanf("%d", &x); for (int i = 0; i < x; i++) { scanf("%d", &a[i...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
0
200
2
#include <stdio.h> #define N 10000 int main(void) { int max, min, i, j, n; scanf("%d", &n); int R[N]; for (i = 0; i < n; i++) { scanf("%d", &R[i]); } max = R[1] - R[0]; min = R[0]; for (i = 0; i < n; i++) { if (max < R[i] - min) { max = R[i] - min; } if (min > R[i]) { min...
#include <stdio.h> #define N 200000 int main(void) { int max, min, i, j, n; scanf("%d", &n); int R[N]; for (i = 0; i < n; i++) { scanf("%d", &R[i]); } max = R[1] - R[0]; min = R[0]; for (i = 1; i < n; i++) { if (max < R[i] - min) { max = R[i] - min; } if (min > R[i]) { mi...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
0
154
4
#include <stdio.h> int main() { int r[100000000], i, t, n, j; scanf("%d\n", &n); for (i = 0; i < n; i++) { scanf("%d\n", &r[i]); } int max, min; max = -10000000000; min = r[0]; for (j = 1; j < n; j++) { if (max < r[j] - min) { max = r[j] - min; } else ; if (min > r[j]) ...
#include <stdio.h> int main() { int r[1000000], i, t, n, j; scanf("%d\n", &n); for (i = 0; i < n; i++) { scanf("%d\n", &r[i]); } int max, min; max = -10000000000; min = r[0]; for (j = 1; j < n; j++) { if (max < r[j] - min) { max = r[j] - min; } else ; if (min > r[j]) { ...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13]]
0
150
2
#include <stdio.h> int main() { int N; int A[200000]; int i, j; int tmp, max, min; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &A[i]); } max = A[1] - A[0]; min = A[0]; for (i = 0; i < N; i++) { tmp = A[i] - min; max = tmp >= max ? tmp : max; min = min <= A[i] ? min : A[...
#include <stdio.h> int main() { int N; int A[200000]; int i, j; int tmp, max, min; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &A[i]); } max = A[1] - A[0]; min = A[0]; for (i = 1; i < N; i++) { tmp = A[i] - min; max = tmp > max ? tmp : max; min = min < A[i] ? min : A[i]...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 1, 0, 11, 12, 41, 15, 16, 17, 20], ["+", 0, 1, 0, 11, 12, 41, 15, 16, 17, 47], ["-", 0, 1, 0, 11, 12, 41, 15, 16, 17, 19], ["+", 0, 1, 0, 11, 12, 41, 15, 16, 17, 18]]
0
149
6
#include <stdio.h> int main() { int N; scanf("%d", &N); int data; scanf("%d", &data); int max = data; int min = data; int i; for (i = 1; i < N; i++) { scanf("%d", &data); max = max > data - min ? max : data - min; min = min < data ? min : data; } printf("%d\n", max); return 0; }
#include <stdio.h> int main() { int N; scanf("%d", &N); int data; scanf("%d", &data); int max = -1000000000; int min = data; int i; for (i = 1; i < N; i++) { scanf("%d", &data); max = max > data - min ? max : data - min; min = min < data ? min : data; } printf("%d\n", max); return 0; }
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
0
109
2
#include <limits.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int n, i, j; int *R; int max = INT_MIN; int min; scanf("%d", &n); R = (int *)malloc(sizeof(int) * n); for (i = 0; i < n; i++) scanf("%d", &R[i]); min = R[0]; for (i = 1; i < n - 1; i++) { if (max...
#include <limits.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int n, i, j; int *R; int max = INT_MIN; int min; scanf("%d", &n); R = (int *)malloc(sizeof(int) * n); for (i = 0; i < n; i++) scanf("%d", &R[i]); min = R[0]; for (i = 1; i < n; i++) { if (max < R...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
169
2
#include <stdio.h> int main() { long i, n, maxv, minv, num; scanf("%ld", &n); scanf("%ld", &minv); scanf("%ld", &num); maxv = num - minv; if (minv >= num) { minv = num; } else { // none } for (i = 1; i < (n - 1); i++) { scanf("%ld", &num); if (maxv <= (num - minv)) { maxv = (n...
#include <stdio.h> int main() { long i, n, maxv, minv, num; scanf("%ld", &n); scanf("%ld", &minv); scanf("%ld", &num); maxv = num - minv; if (minv >= num) { minv = num; } else { // none } for (i = 1; i < (n - 1); i++) { scanf("%ld", &num); if (maxv <= (num - minv)) { maxv = (n...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
152
3
#include <stdio.h> int main() { int a, b, max = -2000000000, min; scanf("%d", &a); int r[a]; int i; for (i = 0; i < a; i++) scanf("%d", &r[i]); min = r[0]; for (i = 1; i < a; i++) { if (r[i] - min > max) max = r[i] - min; if (min > r[i]) min = r[i]; } printf("%d/n", m...
#include <stdio.h> int main() { int a, b, max = -2000000000, min; scanf("%d", &a); int r[200000]; int i; for (i = 0; i < a; i++) scanf("%d", &r[i]); min = r[0]; for (i = 1; i < a; i++) { if (r[i] - min > max) max = r[i] - min; if (min > r[i]) min = r[i]; } printf("%d\...
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]]
0
134
5
#include <stdio.h> #include <stdlib.h> main() { int i; int n; //データ数 int *r; //データ配列用ポインタ int maxv, minv; //最大利益 scanf("%d", &n); r = (int *)malloc(sizeof(int) * n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } maxv = r[1] - r[0]; minv = r[0]; for (i = 1; i < n - 1; ...
#include <stdio.h> #include <stdlib.h> main() { int i; int n; //データ数 int *r; //データ配列用ポインタ int maxv, minv; //最大利益 scanf("%d", &n); r = (int *)malloc(sizeof(int) * n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } maxv = r[1] - r[0]; minv = r[0]; for (i = 1; i < n; i++)...
[["-", 0, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
176
2
#include <stdio.h> int main(void) { int rate[200000], n, i, max, min; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &rate[i]); max = rate[0] - rate[1]; min = rate[0]; for (i = 0; i < n; i++) { if (max < rate[i] - min) max = rate[i] - min; if (min > rate[i]) min = rate[i]; }...
#include <stdio.h> int main(void) { int rate[200000], n, i, max, min; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &rate[i]); max = rate[1] - rate[0]; min = rate[0]; for (i = 1; i < n; i++) { if (max < rate[i] - min) max = rate[i] - min; if (min > rate[i]) min = rate[i]; ...
[["-", 0, 1, 0, 11, 12, 16, 31, 69, 71, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 69, 71, 13], ["-", 0, 1, 0, 11, 12, 16, 12, 69, 71, 13], ["+", 0, 1, 0, 11, 12, 16, 12, 69, 71, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
0
142
6
#include <math.h> #include <stdio.h> int main() { int n, r[200000], i, j, max, min; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } max = -1000000000; min = r[0]; for (i = 1; i < n - 1; i++) { max = max > r[i] - min ? max : r[i] - min; min = min < r[i] ? min : r[i]; } prin...
#include <math.h> #include <stdio.h> int main() { int n, r[200000], i, j, max, min; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } max = -1000000000; min = r[0]; for (i = 1; i < n; i++) { max = max > r[i] - min ? max : r[i] - min; min = min < r[i] ? min : r[i]; } printf("...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
143
2
#include <stdio.h> #define N 200000 int main() { int x[N]; int i; int max = -1000000000; int sa; int min; for (i = 0; i < N; i++) { scanf("%d", &x[i]); } min = x[0]; for (i = 2; i < x[0] + 1; i++) { sa = x[i] - min; if (max < sa) { max = sa; } if (min > sa) { min = x...
#include <stdio.h> #define N 200000 int main() { int x[N]; int i; int max = -1000000000; int sa; int min; for (i = 0; i < N; i++) { scanf("%d", &x[i]); } min = x[1]; for (i = 2; i < x[0] + 1; i++) { sa = x[i] - min; if (max < sa) { max = sa; } if (min > x[i]) { min =...
[["-", 8, 9, 0, 1, 0, 11, 12, 69, 71, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 69, 71, 13], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 22], ["+", 0, 57, 15, 23, 0, 16, 12, 69, 28, 22], ["+", 0, 57, 15, 23, 0, 16, 12, 69, 0, 70], ["+", 0, 57, 15, 23, 0, 16, 12, 69, 71, 22], ["+", 0, 57, 15, 23, 0, 16, 12, 69, 0, 73]]
0
135
7
#include <stdio.h> int main() { int n, i, j, r[200000], maxv, minv; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &r[i]); maxv = -2000000000; minv = r[0]; for (j = 0; j < n; j++) { if (maxv < r[j] - minv) maxv = r[j] - minv; if (minv > r[j]) minv = r[j]; } printf("%d\n", m...
#include <stdio.h> int main() { int n, i, j, r[200000], maxv, minv; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &r[i]); maxv = -2000000000; minv = r[0]; for (j = 1; j < n; j++) { if (maxv < r[j] - minv) maxv = r[j] - minv; if (minv > r[j]) minv = r[j]; } printf("%d\n", m...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
0
135
2
#include <stdio.h> int main() { int i, j, n, r[200000] = {0}, max, min; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } max = r[1] - r[0]; min = r[0]; for (i = 0; i < n; i++) { if (max < r[i] - min) { max = r[i] - min; } if (min > r[i]) min = r[i]; } print...
#include <stdio.h> int main() { int i, j, n, r[200000] = {0}, max, min; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } max = r[1] - r[0]; min = r[0]; for (i = 1; i < n; i++) { if (max < r[i] - min) { max = r[i] - min; } if (min > r[i]) min = r[i]; } print...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
0
151
2
#include <stdio.h> #define MAX 1000000000 int Upper(int x, int y) { if (x >= y) { return x; } return y; } int Lower(int x, int y) { if (x <= y) { return x; } return y; } int main() { int i; int r[MAX]; int num; int minv = 0; int maxv = 0; scanf("%d", &num); for (i = 0; i < num...
#include <stdio.h> #define MAX 200000 int Upper(int x, int y) { if (x >= y) { return x; } return y; } int Lower(int x, int y) { if (x <= y) { return x; } return y; } int main() { int i; int r[MAX]; int num; int minv; int maxv; scanf("%d", &num); for (i = 0; i < num; i++) { ...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
0
194
6
#include <stdio.h> #define N 20000000 int main() { int i = 0, minv = 0, R[N], j = 0, n = 0, maxv = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } minv = R[0]; maxv = R[1] - R[0]; for (j = 1; j <= n - 1; j++) { if (maxv < R[j] - minv) maxv = R[j] - minv; if (minv > R[...
#include <stdio.h> #define N 200000 int main() { int i = 0, minv = 0, R[N], j = 0, n = 0, maxv = 0; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } minv = R[0]; maxv = R[1] - R[0]; for (j = 1; j <= n - 1; j++) { if (maxv < R[j] - minv) maxv = R[j] - minv; if (minv > R[j]...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
0
160
2
#include <stdio.h> int main() { int n, i, R[200000], max, min; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } min = R[0]; max = R[1] - R[0]; for (i = 2; i < n; i++) { if (max < R[i] - min) { max = R[i] - min; } if (min > R[i]) { min = R[i]; } } printf(...
#include <stdio.h> int main() { int n, i, R[200000], max, min; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } min = R[0]; max = R[1] - R[0]; for (i = 1; i < n; i++) { if (max < R[i] - min) { max = R[i] - min; } if (min > R[i]) { min = R[i]; } } printf(...
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
0
147
2
#include <stdio.h> #define N 200000 int main() { int i, j, n, key, maxv, minv, R[N]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } minv = R[0]; maxv = R[1] - R[0]; for (j = 1; j < n - 1; j++) { if (R[j] - minv > maxv) maxv = R[j] - minv; if (R[j] < minv) mi...
#include <stdio.h> #define N 200000 int main() { int i, j, n, key, maxv, minv, R[N]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } minv = R[0]; maxv = R[1] - R[0]; for (j = 1; j <= n - 1; j++) { if (R[j] - minv > maxv) maxv = R[j] - minv; if (R[j] < minv) m...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
152
2
#include <stdio.h> #define N 200000 int main() { int i, n, max, min; int R[N]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } min = R[0]; max = R[1] - R[0]; for (i = 1; i < n - 1; i++) { if (max < R[i] - min) max = R[i] - min; if (R[i] < min) min = R[i]; }...
#include <stdio.h> #define N 200000 int main() { int i, n, max, min; int R[N]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } min = R[0]; max = R[1] - R[0]; for (i = 1; i < n; i++) { if (max < R[i] - min) max = R[i] - min; if (R[i] < min) min = R[i]; } ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
149
2
#include <stdio.h> int main() { int n, i, max, min; scanf("%d", &n); int R[n]; for (i = 0; i < n; i++) { scanf("%d", &R[i]); } min = R[0]; max = R[1] - R[0]; for (i = 1; i < n - 1; i++) { if (max > R[i] - min) max = max; else if (max < R[i] - min) max = R[i] - min; if...
#include <stdio.h> int main() { int n, i, max, min; scanf("%d", &n); int R[n]; for (i = 0; i < n; i++) { scanf("%d", &R[i]); } min = R[0]; max = R[1] - R[0]; for (i = 1; i < n; i++) { if (max > R[i] - min) max = max; else if (max < R[i] - min) max = R[i] - min; if (mi...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
176
2
#include <stdio.h> #define N 200000 int main() { int n, R[N], i, j, minv, maxv; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } maxv = R[1] - R[0]; minv = R[0]; for (j = 1; j < n - 1; j++) { if (maxv < R[j] - minv) maxv = R[j] - minv; if (minv > R[j]) minv = ...
#include <stdio.h> #define N 200000 int main() { int n, R[N], i, j, minv, maxv; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } maxv = R[1] - R[0]; minv = R[0]; for (j = 1; j < n; j++) { if (maxv < R[j] - minv) maxv = R[j] - minv; if (minv > R[j]) minv = R[j]...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
156
2
#include <stdio.h> #define N 200000 int main() { int i, num, maxnum, minnum, array[N]; scanf("%d", &num); for (i = 0; i < num; i++) { scanf("%d", &array[i]); } maxnum = array[1] - array[0]; minnum = array[0]; for (i = 1; i < num; i++) { if (maxnum <= (array[i] - minnum)) { maxnum = arr...
#include <stdio.h> #define N 200000 int main() { int i, num, maxnum, minnum, array[N]; scanf("%d", &num); for (i = 0; i < num; i++) { scanf("%d", &array[i]); } maxnum = array[1] - array[0]; minnum = array[0]; for (i = 1; i < num; i++) { if (maxnum <= (array[i] - minnum)) { maxnum = arr...
[["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
0
152
4
#include <stdio.h> #define N 200000 int main() { int i, maxv, minv, n, r[N]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } maxv = r[1] - r[0]; minv = r[0]; for (i = 1; i < n - 1; i++) { if (maxv < r[i] - minv) maxv = r[i] - minv; if (minv > r[i]) minv = r[i]...
#include <stdio.h> #define N 200000 int main() { int i, maxv, minv, n, r[N]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &r[i]); } maxv = r[1] - r[0]; minv = r[0]; for (i = 1; i < n; i++) { if (maxv < r[i] - minv) maxv = r[i] - minv; if (minv > r[i]) minv = r[i]; ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
148
2
#include <stdio.h> int main() { int i, n, R[200000], min, max; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } min = R[0]; max = R[0] - R[1]; for (i = 1; i < n; i++) { if (max < R[i] - min) max = R[i] - min; if (min > R[i]) min = R[i]; } printf("%d\n", ma...
#include <stdio.h> int main() { int i, n, R[200000], min, max; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &R[i]); } min = R[0]; max = R[1] - R[0]; for (i = 1; i < n; i++) { if (max < R[i] - min) max = R[i] - min; if (min > R[i]) min = R[i]; } printf("%d\n", ma...
[["-", 0, 1, 0, 11, 12, 16, 31, 69, 71, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 69, 71, 13], ["-", 0, 1, 0, 11, 12, 16, 12, 69, 71, 13], ["+", 0, 1, 0, 11, 12, 16, 12, 69, 71, 13]]
0
143
4