답안 #489132

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
489132 2021-11-21T09:12:19 Z cheissmart Soccer (JOI17_soccer) C++14
5 / 100
0 ms 208 KB
#include <bits/stdc++.h>
#define IO_OP ios::sync_with_stdio(0), cin.tie(0)
#define F first
#define S second
#define V vector
#define PB push_back
#define EB emaplce_back
#define MP make_pair
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;

const int INF = 1e9 + 7;
const ll oo = 1e18;

signed main()
{
	IO_OP;
	
	int h, w, a, b, c, n;
	cin >> h >> w >> a >> b >> c >> n;
	vi s(n), t(n);
	for(int i = 0; i < n; i++)
		cin >> s[i] >> t[i];
	ll ans = oo;
	ans = min(ans, 1LL * (abs(s[0] - s[1]) + 1LL * abs(t[0] - t[1])) * c);
	ans = min(ans, 1LL * (abs(t[0] - t[1])) * a + b + 1LL * abs(s[0] - s[1]) * c);
	ans = min(ans, 1LL * (abs(s[0] - s[1])) * a + b + 1LL * abs(t[0] - t[1]) * c);
	
	cout << ans << '\n';
		
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 0 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 0 ms 208 KB Output is correct
6 Incorrect 0 ms 204 KB Output isn't correct
7 Halted 0 ms 0 KB -