Submission #15462

#TimeUsernameProblemLanguageResultExecution timeMemory
15462pichulia분배 (kriii3_Q)C++98
24 / 24
8 ms1596 KiB
#include<stdio.h> #include<algorithm> using namespace std; int n, m; long long int p[1<<16]; int main() { scanf("%d %d",&n,&m); int i, j; long long int k = 1<<m; k = 2*k-1; for(i=0;i<(1<<m);i++) { long long int kk = k - i; int tt=0; for(j=0; j<(1<<(n-m-1)); j++) { if(tt==0)tt=1;else printf(" "); printf("%d",(i<<(n-m-1)) + j); if(tt==0)tt=1;else printf(" "); printf("%d",(kk<<(n-m-1)) + j); } printf("\n"); } }
#Verdict Execution timeMemoryGrader output
Fetching results...