Submission #1320848

#TimeUsernameProblemLanguageResultExecution timeMemory
1320848d_kPrisoner Challenge (IOI22_prison)C++20
5 / 100
13 ms19232 KiB
#include "prison.h"

#include <vector>
#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> devise_strategy(int n) { 	
	vector<vector<int>> ans(n + 1, vector<int>(n + 1, 0));
	int x = n;
	ans[0][0] = 0;
	for(int i = 0; i <= n; i++){
		if(i == 1) ans[0][i] = -1;
		else if(i == n) ans[0][i] = -2;
		else ans[0][i] = i;
	}
	for(int i = 1; i <= x; i++){
		for(int j = 1; j <= n; j++){
			ans[i][0] = 1;
			if(j < i) ans[i][j] = -2;
			else if(j > i) ans[i][j] = -1;
			else ans[i][j] = 0;
		}
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...