Submission #1066259

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10662592024-08-19 17:08:20sammyuriSoccer (JOI17_soccer)C++17
35 / 100
3064 ms20944 KiB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dist[505][505];
ll dist_2[505][505];
ll a, b, c;
ll calc_cost(ll dx, ll dy) {
ll best = (dx + dy) * c;
best = min(best, dx * c + b + dy * a);
best = min(best, dy * c + b + dx * a);
return best;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
memset(dist, -1, sizeof(dist));
int h, w; cin >> h >> w;
h ++; w ++;
cin >> a >> b >> c;
vector<pair<int, int>> players;
int n; cin >> n;
int starti, startj, endi, endj;
for (int i = 0; i < n; i ++) {
int s, t; cin >> s >> t;
players.push_back({s, t});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

soccer.cpp: In function 'int main()':
soccer.cpp:81:67: warning: 'endj' may be used uninitialized in this function [-Wmaybe-uninitialized]
   81 |         best = min(best, curdist + calc_cost(abs(i - endi), abs(j - endj)));
      |                                                                 ~~^~~~~~
soccer.cpp:81:52: warning: 'endi' may be used uninitialized in this function [-Wmaybe-uninitialized]
   81 |         best = min(best, curdist + calc_cost(abs(i - endi), abs(j - endj)));
      |                                                  ~~^~~~~~
soccer.cpp:27:17: warning: 'startj' may be used uninitialized in this function [-Wmaybe-uninitialized]
   27 |     int starti, startj, endi, endj;
      |                 ^~~~~~
soccer.cpp:27:9: warning: 'starti' may be used uninitialized in this function [-Wmaybe-uninitialized]
   27 |     int starti, startj, endi, endj;
      |         ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...