poj 3370 Halloween treats
来源:互联网 发布:表格软件扫描录入 编辑:程序博客网 时间:2024/06/10 15:33
#include<stdio.h>#include<string.h>#define N 100010int main(){ int a[N],b[N],n,m,i,s,begin,end; while(scanf("%d%d",&n,&m)&&n+m) { memset(b,0,sizeof(b)); for(i=1;i<=m;i++) scanf("%d",&a[i]); begin=end=0; for(s=0,i=1;i<=n;i++) { s=(s+a[i])%n; if(s==0){ begin=1; end=i; break; } if(!b[s]) b[s]=i; else{ begin=b[s]+1; end=i; break; } } for(i=begin;i<=end;i++) if(i==end) printf("%d\n",i); else printf("%d ",i); } return 0;}
0 0
- POJ 3370 Halloween treats
- poj 3370 Halloween treats
- poj 3370 Halloween treats
- POJ 3370 Halloween Treats
- poj 3370 Halloween treats
- poj 3370 Halloween treats
- poj 3370 Halloween treats
- Poj 3370 Halloween Treats
- POJ-3370-Halloween treats
- [置顶]poj-3370-Halloween treats
- poj 3370 Halloween treats(抽屉原理)
- POJ 3370 Halloween treats 鸽巢原理
- POJ 3370 Halloween treats 鸽巢原理
- POJ 3370 Halloween treats 鸽巢原理
- POJ 3370 Halloween treats(抽屉原理)
- POJ 3370 Halloween treats(抽屉原理)
- POJ 3370 Halloween treats(抽屉原理)
- POJ 3370 Halloween treats(抽屉原理)
- OER Voice Traffic Optimization Using Active Probes
- Linux下nm和ldd 命令
- Cocos2d-x 弹出对话框的设计与实现
- 去除List中重复元素
- Js实现短信发送进度条
- poj 3370 Halloween treats
- vc++提示cannot open include file 'afxres.h'———VC安装设置问题
- Cos上传
- @Repository、@Service、@Controller 和 @Component
- 打开一个子窗体
- Java环境的配置
- 详解 MySQL 的计划任务
- 关注设计上的意义,而不是实现细节,从今天开始更多的关注思想
- 南阳 636 世界末日