随笔分类 -  数学 -- 博弈

摘要:传送门 A. FashionabLee 签到。 Code /* * Author: heyuhhh * Created Time: 2020/6/23 22:06:06 */ #include <iostream> #include <algorithm> #include <cstring> #i 阅读全文
posted @ 2020-06-24 16:35 heyuhhh 阅读(304) 评论(0) 推荐(0)
摘要:传送门 视频题解。 A. Odd Selection 注意到$n\leq 1000$,所以直接暴力枚举即可。 Code /* * Author: heyuhhh * Created Time: 2020/5/31 22:35:54 */ #include <iostream> #include <a 阅读全文
posted @ 2020-06-01 21:14 heyuhhh 阅读(469) 评论(0) 推荐(0)
摘要:"传送门" A.小乔和小灰灰 签到。 Code cpp / Author: heyuhhh Created Time: 2020/3/13 19:12:53 / include include include include include include include include inclu 阅读全文
posted @ 2020-03-16 11:16 heyuhhh 阅读(322) 评论(0) 推荐(0)
摘要:"PTA" "牛客" A. 托米的字符串 显然答案为: $$ \frac{n(n+1)}{2}\cdot\sum_{len=1}^n\frac{f(len)}{len} $$ 其中$f(i)$表示长度为$i$的所有串中含元音的个数。 显然$f(1)$易求,那么$\displaystyle f(2)= 阅读全文
posted @ 2020-02-06 18:02 heyuhhh 阅读(466) 评论(0) 推荐(0)
摘要:"传送门" 题意: 给出一个$n m$的棋盘,上面有若干个黑色棋子,若干个白色棋子,还有一个空格。 每次先手选择一个空格,将它与相邻的某个白色棋子交换;后手则选择一个空格,与相邻的某个黑色棋子交换。 最终不能移动的人输。 现在给出一个棋盘以及游戏过程,最终的结果为先手输掉比赛。请你输出先手在这次比赛 阅读全文
posted @ 2019-11-07 13:05 heyuhhh 阅读(208) 评论(0) 推荐(0)
摘要:"BZOJ" 题意: 给出一个$n m$的网格,其中有一些障碍点。 现在两个人玩游戏,首先先手选定一个点,然后从后手开始轮流移动,不能移动者即输掉这次游戏。 规定不能移动到那些之前已经到过的格子上。 思路: 网格图可以联想到二分图,我们可以对其进行黑白染色。 注意如果先手必赢的话,直到终点只会走偶数 阅读全文
posted @ 2019-11-07 08:50 heyuhhh 阅读(264) 评论(0) 推荐(0)
摘要:"传送门" D Decimal 题意: 询问$\frac{1}{n}$是否为有限小数。 思路: 拆质因子,看是不是只包含2和5即可,否则除不尽。 Code cpp include define MP make_pair define fi first define se second define 阅读全文
posted @ 2019-10-14 16:31 heyuhhh 阅读(695) 评论(0) 推荐(0)
摘要:"传送门" A. 2048 Game 乱搞即可。 Code B. Knights 直接按奇偶分类其实就行,但我写了个$dfs$... Code C. Perfect Team 直接输出就行,但我写了个二分... Code D. Make The Fence Great Again 题意: 给出$n$ 阅读全文
posted @ 2019-09-20 20:11 heyuhhh 阅读(391) 评论(0) 推荐(1)
摘要:"传送门" A. Yellow Cards 细心点即可。 Code cpp include define fi first define se second define MP make_pair using namespace std; typedef long long ll; typedef 阅读全文
posted @ 2019-09-16 22:38 heyuhhh 阅读(456) 评论(0) 推荐(0)
摘要:"传送门" A. Who is better? 扩展中国剩余定理+斐波那契博弈,没啥好说的,关于斐波那契博弈,详见: "传送门" Code cpp include typedef long long ll; typedef unsigned long long ull; typedef double 阅读全文
posted @ 2019-09-13 17:34 heyuhhh 阅读(322) 评论(0) 推荐(0)
摘要:"传送门" P.S:这场不想补啦。 F.Final Exam 题意: 有$n$门课即将进行考试,现在有$m$分用于分配,如果一门课程的分值为$x$,那么那就需要$x+1$个小时来复习。 现在你的目标是过$k$门课,问怎么分配复习时间可以保证过$k$门课并且复习时间最少。 P.S:老师可以根据你的复习 阅读全文
posted @ 2019-08-21 20:19 heyuhhh 阅读(202) 评论(0) 推荐(0)
摘要:Stone Game II Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 609 Accepted Submission(s): 350 题目链 阅读全文
posted @ 2019-03-21 21:57 heyuhhh 阅读(190) 评论(0) 推荐(0)
摘要:S-Nim Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10368 Accepted Submission(s): 4262 题目链接:htt 阅读全文
posted @ 2019-03-21 21:24 heyuhhh 阅读(275) 评论(0) 推荐(0)
摘要:Nim 题目链接:http://poj.org/problem?id=2975 Description: Nim is a 2-player game featuring several piles of stones. Players alternate turns, and on his/her 阅读全文
posted @ 2019-03-21 21:18 heyuhhh 阅读(269) 评论(0) 推荐(0)
摘要:Matches Game 题目链接:http://poj.org/problem?id=2234 Description: Here is a simple game. In this game, there are several piles of matches and two players. 阅读全文
posted @ 2019-03-21 21:14 heyuhhh 阅读(253) 评论(0) 推荐(0)