http://acm.hdu.edu.cn/showproblem.php?pid=3094 树上删边游戏 一条链的情况:SG分别是0,1,2,……,相当于Nim取石子游戏 那么把边看作石子,树可看做若干堆石子 所以叶节点的SG=0,其余节点的SG等于子节点SG+1的异或和 #include<cst ...
分类:
其他好文 时间:
2020-01-17 22:57:37
阅读次数:
97
Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + ar ...
分类:
其他好文 时间:
2020-01-17 13:27:34
阅读次数:
62
在线体验地址:hksite.cn/prjs/christmashat 源码地址:https://github.com/hk029/christmas-hat 写在开头 叮叮当,叮叮当,吊儿个郎当,一年一度的圣诞节到咯,我不由的回想起了前两年票圈被圣诞帽支配的恐惧。打开票圈全是各种@官方求帽子的: 票 ...
分类:
其他好文 时间:
2020-01-16 14:51:55
阅读次数:
87
原题链接在这里:https://leetcode.com/problems/24-game/ 题目: You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operate ...
分类:
其他好文 时间:
2020-01-16 14:51:19
阅读次数:
97
【题目】题目链接 Two players take turns picking candies from n heaps,the player who picks the last one will win the game.On each turn they can pick any number ...
分类:
其他好文 时间:
2020-01-16 14:47:51
阅读次数:
57
博弈 Game 的分类维度 Deterministic or stochastic? One, two, or more players? Zero sum? Perfect information (can you see the state)? Adversarial Search 对抗搜索 A ...
分类:
其他好文 时间:
2020-01-16 11:01:47
阅读次数:
145
(翻译版本来自 Luogu by lonelysir ) 题目描述 小X一直很喜欢一个纸牌游戏:“24点”,但最近他发现这个游戏太简单了,所以他发明了一个新游戏。 你有一个整数序列,包括n个整数:1,2,3,...,n。步骤很简单,你可以从其中拿出两个数,我们假设它们是a和b,将这两个数从序列中删除 ...
分类:
其他好文 时间:
2020-01-15 09:35:53
阅读次数:
116
HDOJ Game[三维莫队] 题意 "题链" 你有n堆石子,每堆石子有$a_i$个石子。游戏规则:Alice先选择一个大范围$[L,R]$区间内的石子,Bob选择一个子区间$[l,r]$内的石子最终进行游戏。每次至少取走某一堆的一个石子,至多全部取走,无法移动石子者输。Alice先手,双方足够聪明 ...
分类:
其他好文 时间:
2020-01-14 20:57:20
阅读次数:
71
<!doctype html>7.Redis复制的原理与优化 Redis复制的原理与优化 什么是主从复制 单机有什么问题 机器故障 容量瓶颈 QPS瓶颈 主从复制的作用 数据副本 宽展读性能 总结 一个master可以有多个slave 一个slave只能有一个master 数据流向是单向的,mast ...
分类:
其他好文 时间:
2020-01-14 13:11:16
阅读次数:
94
巴什博弈(Bash Game) 只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次能取1~m个。最后取光者取胜。 显 然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜。因此我们发现了取胜的守则:如果n=(m+1)r+s,(r为任 ...
分类:
其他好文 时间:
2020-01-13 01:05:25
阅读次数:
98