Submission #1076383

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10763832024-08-26 13:28:19vjudge1Prisoner Challenge (IOI22_prison)C++17
100 / 100
8 ms1372 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...