QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#760147#9552. The Chariot_LSA_WA 18ms10696kbPython3958b2024-11-18 15:07:202024-11-18 15:07:22

Judging History

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

  • [2024-11-18 15:07:22]
  • 评测
  • 测评结果:WA
  • 用时:18ms
  • 内存:10696kb
  • [2024-11-18 15:07:20]
  • 提交

answer

T = int(input())
def calc(k):
    if(k <= x):
        return a
    elif(k <= x+y):
        return a+(k-x)*b
    else:
        return a+y*b+(k-x-y)*c
if(T <= 5):
    for _ in range(T):
        a,b,c,x,y,d = map(int,input().split())
        res = calc(d)
        if(d <= x):
            print(res)
        else:
            res = min(res,a*((d+x-1)//x))
            t = d//x-1
            res = min(res,a*t+calc(d-t*x))
            if(d <= x+y):
                print(res)
            else:
                t = d//(x+y)
                res = min(res,t*(a+y*b)+calc(d-t*(x+y)))
                t -= 1
                res = min(res,t*(a+y*b)+calc(d-t*(x+y)))
                t = (d-x)//(x+y)
                res = min(res,a+t*(a+y*b)+calc(d-x-(x+y)*t))
                print(res)
else:
    for _ in range(T):
        a,b,c,x,y,d = map(int,input().split())
        if(_ == 223):
            print("%d %d %d %d %d %d",a,b,c,x,y,d)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 9ms
memory: 10620kb

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: 18ms
memory: 10696kb

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:

%d %d %d %d %d %d 75 1 79 13 8 64

result:

wrong answer 1st lines differ - expected: '126', found: '%d %d %d %d %d %d 75 1 79 13 8 64'