QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#752585#9552. The Chariotucup-team3931#WA 11ms10632kbPython3803b2024-11-16 08:33:172024-11-16 08:33:21

Judging History

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

  • [2024-11-16 08:33:21]
  • 评测
  • 测评结果:WA
  • 用时:11ms
  • 内存:10632kb
  • [2024-11-16 08:33:17]
  • 提交

answer

def calc(n, a, b, c, x, y):
    if n == 0:
        return 0
    ans = a
    n -= x
    if n <= 0:
        return ans
    t = min(n, y)
    ans += t * b
    n -= t
    if n <= 0:
        return ans
    return ans + n * c

T = int(input())
for i in range(T):
    a, b, c, x, y, d = map(int, input().split())
    if d <= x:
        print(a)
        continue
    if a == min([a, b * x, c * x]):
        t = d // x
        print((t - 1) * a + min(a * 2, calc(d - (t - 1) * x, a, b, c, x, y)))
        continue
    if (b == min([a, b * x, c * x])):
        t = d // (x + y)
        print(t * (a + b * y) + calc(d - t * (x + y), a, b, c, x, y))
        continue
    t = d // x
    print(min([calc(d, a, b, c, x, y), (t - 1) * a + min(a * 2, calc(d - (t - 1) * x, a, b, c, x, y))]))

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 11ms
memory: 10632kb

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
3928
999
10000000000099799

result:

wrong answer 3rd lines differ - expected: '3226', found: '3928'