Loading

上一页 1 2 3 4 5 6 7 ··· 15 下一页
摘要: [kuangbin带你飞]专题二十二 区间DP ZOJ 3537 Cake 判断闭包+最优三角划分 注意是用求出的闭包来算转移 #include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; int m,f[400] 阅读全文
posted @ 2021-02-23 11:35 dyhaohaoxuexi 阅读(44) 评论(0) 推荐(0) 编辑
摘要: Kuangbin 博弈专题 HDU 1079 Calendar Game 大意: A和B两个人从一个日期开始,A先手,可以将这个日期变为下一天,或者是下个月中相同的天,有效的日期为1900年1月1日至2001年11月4日,无法取的人输,现在给出开始日期,问先手输赢 思路: sg函数简单题,不过写日期 阅读全文
posted @ 2021-02-21 23:22 dyhaohaoxuexi 阅读(106) 评论(0) 推荐(0) 编辑
摘要: HDU 1538 A Puzzle for Pirates 这是一个经典问题,有n个海盗,分m块金子,其中他们会按一定的顺序提出自己的分配方案,如果50%或以上的人赞成,则方案通过,开始分金子,如果不通过,则把提出方案的扔到海里,下一个人继续。现在给出n,问第k个海盗(第n个海盗先提方案,第1个最后 阅读全文
posted @ 2021-02-21 21:16 dyhaohaoxuexi 阅读(1707) 评论(0) 推荐(1) 编辑
摘要: HDU 2486 A simple stone game 有n个石子,两个游戏者轮流操作,第一个操作的人最多能拿走n-1个石子,以后,每个游戏者最多能拿走前一个游戏者拿走数目的k倍,如果先手必败输出lose,否则输出必胜的情况下第一步拿走的石子数。 这就是K倍动态减法游戏,可以参考《曹钦翔从“k倍动 阅读全文
posted @ 2021-02-21 02:44 dyhaohaoxuexi 阅读(497) 评论(0) 推荐(0) 编辑
摘要: 翻硬币游戏 一般的翻硬币游戏的规则是这样的: N 枚硬币排成一排,有的正面朝上,有的反面朝上。我们从左开始对硬币按1 到N 编号。 第一,游戏者根据某些约束翻硬币,但他所翻动的硬币中,最右边那个硬币的必须是从正面翻到反面。例如,只能翻3个硬币的情况,那么第三个硬币必须是从正面翻到反面。如果局面是正正 阅读全文
posted @ 2021-02-20 01:32 dyhaohaoxuexi 阅读(1237) 评论(0) 推荐(2) 编辑
摘要: 求n到m之间的吉利手机号,号码中要出现至少 3 个相邻的相同数字;号码中不能同时出现 8和 4。 这个题需要考虑两个点,一个是前导0,因为有前导0的必然不是手机号,一个是长度必须是11,否则也不是手机号 至于前导0,可以额外开一个维度,记录当前是否有前导0,但是会时内存x2,本题还不会爆,但是别的题 阅读全文
posted @ 2021-02-19 23:05 dyhaohaoxuexi 阅读(68) 评论(0) 推荐(1) 编辑
摘要: A - Can't Wait for Holiday #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; string s; int main() { cin >> s; 阅读全文
posted @ 2021-02-17 03:18 dyhaohaoxuexi 阅读(44) 评论(0) 推荐(0) 编辑
摘要: A - November 30 #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int a, b, c, d; int main() { cin >> a >> b 阅读全文
posted @ 2021-02-16 09:45 dyhaohaoxuexi 阅读(81) 评论(0) 推荐(0) 编辑
摘要: A. Adrien and Austin 大意: 一共n个数,每次可以取至少1个至多k个连续的数,先手胜输出Adrien,后手胜输出Austin 思路: 当k=1时,直接根据n的奇偶性判断即可 当k大于等于2时,先手总可以先取中间的1个或者2个,使得两边剩下的数量一样多,这样后手怎么选我就选和他对称 阅读全文
posted @ 2021-02-15 20:33 dyhaohaoxuexi 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 模拟退火 概述 简单说,模拟退火是一种随机化算法,用于求函数的极值。当一个问题的方案数量极大(甚至是无穷的)而且不是一个单峰函数时,我们常使用模拟退火求解。 它与爬山算法最大的不同是,在寻找到一个局部最优解时,赋予了它一个跳出去的概率,也就有更大的机会能找到全局最优解。 在 OI 领域,对应的,每次 阅读全文
posted @ 2021-02-15 11:47 dyhaohaoxuexi 阅读(288) 评论(0) 推荐(0) 编辑
摘要: A - Entrance Examination #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; double a, b; int main(){ cin >> a > 阅读全文
posted @ 2021-02-15 09:24 dyhaohaoxuexi 阅读(101) 评论(0) 推荐(0) 编辑
摘要: A - B +/- A #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int a,b; int main(){ cin >> a >> b; if (b % a == 阅读全文
posted @ 2021-02-14 01:06 dyhaohaoxuexi 阅读(56) 评论(0) 推荐(0) 编辑
摘要: A - Still TBD #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int main(){ string s; cin >> s; if (s[5] == '1 阅读全文
posted @ 2021-02-13 21:38 dyhaohaoxuexi 阅读(105) 评论(0) 推荐(0) 编辑
摘要: A - Favorite Sound #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int main(){ int a, b, c; cin >> a >> b >> 阅读全文
posted @ 2021-02-13 14:50 dyhaohaoxuexi 阅读(60) 评论(0) 推荐(0) 编辑
摘要: A - White Cells #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int main(){ int a,b,c,d; cin >> a >> b >> c 阅读全文
posted @ 2021-02-13 02:31 dyhaohaoxuexi 阅读(39) 评论(0) 推荐(0) 编辑
摘要: A - Double Helix #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int main(){ char c; cin >> c; if (c == 'A') 阅读全文
posted @ 2021-02-11 11:10 dyhaohaoxuexi 阅读(55) 评论(0) 推荐(0) 编辑
摘要: A - Five Antennas #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int a[5]; int main() { for (int i = 0; i 阅读全文
posted @ 2021-02-11 01:34 dyhaohaoxuexi 阅读(98) 评论(1) 推荐(0) 编辑
摘要: A - Buttons #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int a, b; int main(){ cin>>a>>b; cout << max({a 阅读全文
posted @ 2021-02-10 23:45 dyhaohaoxuexi 阅读(64) 评论(0) 推荐(0) 编辑
摘要: A - Biscuit Generator #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int a, b, t; int main(){ cin>>a>>b>>t; 阅读全文
posted @ 2021-02-09 11:14 dyhaohaoxuexi 阅读(54) 评论(0) 推荐(0) 编辑
摘要: A - New Year #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 5; typedef long long LL; int n; int main(){ cin >> n; cout << 24 - n + 2 阅读全文
posted @ 2021-02-09 09:32 dyhaohaoxuexi 阅读(60) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 15 下一页