Submission #642120

# Submission time Handle Problem Language Result Execution time Memory
642120 2022-09-18T14:42:28 Z mdubaisi Prisoner Challenge (IOI22_prison) C++17
5 / 100
24 ms 19120 KB
#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 time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 5 ms 656 KB Output is correct
4 Correct 6 ms 724 KB Output is correct
5 Correct 24 ms 2004 KB Output is correct
6 Correct 23 ms 1972 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 15 ms 1268 KB Output is correct
9 Correct 16 ms 1440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 468 KB Wrong answer detected in grader
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 15 ms 19120 KB Wrong answer detected in grader
5 Halted 0 ms 0 KB -