Submission #837699

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8376992023-08-25 14:17:17JakobZorz죄수들의 도전 (IOI22_prison)C++17
53 / 100
11 ms1748 KiB
#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);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...