21点游戏,命令行的,面像过程的写法。ruby 的写法以后再试试。
# this is game 21 point
# 操作命令符 空没有操作,n下一步,抽牌;w亮牌结束;l认输
$ope = ''
$prompt = '>'
$x1 = 0
$x2 = 0
$x3 = 0
$pc = 0
$u1 = 0
$u2 = 0
$u3 = 0
$over = ''
def out_main(a = ...
分类:
其他好文 时间:
2014-07-29 12:52:27
阅读次数:
212
题目:uva-10905Children's Game(贪心)
题目大意:给出N个正整数,问将这N个整数连接后得到的最大的数。
解题思路:排序,将两两连接有AB 或是BA,将如果AB > BA ,那么就将A排在B的后面,反之则反之。
代码:
#include
#include
#include
using namespace std;
const int N...
分类:
其他好文 时间:
2014-07-28 16:21:33
阅读次数:
200
Cyclic Tour
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/65535 K (Java/Others)
Total Submission(s): 1478 Accepted Submission(s): 750
Problem Description
There are N cit...
分类:
其他好文 时间:
2014-07-28 16:03:13
阅读次数:
271
Coin Toss
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 3019
Accepted: 817
Description
In a popular carnival game, a coin is tossed onto a table with a...
分类:
其他好文 时间:
2014-07-28 15:54:53
阅读次数:
418
题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your ma....
分类:
编程语言 时间:
2014-07-28 11:34:40
阅读次数:
210
题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your ma....
分类:
编程语言 时间:
2014-07-28 11:33:50
阅读次数:
278
(一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规
定每次至少取一个,最多取m个。最后取光者得胜。 显然,如果n=m+1,那么由于一
次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,
后者取胜。因此我们发现了如何取胜的法则:如果n=(m+1)r+s,(r为任意自然数,
s≤m),那么先取者要拿走s个物品,如果后取者拿走...
分类:
其他好文 时间:
2014-07-28 00:20:49
阅读次数:
242
一、题目DescriptionAfter winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made ofnhori...
分类:
其他好文 时间:
2014-07-27 22:38:59
阅读次数:
311
DescriptionAfter winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made ofnhorizont...
分类:
其他好文 时间:
2014-07-27 22:17:59
阅读次数:
309
单点更新,更新时先除去 原来的数,因为有去摸,可以用乘上逆元代替。//============================================================================// Name : A.cpp// Author : ...
分类:
其他好文 时间:
2014-07-27 22:17:39
阅读次数:
217