Submission #68507

#TimeUsernameProblemLanguageResultExecution timeMemory
68507BTheroSoccer (JOI17_soccer)C++17
5 / 100
3 ms592 KiB
// 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 (stderr)

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