- 博客(59)
- 收藏
- 关注
原创 【模拟+数学】Codeforces Round #621 (Div. 1 + Div. 2) 1307E Cow and Treats
Cow and Treats【cf链接】After a successful year of milk production, Farmer John is rewarding his cows with their favorite treat: tasty grass!On the field, there is a row of n units of grass, each with ...
2020-02-22 23:24:32
565
原创 用平均数和标准差mock数据并保留两位小数
复现论文的时候需要mock正态分布的数据,论文里只有带误差线的柱状图,如下图百度+猜测认为误差线是平均值±标准差用PDF快速看图量了一下,官网链接点这里excel公式为=NORMINV(RAND(),$D2,$E2)其中D2是均值,E2是标准差,接下来只要复制就会有一系列数据了。最后复制粘贴到原位置只保留值,再用excel的“减小小数位数”就ok了。以上如果有错误请留言,谢谢!...
2020-02-12 20:20:54
2911
原创 【dp+超巧妙的线段树】codeforces 1197E. Culture Code
【dp+超巧妙的线段树】codeforces 1197E. Culture Code【题目链接】题目There are famous Russian nesting dolls named matryoshkas sold in one of the souvenir stores nearby, and you’d like to buy several of them. The sto...
2019-07-27 11:50:59
355
原创 【数位dp】求不超过n的数中,有多少个包含2018
【数位dp】求不超过n的数中,有多少个包含2018n的范围是[0,1e9];包含2018的意思是2018是该数的子序列,比如200176855,32018,5270168是符合条件的数, 2019,40017是不符合条件的数。Sample Input2018Sample Input1Sample Input20182018Sample Input92237解题思路数位dp...
2019-04-11 12:13:00
392
原创 WHU校赛2019 Online F. Climb(树上主席树)
WHU校赛2019 Online F. Climb[没有链接]题目JBT is going to climb the mountain, but he was suddenly trapped into an unknown enchantment.There are n mountains, connected by n−1 paths. There is only one road ...
2019-04-07 20:11:39
240
原创 HDU - 6000 Wash 贪心+优先队列
HDU - 6000 Wash 贪心+优先队列【vj链接】题目Mr.Panda is about to engage in his favourite activity doing laundry! He’s brought L indistinguishable loads of laundry to his local laundromat, which has N washing ...
2018-11-18 20:22:34
193
原创 【机智的图论】牛客2018多校第十场 F. Rikka with Line Graph
【机智的图论】牛客2018多校第十场 F. Rikka with Line Graph【题目链接】题目描述Line Graph L(G) can be considered as an operator on an undirected graph G just like Complementary Graph and Dual Graph.Rikka generalize...
2018-08-21 17:33:27
879
原创 【二分+状压dp】Codeforces Round #384 (Div. 2) E. Vladik and cards
【二分+状压dp】Codeforces Round #384 (Div. 2) E. Vladik and cards【vj链接】题目Vladik was bored on his way home and decided to play the following game. He took n cards and put them in a row in front of hi...
2018-08-16 17:34:43
179
原创 【动态主席树,带lazy标记的区间更新求和】HDU - 4348 To the moon
【动态主席树,带lazy标记的区间更新求和】HDU - 4348 To the moon【vj链接】题目Background To The Moon is a independent game released in November 2011, it is a role-playing adventure game powered by RPG Maker. The ...
2018-08-11 17:36:30
289
原创 【动态主席树】 ZOJ 2112 Dynamic Rankings
【动态主席树】 ZOJ 2112 Dynamic Rankings【vj链接】题目求区间第k小,有单点更新输入T组数据n个点Q个询问n个点Q行Q个询问 以Q开头的三个数 l r k 表示询问 [l,r] 第 k 小 以C开头的俩数x y 表示把 a[x] 换成 y输出每个询问对应的第 k 小的数Sample Input25 33 2 1 ...
2018-08-10 17:06:12
142
原创 【神奇的dp】poj 6357 Hills And Valleys
【神奇的dp】poj 6357 Hills And Valleys【题目链接】题目Problem DescriptionTauren has an integer sequence A of length n (1-based). He wants you to invert an interval [l,r] (1≤l≤r≤n) of A (i.e. replace Al,A...
2018-08-07 10:43:07
285
原创 【求最长公共前缀 后缀数组】hdu1403
【求最长公共前缀 后缀数组】hdu1403【vj链接】题目内容给两个字符串,求最长公共子串,多组数据,长度1e5解题思路利用后缀数组的性质,把两个串连起来,找最大的满足公共串部分分别在两个字符串里的height。AC代码#include <iostream>#include <cstdio>#include <cstri...
2018-08-06 10:13:49
299
原创 【分块dp】HDU 6331 Problem M. Walking Plan
【分块dp】HDU 6331 Problem M. Walking Plan【题目链接】题目大意T组数据 每组n个点m条边,给一个有向图,边有长度。 接下来Q个询问 每次问u到v至少经过x个点的最短距离InputThe first line of the input contains an integer T(1≤T≤10), denoting the numbe...
2018-07-31 15:45:05
197
原创 【dfs 组合数】code forces 991E Bus Number
【dfs 组合数】code forces 991E Bus Number【题目链接】题目内容给一个看到的数n(1&lt;=n&lt;=1e18),无前导0,求实际的数x有多少种可能。 n与x的关系是,1.n中出现的数,x中也出现。2.x中任何一个数出现的次数不超过其在n中出现的次数。解题思路1e18范围内最多就只有19个数,先把0,1,2……的数量都统计出...
2018-07-25 09:26:02
215
原创 【矩阵快速幂】code forces 631E
【矩阵快速幂】code forces 631E【题目链接】题目内容There are b blocks of digits. Each one consisting of the same n digits, which are given to you in the input. Wet Shark must choose exactly one digit from eac...
2018-07-24 21:12:17
302
原创 POJ 1742 coins (奇怪的多重背包)
题目给出n种货币和货币数量,求其能凑出的不超过m的和有多少种。InputThe input contains several test cases. The first line of each test case contains two integers n(1<=n<=100),m(m<=100000).The second line contains 2n...
2018-07-21 14:41:44
175
原创 codeforces 500E New Year Domino(线段树预处理+倍增)
codeforces 500E New Year Domino(线段树预处理+倍增)【题目链接】解题思路先用线段树预处理能达到的最远长度,就是从后往前,对每个点,二分找到它能到的最远的木棒,找到这其中的最远距离,更新。 对每一个点,向推倒它之后第一个不能被波及到的木棒连一条边,记录一个花费。 用dp[i][j]表示第i个点走过2的j次方条边后到达的点,同时记录花费。 dp[...
2018-06-05 17:04:58
276
原创 POJ - 2481 Cows (单点更新,区间查询(求和)的树状数组)
POJ - 2481 Cows (单点更新,区间查询(求和)的树状数组)【vj链接】题目Farmer John’s cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in h...
2018-05-22 14:27:01
194
原创 HDU - 2665 Kth number (主席树经典题,求区间第K小)
HDU - 2665 Kth number (主席树经典题,求区间第K小)【题目链接】【大佬博客链接】题目Give you a sequence and ask you the kth big number of a inteval. Input The first line is the number of the test cases. For each test...
2018-05-18 21:26:22
198
原创 2018华科校赛A题 -- Beauty of Trees(带权并查集)
2018华科校赛A题 – Beauty of Trees(带权并查集)【题目链接】题目描述It’s universally acknowledged that there’re innumerable trees in the campus of HUST. One day the tree manager wants to play a game with you. There...
2018-05-10 21:13:27
409
原创 POJ1182 -- 食物链 (带权并查集经典例题)
POJ1182 – 食物链 (带权并查集经典例题)【题目链接】题目食物链Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1...
2018-05-10 19:33:00
227
转载 二维RMQ模板
二维RMQ模板const int maxn=100+7;int n,m;int dp[maxn][maxn][10][10],val[maxn][maxn];void init(){ for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { ...
2018-05-02 21:41:34
150
原创 矩阵快速幂模板
矩阵快速幂模板const int maxarr=7;//矩阵大小LL aa,bb;struct node{ LL arr[maxarr][maxarr];};void init(node &a)//所有新建都要手动清空{ for(int i=0;i<maxarr;i++) { for(int j=0;j<maxarr;j...
2018-05-02 20:15:23
122
原创 第十四届华中科技大学程序设计竞赛 I 题 Neat Tree
Neat Tree【题目链接】题目链接:https://www.nowcoder.com/acm/contest/106/I 来源:牛客网题目描述 It’s universally acknowledged that there’re innumerable trees in the campus of HUST.There is a row of trees alo...
2018-04-30 17:40:53
296
原创 dijkstra 模板
int dis[maxn],vis[maxn],pre[maxn],n;struct node///to为点的编号,d为边权或者最短路{ int to,d;}f,ne;struct cmp{ bool operator() (node a,node b) { return a.d>b.d; }};vector <node&g...
2018-04-26 20:32:10
228
原创 Punching Power Gym - 101670J (二分图最大独立点集匈牙利算法(模板))
Punching Power Gym - 101670J (二分图最大独立点集匈牙利算法(模板))【vj链接】题目大意与解题思路给n[1,2000 ]个点的二维平面坐标,选一个最大的点的集合,要求其中任意两点距离不能大于1.3。1.3是一个很特别条件,因为给出的点都是整数点,所以就是上下相邻和左右相邻的不能同时出现,这就是一个二分图,同一条反斜线上的点的特征是横纵坐标值之和...
2018-04-21 21:14:15
347
原创 Tarjan 模板
#include <bits/stdc++.h>#define LL long longusing namespace std;#define maxn 200007const int INF=0x3f3f3f3f;int DFN[maxn],low[maxn],num,index;bool inStack[maxn];vector <int> G[ma...
2018-04-16 21:59:16
606
1
原创 HDU - 4856 Tunnels (预处理+状压dp)
HDU - 4856 Tunnels (预处理+状压dp)【hud链接】 【vj链接】题目Problem DescriptionBob is travelling in Xi’an. He finds many secret tunnels beneath the city. In his eyes, the city is a grid. He can’t enter ...
2018-04-14 16:39:25
295
原创 2018年东北农业大学春季校赛
【题目】A wyh的曲线 10/51 未通过学一下求曲线长度?B wyh的矩阵 461/1355 通过规律题方便打表的先打表再推C wyh的商机 12/31 未通过离线LCA?D wyh的迷宫 383/1149 通过E wyh的阶乘 630/1711 通过阶乘末尾的0由其中5的因子的个数决定,这道题思...
2018-04-07 22:22:40
287
原创 CodeForces - 514C Watto and Mechanism(字典树)
CodeForces - 514C Watto and Mechanism(字典树)【vj链接】 【cf链接】题目Watto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings in a certain way. Initia...
2018-04-04 21:29:49
275
原创 KMP模板1(便于理解)(poj3461)
KMP模板1(便于理解)(poj3461)优化后的模板(不需要memset)void get_Next(const string &a,int Next[],int len){ Next[0]=-1; int k=-1; for(int i=1;i<len;i++) { while (k>=0 && ...
2018-03-28 21:29:21
156
原创 UVa 12118 - Inspector's Dilemma(并查集,欧拉回路)
UVa 12118 - Inspector’s Dilemma(并查集,欧拉回路)【vj链接】题目In a country, there are a number of cities. Each pair of city is connected by a highway, bi-directional of course. A road-inspector’s task is...
2018-03-23 20:46:40
322
原创 概率dp
Problem K. A game (High)Input file: stdin Output file: stdout Time limit: 1 sec Memory limit: 256 MbAlex met a friend who invited him to play for the collectible card. The game divided on a...
2018-03-22 22:20:17
142
原创 tarjan判环(51Nod - 1076)
tarjan判环(51Nod - 1076)51Nod - 1076 vj链接模板int DFN[maxn],low[maxn],cnt=0;bool vis[maxn],inStack[maxn];///每次使用要清空vector <int> edge[maxn];stack <int> st;void dfs(int u,int pre...
2018-03-20 23:34:00
1121
原创 【模板】Dijkstra \ Floyed \ Prim
Dijkstraint dis[maxn],vis[maxn],pre[maxn];void dijkstra()//不能有负权边{ int i,j; for(i=0;i { dis[i]=map[begin][i]; vis[i]=0; pre[i]=-1; } dis[begin]=0;
2018-01-19 18:59:50
155
原创 【解题报告】Tree Destruction CodeForces - 911F(搜索??)
【解题报告】Tree Destruction CodeForces - 911F(搜索??)====================================================================【cf链接】【vj链接】==================================================================
2018-01-08 17:21:42
584
1
原创 【动态规划】POJ - 2192 Zipper
【动态规划】POJ - 2192 ZipperDescriptionGiven three strings, you are to determine whether the third string can be formed by combinin
2017-12-27 16:45:43
826
原创 【dp】POJ - 1080 Human Gene Functions
【dp】POJ - 1080 Human Gene Functions【poj链接】 【vj链接】题目大意给两个字符串包括A,C,G,T,一一对应的组合有权重,加入’-‘使两字符串长度相等,求最大权重和,注意:两个’-‘不可对应。 InputThe input consists of T test cases. The number of test cases ) (T is given in
2017-12-04 22:36:40
156
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人