Submission #1159885

#TimeUsernameProblemLanguageResultExecution timeMemory
1159885rdabaSoccer (JOI17_soccer)C++17
5 / 100
0 ms328 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=abs(a2-a1),y=abs(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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...