QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#636670 | #9255. Python Program | maspy | TL | 18ms | 10748kb | Python3 | 436b | 2024-10-13 01:43:49 | 2024-10-13 01:43:50 |
Judging History
answer
txt = [input() for _ in range(5)]
def find(X):
p=X.find("range")
X=X[p+5:][1:-2]
return X.split(",")
A=find(txt[1])
B=find(txt[2])
if len(A)==2:
A.append(1)
if len(B)==2:
B.append(1)
ANS = 0
a,b,c=map(int,A)
for x in range(a,b,c):
def f(s):
if s.lstrip('-').isdigit():
return int(s)
return x
p,q,r=map(f,B)
ANS += sum(range(p,q,r))
print(ANS)
詳細信息
Test #1:
score: 100
Accepted
time: 18ms
memory: 10552kb
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: 14ms
memory: 10748kb
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)