QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#762786#9552. The ChariotkazimiyuukaCompile Error//C++201.1kb2024-11-19 16:39:192024-11-19 16:39:19

Judging History

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

  • [2024-11-19 16:39:19]
  • 评测
  • [2024-11-19 16:39:19]
  • 提交

answer

'''
Author: kazimiyuuka [email protected]
Date: 2024-11-19 16:12:40
LastEditors: kazimiyuuka [email protected]
LastEditTime: 2024-11-19 16:37:36
Description: 

Copyright (c) 2024 by ${git_name}, All Rights Reserved. 
'''
import math

cnt = int(input())

for i in range(cnt):
    str=input()
    val = str.split(' ')
    
    a = int(val[0])
    b = int(val[1])
    c = int(val[2])
    x = int(val[3])
    y = int(val[4])
    d = int(val[5])

    ans = int(0)
    if d <= x:
        ans = a
    elif d <= (x + y):
        ans = a + (d - x) * b
    else:
        ans = a + y * b + (d - x - y) * c

    tmp = x + y
    signal = int(d // tmp)
    rem = d - signal * tmp
    
    if signal != 0:
       ans = min(ans , signal * (a + b * y) + rem * c)
    ans = min(ans , signal * (a + b * y) + (a if rem <= x else a + (rem - x) * b))
    
    signal = int(d // x)
    rem = d - signal * x
    ans = min(ans , a * (signal + (1 if rem != 0 else 0)))
    if signal != 0:
       ans = min(ans , signal * a + (rem * b if rem <= y else y * b + (rem - y) * c))
    
    ans = int(ans)

    print(ans)






Details

answer.code:1:1: error: empty character constant
    1 | '''
      | ^~
answer.code:1:3: warning: missing terminating ' character
    1 | '''
      |   ^
answer.code:1:3: error: missing terminating ' character
answer.code:2:32: error: stray ‘@’ in program
    2 | Author: kazimiyuuka [email protected]
      |                                ^
answer.code:4:37: error: stray ‘@’ in program
    4 | LastEditors: kazimiyuuka [email protected]
      |                                     ^
answer.code:9:1: error: empty character constant
    9 | '''
      | ^~
answer.code:9:3: warning: missing terminating ' character
    9 | '''
      |   ^
answer.code:9:3: error: missing terminating ' character
answer.code:1:1: error: expected unqualified-id before '\x0'
    1 | '''
      | ^~
answer.code:8:34: error: expected unqualified-id before ‘,’ token
    8 | Copyright (c) 2024 by ${git_name}, All Rights Reserved.
      |                                  ^
answer.code:8:40: error: expected constructor, destructor, or type conversion before ‘Rights’
    8 | Copyright (c) 2024 by ${git_name}, All Rights Reserved.
      |                                        ^~~~~~