# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15202 | jeapi | 분배 (kriii3_Q) | C++98 | 35 ms | 1756 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<iostream>
#include<algorithm>
using namespace std;
int D[10000];
int square(int D){
int T = 1;
for (int i = 1; i < D; i++){
T = T * 2;
}
return T;
}
int main(){
int N, K;
cin >> N >> K;
int W = (1 << (N - K));
N = (1 << N);
K = (1 << K);
for (int j = 0; j < K; j++){
for (int i = 0; i < W; i++){
if (i % 2 == 0)
cout << (((i + 1) / 2)*(K * 2)) + j << ' ';
else
cout << (((i + 1) / 2)*(K * 2)) - j - 1 << ' ';
}
cout << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |