# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15194 | sujin | 분배 (kriii3_Q) | C++98 | 7 ms | 1084 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.
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int my_pow(int n, int k){
int r = 1;
while (k--){
r *= n;
}
return r;
}
int main(){
int N, K;
scanf("%d %d", &N, &K);
int X = my_pow(2, N) - 1;
int T = my_pow(2, N - K) / 2;
int M = my_pow(2, K);
for (int i = 0; i < M; i++){
for (int j = 0; j < T; j++){
printf("%d %d ", j + i * T, X - j - i * T);
}
printf("\n");
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |