codeforces 669B Little Artem and Grasshopper
来源:互联网 发布:python __iter__ 编辑:程序博客网 时间:2024/05/17 17:56
点击打开链接
题意:判断蚂蚱能不能跳出去,注意审清题,给出的i的方向和距离。然后模拟这个过程。
#include<cstdio>#include<cstring>const int max1=1e5+10;int n,a[max1];char str[max1];int main(){ scanf("%d",&n); scanf("%s",str+1); int k=1; for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++) { if(str[k]=='>') k+=a[k]; else k-=a[k]; if(k<1||k>n) { printf("FINITE\n"); return 0; } } printf("INFINITE\n"); return 0;}
阅读全文
0 0
- CodeForces 669B Little Artem and Grasshopper
- codeforces 669B Little Artem and Grasshopper
- Codeforces 669B Little Artem and Grasshopper【思维+模拟】
- B. Little Artem and Grasshopper
- CodeForces 669B Little Artem and Grasshopper(可怜的小蚂蚱,等待AC)
- Little Artem and Grasshopper
- CodeForces 641 A.Little Artem and Grasshopper(水~)
- CF Round #348 Div. 2 A. Little Artem and Present B. Little Artem and Grasshopper C. Little Artem and
- Codeforces Round #348 (VK Cup 2016 Round 2, Div. 2 Edition)-B. Little Artem and Grasshopper(模拟)
- CodeForces 668B Little Artem and Dance
- CodeForces 669A Little Artem and Presents
- CodeForces 669D Little Artem and Dance
- CodeForces 669D Little Artem and Dance
- CodeForces 669A Little Artem and Presents
- 【CodeForces】669A - Little Artem and Presents
- 【CodeForces】[669A]Little Artem and Presents
- CodeForces 669A Little Artem and Presents
- codeforces 669C Little Artem and Matrix
- Java BigDecimal divide注意事项
- 深度学习调参技巧总结
- Android中如何清除缓存
- 求一个数组中右边第一个比他大的数(单调栈)
- 2017"百度之星"程序设计大赛
- codeforces 669B Little Artem and Grasshopper
- 微信小程序开发(二)--网络请求
- Java基础知识-基本数据类型相互转型
- poj1330,JDOJ3055部分分LCA(n^2暴力算法)
- Weex和React Native框架对比与选择
- 多线程操作说明
- CF449C Jzzhu and Apples (筛素数 数论
- JS导航
- BaseServlet