Submission #18703700
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,x,y;
cin>>a>>b>>x>>y;
if(a<=b){
if(2*x<y){
cout<<(2*(b-a)+1)*x<<endl;
}else{
cout<<(b-a)*y+x<<endl;
}
}else{
if(2*x<y){
cout<<(2*(a-b)-1)*x<<endl;
}else{
cout<<(a-b-1)*y+x<<endl;
}
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Hands |
| User | Keiichiro_Harry |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 401 Byte |
| Status | AC |
| Exec Time | 7 ms |
| Memory | 3632 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample.txt, sample_2.txt, sample_3.txt |
| All | 18_18_40_79.txt, 18_18_40_81.txt, 1_100_100_100.txt, 1_100_33_65.txt, 1_100_33_67.txt, 1_100_50_100.txt, 1_100_99_99.txt, 77_7_25_49.txt, 77_7_25_51.txt, sample.txt, sample_2.txt, sample_3.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 18_18_40_79.txt | AC | 7 ms | 3560 KiB |
| 18_18_40_81.txt | AC | 4 ms | 3448 KiB |
| 1_100_100_100.txt | AC | 2 ms | 3556 KiB |
| 1_100_33_65.txt | AC | 2 ms | 3596 KiB |
| 1_100_33_67.txt | AC | 2 ms | 3576 KiB |
| 1_100_50_100.txt | AC | 2 ms | 3528 KiB |
| 1_100_99_99.txt | AC | 2 ms | 3532 KiB |
| 77_7_25_49.txt | AC | 3 ms | 3632 KiB |
| 77_7_25_51.txt | AC | 2 ms | 3532 KiB |
| sample.txt | AC | 2 ms | 3572 KiB |
| sample_2.txt | AC | 2 ms | 3528 KiB |
| sample_3.txt | AC | 2 ms | 3576 KiB |