QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#710684#9552. The Chariotucup-team1196#Compile Error//C++201.3kb2024-11-04 21:00:332024-11-04 21:00:34

Judging History

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

  • [2024-11-04 21:00:34]
  • 评测
  • [2024-11-04 21:00:33]
  • 提交

answer


def main():
    for T in range(0, int(input())):
        A, B, C, X, Y, D = map(int, input().split(" "))

        #ABCCCCCCCCCCC
        ans = 0
        if D < X:
            ans = A
        elif D < X + Y:
            ans = A + B * (D - X)
        else:
            ans = A + B * Y + (D - X - Y) * C

        # AAAAAAAAAA

        cntA = (D + X - 1) // X
        ans = min(ans, cntA * A)

        # #ABABABABABABABCCC

        cntAB = D // (X + Y)
        restAB = D - cntAB * (X + Y)
        if cntAB >= 1:
            ans = min(ans, cntAB * (A + Y * B) + restAB * C)

        # AAAAAAAA use B, C to fill the rest

        cntA = D // X
        restA = D - cntA * X
        if restA <= Y * cntA:
            ans = min(ans, cntA * A + restA * B)

        # # #AAAAAAABCCCCCC

        if restA > Y:
            ans = min(ans, cntA * A + B * Y + (restA - Y) * C)


        #ABABABAb
        if X < restAB:
            ans = min(ans, cntAB * (A + B * Y) + (restAB - X) * B + A)
        else :
            ans = min(ans, cntAB * (A + B * Y) + A)

        rest = restAB - X
        if rest < 0 and cntAB * Y + rest > 0:
            ans = min(ans, cntAB * (A + B * Y) + A + B * rest)


        print(ans)



if __name__ == "__main__":
    main()

詳細信息

answer.code:6:10: error: invalid preprocessing directive #ABCCCCCCCCCCC
    6 |         #ABCCCCCCCCCCC
      |          ^~~~~~~~~~~~~
answer.code:15:11: error: invalid preprocessing directive #AAAAAAAAAA
   15 |         # AAAAAAAAAA
      |           ^~~~~~~~~~
answer.code:20:11: error: invalid preprocessing directive ##
   20 |         # #ABABABABABABABCCC
      |           ^
answer.code:27:11: error: invalid preprocessing directive #AAAAAAAA
   27 |         # AAAAAAAA use B, C to fill the rest
      |           ^~~~~~~~
answer.code:34:11: error: invalid preprocessing directive ##
   34 |         # # #AAAAAAABCCCCCC
      |           ^
answer.code:40:10: error: invalid preprocessing directive #ABABABAb
   40 |         #ABABABAb
      |          ^~~~~~~~
answer.code:2:1: error: ‘def’ does not name a type
    2 | def main():
      | ^~~