Submission #145245

#TimeUsernameProblemLanguageResultExecution timeMemory
145245jhwest2Soccer (JOI17_soccer)C++14
5 / 100
2 ms504 KiB
#include <bits/stdc++.h> #define va first #define vb second using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; ll h, w, a, b, c, n; pll arr[101010]; int main() { cin >> h >> w >> a >> b >> c >> n; for (int i=0; i<n; i++) { cin >> arr[i].va >> arr[i].vb; } ll x = abs(arr[0].va-arr[1].va); ll y = abs(arr[0].vb-arr[1].vb); cout << min({c*(x+y), a*x+b+c*y, c*x+a*y+b}); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...