Submission #15194

#TimeUsernameProblemLanguageResultExecution timeMemory
15194sujin분배 (kriii3_Q)C++98
24 / 24
7 ms1084 KiB
#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 timeMemoryGrader output
Fetching results...