Submission #629037

# Submission time Handle Problem Language Result Execution time Memory
629037 2022-08-14T04:33:34 Z Red_Inside Prisoner Challenge (IOI22_prison) C++17
0 / 100
1 ms 212 KB
#include "prison.h"
#include "prison.h"
//
#include <bits/stdc++.h>
 
#define ll long long
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define o cout<<"BUG"<<endl;
#define FOR(i, j, n) for(int j = i; j < n; ++j)
#define forn(i, j, n) for(int j = i; j <= n; ++j)
#define nfor(i, j, n) for(int j = n; j >= i; --j)
#define sortv(vv) sort(vv.begin(), vv.end())
#define all(v) v.begin(), v.end()
#define ld long double
#define ull unsigned long long
 
using namespace std;
const int maxn=500+10,LOG=17, mod=1e9+7;
int block = 320, timer = 0;
const ld EPS = 1e-18;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
 
#define bt(i) (1 << (i))
//#define int ll
const int inf=1e9+10;
#define y1 yy
#define prev pre
#define pii pair <int, int>

vector<vector<int> > devise_strategy(int n) {
	vector <vector <int> > ans;
	int x = 21;
	ans.assign(x+1, {});
	forn(0, i, x)
	{
		ans[i].assign(n+ 1, 0);
	}
	ans[0][0] = 0;
	forn(1, i, x)
	{
		//0 1 2 3 4 5 6 7 8 9 10
		//0 1 1 1 0 0 0 
		if((i-1) / 3 % 2 == 0)
			ans[i][0] = 1;
		else
			ans[i][0] = 0;
	}
	forn(1, j, n)
	{
		int t = j;
		forn(1, iter, 7)
		{
			t /= 3;
		}
		t %= 3;
		ans[0][j] = t + 1;
	}
	forn(1, i, x)
	{
		int num = 7 - (i - 1) / 3;
		int bt = (i - 1) % 3;
		forn(1, j, n)
		{
			int t = j;
			forn(1, iter, num)
			{
				t /= 3;
			}
			t %= 3;
			if(t < bt) ans[i][j] = -(ans[i][0] + 1);
			else if(t > bt) ans[i][j] = -((ans[i][0] ^ 1) + 1);
			else if(((i - 1) / 3 + 1) * 3 + t + 1 <= x)
				ans[i][j] = ((i - 1) / 3 + 1) * 3 + t + 1;
			else
				ans[i][j] = x;
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Strategy failed for N=2, A=1, B=2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Strategy failed for N=2, A=1, B=2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Strategy failed for N=3, A=1, B=2
2 Halted 0 ms 0 KB -