Submission #378017

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3780172021-03-15 18:28:00WLZWombats (IOI13_wombats)C++14
100 / 100
12374 ms197100 KiB
#include "wombats.h"
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int r, c;
vector< vector<int> > h, v;
vector<int> range;
vector< vector<int> > calc(int x) {
vector< vector<int> > ans(c, vector<int>(c, INF)), pre(2, vector<int>(c, 0));
for (int i = 0; i < 2; i++) for (int j = 1; j < c; j++) pre[i][j] = pre[i][j - 1] + h[x + i][j - 1];
for (int i = 0; i < c; i++) {
int mx = -INF;
for (int j = 0; j < c; j++) {
mx = max(mx, pre[1][j] - abs(pre[0][i] - pre[0][j]) - v[x][j]);
ans[i][j] = min(ans[i][j], pre[1][j] - mx);
}
int mn = INF;
for (int j = c - 1; j >= 0; j--) {
mn = min(mn, abs(pre[0][i] - pre[0][j]) + v[x][j] + pre[1][j]);
ans[i][j] = min(ans[i][j], mn - pre[1][j]);
}
}
return move(ans);
}
vector< vector<int> > combine(const vector< vector<int> > &a, const vector< vector<int> > &b) {
vector< vector<int> > ans(c, vector<int>(c, INF)), best(c, vector<int>(c, -1));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
   15 |  int res;
      |      ^~~
wombats.cpp: In function 'std::vector<std::vector<int> > calc(int)':
wombats.cpp:26:14: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
   26 |   return move(ans);
      |          ~~~~^~~~~
wombats.cpp:26:14: note: remove 'std::move' call
wombats.cpp: In function 'std::vector<std::vector<int> > combine(const std::vector<std::vector<int> >&, const std::vector<std::vector<int> >&)':
wombats.cpp:42:14: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
   42 |   return move(ans);
      |          ~~~~^~~~~
wombats.cpp:42:14: note: remove 'std::move' call
wombats.cpp: In function 'std::vector<std::vector<int> > calc(int, int)':
wombats.cpp:48:14: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
   48 |   return move(ans);
      |          ~~~~^~~~~
wombats.cpp:48:14: note: remove 'std::move' call
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...