QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#674288 | #9255. Python Program | mzyx | TL | 15ms | 10716kb | Python3 | 1.4kb | 2024-10-25 14:58:08 | 2024-10-25 14:58:08 |
Judging History
answer
l1 = input()
l2 = input()
l3 = input()
l4 = input()
l5 = input()
l2 = l2.split(' ')
l3 = l3.split(' ')
while len(l2) > 0 and l2[0] == '':
del l2[0]
while len(l3) > 0 and l3[0] == '':
del l3[0]
i = l2[1]
j = l3[1]
s = len(l2[3])
ss = ''
ml1 = []
for x in range(6, s):
if l2[3][x] != ',' and l2[3][x] != ')':
ss += l2[3][x]
else:
ml1.append(ss)
ss = ''
ss = ''
ml2 = []
s = len(l3[3])
for x in range(6, s):
if l3[3][x] != ',' and l3[3][x] != ')':
ss += l3[3][x]
else:
ml2.append(ss)
ss = ''
if len(ml1) == 2:
ml1.append('1')
a, b, c = int(ml1[0]), int(ml1[1]), int(ml1[2])
if len(ml2) == 2:
ml2.append('1')
t = str(int(ml2[0] == i)) + str(int(ml2[1] == i)) + str(int(ml2[2] == i))
ans = 0
for x in range(a, b, c):
if t == '000':
for y in range(int(ml2[0]), int(ml2[1]), int(ml2[2])):
ans += y
if t == '001':
for y in range(int(ml2[0]), int(ml2[1]), x):
ans += y
if t == '010':
for y in range(int(ml2[0]), x, int(ml2[2])):
ans += y
if t == '100':
for y in range(x, int(ml2[1]), int(ml2[2])):
ans += y
if t == '110':
for y in range(x, x, int(ml2[2])):
ans += y
if t == '101':
for y in range(x, int(ml2[1]), x):
ans += y
if t == '011':
for y in range(int(ml2[0]), x, x):
ans += y
if t == '111':
for y in range(x, x, x):
ans += y
print(ans)
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 10ms
memory: 10524kb
input:
ans=0 for a in range(1,3): for b in range(5,1,-2): ans+=b print(ans)
output:
16
result:
ok single line: '16'
Test #2:
score: 0
Accepted
time: 15ms
memory: 10716kb
input:
ans=0 for q in range(100,50,-1): for i in range(q,77,20): ans+=i print(ans)
output:
2092
result:
ok single line: '2092'
Test #3:
score: -100
Time Limit Exceeded
input:
ans=0 for i in range(1,1000000): for j in range(i,1,-1): ans+=j print(ans)