Submission #15202

#TimeUsernameProblemLanguageResultExecution timeMemory
15202jeapi분배 (kriii3_Q)C++98
24 / 24
35 ms1756 KiB
#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 timeMemoryGrader output
Fetching results...