제출 #569224

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5692242022-05-27 05:28:13SSRS"The Lyuboyn" code (IZhO19_lyuboyn)C++14
100 / 100
593 ms6632 KiB
#include <bits/stdc++.h>
using namespace std;
vector<int> solve(int N, int K, int t){
if (K == N - 1){
vector<int> ans(1 << N);
ans[0] = t;
for (int i = 1; i < (1 << N); i++){
ans[i] = ans[i - 1] ^ ((1 << N) - 1);
int p = __builtin_ctz(i);
ans[i] ^= 1 << p;
}
return ans;
} else {
vector<int> P1 = solve(N - 1, K, t);
int r = P1.back();
int r2 = r ^ ((1 << (K - 1)) - 1);
vector<int> P2 = solve(N - 1, K, r2);
vector<int> P;
for (int i = 0; i < (1 << (N - 1)); i++){
P.push_back(P1[i]);
}
for (int i = 0; i < (1 << (N - 1)); i++){
P.push_back(P2[i] ^ (1 << (N - 1)));
}
return P;
}
}
int main(){
int N, K, T;
cin >> N >> K >> T;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...