Submission #1290421

#TimeUsernameProblemLanguageResultExecution timeMemory
1290421AishaSoccer (JOI17_soccer)C++20
5 / 100
1 ms576 KiB
#include "bits/stdc++.h"

using namespace std;

#define int long long

const int mod = 1000000007;

signed main() {
    int h, w;
    cin >> h >> w;

    int a, b, c;
    cin >> a >> b >> c;

    int n;
    cin >> n;

    int s1, t1, s2, t2;
    cin >> s1 >> t1 >> s2 >> t2;

    int ans = (abs(s1 - s2) + abs(t1 - t2)) * c;
    ans = min(ans, a * abs(s1 - s2) + b + abs(t1 - t2) * c);
    ans = min(ans, a * abs(t1 - t2) + b + abs(s1 - s2) * c);

    cout << ans << endl;

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...