QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#764868#9255. Python Program1903331632TL 15ms10488kbPython3339b2024-11-20 10:58:562024-11-20 10:58:57

Judging History

你现在查看的是最新测评结果

  • [2024-11-20 10:58:57]
  • 评测
  • 测评结果:TL
  • 用时:15ms
  • 内存:10488kb
  • [2024-11-20 10:58:56]
  • 提交

answer

# 提示用户输入多行代码
user_code = []
for i in range(0,5):
    line = input()  # 一次读取一行
    user_code.append(line)

# 将代码拼接成完整的代码块
code_to_execute = "\n".join(user_code)

# 执行代码
try:
    exec(code_to_execute)
except Exception as e:
    print(f"代码执行出错:{e}")

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 12ms
memory: 10460kb

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: 10488kb

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)

output:


result: