# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15462 | pichulia | 분배 (kriii3_Q) | C++98 | 8 ms | 1596 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<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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |