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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s157717858 | p03827 | u224488911 | 1567904174 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 137 | n=input()
s=input()
c,m=0,0
for i in range(n):
if s[i]=="I":
c+=1
m=max(c,m)
if s[i]=="D":
c=c-1
print(m) |
s112938253 | p03827 | u224488911 | 1567904048 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 161 | n = input()
s = input()
x = 0
y = 0
for i in range(len(s)):
if s[i] == "I":
y += 1
x = max(x,y)
if s[i] == "D":
y = y - 1
x = max(x,y)
print(x) |
s172169867 | p03827 | u224488911 | 1567904031 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 156 | n = input()
s = input()
x = 0
y = 0
for i in range(n):
if s[i] == "I":
y += 1
x = max(x,y)
if s[i] == "D":
y = y - 1
x = max(x,y)
print(x) |
s814442024 | p03827 | u224488911 | 1567903936 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 147 | n = input()
s = input()
x = 0
y = 0
for i in range(n - 1):
if s[i] == "I":
y += 1
x = max(x,y)
if s[i] == "D":
y = y - 1
print(x) |
s613103048 | p03827 | u224488911 | 1567903851 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 143 | n = input()
s = input()
x = 0
y = 0
for i in range(n):
if s[i] == "I":
y += 1
x = max(x,y)
if s[i] == "D":
y = y - 1
print(x) |
s643151844 | p03827 | u224488911 | 1567903798 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 137 | n = input()
s = input()
x = 0
y = 0
for i in range(n):
if i == "I":
y += 1
x = max(x,y)
if i == "D":
y = y - 1
print(x) |
s691873132 | p03827 | u396391104 | 1567819817 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 147 | n = int(input())
s = input()
x=before=0
for i in s:
if i == "I":
x += 1
if before < x:
before = x
else:
x -= 1
print(berofe) |
s074447905 | p03827 | u802963389 | 1566557889 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 134 | n = input()
s = input()
ans = 0
for i in s:
if i == "I":
cnt += 1
else:
cnt -= 1
if ans < cnt:
ans = cnt
print(ans) |
s741943882 | p03827 | u994988729 | 1566311234 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 142 | n=int(input())
S=input()
ans=[0]*(n+1)
for i,s in S:
if s=="I":
ans[i+1]=ans[i]+1
elif s=="D":
ans[i+1]=ans[i]-1
print(max(ans)) |
s810631791 | p03827 | u077291787 | 1566141669 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 234 | # ABC052B - Increment Decrement
def main():
_, S = tuple(input() for _ in range(2))
ans, x = [0], 0
for i in S:
x += 1 i == "I" else -1
ans += [x]
print(max(ans))
if __name__ == "__main__":
main() |
s246988250 | p03827 | u251515715 | 1566011916 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 139 | n=int(input())
s=list(input())
x=0
ans=0
for i in range(n):
if s[i]=='I':
x+=1
else s[i]=='D':
x-=1
ans=max(ans,x)
print(ans) |
s748260666 | p03827 | u453500284 | 1565880796 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 157 | input()
s = input()
x,m = 0, 0
for i in range(n):
if s[i]=="I":
x += 1
m = max(x, m)
if s[i]=="D":
x -= 1
m = max(x, m)
print(m)
|
s426740878 | p03827 | u842388336 | 1565852172 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 154 | do_list = []
x=0
N = int(input())
s = input()
for i in range(N):
if s[i]=="I":
x+=1
if S[i]=="D":
x-=1
do_list.append(x)
print(max(do_list)) |
s451690924 | p03827 | u946424121 | 1565757224 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 157 | n = input()
s=input()
c,m=0,0
for i in range(n):
if s[i]=="I":
c+=1
m=max(c,m)
if s[i]=="D":
c-=1
m=max(c,m)
print(m) |
s773479044 | p03827 | u946424121 | 1565757085 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 154 | n = int(input())
s = 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(l)) |
s001119287 | p03827 | u946424121 | 1565757032 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 154 | n = int(input())
s = input()
x = 0
l = [0]
for n in range(n):
if s[n] == "I":
x += 1
l.append(x)
else:
x -= 1
l.append(x)
print(max(l)) |
s524751826 | p03827 | u093500767 | 1564804260 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 189 | n = int(input())
s = input()
ans = 0
max = 0
for i in range(n):
if s[i]=="I":
ans+=1
max = max(ans, max)
else:
ans-=1
max = max(ans, max)
print(max) |
s659958935 | p03827 | u093500767 | 1564804183 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 194 | n = int(input())
s = str(input())
ans = 0
max = 0
for i in range(n):
if s[i]=="I":
ans+=1
max = max(ans, max)
else:
ans-=1
max = max(ans, max)
print(max) |
s477052989 | p03827 | u093500767 | 1564803763 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 169 | n = int(input())
s = str(input())
ans = 0
max = 0
for i in range(0, n):
if s[i]=="I":
ans+=1
max = max(ans, max)
else:
ans-=1
print(max) |
s745271326 | p03827 | u093500767 | 1564803458 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 129 | n = input()
s = input().str()
ans = 0
for i in range(0, n):
if s[i]=="I":
ans+=1
else:
ans-=1
print(ans) |
s949037206 | p03827 | u093500767 | 1564803419 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 135 | n = input().int()
s = input().str()
ans = 0
for i in range(0, n):
if s[i]=="I":
ans+=1
else:
ans-=1
print(ans) |
s630956215 | p03827 | u408620326 | 1564549482 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 118 | N=int(input())
S=input()
x=0
ans=0
for s in S:
if s=='I':
x+=1
ans=max(anx,x)
else:
x-=1
print(ans)
|
s698591682 | p03827 | u423585790 | 1563567512 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38768 | 1378 | #!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')
#A
def A():
a, b, c, d = LI()
print(max(a * b, c * d))
return
#B
def B():
_ = II()
s = S()
d["I"] = 1
d["D"] = -1
ans = 0
now = 0
for i in s:
now += d[i]
ans = max(ans, now)
print(ans)
return
#C
def C():
return
#D
def D():
return
#Solve
if __name__ == '__main__':
B()
|
s217132547 | p03827 | u423585790 | 1563567490 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38640 | 1474 | #!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')
#A
def A():
a, b, c, d = LI()
print(max(a * b, c * d))
return
#B
def B():
_ = II()
s = S()
d["I"] = 1
d["D"] = -1
ans = 0
now = 0
for i in s:
now += d[i]
ans = max(ans, now)
print(ans)
return
#C
def C():
return
#D
def D():
return
#E
def E():
return
#F
def F():
return
#G
def G():
return
#H
def H():
return
#Solve
if __name__ == '__main__':
A()
|
s917839034 | p03827 | u136811344 | 1563472595 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 137 | N=int(input())
S=input()
x = 0
max_x = 0
for s_i in S:
if s_i = "I":
x += 1
else:
x -= 1
max_x = max(max_x, x)
print(max_x) |
s964477094 | p03827 | u239342230 | 1563414188 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 130 | N=int(input())
S=input()
arr=[]
v=0
for s in S:
if s=="I":
v+=1
arr.append(v)
else:
v-=1
arr.append(v)
print(max(0,arr)) |
s280413389 | p03827 | u296150111 | 1560987747 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 131 | n=int(input())
s=input()
a=[1]
for i in range(1,n+1):
if s[i]=="I":
a.append(a[i-1]+1)
else:
a.append(a[i-1]-1)
print(max(a)) |
s589273170 | p03827 | u172111219 | 1559932690 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38384 | 152 | x=0
s_max = 0
n = int(input())
s = input()
for i in s:
if i == "I":
x += 1
else:
x -= 1
x_max = max(x_max,x)
print(x_max) |
s124966471 | p03827 | u095756391 | 1558831969 | Python | Python (3.4.3) | py | Runtime Error | 70 | 5688 | 180 | from fractions import *
n = int(input())
s = input()
x = 0
ans = 0
for i in range(N):
if s[i] == 'I':
x += 1
else:
x -= 1
ans = max(x, ans)
print(ans) |
s507220904 | p03827 | u625257971 | 1558673630 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 132 | input_n=input()
input_s=input()
tmp=0
x = 0
for i in input_s:
if i == "I":
x=x+1
else:
x=x-1
tmp=max(tmp,x)
print(tmp |
s763653894 | p03827 | u625257971 | 1558673545 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 132 | input_n=input()
input_s=input()
tmp=0
x = 0
for i in input_s:
if i == "I":
x=x+1
else:
x=x-1
tmp=max(tmp,x)
print(tmp |
s840194836 | p03827 | u163320134 | 1555398427 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 137 | n=int(input())
s=input()
ans=0
for i in range(n):
if s[i]='I':
tmp=ans+1
else:
tmp=ans-1
if tmp>ans:
ans=tmp
print(ans) |
s613114270 | p03827 | u003928116 | 1554339235 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 168 | n=int(input())
s=input()
a=[]
count=0
for i in range(len(s)):
if s[i]=="I":
count+=1
a.append(count)
else:
count-=1
print(max(max(a),0)) |
s806615457 | p03827 | u003928116 | 1554339189 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 163 | n=input()
s=input()
a=[]
count=0
for i in range(len(s)):
if s[i]=="I":
count+=1
a.append(count)
else:
count-=1
print(max(max(a),0)) |
s680228875 | p03827 | u143318682 | 1554047379 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 335 | # -*- coding: utf-8 -*-
N = int(input())
S = input()
I_count = [i for i, x in enumerate(S) if x == 'I']
D_count = [i for i, x in enumerate(S) if x == 'D']
tmp = [0] * N
for i in I_count:
tmp[i] = 1
for i in D_count:
tmp[i] = -1
ans = 0
List = []
for i in range(N):
ans += tmp[i]
List.append(ans)
print(max(0, List)) |
s146946711 | p03827 | u363610900 | 1553643103 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 155 | N = int(input())
S = input()
x = 0
l = []
for i in S:
if i == 'I':
x += 1
elif i == 'D':
l.append(x)
x -= 1
print(max(l)) |
s625864859 | p03827 | u518042385 | 1553230462 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 138 | n=int(input())
l=list(input())
n=0
lis=[]
for i in range(n):
if l[i]=="D":
n+=-1
else:
n+=1
lis.append(n)
print(max(lis))
|
s723388670 | p03827 | u363610900 | 1553141356 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 104 | x = nums =0
dic = {'I': 1, 'D': -1}
for i in s:
x += dic[i]
nums = max(x, nums)
print(nums) |
s326641260 | p03827 | u455696302 | 1552324953 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 214 | N = int(input())
S = input()
x = [0]*N
if S[0] == 'I':
x[0] += 1
else:
x[0] -= 1
for i in range(1,N):
if S[i] == 'I':
x[i] = x[i-1] + 1
else:
x[i] = x[i-1] - 1
print(max(x,0)) |
s988057858 | p03827 | u516272298 | 1550563711 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 247 | n = int(input())
s = str(input())
l = []
c = 0
if s.count("I") < s.count("D"):
print(0)
else:
for i in range(len(s)):
if s[i] == "I":
c += 1
elif s[i] == "D":
c -= 1
l.append(c)
print(max(l)) |
s295888960 | p03827 | u231647664 | 1547948598 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 150 | n = input()
str = input()
val = []
o = str[:1]
if o == 'D':
n -= 1
val.append(n)
str = str[1:]
else:
n += 1
val.append(n)
str = str[1:]
|
s773682012 | p03827 | u597374218 | 1546984589 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 123 | n,s=input(),input()
c,m=0,0
for i in range(n):
if s[i]=="I":c,m=c+1,max(c,m)
if s[i]=="D":c,m=c-1,max(c,m)
print(m) |
s851989973 | p03827 | u928784113 | 1546534030 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 221 | N = int(input())
S = str(input())
lst_for_ans = []
for i in range(len(S)):
I_count = S[:i].count("I")
D_count = S[:i].count("D")
lst_for_ans.append(I_count - D_count)
print(max(lst_for_ans,0)) |
s965997236 | p03827 | u283846680 | 1545446804 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 144 | n = int(input())
s = input()
x = 0
c = 0
for i in range(n):
if s[i] = "I":
c += 1
else:
c -= 1
x = max(x,c)
print(x) |
s638107501 | p03827 | u409064224 | 1540436444 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 215 | # this is cumulative
n = int(input())
s = input()
point = 0
cum_sum = []
for i in s:
if i == "I":
point += 1
else:
point -= 1
cum_sum.append(point)
else:
print(max(cum_sum,0))
|
s044273538 | p03827 | u277802731 | 1534217800 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 162 | #52b
n = int(input())
s = input()
ans = [0]
for i in s:
if s[i]=='I':
ans.append(ans[-1]+1)
else:
ans.append(ans[-1]-1)
print(max(ans))
|
s079991453 | p03827 | u095969144 | 1530067091 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 136 | i = int(input())
s = input()
ans = 0
for x in range(len(i)) :
if s[x] == "I" :
ans ++
else :
ans --
print(ans) |
s813849952 | p03827 | u399280934 | 1528673027 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 149 | n=int(input())
s=input()
x=ans=0
for i in range(n):
if s[i]=='I':
x=x+1
elif s[i]=='D':
x=x-1
ans=max(ans,x)
print(ans) |
s404924704 | p03827 | u409064224 | 1527634021 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 171 | n = int(input())
s = str(input())
num = 0
res = 0
for i in range(len(s)):
if str[i] == 'I':
num += 1
else:
num -= 1
if num > res:
res = num
print(res) |
s085365569 | p03827 | u881612683 | 1526418993 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 231 | N = int(input())
S = list(input())
x = 0
for item in S:
if item == 'I":
x+= 1
if item == 'D':
x-= 1
N = int(input())
S = list(input())
x = 0
for item in S:
if item == 'I":
x+= 1
if item == 'D':
x-= 1
print(x) |
s010790292 | p03827 | u881612683 | 1526418959 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 110 | N = int(input())
S = list(input())
x = 0
for item in S:
if item == 'I":
x+= 1
if item == 'D':
x-= 1 |
s757442560 | p03827 | u018679195 | 1523005674 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 309 |
x=0
n=int(input())
F=list(input())
#lis=F.split()
alist=[]
alist.append(x)
for token in F:
if token=="I":
x=x+1
alist.append(x)
else:
x=x-1
alist.append(x)
for i in alist:
if alist[i]>alist[i+1]:
x=alist[i]
else:
x=alist[i+1]
print(x) |
s758181577 | p03827 | u019584841 | 1519853978 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 131 | n=int(input())
s=input()
l=[0]*n
for i in range(n-1):
if s[i]==I:
l[i+1]=l[i]+1
else:
l[i+1]=i[i]-1
print(max(l))
|
s836210870 | p03827 | u019584841 | 1519853852 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | n=int(input())
s=input()
l=[0]*n
for i in range(n):
if s[i]==I:
l[i]+=1
else:
l[i]-=1
print(max(l))
|
s939041231 | p03827 | u319612498 | 1519324024 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 194 | n=int(input())
s=list(input())
x=0
a=[0]
for i in range(n):
if s[i]=="I":
x+=1
a.append(x)
else:
x-=1
a.append(x)
a=list(set(a))
b=a.reverse()
print(b[0]) |
s307621720 | p03827 | u030726788 | 1519305271 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | n=int(input())
s=input()
x=0
max=0
for i in range(n):
if(s[i]=="D"):
x-=1
else:
x+=1
max=max([max,x])
print(max) |
s892194336 | p03827 | u586577600 | 1517081697 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 152 | n = int(input())
s = input()
ans = 0
cur = 0
for c in s:
if c == 'I':
cur += 1
ans = max(ans, cur)
else:
cur -= 1
print(ans) |
s737866339 | p03827 | u350179603 | 1515884963 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 184 | s = list(input())
i_tmp1 = 200001
for i in range(len(s)):
if s[i] == "A":
i_tmp1= i
elif s[i] == "Z" and i >= i_tmp1:
i_tmp2 = i
break
print(i_tmp2-i_tmp1+1) |
s474201501 | p03827 | u350179603 | 1515881257 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 107 | n = int(input())
s = list(input())
for i in s:
if i =="I":
n += 1
else:
n -= 1
print(n) |
s891710188 | p03827 | u018679195 | 1507012203 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 264 | n = raw_input()
x = n.split()
N= int(x[0])
S = x[1]
x=0
y = str(x)
for i in range(0,N):
if S[i] == "I":
x = x+1
y = y + str(x)
elif S[i]=="D":
x = x - 1
y = y + str(x)
print max([int(c) for c in ])
|
s973916717 | p03827 | u863370423 | 1507011834 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 243 | n = raw_input()
S = raw_input()
N = int(n)
x=0
y = str(x)
for i in range(0,N):
if S[i] == "I":
x = x+1
y = y + str(x)
elif S[i]=="D":
x = x - 1
y = y + str(x)
print max([int(c) for c in y])
|
s771044261 | p03827 | u667084803 | 1494630634 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 162 | N=int(input())
S=str(input())
t=[0]
s=0
for i in range(N):
if S[i]=="I":
s+=1
else:
s-=1
t+=[s]
ans=0
for i in range(N+1):
ans=max(ans,int(t[i]))
print(ans) |
s503178354 | p03827 | u996776197 | 1493607664 | Python | Python (2.7.6) | py | Runtime Error | 12 | 2692 | 424 | #coding: shift_jis
N = int(raw_input())
S = raw_input()
x = 0
y = [x]
for i in range(N):
if S[i] == 'I':
x += 1
elif S[i] == 'D':
x -= 1
y.append(x)
print max(y)
#coding: shift_jis
N = int(raw_input())
S = raw_input()
x = 0
y = [x]
for i in range(N):
if S[i] == 'I':
x += 1
elif S[i] == 'D':
x -= 1
y.append(x)
print max(y)
|
s965537709 | p03827 | u481333386 | 1491176577 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 424 | # -*- coding: utf-8 -*-
def main(n, s):
count = 0
max_values = []
for c in s:
if c == 'I':
count += 1
max_values.append(count)
else:
count -=
max_values = max_values if max_values else [0]
return max(max_values) if 0 < max(max_values) else 0
if __name__ == '__main__':
n = int(input())
s = input()
answer = main(n, s)
print(answer) |
s893907785 | p03827 | u481333386 | 1491176372 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 423 | # -*- coding: utf-8 -*-
def main(n, s):
count = 0
max_values = []
for c in s:
if c == 'I':
count += 1
max_values.append(count)
else:
count -= 1
max_values = max_values if max_values else 0
return max(max_values) if 0 < max(max_values) else 0
if __name__ == '__main__':
n = int(input())
s = input()
answer = main(n, s)
print(answer) |
s577999833 | p03827 | u481333386 | 1491176215 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 374 | # -*- coding: utf-8 -*-
def main(n, s):
count = 0
max_values = []
for c in s:
if c == 'I':
count += 1
max_values.append(count)
else:
count -= 1
return max(max_values) if 0 < max(max_values) else 0
if __name__ == '__main__':
n = int(input())
s = input()
answer = main(n, s)
print(answer) |
s083056352 | p03827 | u481333386 | 1491176093 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 379 | # -*- coding: utf-8 -*-
def main(n, s):
count = 0
max_values = []
for c in s:
if c == 'I':
count += 1
max_values.append(count)
else:
count -= 1
return max(max_values) if 0 < max(max_values) else 0
if __name__ == '__main__':
n = int(input())
s = int(input())
answer = main(n, s)
print(answer) |
s734061190 | p03827 | u972669913 | 1485650775 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 179 | N = int(raw_input())
S = int(raw_input())
x = 0
maxx = 0
for c in S:
if c == 'I':
x += 1
if c == 'D':
x -= 1
if x > maxx:
maxx = x
print maxx |
s909984386 | p03827 | u203900263 | 1484970791 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 171 | N = int(input())
S = input()
x = 0
max = 0
for i in range(N):
if S[i] == ‘I’:
x += 1
else:
x -= 1
if x > max:
max = x
print(max)
|
s421714814 | p03827 | u272028993 | 1484622885 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 188 | n=int(raw_input())
s=raw_input()
ans=0
for i in xrange(n):
if s[i]=="I":
cnt+=1
ans=max(ans,cnt)
elif s[i]=="D":
cnt-=1
ans=max(ans,cnt)
print(ans)
|
s959987127 | p03827 | u731028462 | 1484600802 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 139 | n = int(input())
s = list(map(lambda x: 1 if x == "I" else -1, list(input()))
x = 0
m = 0
for i in s:
x += i
m = max(m,x)
print(m)
|
s748480843 | p03827 | u882200107 | 1484536520 | Python | Python (3.4.3) | py | Runtime Error | 22 | 2940 | 192 | 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) |
s893487618 | p03827 | u012693733 | 1484534343 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 229 | n = int(raw_input())
s = raw_input()
x = []
cnt = 0
for i in s:
if s[i] == 'I':
cnt += 1
x.append(cnt)
elif s[i] == 'D':
cnt -= 1
x.append(cnt)
else:
x.append(cnt)
print max(x)
|
s993223917 | p03827 | u012693733 | 1484534262 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 177 | n = int(raw_input())
s = raw_input()
x = []
cnt = 0
for i in s:
if s[i] == 'I':
cnt += 1
x.append(cnt)
elif s[i] == 'D':
cnt -= 1
x.append(cnt)
else:
x.append(cnt)
print max(x)
|
s718254810 | p03827 | u012693733 | 1484533934 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 255 | n = int(raw_input())
s = raw_input()
x = []
cnt = 0
for i in s:
if s[i] == 'I':
cnt += 1
x.append(cnt)
elif s[i] == 'D':
cnt -= 1
x.append(cnt)
else:
x.append(cnt)
print max(x) |
s366582498 | p03828 | u425762225 | 1600276460 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9160 | 402 | MOD = 10**9+7
memo = [0]*10000
N = int(input())
def primeLst(k):
acc = []
if k == 1:
return acc
f = 2
while f * f <= k:
if k % f == 0:
acc.append(f)
k //= f
else:
f += 1
if k != 1:
acc.append(k)
return acc
for i in range(N):
l = primeLst(i+1)
for x in l:
memo[x] += 1
res = 1
for i in range(1,N):
res *= memo[i+1] + 1
res %= MOD
print(acc) |
s174904889 | p03828 | u875769753 | 1598545727 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9136 | 399 | N = int(input())
ls = [0]+[0]*N
couterls = collections.Counter(ls)
for i in range(1,N+1):
for j in range(2,N+1):
if i % j == 0:
while i % j == 0:
couterls[j] += 1
i = i // j
elif i == 1:
break
else:
pass
ans = 1
couterls.pop(0)
for i in couterls.values():
ans = (ans * (i+1) ) % (10**9+7)
print(ans) |
s761780633 | p03828 | u396211450 | 1597816552 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8896 | 303 | n=int(input())
p=[1 for i in range(10000)]
p[0]=0
p[1]=0
for i in range(2,n+1):
if p[i]==1:
for j in range(i*i,n+1,i):
p[j]=0
ans=1
for i in range(2,n+1):
if p[i]:
c=0
k=i
while n//k>0:
c=c+(n//k)%m
k=k*k
ans=(ans*((c+1)%m))%m
print(ans)
|
s801671065 | p03828 | u396211450 | 1597809824 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9032 | 302 | n=int(input())
p=[0 for i in range(10000)]
p[0]=0
p[1]=0
for i in range(2,n+1):
if p[i]==1:
for j in range(i*i,n+1,i):
p[j]=0
ans=1
for i in range(2,n+1):
if p[i]:
c=0
k=i
while n//k>0:
c=c+(n//k)%m
k=k*k
ans=(ans*((c+1)%m))%m
print(ans)
|
s469718909 | p03828 | u980503157 | 1597514259 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8944 | 214 | from math import sqrt
num = int(input())
f = 1
for i in range(num):
f = f * (i+1)
divisors = 0
new_f = f%1000000007
for i in range(sqrt(new_f)):
if new_f%(i+1) == 0:
divisors += 2
print(divisors)
|
s867397780 | p03828 | u895918162 | 1597513964 | Python | Python (3.8.2) | py | Runtime Error | 21 | 9180 | 177 | num = int(input())
product = 1
factors = 0
for i in range(1, num+1):
product *= i
for j in range(1, product/2 + 1):
if product % j == 0:
factors += 1
print(factors)
|
s204488482 | p03828 | u980503157 | 1597513787 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9068 | 192 | from math import sqrt
num = int(input())
f = 1
for i in range(num):
f = f * (i+1)
divisors = 0
for i in range(int(sqrt(f))):
if f%(i+1) == 0:
divisors += 2
print(divisors) |
s420442332 | p03828 | u895918162 | 1597513097 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9188 | 170 | num = int(input())
product = 1
factors = 0
for i in range(1, num+1):
product *= i
for j in range(product//2):
if product % j == 0:
factors += 1
print(factors) |
s170729674 | p03828 | u250662864 | 1597513094 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9100 | 139 | num = int(input())
total = 0
for i in range(1, num+1):
fac *= i
for i in range(1, fac+1):
if(fac % i == 0):
total += 1
print(total) |
s299450390 | p03828 | u250662864 | 1597513069 | Python | Python (3.8.2) | py | Runtime Error | 21 | 9168 | 145 | num = int(input())
i = 1
total = 0
for i in range(1, num+1):
fac *= i
for i in range(1, fac+1):
if(fac % i == 0):
total += 1
print(total) |
s610214435 | p03828 | u980503157 | 1597513038 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9128 | 150 | num = int(input())
f = 1
for i in range(num):
f = f *(i+1)
divisors = 0
for i in range(f):
if f%i == 0:
divisors += 1
print(divisors) |
s199590314 | p03828 | u566428756 | 1597363144 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9380 | 526 | N=int(input())
p=10**9+7
def primeryNum(n):
n_=int(n**0.5)
ary=list(range(n+1))
ary[1]=0
for a in ary:
if a>n_: break
elif a==0: continue
for i in range(a*2,n+1,a):
ary[i]=0
return ary
primeryN=primeryNum(N)
divN=[0]*N
for pn in primeryN:
if pn==0:
continue
i=1
cnt=0
while (pn**i<N):
cnt+=(N//pn**i)
i+=1
divN[pn]=cnt
ans=1
for d in divN:
if d==0:
continue
ans=(ans*(d+1))%p
print(ans) |
s104464281 | p03828 | u065099501 | 1597087519 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9404 | 459 | import collections
n = int(input())
for i in range(1,n+1):
t *= i
def prime_factorize(n):
a = []
while n % 2 == 0:
a.append(2)
n //= 2
f = 3
while f * f <= n:
if n % f == 0:
a.append(f)
n //= f
else:
f += 2
if n != 1:
a.append(n)
return a
c = collections.Counter(prime_factorize(t))
ans = 1
for _, v in c.items():
ans *= (v + 1)
print(ans%(10**9+7)) |
s400835135 | p03828 | u278183305 | 1597086116 | Python | Python (3.8.2) | py | Runtime Error | 2210 | 182268 | 471 | def make_divisors(n):
lower_divisors , upper_divisors = [], []
i = 1
while i*i <= n:
if n % i == 0:
lower_divisors.append(i)
if i != n // i:
upper_divisors.append(n//i)
i += 1
return lower_divisors + upper_divisors[::-1]
def factorial(n):
if n <= 1:
return 1
else:
return factorial(n-1) * n
n = int(input())
m = factorial(n)
res = make_divisors(m)
print(len(res)%(10**9+7)) |
s061097082 | p03828 | u626228246 | 1595883240 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9144 | 919 | import math
n = int(input())
prime_list = []
#2からnまでの数字をsearch_listに入れる
search_list = list(range(2,n+1))
while True:
#search_listの先頭の値が√nの値を超えたら処理終了
if search_list[0] > math.sqrt(n):
#prime_listにsearch_listを結合
prime_list.extend(search_list)
break
else:
#search_listの先頭をprime_listに入れる
head_num = search_list[0]
prime_list.append(head_num)
#search_listの先頭をpopする
search_list.pop(0)
#head_numの倍数を取り除く
search_list = [num for num in search_list if num % head_num != 0]
#print(prime_list)
########ここから本問を解く#########
ans = 1
for x in prime_list:
tmp = 0
nl = 1
while(x**nl <= n):
tmp += n//(x**nl)
nl += 1
ans *= tmp+1
if ans >= 10**9+7:
ans %= (10**9+7)
print(ans) |
s114816466 | p03828 | u440478998 | 1592938359 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9024 | 91 | import sympy
num = int(input())
print(sympy.divisor_count(math.factorial(num)) % (10**9+7)) |
s287741216 | p03828 | u410269178 | 1591653588 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38256 | 286 | import numpy as np
MOD = 1000000007
n = int(input())
cnt = np.ones(n+1)
for i in range(2, n+1):
m = i
for j in range(2, i+1):
while m % j == 0:
m = m / j
cnt[j] += 1
ans = 1
for i in range(2, n+1):
ans = (ans * cnt[i]) % MOD
print(int(ans)) |
s942158725 | p03828 | u823885866 | 1591479997 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3064 | 311 | n = int(input())
a = 1
for i in range(1, n):
a *= i
li = []
temp = 0
while a % 2 == 0:
temp += 1
a //= 2
else:
li.append(temp+1)
for i in range(3, int(a**0.5)+1, 2):
temp = 0
while a % i == 0:
temp += 1
a //= i
else:
li.append(temp+1)
ans = 1
for i in li:
ans *= i
else:
print(ans) |
s186808836 | p03828 | u047197186 | 1591158778 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 319 | import math
n = int(input())
fac_n = math.factorial(n)
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
return divisors
print(len(make_divisors(fac_n)) % (10**9+7)) |
s880911425 | p03828 | u047197186 | 1591158750 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 340 | import math
n = int(input())
fac_n = math.factorial(n)
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
divisors.sort()
return divisors
print(len(make_divisors(fac_n)) % (10**9+7)) |
s536163583 | p03828 | u047197186 | 1591158663 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 328 | import math
n = int(input())
fac_n = math.factorial(n)
def make_divisors(n):
divisors = []
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
divisors.sort()
return divisors
print(len(make_divisors(fac_n))) |
s349306461 | p03828 | u497952650 | 1590196991 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3316 | 777 | from collections import defaultdict
def prime_factorize(N): #素因数分解
exponent = 0
while N%2 == 0:
exponent += 1
N //= 2
if exponent: factorization = [[2,exponent]]
else: factorization = []
i=1
while i*i <=N:
i += 2
if N%i: continue
exponent = 0
while N%i == 0:
exponent += 1
N //= i
factorization.append([i,exponent])
if N!= 1: factorization.append([N,1])
assert N != 0, "zero"
return factorization
N = int(input())
if N <= 2:
print(N)
else:
num = defaultdict(int)
for i in range(2,N+1):
for n,m in prime_factorize(i):
num[n] += m
ans = 1
mod = int(1e9+7)
for i in num.values():
ans = ((i+1)*ans)%mod
print(ans) |
s392544447 | p03828 | u085334230 | 1590041617 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 251 | import math
N = int(input())
N = math.factorial(N)
i = 2
num = 1
ans = 1
while N != 1:
if N % i == 0:
N //= i
num += 1
else:
ans *= num
num = 1
i += 1
ans *= num
ans %= (10 ** 9) + 7
print(ans) |
s319482363 | p03828 | u085334230 | 1590041591 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 338 | import math
N = int(input())
N = math.factorial(N) # N!を出してくれる (N=3, 0+1+2+3=6)
i = 2 #Nを素因数分解するためまずは2で
num = 1
ans = 1
while N != 1:
if N % i == 0:
N //= i
num += 1
else:
ans *= num
num = 1
i += 1
ans *= num
ans %= (10 ** 9) + 7
print(ans) |
s387214561 | p03828 | u513081876 | 1589938732 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 232 | import math
N = int(input())
num = 1
ans = 0
for i in range(1, N + 1):
num *= i
maxx = int(math.sqrt(num)) + 2
for i in range(1, (num // 2) + 3):
if num % i == 0:
ans += 1
ans %= (10**9) + 7
print(ans + 1) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.