Submission #785173

#TimeUsernameProblemLanguageResultExecution timeMemory
785173vjudge1Prisoner Challenge (IOI22_prison)C++17
0 / 100
1 ms212 KiB
#include "prison.h"
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> devise_strategy(int N) {
    vector a(25, vector<int>(N + 1));
    for (int i = 13; i <= 24; i++) {
        a[i][0] = 1;
    }
    for (int j = 1; j <= N; j++) {
        for (int i = 0; i <= 12; i++) {
            int t = (12 - i) / 2 * 2;
            if (i % 2 != (j >> (t + 1) & 1)) {
                a[i][j] = -2 - i % 2;
            } else {
                a[i][j] = 26 - t - (j >> t & 1);
                if (t == 0) {
                    a[i][j] = -1 - a[i][j];
                }
            }
        }
        for (int i = 13; i <= 24; i++) {
            int t = (26 - i) / 2 * 2 - 1;
            if (i % 2 != (j >> (t + 1) & 1)) {
                a[i][j] = -1 - i % 2;
            } else {
                a[i][j] = 13 - t - (j >> t & 1);
            }
        }
    }
    return a;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...