# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
153252 | 2019-09-13T05:19:27 Z | arnold518 | Soccer (JOI17_soccer) | C++14 | 2 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 1e5; struct Point { int x, y; }; int H, W, N; ll A, B, C, ans; Point S[MAXN+10]; int main() { int i, j; scanf("%d%d%lld%lld%lld%d", &H, &W, &A, &B, &C, &N); for(i=1; i<=N; i++) scanf("%d%d", &S[i].x, &S[i].y); ans=min({C*abs(S[2].x-S[1].x)+C*abs(S[2].y-S[1].y), C*abs(S[2].x-S[1].x)+A*abs(S[2].y-S[1].y)+B, A*abs(S[2].x-S[1].x)+C*abs(S[2].y-S[1].y)+B}); printf("%lld", ans); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 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 | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 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 | 256 KB | Output is correct |
6 | Incorrect | 2 ms | 376 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |