QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#500185 | #9136. Exponent Calculator | ucup-team3734 | AC ✓ | 11ms | 10576kb | Python3 | 1.0kb | 2024-08-01 00:50:43 | 2024-08-01 00:50:43 |
Judging History
answer
ops = list()
ops.append('$1 = $1 * 0.03125')
cs = [
'1.00000000000409250411',
'0.99999999996229649302',
'0.49999999943843465022',
'0.16666666793726392370',
'0.04166667869120328771',
'0.00833332210917809603',
'0.00138880002043589921',
'0.00019844700093970611',
'0.00002506724645050853',
'0.00000273136629213122',
]
ops.append(f'$0 = {cs[-1]}')
for x in cs[-2::-1]:
ops.append('$0 = $0 * $1')
if x == '-':
ops.append('$0 = $0 - ' + x)
else:
ops.append('$0 = $0 + ' + x)
ops.append('$0 = $0 * $0')
ops.append('$0 = $0 * $0')
ops.append('$0 = $0 * $0')
ops.append('$0 = $0 * $0')
ops.append('$0 = $0 * $0')
print(len(ops))
for op in ops:
print(op)
# import re
# def evl(ops, x):
# regs = [0.0] * 10
# regs[1] = x
# for op in ops:
# l = re.sub(r'\$(\d+)', r'regs[\1]', op)
# exec(l)
# print(op)
# print(regs)
# return regs[0]
# import math
# x = -10
# print(evl(ops, x) / math.exp(x))
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 11ms
memory: 10576kb
input:
input
output:
25 $1 = $1 * 0.03125 $0 = 0.00000273136629213122 $0 = $0 * $1 $0 = $0 + 0.00002506724645050853 $0 = $0 * $1 $0 = $0 + 0.00019844700093970611 $0 = $0 * $1 $0 = $0 + 0.00138880002043589921 $0 = $0 * $1 $0 = $0 + 0.00833332210917809603 $0 = $0 * $1 $0 = $0 + 0.04166667869120328771 $0 = $0 * $1 $0 = $0 ...
result:
ok max relative diff is 1.55512e-10. Checker runtime is 163 ms
Extra Test:
score: 0
Extra Test Passed