CodeForces 500A
来源:互联网 发布:程序员工作量化 编辑:程序博客网 时间:2024/05/13 15:50
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<iostream>
using namespace std;
#define maxn 110000;
#define INF 0x3f3f3f3f;
int a[50000];
int main()
{
int n,m;
while(~scanf("%d%d",&n,&m))
{
for(int i=1;i<n;i++)
scanf("%d",&a[i]);
int i;
for(i=1;i<=n;i+=a[i])
{
if(i>=m)
break;
}
if(i==m)puts("YES");
else puts("NO");
}
return 0;
}
0 0
- CodeForces 500A
- CodeForces-a
- Codeforces 903A A
- CodeForces 500A New Year Transportation
- 【暴力】Codeforces-500A New Year Transportation
- codeforces 500 A. New Year Transportation
- Codeforces 500A New Year Transportation 题解
- CodeForces 18A A - Triangle
- CodeForces 133A A. HQ9+
- codeforces 651A A. Joysticks
- 【Codeforces 597A】A. Divisibility
- 【 Codeforces 615A】A. Bulbs
- A. Divisibility CodeForces 597A
- codeforces 417A A. Elimination
- CodeForces 534A A. Exam
- codeforces#98 a
- codeforces#99 a
- codeforces 105 div2 A
- HDU5533Dancing Stars on Me(长春题)
- C#控制台基础 helloworld之 使用using命名空间指令(简化空间名称)输出
- 盛夏的果实(二分答案+最优路径)
- CentOS6.5安装与配置Mysql数据库
- 控制器View的生命周期及相关函数是什么?你在开发中是如何用的?
- CodeForces 500A
- HDU 5787 K-wolf Number
- C++中linked lists的使用
- html中method提交的 get和post区别
- hdoj 4857 逃生 (拓扑排序--逆序构图+邻接表+优先队列)
- 《Java线程池》:任务拒绝策略
- 郑轻 1899 985的最大和难题
- Super关键字
- MAC平台下Xcode配置使用OpenCV的具体方法(转载)