Submission #31064112
Source Code Expand
a, b, c, x, y = map(int, input().split())
answer = 10 ** 9 # 十分大きな値で初期化
for i in range(x + 1): # A ピザの枚数
for j in range(y + 1): # B ピザの枚数
for k in range(max(x, y) + 1): # AB ピザの組数
if i + k >= x and j + k >= y: # ピザが足りているか判定
answer = min(answer, a * i + b * j + c * 2 * k)
# k に 2 をかけるのを忘れずに
print(answer)
Submission Info
| Submission Time | |
|---|---|
| Task | C - Half and Half |
| User | Pro_ktmr |
| Language | PyPy3 (7.3.0) |
| Score | 0 |
| Code Size | 462 Byte |
| Status | TLE |
| Exec Time | 2208 ms |
| Memory | 71204 KiB |
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | a01, a02, a03 |
| All | a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| a01 | AC | 67 ms | 61516 KiB |
| a02 | AC | 50 ms | 61540 KiB |
| a03 | TLE | 2208 ms | 68636 KiB |
| b04 | AC | 68 ms | 61420 KiB |
| b05 | TLE | 2207 ms | 66168 KiB |
| b06 | TLE | 2208 ms | 66188 KiB |
| b07 | TLE | 2208 ms | 67800 KiB |
| b08 | TLE | 2208 ms | 68588 KiB |
| b09 | TLE | 2208 ms | 68704 KiB |
| b10 | TLE | 2208 ms | 68820 KiB |
| b11 | TLE | 2208 ms | 71204 KiB |
| b12 | TLE | 2208 ms | 69144 KiB |
| b13 | TLE | 2208 ms | 67532 KiB |
| b14 | TLE | 2208 ms | 69084 KiB |
| b15 | TLE | 2208 ms | 69224 KiB |