# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15268 | ainta | 분배 (kriii3_Q) | C++98 | 16 ms | 3140 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<vector>
#include<algorithm>
using namespace std;
int n, K;
vector<int>E[65536];
int main()
{
scanf("%d%d",&n,&K);
int i, j, cnt = 0;
for(i=0;i<(1<<K);i++){
for(j=0;j<(1<<n-K-1);j++){
E[i].push_back(cnt);
cnt++;
}
}
cnt = (1<<n);
for(i=0;i<(1<<K);i++){
for(j=0;j<(1<<n-K-1);j++){
cnt--;
E[i].push_back(cnt);
}
}
for(i=0;i<(1<<K);i++){
for(j=0;j<E[i].size();j++)printf("%d ",E[i][j]);
printf("\n");
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |