摘要: CF681B 题目链接 题目大意 现在有n个建筑平行排列,用一个长度为n的01字符串代表这个n个建筑,如果字符串某个位置为1,代表这个建筑下面地雷,为0则代表没有,现在设定一种规则,我们可以花 \(a\) 个硬币引爆一个地雷,这个地雷的位置为 \(x\) ,如果 \(x - 1\) 或者 \(x + 阅读全文
posted @ 2020-11-12 09:51 zdy_1214 阅读(131) 评论(0) 推荐(0)
摘要: 标签(空格分隔): ACM D. MEX maximizing Description: Recall that MEX of an array is a minimum non negative integer that does not belong to the array. Examples 阅读全文
posted @ 2020-01-27 22:24 zdy_1214 阅读(253) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstdio> #include <queue> #include <vector> #include <cstring> using namespace std; const int INF=0x3f3f3f3f; const int inf=2147483647; const int maxn=100010; struct edge 阅读全文
posted @ 2019-08-22 19:40 zdy_1214 阅读(161) 评论(0) 推荐(0)
摘要: 1.高精度加法 算法复杂度O(n) #include<iostream> #include<cstring> #include <string> #include<algorithm> using namespace std; const int L=110; string add(string a 阅读全文
posted @ 2019-08-12 17:31 zdy_1214 阅读(635) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 #include<string> 6 #include<vector> 7 #include<stack> 8 #include<bitset> 9 #include<cstdlib> 10 #include<cmath> 11 # 阅读全文
posted @ 2019-08-11 15:20 zdy_1214 阅读(728) 评论(0) 推荐(0)
摘要: hdoj2049 http://acm.hdu.edu.cn/showproblem.php?pid=2049 Problem Description: 国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的:首 阅读全文
posted @ 2019-07-24 00:11 zdy_1214 阅读(602) 评论(0) 推荐(0)
摘要: 1.先行知识 首先介绍lowbit(x)函数 lowbit(x)函数:lowbit(i)的意思是将i转化成二进制数之后,只保留最低位的1及其后面的0,截断前面的内容,然后再转成10进制数比如lowbit(7),7的二进制位是111,lowbit(7) = 1,6 = 110(2),lowbit(6) 阅读全文
posted @ 2019-07-08 00:06 zdy_1214 阅读(317) 评论(0) 推荐(0)
摘要: D. Candy Box (easy version) http://codeforces.com/contest/1183/problem/D 这题本来是一个简单题,但是不可以开数组来解决,开数组需要把数组的大小开到2*10^5,当很q大并且n很大时,使用sort排序时会TLE。所以这里我们使用C 阅读全文
posted @ 2019-07-07 20:28 zdy_1214 阅读(221) 评论(0) 推荐(0)