搜狐2道100%AC
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int n,m;
vector<int> veccur;
vector<int> vecnext;
int temp;
cin>>n;
cin>>m;
int *a=new int[n];
int i;
int j=0;
for(i=0;i<m;i++)
{
cin>>a[i];
}
veccur.push_back(a[0]);
for(i=0;veccur.size()<n;i++)
{
if(i==0)
{
temp=veccur[i]-1;
}
else if(i>=veccur.size())
{
veccur.push_back(a[j]);
temp=veccur[i]-1;
}
else
{
temp=veccur[i];
}
while(temp)
{
temp--;
veccur.push_back(a[j]);
}
if(j<m)
{
j++;
}
else
{
j=0;
}
}
for(i=0;i<n;i++)
{
cout<<veccur[i]<<endl;
}
return 0;
}