# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
837699 | JakobZorz | 죄수들의 도전 (IOI22_prison) | C++17 | 11 ms | 1748 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include"prison.h"
#include<vector>
using namespace std;
vector<vector<int>>strats;
int n;
int to_neg(int bag){
return -1-bag;
}
int dp[20][2][2];
bool dpt[20][2][2];
int get_strat(int bit,int prev_bit,int prev_bag){
if(dpt[bit][prev_bit][prev_bag])
return dp[bit][prev_bit][prev_bag];
int curr_strat=(int)strats.size();
strats.push_back(vector<int>(n+1));
int inspected_bag=prev_bag^1;
strats[curr_strat][0]=inspected_bag;
if(bit==0){
for(int i=1;i<=n;i++){
if(i%2==1){
strats[curr_strat][i]=to_neg(prev_bag);
}else{
strats[curr_strat][i]=to_neg(inspected_bag);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |