摘要:
1002.Blow up the Enemy 先把最优的武器选出来,花最少时间能打死对面那种(不止一个) 父亲想赢的话就只有赌中这些最优的武器概率为cnt/n,选出来了也只有1/2的概率赢 最后我赢的概率就是父亲输的概率 ,1-cnt/2n #include <bits/stdc++.h> usin 阅读全文
摘要:
1004.Tokitsukaze and Multiple 求和为p的倍数的块的最大数量,我用了比较暴力的做法,好像有dp的做法? #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a 阅读全文
摘要:
1001.Total Eclipse 每次选择最大连通块,将所有值同时减小,减小到零断开。 换种思路,将所有数从大到小排序,依次将点加入图,加入后将所有值的权值降至下一个数的大小 此时答案为 (b[i]-b[i+1])*当前图的连通块个数,对每次加点维护一个连通块个数即可 #include <bit 阅读全文
摘要:
1004.Distinct Sub-palindromes 签到题,问长度为n且回文子串的个数最少的串的数量 想到 abcabcabc... 排列回文子串最少为3 n=1,2,3特殊处理一下 #include <bits/stdc++.h> using namespace std; typedef 阅读全文
摘要:
题目传送门 A. Johnny and Ancient Computer a经过一系列变换成为b需要的次数 简单的模拟 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) f 阅读全文
摘要:
题目传送门 先放这,后面会补的 A. Odd Selection #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (register int i = a; i < 阅读全文
摘要:
题目传送门 A. Berland Poker #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (register int i = a; i <= b; i++) 阅读全文
摘要:
题目传送门 A. Park Lighting #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (register int i = a; i <= b; i++) 阅读全文
摘要:
题目传送门 A. Minimal Square #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (register int i = a; i <= b; i++) 阅读全文
摘要:
题目传送门 A. Sequence with Digits an+1=an+minDigit(an)⋅maxDigit(an),已知a1,k,求ak。 当minDigit(an)=0时,an+1=an,对后续的答案不会产生影响了。 #include <bits/stdc++.h> using nam 阅读全文