计蒜客 第18题:跳跃游戏
2015-03-23 16:10
155 查看
#include <iostream> using namespace std ; bool jump( int A[] , int len , int step) { if ( step == len-1) return true ; for ( int i = A[step];i > 0 ;i--) { if (jump(A,len,step+i)) return true ; else A[step+i] = -1 ; } return false ; } int main() { int A[10000]; int n ; cin >> n ; for ( int i = 0 ; i < n ;++i) cin >>A[i] ; if(jump(A,n,0)) cout << "true" << endl ; else cout << "false" << endl ; }
相关文章推荐
- 【计蒜客系列】挑战难题20:跳跃游戏二
- 计蒜客--第18题:跳跃游戏
- 【计蒜客系列】挑战难题20:跳跃游戏二
- 计蒜客 挑战难题 第18题:跳跃游戏
- 计蒜客第18题---跳跃游戏
- 计蒜客 第18题:跳跃游戏
- 【计蒜客】20 - 跳跃游戏二(dp)
- 第18题:跳跃游戏
- [LeetCode] Jump Game 跳跃游戏
- 跳跃游戏-计蒜课
- 计蒜客 难题题库 020 跳跃游戏二
- lintcode--跳跃游戏--跳跃游戏Ⅱ
- [LintCode] 跳跃游戏
- 有趣的算法问题12——跳跃游戏1(贪心算法)
- Jump Game 跳跃游戏(求是否能跳到最后一个) @LeetCode
- LintCode 116-跳跃游戏
- Leet Code 45 Jump Game II - 跳跃游戏 - Java
- Leet Code 55 Jump Game - 跳跃游戏 - Java
- 计蒜客-跳跃游戏(贪心)
- 计蒜客—跳跃游戏二