답안 #145245

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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});
}
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 -