| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1159879 | rdaba | Soccer (JOI17_soccer) | C++17 | 0 ms | 324 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
ll h,w;
cin >> h >> w;
ll a,b,c;
cin >> a >> b >> c;
ll n;
cin >> n;
ll a1,b1,a2,b2;
cin >> a1 >> b1 >> a2 >> b2;
if (a1==a2 && b1==b2) return cout << 0,0;
ll x=a2-a1,y=b2-b1;
ll mn=(x*c)+(y*c);
ll mn1=(x*c)+(y*a+b);
ll mn4=(x*a+b)+(y*c);
cout << min({mn,mn1,mn4});
}
//1 0 0
//0 0 0
//0 0 0
//0 0 1
//0 15 10| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
