Submission #153252

#TimeUsernameProblemLanguageResultExecution timeMemory
153252arnold518Soccer (JOI17_soccer)C++14
5 / 100
2 ms376 KiB
#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 (stderr)

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);
                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...