Submission #145245

# Submission time Handle Problem Language Result Execution time Memory
145245 2019-08-19T11:26:21 Z jhwest2 Soccer (JOI17_soccer) C++14
5 / 100
2 ms 504 KB
#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 time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Incorrect 2 ms 504 KB Output isn't correct
7 Halted 0 ms 0 KB -