Submission #642120

#TimeUsernameProblemLanguageResultExecution timeMemory
642120mdubaisiPrisoner Challenge (IOI22_prison)C++17
5 / 100
24 ms19120 KiB
#include<prison.h> #include <bits/stdc++.h> #include <math.h> #include <unordered_set> #define all(v) (v.begin()), (v.end()) #define setall(a, val) memset(a, val, sizeof a) #define ll long long const ll MOD = 1e9 + 7; const ll N = 1e6 + 1; const ll M = 2e2 + 1; using namespace std; // sol for 1st subtask vector< vector<int> > devise_strategy(int n) { const int x = n; //size of ans. vector< vector<int> > ans(x, vector<int>(n + 1, 0)); ans[0][0] = 0; ans[0][1] = -1; for (int j = 2; j < n; j++) ans[0][j] = j; ans[0][n] = -2; for (int i = 1; i < x; i++) { ans[i][0] = 1; for (int j = 1; j <= n; j++) { if (j == i) continue; ans[i][j] = j > i ? -1 : -2; } } return ans; } //int main() { // ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); srand(time(NULL)); // // auto ans = devise_strategy(3); // for (auto v : ans) { // for (auto x : v) // cout << x << ' '; // cout << endl; // } //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...