您的位置:首页 > 其它

CF415AMashmokh and Lights(map)

2014-05-13 20:58 113 查看
题目链接:http://codeforces.com/problemset/problem/415/A

#include <iostream>
#include <cstdio>
#include <map>
using namespace std;

int main()
{
map<int ,int> p;
int n,m;
while(~scanf("%d%d",&n,&m))
{
int a;
p.clear();
while(m--)
{
cin>>a;
for(int i=a;i<=n;i++)
{
if(p[i]==0)
p[i]=a;
}
}
for(int i=1;i<=n;i++)
cout<<p[i]<<" ";
cout<<endl;
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: