[AGC033C] Removing Coins
个人思路:
每轮会删掉除选定节点外的所有叶子节点。
黑白染色,但是不会推 SG 函数。
然后就不会了。
正解:
每次直径长度 \(-1\) 或 \(-2\)。\(0\) 必胜,\(1\) 必败,\(2\) 必胜,\(3\) 必胜。
显然,直径长度 \(-1\) 模 \(3\) 余 \(0\) 先手必败,否则必胜。
[AGC033C] Removing Coins的更多相关文章
- ACM: Gym 101047M Removing coins in Kem Kadrãn - 暴力
Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS Memory Limit:65536KB 64bit IO Fo ...
- Gym 101047M Removing coins in Kem Kadrãn
给定一个序列,只能拿走D,隔壁的会翻转,问能否全部拿走. 注意到如果能拿走的话,拿D的顺序是没关系的.模拟即可 #include <cstdio> #include <cstdlib ...
- AtCoder刷题记录
构造题都是神仙题 /kk ARC066C Addition and Subtraction Hard 首先要发现两个性质: 加号右边不会有括号:显然,有括号也可以被删去,答案不变. \(op_i\)和 ...
- Codeforces & Atcoder神仙题做题记录
鉴于Codeforces和atcoder上有很多神题,即使发呆了一整节数学课也是肝不出来,所以就记录一下. AGC033B LRUD Game 只要横坐标或者纵坐标超出范围就可以,所以我们只用看其中一 ...
- AGC 033
目录 A. Darker and Darker B. LRUD Game 题面 题解 代码 C. Removing Coins 题面 题解 代码 D. Complexity 题面 题解 代码 E. G ...
- 【AtCoder】AGC033(A-F)
AGC033 A - Darker and Darker 直接BFS #include <bits/stdc++.h> #define fi first #define se second ...
- [LeetCode] Arranging Coins 排列硬币
You have a total of n coins that you want to form in a staircase shape, where every k-th row must ha ...
- Codeforces 2016 ACM Amman Collegiate Programming Contest A. Coins(动态规划/01背包变形)
传送门 Description Hasan and Bahosain want to buy a new video game, they want to share the expenses. Ha ...
- Swift 提示:Initialization of variable was never used consider replacing with assignment to _ or removing it
Swift 提示:Initialization of variable was never used consider replacing with assignment to _ or removi ...
- csuoj 1119: Collecting Coins
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1119 1119: Collecting Coins Time Limit: 3 Sec Memo ...
随机推荐
- Codeforces 1492D、Genius's Gambit
原题网址 https://codeforces.com/contest/1492/problem/D 题目大意 给定a,b,k,求x,y使得x和y的二进制表示都恰有a个0和b个1,且不能使用开头的0. ...
- 这个仅2M的宝藏小工具,竟无需群发就能揪出微信所有单向好友!
背景:很多人平时微信跟人发消息的时候,发现自己已经被对方清理掉了,因此可能想把自己的微信单向好友都清理出去."转账验证好友"是大部分人已经都知道的方法,但是好友太多,我们实在是无法 ...
- .NET 6 + Hangfire 实现后台作业管理
一.环境: ASP.NET Core 6 + Hangfire + MySQL 二.新建ASP.NET Core空项目 项目名称:HangfireExample 框架:.NET 6.0 三.N ...
- 设置导航栏的title
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObjectsAnd ...
- 容器逃逸 --with docker.sock
容器逃逸 --with docker.sock 本人对于容器逃逸的基本理解就是用户从容器中逃出去到宿主机里去了. 本文意在记录一个使用 docker.sock 来进行容器逃逸的方法. 首先随便来个镜像 ...
- c语言container_of 编译报错
求指针ptr所在的结构体实例的首地址, #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #define co ...
- 浅析sleep()方法与wait()方法
为什么 wait() 方法不定义在 Thread 中? wait() 是让获得对象锁的线程实现等待,会自动释放当前线程占有的对象锁.每个对象(Object)都拥有对象锁,既然要释放当前线程占有的对 ...
- map转换 bean和list
转实体类 JSONObject JSONObj = JSONObject.parseObject(JSON.toJSONString(resultMap));String result = JSONO ...
- uniapp组件监听onShow
在uniapp开发中,组件中需要监听页面onShow的方法 index.vue onShow() { uni.$emit('onShow', 1); //用于子组件监听onShow }, 子组件 be ...
- vue 添加代理
1.跟目录下新建vue.config.js文件,添加内容: module.exports = { assetsDir: 'static', parallel: false, publicP ...