比赛 期末考试3 评测结果 WWAWWWWWWWWWWWWWWWWW
题目名称 hope I can be awake 最终得分 5
用户昵称 zcx 运行时间 0.308 s
代码语言 C++ 内存使用 3.87 MiB
提交时间 2026-02-11 11:04:32
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int const N=2e5+2;
int a[N];
int main()
{
	freopen("hopeicanbeawake.in","r",stdin);
	freopen("hopeicanbeawake.out","w",stdout);
	int n,k;
	cin>>n>>k;
	for(int i=0;i<k;i++) cin>>a[i];
	vector<int> ans;
	int pv=0;
	for(int i=0;i<k-1;i++){
		int b=max(a[i],pv+1);
		for(int x=b;x>pv;x--) ans.push_back(x);
		pv=b;
	}
	for(int x=n;x>pv;x--) ans.push_back(x);
	for(int i=0;i<n;i++) cout<<ans[i]<<" ";
	return 0;
}