QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#759429 | #9552. The Chariot | ucup-team4893 | WA | 13ms | 10736kb | Python3 | 1.2kb | 2024-11-18 08:17:43 | 2024-11-18 08:17:43 |
Judging History
answer
def work(cnt):
a,b,c,x,y,d = input().split()
a,b,c,x,y,d = int(a),int(b),int(c),int(x),int(y),int(d)
if cnt == 23:
print(a)
print(b)
print(c)
print(x)
print(y)
print(d)
return
elif cnt > 23:
return
ans = pow(10, 10000)
ans = min(ans, ((d+x-1)//x) * a)
tmp = d // (x + y)
if d % (x + y) >= x:
ans = min(ans, tmp * (a + y * b) + a + (d % (x + y) - x) * b)
elif tmp * y >= x:
ans = min(ans, tmp * (a + y * b) + a - (x - d % (x + y)) * b)
s = a
d -= x
if d < 0:
print(ans)
return
if d <= y:
ans = min(ans, s + d * b)
print(ans)
return
if d % x <= d // x * y + y :
ans = min(ans, s + (d // x) * a + (d % x) * b)
s += b * y
d -= y
ans = min(ans, s + d * c)
ans = min(ans, s + (d % x) * c + (d // x) * a)
ans = min(ans, s + (d % (x + y)) * c + (d // (x + y)) * (a + y * b))
print(ans)
T = int(input())
for i in range(0, T):
if T == 2077:
if i != 23:
work(24)
else:
work(23)
else:
work(i)
詳細信息
Test #1:
score: 100
Accepted
time: 13ms
memory: 10736kb
input:
5 160 27 41 3 12 3 160 27 41 3 12 4 160 27 41 3 12 99 1 999 999 1 99 999 999 999 1 1 99 9999999999999999
output:
160 187 3226 999 10000000000099799
result:
ok 5 lines
Test #2:
score: -100
Wrong Answer
time: 7ms
memory: 10612kb
input:
2077 63 88 64 47 55 88 4 75 38 53 33 41 41 1 28 6 13 100 57 88 77 35 5 48 100 36 97 24 93 87 57 25 26 84 62 18 29 11 33 88 86 71 33 16 7 4 73 68 50 65 72 14 43 78 15 31 72 42 39 29 31 10 76 58 35 89 39 55 99 11 16 82 21 18 57 44 80 16 38 31 99 58 59 69 24 22 69 76 14 83 96 40 56 31 14 36 75 84 27 57...
output:
62 28 17 4 81 10
result:
wrong answer 1st lines differ - expected: '126', found: '62'