Submission #1066270

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10662702024-08-19 17:16:25sammyuriSoccer (JOI17_soccer)C++17
35 / 100
3044 ms16844 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;
}
inline ll pack(pair<ll, pair<int, int>> xx) {
return xx.first * 360000ll + (600ll * xx.second.first + xx.second.second);
}
inline pair<ll, pair<int, int>> unpack(ll xx) {
ll k = xx % 360000ll;
return {xx / 360000ll, {k / 600ll, k % 600ll}};
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
memset(dist, -1, sizeof(dist));
int h, w; cin >> h >> w;
h ++; w ++;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

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