码迷,mamicode.com
首页 >  
搜索关键字:jump game    ( 6026个结果
HDU 1505 Largest Rectangle in a Histogram && HDU 1506 City Game(动态规划)
1506题意:给你连续的直方图(底边边长为1),求连续的矩阵面积。 对每个直方图,分别向左向右进行扩展。 #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define...
分类:其他好文   时间:2014-07-18 23:12:40    阅读次数:290
10165 - Stone Game(Nim游戏)
UVA 10165 - Stone Game 题目链接 题意:给定n堆石子,每次能在一堆取1到多个,取到最后一个赢,问谁赢 思路:就裸的的Nim游戏,利用定理求解 代码: #include #include int n, num; int main() { while (~scanf("%d", &n) && n) { int sum = 0; ...
分类:其他好文   时间:2014-07-18 22:17:20    阅读次数:342
UVA 12293 - Box Game(博弈)
UVA 12293 - Box Game 题目链接 题意:两个盒子,一开始一个盒子有n个球,一个只有1个球,每次把球少的盒子中球消掉,把多的拿一些球给这个盒子,最后不能操作的输(球不能少于1个),Alice先手,问谁赢 思路:博弈,题目其实可以转化为,给定一个n,每次把减少1到n/2的数字,最后谁是1谁就输了,那么可以去递推前几项找个规律,或者推理,都可以发现只要是2^i - 1...
分类:其他好文   时间:2014-07-18 21:27:44    阅读次数:186
UVA 847 - A Multiplication Game(博弈)
UVA 847 - A Multiplication Game 题目链接 题意:一个数一开始是1,每次轮流乘2-9,谁先大于n谁就赢,问谁胜 思路:博弈,找出必胜态,2-9为stan,10-18为ollie,19-162为stan...发现都是乘2乘9交替 代码: #include #include #include long long n; bool ju...
分类:其他好文   时间:2014-07-18 21:27:15    阅读次数:194
Firefly《暗黑世界》碎片合成部分代码
这里讲的是Firefly《暗黑世界》碎片合成的流程部分的代码,这个主要是消息解析的部分,好吧上代码,代码路径app/game/gatenodeapp/compound.py。#coding:utf8'''Created on 2013-3-21物品合成@author: lan (www.9miao....
分类:其他好文   时间:2014-07-18 09:09:27    阅读次数:204
ZOJ 2965 Accurately Say CocaCola
A - Accurately Say "CocaCola"!DescriptionIn a party held by CocaCola company, several students stand in a circle and play a game.One of them...
分类:其他好文   时间:2014-07-18 00:01:04    阅读次数:239
HDU 1528 (二分图最大匹配 + 最小覆盖, 14.07.17)
Problem Description Adam and Eve play a card game using a regular deck of 52 cards. The rules are simple. The players sit on opposite sides of a table, facing each other. Each player gets k cards f...
分类:其他好文   时间:2014-07-17 20:17:43    阅读次数:381
POJ 1965 The Pilots Brothers' refrigerator 搜索
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18222   Accepted: 6936   Special Judge Description The game “The Pilots...
分类:其他好文   时间:2014-07-17 19:25:39    阅读次数:207
LeetCode Jump Game II
class Solution {private: vector sum; vector step; set can;public: int jump(int A[], int n) { step.clear(), sum.clear(), can.clear()...
分类:其他好文   时间:2014-07-17 18:36:56    阅读次数:221
UVA - 536 Tree Recovery
Description   Tree Recovery  Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters i...
分类:其他好文   时间:2014-07-17 17:21:38    阅读次数:253
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!