# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1076383 | vjudge1 | Prisoner Challenge (IOI22_prison) | C++17 | 8 ms | 1372 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "prison.h"
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
vector<vi> multiply(vector<vi> S0, int fact) {
int x0 = S0.size(), n0 = int(S0[0].size()) - 1;
int n = n0 * fact + 2;
vector<vi> S(x0 + fact, vi(n + 1, 0));
for(auto &sir : S0) {
sir[0] ^= 1;
for(auto &it : sir)
if(it < 0) it = -3 - it;
}
S[0][0] = 0;
S[0][1] = -1; S[0][n] = -2;
for(int i = 2; i <= n - 1; ++i)
S[0][i] = (i - 2) / n0 + 1;
///copii de S0[0]
for(int i = 1; i <= fact; ++i) {
S[i][0] = S0[0][0];
///marginile
for(int j = 1; j <= (i - 1) * n0 + 1; ++j)
S[i][j] = -2;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |