上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 30 下一页
摘要: https://ac.nowcoder.com/acm/contest/37160#question ###anti-Nim游戏(反Nim游戏/反尼姆博弈问题) 定义 游戏规则与Nim类似,只是最后把石子取完的人输。 结论 先手必胜的条件为 ①:所有堆的石子数均=1,且有偶数堆。 ②:至少有一个堆的 阅读全文
posted @ 2022-11-08 18:40 高尔赛凡尔娟 阅读(54) 评论(0) 推荐(0) 编辑
摘要: A - Rightmost #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII; const LL MAXN=1e18; const LL INF=1e9; const 阅读全文
posted @ 2022-11-08 18:28 高尔赛凡尔娟 阅读(30) 评论(0) 推荐(0) 编辑
摘要: https://www.acwing.com/activity/content/2589/ 这场周赛也很简单,除了C我在赛场上写的时候有点小bug,赛时没改出来,哎,真废啊 4713. 反转字符串 #include<bits/stdc++.h> using namespace std; typede 阅读全文
posted @ 2022-11-07 17:19 高尔赛凡尔娟 阅读(18) 评论(0) 推荐(0) 编辑
摘要: D. Masha and a Beautiful Tree 题目大意: 给定一颗满二叉树的叶子节点,让我们更换子树位置,从而让叶子节点排序为升序 求最小操作数,如果不能移动成那样的话,直接输出-1. input 4 8 6 5 7 8 4 3 1 2 4 3 1 4 2 1 1 8 7 8 4 3 阅读全文
posted @ 2022-11-05 18:05 高尔赛凡尔娟 阅读(51) 评论(0) 推荐(1) 编辑
摘要: https://codeforces.com/contest/1747/problem/C C. Swap Game 题目大意: 给定一个长度为n的数组a,每次只要当我想动但是发现a[1]==0的时候我就输了 要么就是我每次把a[1]的数值减一丢到后面的数组中去,同时从后面的数组中提出一个数字来放回 阅读全文
posted @ 2022-11-05 15:51 高尔赛凡尔娟 阅读(110) 评论(0) 推荐(1) 编辑
摘要: https://atcoder.jp/contests/abc273 A - A Recursive Function #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PII 阅读全文
posted @ 2022-11-04 21:34 高尔赛凡尔娟 阅读(55) 评论(0) 推荐(0) 编辑
摘要: https://atcoder.jp/contests/abc274/tasks A - Batting Average #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL,LL> PI 阅读全文
posted @ 2022-11-04 17:49 高尔赛凡尔娟 阅读(44) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/contest/1526/problem/C1 题目大意: n≤2000 一行有n种药剂,药剂1在最左边,药剂n在最右边。每种药剂在饮用时都会增加你ai的生命值。ai可以是负的,意味着药剂会降低生命值。 你从0生命值开始,从左向右走,从第一瓶药水走到最后 阅读全文
posted @ 2022-11-03 20:18 高尔赛凡尔娟 阅读(31) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/contest/1409 A. Yet Another Two Integers Problem 题目大意: k∈[1;10] 我们每次可以选择 a:=a+k or a:=a−k 问a要经历多少次操作变成b? input 6 5 5 13 42 18 4 阅读全文
posted @ 2022-11-01 21:43 高尔赛凡尔娟 阅读(18) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/problemset/problem/166/E 题目大意: 给定一个正三角锥,最上面的顶点是D点,下面三个点分别标号为ABC 给定n次,我们初始化在D点上,并且要求最后第n步也必须回到D点上,但是不能两秒同在同一个点上,问我们这样的路径有多少条? 输入 阅读全文
posted @ 2022-11-01 18:39 高尔赛凡尔娟 阅读(17) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 30 下一页