![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
比赛
愈努力俞幸运
这个作者很懒,什么都没留下…
展开
-
9.9
今天我出的一个题目比较晚了,一个小时,读题读了,20分钟,题目不够12个,所以和安分到了一个题目,她一开始题目不是很明确,我给他说之后,他就先去敲了,因为当时已经有人出了,然后我就按照理解手动运行,然后敲了一发wa,问我题意是不是错,然后又读了一遍,是去前导零,感觉自己题意理解没错,他们就是wa,改半天他们的代码,没改出来,就自己写了,然后A了,第一次遇到这种情况,以后重了,就自己运行完样例敲吧,...原创 2018-09-09 22:40:49 · 330 阅读 · 0 评论 -
二分--求最小值的最大p1m2
http://acm.hdu.edu.cn/showproblem.php?pid=6383题意:中文题。思路:求最小值的最大,一看就是二分。二分答案。#include<bits/stdc++.h>#define ll long long#define inf 0x3f3f3f3fusing namespace std;const int maxn=300010;...原创 2018-08-12 21:26:56 · 310 阅读 · 0 评论 -
gcd常见结论及gcd与斐波那契结合--hdu6363.
结论:http://acm.hdu.edu.cn/showproblem.php?pid=6363f[d]表示d|gcd(x1,x2,...,xk)的方案数d|gcd(x1,x2,..,xk)=d|x1,d|x2,...d|x3, x1+x2+...+xk=n则x1+x2+...+xk=n/d非负整数解f[d]=C(n/d+k-1,k-1)g[d]表示d...原创 2018-08-12 20:58:56 · 975 阅读 · 0 评论 -
plan
链接:https://www.nowcoder.com/acm/contest/143/J来源:牛客网 plan时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述There are n students going to travel. And hotel has two t...原创 2018-08-03 09:31:50 · 157 阅读 · 0 评论 -
经典问题莫比乌斯反演gcd(a,b)==kGuGuFishtion好题
http://acm.hdu.edu.cn/showproblem.php?pid=63901.任意一个数都可以分解成质因子的乘积2.考虑质因子pa:p^a1;b:p^b1;phi(a)=(p-1)*p^(a-1)phi(b)=(p-1)*p(b1-1);phi(a,b)=(p-1)*p(a1+b1-1);phi(ab)/(phi(a)*phi(b))=p/p-1=...原创 2018-08-14 21:49:13 · 690 阅读 · 0 评论 -
分块+矩阵快速幂
http://acm.hdu.edu.cn/showproblem.php?pid=6395P/i会有相同的一段,所以想到分块,这个也经常用#include<algorithm>#include <iostream>#include <stdlib.h>#include <string.h>#include <std...原创 2018-08-14 19:04:59 · 2269 阅读 · 0 评论 -
Werewolf
http://acm.hdu.edu.cn/showproblem.php?pid=6370分析:思路:首先所有人都是狼一定合法,所以村民无法确定。经过一番推理,发现只有两种情况可以确定狼:1、某些人的发言构成一个环,环上只有一个人发言说xxx是狼,其他的都说是村民。那么被说是狼的这个人一定是狼。2、由1确定狼以后,有人说1确定的狼是人,那么这个人就一定是狼。(因为村民不会说谎)...原创 2018-08-11 11:43:57 · 204 阅读 · 0 评论 -
Counting 4-Cliques
链接:https://www.nowcoder.com/acm/contest/145/E来源:牛客网 Counting 4-Cliques时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288KSpecial Judge, 64bit IO Format: %lld题目描述You love doing graph theory ...原创 2018-08-11 10:14:57 · 299 阅读 · 0 评论 -
bfs--最小步数--青蛙
链接:https://www.nowcoder.com/acm/contest/157/E来源:牛客网 青蛙时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述有一只可爱的老青蛙,在路的另一端发现了一个黑的东西,想过去一探究竟。于是便开始踏上了旅途一直这个小路上有很多的隧道,从...原创 2018-08-11 09:46:38 · 313 阅读 · 0 评论 -
计算C(n,0)+C(n,1)+...+C(n,m)--Problem B. Harvest of Apples
http://acm.hdu.edu.cn/showproblem.php?pid=6333四个while的顺序不能变,不知道为什么#include<bits/stdc++.h>using namespace std;typedef long long ll;const int mod=1e9+7;const int N=1e5+10;ll block;ll fa...原创 2018-08-06 21:52:01 · 1069 阅读 · 0 评论 -
dfs-Bit Compression
链接:https://www.nowcoder.com/acm/contest/145/C来源:牛客网 Bit Compression时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288KSpecial Judge, 64bit IO Format: %lld题目描述A binary string s of length N =...原创 2018-08-10 18:53:02 · 200 阅读 · 0 评论 -
map--Bit Compression
链接:https://www.nowcoder.com/acm/contest/145/C来源:牛客网 Bit Compression时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288KSpecial Judge, 64bit IO Format: %lld题目描述A binary string s of length N =...原创 2018-08-10 18:28:39 · 166 阅读 · 0 评论 -
Problem L. Graph Theory Homework
http://acm.hdu.edu.cn/showproblem.php?pid=6343容易证明 ⌊a⌋+⌊b⌋≥⌊a+b⌋\lfloor \sqrt{a} \rfloor + \lfloor \sqrt{b} \rfloor \ge \lfloor \sqrt{a + b} \rfloor⌊√a⌋+⌊√b⌋≥⌊√a+b⌋,进而可以证明边权满足三角不等式,故直接从 ...原创 2018-08-01 21:27:28 · 256 阅读 · 0 评论 -
Problem D. Nothing is Impossible
http://acm.hdu.edu.cn/showproblem.php?pid=6335思路:很水的一道题,想尽量获得高分,先按错题数由小到大排序,每次都让做对的人接着往下做呗#include<bits/stdc++.h>#define ll long longusing namespace std;int v[205];int main(){ int ...原创 2018-08-01 21:01:56 · 163 阅读 · 0 评论 -
Shuffle Cards(Rope大法)将一段区间的数字整体搬动
链接:https://www.nowcoder.com/acm/contest/141/C来源:牛客网 Shuffle Cards时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288KSpecial Judge, 64bit IO Format: %lld题目描述Eddy likes to play cards game sin...原创 2018-07-28 10:46:54 · 154 阅读 · 0 评论 -
Generation I--组合数和数学
链接:https://www.nowcoder.com/acm/contest/144/C来源:牛客网 Generation I时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Oak is given N empty and non-repeatable sets whic...原创 2018-08-05 17:56:21 · 533 阅读 · 0 评论 -
保存最大的前20项暴力--Heritage of skywalkert
链接:https://www.nowcoder.com/acm/contest/144/J来源:牛客网 Heritage of skywalkert时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述skywalkert, the new legend of Beihang U...原创 2018-08-05 16:05:13 · 302 阅读 · 0 评论 -
多校 HDU 6313 Hack It——构造
题意:构造一个矩阵,使得不存在这样一个子矩阵,子矩阵的四个角都为1思路:首先用常用的数论构造方法,假设n=5^2,那么矩阵可以写作这种形式:xxxxx xxxxx xxxxx xxxxx xxxxxxxxxx xxxxx xxxxx xxxxx xxxxxxxxxx xxxxx xxxxx xxxxx xxxxxxxxxx xxxxx xxxxx xxxxx xxxxx...原创 2018-07-27 22:17:22 · 208 阅读 · 0 评论 -
并查集应用
http://acm.hdu.edu.cn/showproblem.php?pid=6380#include<bits/stdc++.h>#define ll long long#define inf 0x3f3f3f3fusing namespace std;const int maxn=200010;int n,m,k;int a[maxn],fa[maxn];...原创 2018-08-12 21:34:54 · 284 阅读 · 0 评论 -
hdu 6397 Character Encoding
http://acm.hdu.edu.cn/showproblem.php?pid=6397分析在这篇博客:https://blog.csdn.net/qq_37891604/article/details/81710038#include<bits/stdc++.h>using namespace std;typedef long long ll;const in...原创 2018-08-15 20:05:38 · 186 阅读 · 0 评论 -
构造--hdu 6400 Parentheses Matrix
http://acm.hdu.edu.cn/showproblem.php?pid=6400A parentheses matrix is a matrix where every element is either '(' or ')'. We define the goodness of a parentheses matrix as the number of balanced rows...原创 2018-08-15 21:48:14 · 181 阅读 · 0 评论 -
排列:计算1!+2*2!+3*3!+...+n*n!
排列:计算1!+2*2!+3*3!+...+n*n!https://nanti.jisuanke.com/t/30990原式=(2-1)x1!+2x2!+3x3!+4x4!+.....+nxn!=2!-1+2x2!+3x3!+4x4!+.....+nxn!=(1+2)x2!-1+3x3!+4x4!+.....+nxn!=3!-1+3x3!+4x4!+.....+nxn!=(1+3...原创 2018-09-03 21:56:12 · 2194 阅读 · 0 评论 -
Dijstra--讲解
这个算法只能计算单源最短路,而且不能计算负权值,这个算法是贪心的思想。Dijkstra是按路径长度递增的顺序构造最短路径,每次都是从dist数组中选择最小的,然后加入已经确定出最短路的顶点的集合中,然后去更新,没有加入到已经确定出最短路的顶点的集合中,Dijkstra 每次循环都可以确定一个顶点的最短路径,故程序需要循环 n-1 次。Dijkstra O(n^2) 单源最短路算法(计算从一...原创 2018-09-05 22:21:03 · 379 阅读 · 2 评论 -
ACM-ICPC 2018 南京赛区网络预赛 B The writing on the wall(暴力)
题目链接题意:一个n*m的方格矩阵,有的格子被涂成了黑色,问该矩阵中有多少个子矩阵,子矩阵不包含黑色格子;思路:对于一个长为L, 高为H的无黑点矩阵中包含的高为H的子矩阵个数为L+(L-1)+(L-2)+…+1个;这是直接算的一种方法;如何程序表示该计算呢?for(int i=1; i<=L; i++){ for(int j=i; j>...转载 2018-09-05 21:41:27 · 144 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛
https://nanti.jisuanke.com/t/30996During tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dragon imprisoned Lpl in the Castle? Dragon smiled enigmatically and...原创 2018-09-02 21:38:07 · 177 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛
J题预处理,先打个线性筛,把1到n全都分解质因数,计算贡献,每个次幂为一的质因子贡献*2,次幂为2的质因子不算贡献,有超过2次幂的质因子那么这个数字就可以直接置为0了 #include <set>#include <map>#include <deque>#include <stack>#include <queue>#i...原创 2018-09-05 00:12:34 · 149 阅读 · 0 评论 -
CCPC网络赛--hdu 6438--买卖--贪心
http://acm.hdu.edu.cn/showproblem.php?pid=6438 Buy and Resell Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 759 Accepted Submis...原创 2018-08-26 00:44:21 · 397 阅读 · 0 评论 -
8.25
今天比赛 精心动魄,全程没一点时间放松,正在看别的题,明天写心得,今天凑活,因为没看懂也不想写总结,原创 2018-08-25 22:11:15 · 199 阅读 · 0 评论 -
Codeforces--506--div3--D--求与x相加求与m等于0的y的个数
D. Concatenated MultiplesYou are given an array aa, consisting of nn positive integers.Let's call a concatenation of numbers xx and yy the number that is obtained by writing down numbers xx and yy...原创 2018-08-31 00:48:11 · 235 阅读 · 0 评论 -
8.27
牛客月赛B就是模板,上网百度的,吓人的是,还百度了个错误的代码,另一个队友一百度就对了,这就是传说中的人品了,线段树区间合并。C就是个规律题,E也是个板子HDU 1166 敌兵布阵(线段树:点更新,区间求和)单点更新,区间查询,query时查询区间覆盖线段树区间,update是向上更新HDU 1754 I Hate It(线段树:单点替换,区间最值)和上一题一样HDU 13...原创 2018-08-27 22:25:33 · 1403 阅读 · 0 评论 -
Music Game
链接:https://www.nowcoder.com/acm/contest/147/E来源:牛客网 Music Game时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Niuniu likes to play OSU!We simplify the game OSU...原创 2018-08-17 15:55:23 · 262 阅读 · 0 评论 -
线段树区间合并--询问某段区间内最长连续上升子序列即最长上升子串
链接:https://www.nowcoder.com/acm/contest/158/B来源:牛客网 最长区间时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述给你一个长度为 n 的序列 a ,求最长的连续的严格上升区间的长度。同时会进行 m 次修改,给定 x , y ,...原创 2018-08-27 09:44:25 · 820 阅读 · 0 评论 -
【BZOJ4318】OSU!【期望DP】
题意:有 n 个操作,有 Ai 的概率成功,连续成功 x 次 对答案的贡献是 x ^ 3,断掉就要重新记,求期望的答案 ( 期望DP )这道题和 bzoj3450一样,题意也一样,不过要注意的是平方的期望不等于期望的平方!既然E(x^2)!=(E(x))^2。分析:第i次点击可能成功也可能失败;第i次点击时的长度,设第i-1次点击时的长度为x;len=(1-pi)*0+pi*(x...原创 2018-08-17 10:42:28 · 169 阅读 · 0 评论 -
期望dp--BZOJ3450 Easy
EasyDescription某一天WJMZBMR在打osu~~~但是他太弱逼了,有些地方完全靠运气:(我们来简化一下这个游戏的规则有n次点击要做,成功了就是o,失败了就是x,分数是按comb计算的,连续a个comb就有a*a分,comb就是极大的连续o。比如ooxxxxooooxxx,分数就是2*2+4*4=4+16=20。Sevenkplus闲的慌就看他打了一盘,有些地方跟运气...原创 2018-08-17 10:07:49 · 152 阅读 · 0 评论 -
又见n/i下取整+分块
链接:https://www.nowcoder.com/acm/contest/158/A来源:牛客网 因数个数和时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述q次询问,每次给一个x,问1到x的因数个数的和。输入描述:第一行一个正整数q ;接下来q行,每行一个...原创 2018-08-26 21:03:09 · 1936 阅读 · 0 评论 -
2018CCPC网络赛
https://blog.csdn.net/qq_37891604/article/details/82078998https://blog.csdn.net/qq_37891604/article/details/82078184https://blog.csdn.net/qq_37891604/article/details/82056843原创 2018-08-26 11:45:58 · 978 阅读 · 0 评论 -
费马小定理
DreamTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 908 Accepted Submission(s): 130Special Judge Problem DescriptionFreshmen freque...原创 2018-08-26 11:44:17 · 540 阅读 · 0 评论 -
费马大定理
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1004&cid=812Find IntegerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 6597...原创 2018-08-26 10:41:30 · 675 阅读 · 0 评论 -
多校训练 Naive Operations线段树区间更新
http://acm.hdu.edu.cn/showproblem.php?pid=6315维护ai/bi向下取整,怎么维护??a数组+1就是对应的b数组减一,b数组减到0时结果就该加1了#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=100005;int b...原创 2018-07-27 21:44:49 · 146 阅读 · 0 评论 -
小白月赛5 D阶乘
链接:https://www.nowcoder.com/acm/contest/135/D来源:牛客网 阶乘(factorial)时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述输入描述:输入数据共一行,一个正整数n,意义如“问题描述”。输出描述:输出一...原创 2018-07-23 09:45:18 · 200 阅读 · 0 评论