415A Mashmokh and Lights
来源:互联网 发布:淘宝搭配套餐怎么设置 编辑:程序博客网 时间:2024/04/29 23:48
题目链接:点击打开链接
题目分析:题目简单,大于i的灯如果亮着就关掉,最后输出
题目代码:
#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>#include <iostream>#define MAXN 3005#define mod 1000000007using namespace std;int b[105];int main(){ int n,m,tmp; while(scanf("%d%d",&n,&m)!=EOF) { memset(b,-1,sizeof(b)); for(int i=1;i<=m;i++) { scanf("%d",&tmp); for(int j=tmp;j<=n;j++) if(b[j]!=-1) break; else b[j]=tmp; } for(int i=1;i<=n;i++) printf("%d ",b[i]); printf("\n"); } return 0;}
0 0
- 415A Mashmokh and Lights
- A. Mashmokh and Lights
- code forces 415A Mashmokh and Lights
- CodeForces 415A Mashmokh and Lights
- cf,A. Mashmokh and Lights
- Codeforces 415A Mashmokh and Lights(水题)
- cf——A. Mashmokh and Lights
- Mashmokh and Lights
- Codeforces Round #240 (Div. 2) A. Mashmokh and Lights
- A. Mashmokh and Numbers
- A. Mashmokh and Numbers
- 415B - Mashmokh and Tokens
- Codeforces 414A Mashmokh and Numbers(构造)
- Codeforces 414A Mashmokh and ACM(dp)
- CodeForces 414A Mashmokh and Numbers
- CodeForces 414A Mashmokh and Numbers
- codeforces 415B Mashmokh and Tokens
- CodeForces 415B Mashmokh and Tokens
- 第七周项目1-体会深复制
- Andriod 从源码的角度详解View,ViewGroup的Touch事件的分发机制
- 焦虑情绪小心误当做焦虑症
- 中移动香港推54元无限流量套餐,港人嫌太普通
- DAY12------面向对象 小结 2 Object类 代码块构造私有化 抽象类 接口 枚举类
- 415A Mashmokh and Lights
- 静态链表的表示和实现
- SPI
- android SlidingDrawer伸缩折叠布局组件
- Hibernate 事务传播和隔离属性
- Let us learn C in Code <9> pseudocode
- vim 搜索
- HDOJ-4217 Data Structure
- Linux学习笔记之——ssh连接虚拟机中的ubuntu12.0.4