题意:
给n堆石子,两人交替,选择一堆石头后先拿去任意颗,再把剩下的放到其他任意堆,最先拿完所有石子赢,问先手必胜还是必败。
分析;
解决此类问题的一种的思路是先构造策略,然后判断此策略能否满足1.必胜态可到必败态。2.必败态无法到必败态。
代码:
//poj 1740
//sep9
#include
#include
using namespace std;
const int m...
分类:
其他好文 时间:
2015-02-24 09:07:39
阅读次数:
142
DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone’ (also known as ‘Rock, Paper, Scissors’, ‘Ro, Sham, Bo’, and a host of other names) in ord...
分类:
其他好文 时间:
2015-02-23 19:01:06
阅读次数:
263
A New Stone Game
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 5028
Accepted: 2753
Description
Alice and Bob decide to play a new stone game.At the begin...
分类:
其他好文 时间:
2015-02-14 13:51:28
阅读次数:
178
传送门:http://poj.org/problem?id=2253
Frogger
Description
Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to v...
分类:
其他好文 时间:
2015-02-13 14:53:14
阅读次数:
208
#!d:/Python/bin/python
__author__=‘stone‘
#引入oracle支持包
importcx_Oracle
importtraceback
frompip.backwardcompatimportraw_input
#定义函数
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
defquerysal(conn,empnum):
c..
分类:
数据库 时间:
2015-02-12 18:39:39
阅读次数:
196
一、前言本节教程将大概完成文章和标签管理以及标签关联。二、Let‘sgo1.文章管理首先创建管理后台文章列表视图:$phpartisangenerate:viewadmin.articles.list修改views/admin/articles/list.blade.php:@extends(‘_layouts.default‘)
@section(‘main‘)
<divclass="am-gam-..
分类:
其他好文 时间:
2015-02-10 16:56:21
阅读次数:
241
1. 有一个5个字节的window,沿着文本向右滑动,每次滑动一个字节
2. 每一个window里面的5个字节,分别可以N个组成3元组。 例如igram,可以分为:igr iga igm iga igm gra grm gam ram
3. 每一个三元组通过一个hash函数,算出来一个结果,设为i ,i的区间是(0,256), 最下面有一个数组,也是共256位,刚好对应存放。 例如igr,假...
分类:
编程语言 时间:
2015-02-09 20:18:07
阅读次数:
385
题目 这是道链表的简单应用题目,删除从结尾数第n个节点。Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2.
After removing the ...
分类:
其他好文 时间:
2015-02-09 18:27:06
阅读次数:
132
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1115#大意:给你个n,有n个点,然后给你n个点的坐标,求这n个点形成的多边形的重心的坐标。直接套模板,我也不知道什么意思。注意在POJ上面定义double时,输出f,如果输出lf则WA,HDU上面输出l...
分类:
其他好文 时间:
2015-02-06 20:19:00
阅读次数:
109
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the...
分类:
其他好文 时间:
2015-02-05 16:33:01
阅读次数:
116