답안 #68507

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
68507 2018-08-17T08:38:22 Z BThero Soccer (JOI17_soccer) C++17
5 / 100
3 ms 592 KB
// Why I am so dumb? :c
#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()

#define fi first
#define se second

using namespace std;

typedef long long ll;

int px[15], py[15];

int a, b, c;

int n, m, k;

ll ans;

void solve() {                   
	scanf("%d %d", &n, &m);
	scanf("%d %d %d", &a, &b, &c);
	scanf("%d", &k);

	for (int i = 1; i <= k; ++i) {
		scanf("%d %d", &px[i], &py[i]);
	}

	ll dx = abs(px[1] - px[2]);
	ll dy = abs(py[1] - py[2]);                                            

	ans = dx * c + dy * c;

   	ans = min(ans, dx * c + dy * a + b);
   	ans = min(ans, dy * c + dx * a + b);

   	printf("%lld\n", ans);
}

int main() {    
    int tt = 1;

    while (tt--) {
        solve();
    }

    return 0;
}

Compilation message

soccer.cpp: In function 'void solve()':
soccer.cpp:25:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &m);
  ~~~~~^~~~~~~~~~~~~~~~~
soccer.cpp:26:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d %d", &a, &b, &c);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
soccer.cpp:27:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &k);
  ~~~~~^~~~~~~~~~
soccer.cpp:30:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &px[i], &py[i]);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 3 ms 420 KB Output is correct
4 Correct 2 ms 436 KB Output is correct
5 Correct 3 ms 480 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 592 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 3 ms 420 KB Output is correct
4 Correct 2 ms 436 KB Output is correct
5 Correct 3 ms 480 KB Output is correct
6 Incorrect 3 ms 592 KB Output isn't correct
7 Halted 0 ms 0 KB -