Submission #1105067

#TimeUsernameProblemLanguageResultExecution timeMemory
1105067fve5Prisoner Challenge (IOI22_prison)C++17
0 / 100
33 ms37948 KiB
#include <bits/stdc++.h> #include "prison.h" using namespace std; vector<vector<int>> devise_strategy(int N) { vector<vector<int>> ans; auto rec = [&](auto &&rec, int l, int r, bool fst) -> int { int sz = ans.size(); ans.emplace_back(N + 1); ans[sz][0] = fst; int m = (l + r) / 2; int ll, rr; if (r - l > 1) { ll = rec(rec, l, m, !fst); rr = rec(rec, m, r, !fst); } for (int i = 1; i <= N; i++) { if (i <= l) ans[sz][i] = fst ? -2 : -1; else if (i >= r - 1) ans[sz][i] = fst ? -1 : -2; else if (i < m) ans[sz][i] = ll; else ans[sz][i] = rr; } return sz; }; rec(rec, 1, N + 1, true); return ans; }

Compilation message (stderr)

prison.cpp: In lambda function:
prison.cpp:29:28: warning: 'rr' may be used uninitialized in this function [-Wmaybe-uninitialized]
   29 |                 ans[sz][i] = rr;
prison.cpp:27:28: warning: 'll' may be used uninitialized in this function [-Wmaybe-uninitialized]
   27 |                 ans[sz][i] = ll;
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...