Submission #24287347
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main () {
int N, A, X, Y;
cin >> N >> A >> X >> Y;
int ans = 0;
if (N <= A){
ans += N * X;
}
else {
ans += A * X;
ans += (N - A) * Y;
}
cout << ans << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Cabbages |
| User | Awes |
| Language | C++ (GCC 9.2.1) |
| Score | 100 |
| Code Size | 310 Byte |
| Status | AC |
| Exec Time | 6 ms |
| Memory | 3640 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, example0.txt, example1.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 6 ms | 3628 KiB |
| 001.txt | AC | 3 ms | 3448 KiB |
| 002.txt | AC | 2 ms | 3628 KiB |
| 003.txt | AC | 1 ms | 3628 KiB |
| 004.txt | AC | 2 ms | 3532 KiB |
| 005.txt | AC | 2 ms | 3600 KiB |
| 006.txt | AC | 2 ms | 3396 KiB |
| 007.txt | AC | 2 ms | 3596 KiB |
| 008.txt | AC | 2 ms | 3640 KiB |
| 009.txt | AC | 3 ms | 3396 KiB |
| example0.txt | AC | 3 ms | 3524 KiB |
| example1.txt | AC | 2 ms | 3528 KiB |