답안 #153252

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
153252 2019-09-13T05:19:27 Z arnold518 Soccer (JOI17_soccer) C++14
5 / 100
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

soccer.cpp: In function 'int main()':
soccer.cpp:18:12: warning: unused variable 'j' [-Wunused-variable]
     int i, j;
            ^
soccer.cpp:20:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%lld%lld%lld%d", &H, &W, &A, &B, &C, &N);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
soccer.cpp:21:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(i=1; i<=N; i++) scanf("%d%d", &S[i].x, &S[i].y);
                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 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 -