s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s303202918
p03826
u095969144
1530067178
Python
Python (3.4.3)
py
Runtime Error
17
2940
140
i = int(input()) s = input() ans = 0 for x in range(len(i)) : if s[x] == "I" : ans += 1 else : ans -= 1 print(ans)
s768085621
p03826
u205561862
1528810777
Python
Python (3.4.3)
py
Runtime Error
17
2940
60
l = map(int,input().split());print(max(l[0]*l[1],l[2]*l[3]))
s764759861
p03826
u306142032
1522875378
Python
Python (3.4.3)
py
Runtime Error
18
3188
86
a,b,c,d = map(int, input()) if(a*b >= c*d): print(a*b) else: print(c*d)
s575505372
p03826
u127856129
1521468188
Python
Python (3.4.3)
py
Runtime Error
18
2940
103
a,b,c,d=map(int,input().split()) if a*b=c*d: print(a*b) elif a*b>c*d: print(a*b) else: print(c*d)
s906449944
p03826
u319612498
1519015817
Python
Python (3.4.3)
py
Runtime Error
17
2940
50
a,b,c,d=map(int,input().split()) print(max(ab,cd))
s410883937
p03826
u133966084
1517897810
Python
Python (3.4.3)
py
Runtime Error
17
2940
62
A,B,C,D=(int (i) for i in input() split()) print(max(A*B,C*D))
s446325508
p03826
u863684580
1514850761
Python
Python (2.7.6)
py
Runtime Error
10
2568
390
import sys sys.getrecursionlimit() sys.setrecursionlimit(1000) l = int(raw_input()) def factorial(l): if l == 0: return 1 else: return l * factorial(l-1) integ = factorial(l) integ = integ factors = [] i = 1 while(integ >= i): if (integ % i) == 0: factors.append(i) i+=1 print len(factors) divisor = long(len(factors)) origin =long((10 ** 9) + 7)
s428016067
p03826
u863684580
1514848911
Python
Python (2.7.6)
py
Runtime Error
11
2568
217
inputted = int(raw_input()) l = list(raw_input()) x = 0 record = [] record.append(x) for i in range(len(l)): if l[i] == "I": x+=1 elif l[i] == "D": x-=1 record.append(x) print max(record)
s890570532
p03826
u667024514
1510776586
Python
Python (3.4.3)
py
Runtime Error
17
3060
129
a = input().spulit() A = int(a[0]) B = int(a[1]) C = int(a[2]) D = int(a[3]) q = A*B w = C*D if q <= w: print(w) else: print(q)
s265908155
p03826
u667024514
1510776536
Python
Python (3.4.3)
py
Runtime Error
18
2940
121
a = input().spulit() A = int(a[0]) B = int(a[1]) C = int(a[2]) D = int(a[3]) if A*B <= C*D: print(C*D) else: print(A*B)
s461633696
p03826
u126747509
1507235595
Python
Python (3.4.3)
py
Runtime Error
17
3064
264
def main(): n = int(input()) s = input() x, maxv = 0, 0 for c in s: if c == 'I': x += 1 elif c == 'D': x -= 1 if x > maxv: maxv = x print(maxv) if __name__ == "__main__": main()
s936890723
p03826
u863370423
1507007163
Python
Python (2.7.6)
py
Runtime Error
11
2568
237
s = raw_input("Please enter your numbers: ") p= int(s[0]) q= int(s[1]) r= int(s[2]) s= int(s[3]) def area(a,b,c, d): if a*b > c*d: print a*b elif c*d > a*b: print c*d else: print a*b x = area(p,q,r,s)
s687864618
p03826
u816631826
1507006259
Python
Python (2.7.6)
py
Runtime Error
11
2568
166
s = input() a = s/1000 b = s/100 -(s/1000)*10 c = s/10 -(s/100)*10 d = s - (s/10)*10 if a*b > c*d: print a*b elif c*d > a*b: print c*d else: print a*b
s608934169
p03826
u018679195
1507006004
Python
Python (2.7.6)
py
Runtime Error
11
2568
96
a,b,c,d = input() if a*b > c*d: print a*b elif c*d > a*b: print c*d else: print a*b
s289329288
p03826
u089230684
1507005945
Python
Python (2.7.6)
py
Runtime Error
10
2568
125
a = input() b = input() c = input() d = input() if a*b > c*d: print a*b elif c*d > a*b: print c*d else: print a*b
s016975591
p03826
u018679195
1507005823
Python
Python (2.7.6)
py
Runtime Error
10
2568
172
a = input() b = input() c = input() d = input() def area(a,b,c, d): if a*b > c*d: return a*b elif c*d > a*b: return c*d else: return a*b
s520475468
p03826
u089230684
1507005347
Python
Python (3.4.3)
py
Runtime Error
17
2940
106
A=int(input()) B=int(input()) C=int(input()) D=int(input()) if A*B>=C*D: print (A*B) else: print (C*D)
s710099618
p03826
u820351940
1497894521
Python
Python (3.4.3)
py
Runtime Error
17
3064
57
a, b, c, d = map(int, input.split()) print(max(a*b, c*d))
s504611420
p03826
u033407970
1494690939
Python
Python (3.4.3)
py
Runtime Error
18
3060
231
n, a, b = [int(x) for x in input().split(' ')] dis = [a*int(x) for x in input().split(' ')] dist = [dis[x+1] - dis[x] for x in range(n-1)] out = 0 for j in dist: if j > b: out += b else: out += j print(out)
s708985426
p03826
u996776197
1493607294
Python
Python (2.7.6)
py
Runtime Error
11
2692
191
#coding: shift_jis N = int(raw_input()) S = raw_input() x = 0 y = [x] for i in range(N-1): if S[i] == 'I': x += 1 elif S[i] == 'D': x -= 1 y.append(x) print max(y)
s195363038
p03826
u996776197
1493607071
Python
Python (2.7.6)
py
Runtime Error
19
3200
193
#coding: shift_jis N = int(raw_input()) S = raw_input() x = 0 y = [x] for i in range(N-1): if S[i] == 'I': x += 1 elif S[i] == 'D': x -= 1 y.append(x) print max(y)
s176781547
p03826
u087279476
1491024775
Python
Python (3.4.3)
py
Runtime Error
17
2940
102
a, b, c, d = map(int, input()split()) s1 = a*b s2 = c*d if s1 > s2: print(s1) else: print(s2)
s472581036
p03826
u104922648
1490462469
Python
Python (3.4.3)
py
Runtime Error
18
2940
77
a = input() b = input() c = input() d = input() print(max((a * b), (c * d)))
s915788013
p03826
u581309643
1486749492
Python
Python (3.4.3)
py
Runtime Error
23
3064
137
N = int(input()) S = input() x = 0 max_x = 0 for c in S: if c == 'I': x += 1 else: x -= 1 max_x = max(max_x, x) print(max_x)
s007616890
p03826
u117629640
1486670955
Python
Python (3.4.3)
py
Runtime Error
23
3064
149
# -*- coding: utf-8 -*- import math def main(): T = 1000000007 print(math.factorial(int(input()))) if __name__ == '__main__': main()
s417888522
p03826
u873917047
1485626190
Python
Python (3.4.3)
py
Runtime Error
24
3064
225
#coding: UTF-8 N, A, B=map(int, input().split()) lis=list(map(int,input().split())) #print(lis) out=0 for i in range(0,N-1): d=lis[i+1]-lis[i] if d*A < (B-A): out=out+d*A else: out=out+B print(out)
s847130635
p03826
u873917047
1485057272
Python
Python (2.7.6)
py
Runtime Error
16
2568
118
#coding: UTF-8 A, B, C, D = map(int, input().split()) a1 = A*B a2 = C*D if a1 >= a2: print(a1) else: print(a2)
s737920140
p03826
u407106303
1485029489
Python
Python (3.4.3)
py
Runtime Error
23
3064
92
n,s=int(input()),input() print(max([s[0:i].count('I')-s[0:i].count('D') for i in range(n)]))
s023255773
p03826
u284563808
1484946626
Python
Python (3.4.3)
py
Runtime Error
24
3064
128
import math from sympy import divisor_count N = int(input()) N = math.factorial(N) mod = 10**9+7 print(divisor_count(N) % mod)
s452118808
p03826
u123756661
1484544796
Python
Python (3.4.3)
py
Runtime Error
23
3064
59
a,b,c,d=[int(i)for i in input().split()] print(max(a*b,c*d)
s839390573
p03826
u582243208
1484541317
Python
Python (3.4.3)
py
Runtime Error
22
3064
319
pr = [True] * 1001 n = int(input()) ans = 1 MOD = 10 ** 9 + 7 for i in range(2, n + 1): if pr[i]: for j in range(i * 2, n + 1, i): pr[j] = False cnt = 0 now = n while now: cnt += now // i now //= i ans = ans * (cnt + 1) % MOD print(ans)
s399906069
p03826
u093843560
1484539027
Python
Python (2.7.6)
py
Runtime Error
1897
19556
549
import numpy as np N,A,B = map(int,raw_input().split()) city = raw_input() ci = city.split(" ") path = [] for i in range(len(ci)-1): z = int(ci[i+1])-int(ci[i]) path.append(z) costa = [] def binary_encode(i, num_digits): return np.array([i >> d & 1 for d in range(num_digits)]) for i in range(2**len(path)): pc = binary_encode(i,len(path)) cost =0 for z in range(len(pc)): if pc[z] == 0: cost = cost + A *path[z] else: cost = cost + B costa.append(cost) print min(costa)
s243337619
p03826
u093843560
1484537990
Python
Python (2.7.6)
py
Runtime Error
26
2696
582
import numpy as np N,A,B = map(int,raw_input().split()) city = raw_input() ci = city.split(" ") path = [] for i in range(len(ci)-1): z = int(ci[i+1])-int(ci[i]) path.append(z) costa = [] def binary_encode(i, num_digits): return np.array([i >> d & 1 for d in range(num_digits)]) for i in range(2**len(path)): pc = binary_encode(i,len(path)) cost =0 for z in range(len(pc)): if pc[z] == 0: cost = cost + A *path[z] else: cost = cost + B costa.append(cost) print min(costa) ~
s386899003
p03826
u106342872
1484537874
Python
Python (3.4.3)
py
Runtime Error
22
3064
648
# -*- coding:utf-8 -*- import math import sys def mark(s, x): for i in range(x + x, len(s), x): s[i] = False def sieve(n): s = [True] * n for x in range(2, int(n**0.5) + 1): if s[x]: mark(s, x) return [i for i in range(0,n) if s[i] and i > 1] n = int(input()) p = sieve(n) arr = [0]*len(p) n = math.factorial(n) for i in range(len(p)): flag = 1 k = p[i] while flag: if n%k == 0: k = k*p[i] arr[i] += 1 else: flag = 0 x = 1 for i in range(len(arr)): if arr[i] != 0: x *= (arr[i]+1) if ( n = 6): print(4) else: print(x%(10**9+7))
s973022091
p03826
u510334277
1484537394
Python
Python (3.4.3)
py
Runtime Error
23
3064
162
a,b,c,d = list(map(int,input().split())) sum1=a*b sum2=c*d if sum1 > sum2: print(sum1) elif sum1 < sum2: print(sum2) else sum1 == sum2: print(sum1)
s822274667
p03826
u331097927
1484534899
Python
Python (2.7.6)
py
Runtime Error
16
2568
142
n = int(raw_input()) s = str(raw_input()) x = 0 xs = [x] for si in s: if si == 'I': x += 1 else: x -= 1 xs.append(x) print max(xs)
s887205620
p03826
u882200107
1484534721
Python
Python (3.4.3)
py
Runtime Error
23
3064
144
input() S = input() x = 0 max_x = 0 for elem in S: if elem == 'I': x += 1 elif elem == 'D': x -= 1 if x > max_x: max_x = x print(max_x)
s318367693
p03826
u425351967
1484534510
Python
Python (3.4.3)
py
Runtime Error
23
3064
661
N=int(input()) div=1000000007 primedict= {i:True for i in range(2,N+1)} for i in range(2,N+1): if primedict[i]==True: j=2 while i*j<=N: primedict[i*j]=False j+=1 primelist = [i for i in range(2,N+1) if primedict[i]==True] # print(primelist) primecntdict={p:0 for p in primelist} for n in range(2,N+1): for p in [p for p in primelist if p <= n]: while n%p==0: n/=p primecntdict[p]+=1 res=1 for p in primelist: res*=primecntdict[p]+1 res%=div # print(primecntdict[2]) print(res)
s164583497
p03826
u331097927
1484534055
Python
Python (3.4.3)
py
Runtime Error
22
3068
75
a, b, c, d = map(int, raw_input().split()) print(a*b if a*b > c*d else c*d)
s789511709
p03826
u012693733
1484533272
Python
Python (2.7.6)
py
Runtime Error
16
2568
91
a,b,c,d = map(int,raw_input().split()) if a*b >= c*d:     print a*b else:     print c*d
s131912887
p03826
u112002050
1484532186
Python
Python (3.4.3)
py
Runtime Error
23
3064
80
in = [int(i) for i in input().split()] print(max(in[0] * in[1], in[2] * in[3]]))
s582376972
p03826
u112002050
1484532099
Python
Python (3.4.3)
py
Runtime Error
23
2940
72
in = [int(i) for i in input()] print(max(in[0] * in[1], in[2] * in[3]]))
s585182769
p03827
u197273335
1601103203
Python
Python (3.8.2)
py
Runtime Error
24
8900
172
= int(input()) s = input() x = 0 l = [0] for a in s: if a == "I": x = x + 1 l.append(x) else: x = x - 1 l.append(x) print(max(l))
s834857316
p03827
u854780853
1598490398
Python
Python (3.8.2)
py
Runtime Error
24
9100
124
N = int(input()) S = input().split() x = 0 for N in S: if S[N] == "I": x += 1 elif S[N] == "D": x -= 1 print(x)
s568555655
p03827
u895918162
1597512690
Python
Python (3.8.2)
py
Runtime Error
25
9004
189
num = int(input()) given = input() new = given.split() x = 0 max = 0 for i in range(num): if new[i] == "D": x -= 1 if new[i] == "I": x += 1 if max < x: max = x print(max)
s101952462
p03827
u895918162
1597512653
Python
Python (3.8.2)
py
Runtime Error
22
9076
190
num = int(input()) given = input() new = given.split() x = 0 max = 0 for i in range(num): if new[i] == "D": x -= 1 elif new[i] == "I": x += 1 if max < x: max = x print(max)
s882298998
p03827
u066869486
1597460264
Python
Python (3.8.2)
py
Runtime Error
24
8816
152
N = int(input()) S = input() a = 0 sum_a = 0 for i in range(N): if S[i]=="I": sum_a += 1 a = max (a , sum_a) else: sum_a- = 1 print(a)
s941100756
p03827
u552738814
1597098430
Python
Python (3.8.2)
py
Runtime Error
26
9140
239
n = int(input()) s = input() count = 0 count_list = [] for i in range(len(s)): if s[i] == "I": count += 1 count_list.append(count) else: count -= 1 count_list.append(count) print(max(count_list,0))
s533317342
p03827
u886907961
1597041850
Python
Python (3.8.2)
py
Runtime Error
26
9084
204
n =int(input()) s = input() c = 0 t = [] t1 = [] for i in s: if i=='I': c+=1 t.append(c) elif i=='D': c-=1 t1.append(c) if (max(max(t),max(t1)))<0: print(0) else: print(max(max(t),max(t1)))
s154336711
p03827
u886907961
1597041725
Python
Python (3.8.2)
py
Runtime Error
24
9104
158
n =int(input()) s = input() c = 0 t = [] t1 = [] for i in s: if i=='I': c+=1 t.append(c) elif i=='D': c-=1 t1.append(c) print(max(max(t),max(t1)))
s846352591
p03827
u226779434
1597027511
Python
Python (3.8.2)
py
Runtime Error
26
8864
112
n =int(input()) s = input() x = 0 for i in s: if i ="I": x =max(x,x+1) else: x =max(x,x-1) print(x)
s861156710
p03827
u763177133
1593295242
Python
Python (3.8.2)
py
Runtime Error
23
9072
74
s = input() for c in s: x += 1 if c == 'I' else -1 print(max(x))
s631890812
p03827
u492749916
1591497769
Python
Python (3.4.3)
py
Runtime Error
17
2940
215
= int(input()) S = str(input()) cnt = 0 ans = [] for i in range(0,N): if S[i] == "I": cnt = cnt+1 elif S[i] == "D": cnt = cnt-1 ans.append(cnt) if max(ans) <= 0: print("0") else: print(max(ans))
s335478303
p03827
u374082254
1590877456
Python
Python (3.4.3)
py
Runtime Error
17
3060
303
def li(): return list(map(int, input().split())) def mi(): return map(int, input().split()) def ii(): return int(input()) N = ii() S = input() current = 0 maxx = 0 for s in S: if s == "I": current += 1 else: current -= 1 maxx = max(maxx, current) print(result)
s603573791
p03827
u193927973
1590607349
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
N = int(input()) S = list(input()) x=0 maxa=0 for s in S: if s=="I": x+=1 else: x-= maxa=max(x, maxa) print(maxa)
s302147617
p03827
u519939795
1590090743
Python
Python (3.4.3)
py
Runtime Error
17
3060
148
n=int(input()) s=input() ans=0 x=[] for i in range(n): if s[i]=='I': ans+=1 x.append(ans) else: ans-=1 print(max(x))
s788763841
p03827
u519939795
1590090707
Python
Python (3.4.3)
py
Runtime Error
17
2940
148
n=int(input()) s=input() ans=0 x=[] for i in range(n): if s[i]=='I': ans+=1 x.append(ans) else: ans-=1 print(max(x))
s486276912
p03827
u519939795
1590090615
Python
Python (3.4.3)
py
Runtime Error
17
2940
137
n=int(input()) s=input() ans=0 x=0 for i in range(n): if s[i]=='I': ans+=1 x=max(0,ans) else: ans-=1 print(x)
s048566427
p03827
u851704997
1589445319
Python
Python (3.8.2)
py
Runtime Error
20
9124
187
N = int(input()) S = input() x = 0 length = len(S) List = [0] for i in range(length): if(S[i] == I): x += 1 List.append(x) else: x -= 1 List.append(x) print(max(List))
s939032996
p03827
u711238850
1588936437
Python
PyPy3 (2.4.0)
py
Runtime Error
165
38256
124
n = int(input()) s = input() x = 0 ans = 0 for c in s: if c=='I' x+=1 ans = max(x,ans) else: x-=1 print(ans)
s125218631
p03827
u017415492
1588820798
Python
Python (3.4.3)
py
Runtime Error
18
2940
167
#a,b,c,d=map(int,input().split()) n=int(input()) s=input() ans=0 for i in s: if i=="I": ans+=1 elif i=="D": ans-=1 if x<0: print(0) else: print(ans)
s154079244
p03827
u017415492
1588820563
Python
Python (3.4.3)
py
Runtime Error
17
2940
165
#a,b,c,d=map(int,input().split()) n=int(input()) s=input() ans=0 for i in s: if i=="I": ans+=1 elif i=="D": ans-=1 if x<0: print(0) else: print(x)
s272297152
p03827
u798260206
1588177314
Python
Python (3.4.3)
py
Runtime Error
17
2940
147
n = int(input()) s = input() ans = 0 x =0 for i in range(n): if s(i) == "I": x += 1 else: x -= 1 ans = max(ans,x) print(ans)
s094629606
p03827
u106181248
1587753842
Python
PyPy3 (2.4.0)
py
Runtime Error
179
38256
138
n = int(input()) s = input() x = 0 ans = 0 for c in x: if c == "I": x += 1 else: x -= 1 if x > ans: ans = x print(ans)
s735355590
p03827
u821251381
1587700846
Python
Python (3.4.3)
py
Runtime Error
18
2940
104
S=input() max_v =0 v =0 for i in S: if i=="I": v+=1 if v>max_v: max_v=v else: v-=
s734194074
p03827
u642418876
1587594881
Python
Python (3.4.3)
py
Runtime Error
17
2940
147
n=int(input()) s=str(input()) x=0 l=[0] for i in range(n): if s[i]=='I': x+=1 l.append(x) else: x-=1 l.append(x) print(max(x))
s294498172
p03827
u239653493
1587523858
Python
Python (3.4.3)
py
Runtime Error
17
2940
143
n=int(input()) s=input() k=0 for i in range(n): if s[i]=="I": x+=1 if x>k: k=x else: x+=-1 print(k)
s728847100
p03827
u272525952
1586960698
Python
PyPy3 (2.4.0)
py
Runtime Error
170
38256
195
n=int(input()) l=list(map(str,input().split())) lis=[0] count=0 for i in range(n): if l[i]='D': lis.append(count-1) count-=1 else: lis.append(count+1) count+=1 print(max(lis))
s423621683
p03827
u903005414
1586879019
Python
Python (3.4.3)
py
Runtime Error
17
2940
123
N = int(input()) S = input() ans = 0 x = 0 for s in S: v = 1 if s == 'I' else: 0 x += v ans = max(ans, x) print(ans)
s428557644
p03827
u516447519
1586479084
Python
Python (3.4.3)
py
Runtime Error
17
2940
173
N = int(input()) S = int(input()) max = 0 x = 0 for i in range(N): if S[i] == 'I': x += 1 else: x -= 1 if x > max: max = x print(max)
s000317804
p03827
u373047809
1586406791
Python
Python (3.4.3)
py
Runtime Error
17
2940
100
n = int(input()) s = input() x = m = 0 for i range(n): x += [-1,1][s[i] == I]; m = max(m,x) print(m)
s079599892
p03827
u852790844
1586398059
Python
Python (3.4.3)
py
Runtime Error
21
3316
203
import itertools n = int(input()) s = list(input()) s1 = [1 if s[i] == 'I' else -1 for i in range(n)] cumsum = list(itertools.accumulate(s1)) print(s1) print(cumsum) ans = max(cumsum) print(max(ams, 0))
s881037790
p03827
u852790844
1586397914
Python
Python (3.4.3)
py
Runtime Error
18
3060
203
import itertools n = int(input()) s = list(input()) s1 = [1 if s[i] == 'I' else -1 for i in range(n)] cumsum = list(itertools.accumulate(s1)) print(s1) print(cumsum) ans = max(cumsum) print(max(ams, 0))
s990317435
p03827
u440129511
1585538357
Python
Python (3.4.3)
py
Runtime Error
18
2940
140
n=int(input()) s=list(input()) k=[0] for i in range(0,n): if s[i]=='I':k.append(int(k[i]+1) else:k.append(int(k[i]-1)) print(max(k))
s953206439
p03827
u321035578
1585270513
Python
Python (3.4.3)
py
Runtime Error
17
2940
284
def main(): n = int(input()) s = list(input().split()) ans = 0 now = 0 for i, i_d in enumerate(s): if i_d == 'I': now += 1 ans = max(ans, now) else: now -= 1 print(ans) if __name__ = '__main__': main()
s001338648
p03827
u623819879
1584855225
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38256
65
,t=open(0) a=[0] for i in t:a+=a[-1]+1-2*(i=='D'), print(max(a))
s718893133
p03827
u623819879
1584854936
Python
PyPy3 (2.4.0)
py
Runtime Error
178
38384
65
input() x=0 a=[0] for i in input():a+=a[-1]+1-2*(i=='D') print(a)
s020350300
p03827
u453683890
1583442628
Python
Python (3.4.3)
py
Runtime Error
17
2940
155
N = int(input()) line = input() x = 0 t = 0 for i in range(N): if line[i] == 'I': t += 1 else if line[i] == 'D': t -= 1 x = max(t,x) print(x)
s641720694
p03827
u699089116
1583387926
Python
PyPy3 (2.4.0)
py
Runtime Error
163
38384
160
n = int(input()) s = input() ans = [0] for i in range(1, n+1): if s[i] == "I": ans.append(ans[i-1]+1) else: ans.append(ans[i-1]-1) print(max(ans))
s786349683
p03827
u883040023
1583067591
Python
Python (3.4.3)
py
Runtime Error
17
3060
152
n = int(input()) s = input() x = 0 for i in range(n): if s[i] == "I": x += 1 else: x -= 1 ans = max(0,x,ans) print(ans)
s340745532
p03827
u768559443
1582861214
Python
Python (3.4.3)
py
Runtime Error
17
2940
138
input() s=input() n,m=0 for i in range(len(s)): if s[i]=="I": n+=1 m=max(n,m) if s[i]=="D": n=n-1 m=max(n,m) print(m)
s624291994
p03827
u541610817
1582278320
Python
Python (3.4.3)
py
Runtime Error
17
2940
140
N = int(input()) S = input() res = 0 x = 0 for i in range(N): if S[i] == 'I': x += 1 else: x -= 1 res = max(res, x) return res
s353984361
p03827
u840958781
1580958693
Python
Python (3.4.3)
py
Runtime Error
17
3060
134
n=int(input()) s=input() x=0 a=[] for i in range(n): if s[i]==I: x+=1 else: x-=1 a.append(x) print(max(a))
s041901554
p03827
u127499732
1580602538
Python
Python (3.4.3)
py
Runtime Error
17
2940
100
n,s=map(int,input().split()) l=[0] for i in s: x= -1 if i=="D" else 1 l+=[l[-1]+x] print(max(l))
s167433861
p03827
u113971909
1580597972
Python
Python (3.4.3)
py
Runtime Error
17
2940
131
n=int(input()) s=list(input()) nw = 0 ans = 0 for i in s: if i='I': nw+=1 else: nw-=1 ans = max(ans,nw) print(ans)
s969062404
p03827
u993435350
1579726774
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
N = int(input()) S = input() m = 0 p = 0 for i in S: if i == D: p -= 1 else: p += 1 if p >= m: m = p print(m)
s977856571
p03827
u475179653
1578348717
Python
Python (3.4.3)
py
Runtime Error
17
2940
155
l=[] x=0 l.append(x) n=int(input()) s=input() for i in s: if(i=='I'): x++ l.append(x) if(i=='D'): x-- l.append(x) print(max(l))
s838587918
p03827
u475179653
1578348601
Python
Python (3.4.3)
py
Runtime Error
17
2940
147
l=[] x=0 l.append(x) n=int(input()) s=input() for i in s: if(i=='I'): x++ l.append(x) if(i=='D'): x-- l.append(x) print(max(l))
s332798043
p03827
u506858457
1577981129
Python
Python (3.4.3)
py
Runtime Error
17
2940
132
N=int(input()) S=input() ans=0 cnt=0 for i in range(N): if S[i]='I': cnt+=1 ans=max(cnt,ans) else: cnt-=1 print(ans)
s892032255
p03827
u540761833
1577026208
Python
Python (3.4.3)
py
Runtime Error
17
2940
145
n= int(input()) s= input() suma=[0] for i in range(n): if s[i] == 'I': suma.append(s[i]+1) else: suma.append(s[i]-1) print(max(suma))
s826645715
p03827
u754022296
1573998582
Python
Python (3.4.3)
py
Runtime Error
18
3064
125
n = int(input()) s = input() x = 0 ans = 0 for i in s: if i=="I: c+=1 else: c-=1 ans = max(c, ans) print(ans)
s669822455
p03827
u754022296
1573998573
Python
Python (3.4.3)
py
Runtime Error
17
2940
124
n = int(input()) s = input() x = 0 ans = 0 for i in s: if i=="I: c+=1 else: c-=1 ans = max(c, ans) print(ans
s752767293
p03827
u556589653
1573748223
Python
Python (3.4.3)
py
Runtime Error
17
2940
164
N = int(input()) S = input() K = [] ans = 0 for i in range(S): if S[i] == "I": ans += 1 K.append(ans) else: ans -= 1 K.append(ans) print(max(K))
s387134915
p03827
u663438907
1573704844
Python
Python (3.4.3)
py
Runtime Error
17
3068
168
N = int(input()) S = list(str(input())) x = 0 ans = 0 for i in range(len(N)): if S[i] == 'I': x += 1 else: x -= 1 if ans < x: ans = x print(ans)
s452098269
p03827
u852367841
1572469506
Python
Python (3.4.3)
py
Runtime Error
17
2940
299
N = int(input()) S = input() count = 0 count_list = [] for i in S: if i == 'I': count += 1 count_list.append(count) elif i == 'D': count -= 1 else: print('Error') max_count = max(count_list) if max_count > 0: print(max_count) else: print(0)
s160811708
p03827
u626468554
1571631819
Python
Python (3.4.3)
py
Runtime Error
17
2940
194
#n,l = map(int,input().split()) #l = kist(input()) l = list(input()) cnt=0 ans=0 for i in range(n): if l[i]=='I': cnt+=1 else: cnt-=1 ans = max(ans,cnt) print(ans)
s744108596
p03827
u626468554
1571631695
Python
Python (3.4.3)
py
Runtime Error
17
2940
194
#n,l = map(int,input().split()) #l = kist(input()) l = kist(input()) cnt=0 ans=0 for i in range(n): if l[i]=='I': cnt+=1 else: cnt-=1 ans = max(ans,cnt) print(ans)
s316999240
p03827
u089376182
1571604499
Python
Python (3.4.3)
py
Runtime Error
18
2940
148
_ = input() S = input() max_n = 0 temp = 0 for s in S: temp += 1 if s == 'I' else temp -= 1 if max_n < temp: max_n = temp print(max_n)
s193417085
p03827
u408791346
1569262610
Python
Python (3.4.3)
py
Runtime Error
18
3064
293
n = int(input()) s = input() x = 0 m = [0,] def incre(): for i in range(len(s)): if s[i] == 'I': x += 1 m.append(x) elif s[i] == 'D': x -= 1 m.append(x) else: print(max(m)) if __name__ == "__main__": incre()
s245692835
p03827
u224488911
1567904240
Python
Python (3.4.3)
py
Runtime Error
17
2940
139
n=input() s=input() c,m=0,0 for i in range(n-1): if s[i]=="I": c+=1 m=max(c,m) if s[i]=="D": c=c-1 print(m)