文章
81
粉丝
2
获赞
511
访问
10.7k
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n;
while(cin >> n){
int a[1005];
for(int i = 1; i <= n; i++){
cin >> a[i];
}
int m;
cin >> m;
int l = pow(2, m - 1);
int r = pow(2, m) - 1;
if(l > n){
cout << "EMPTY" << endl;
continue;
}
if(r > n) r = n;
for(int i = l; i <= r; i++){
cout << a[i];
if(i != r) cout << " ";
}
cout << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发