自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(40)
  • 收藏
  • 关注

转载 2019icpc 南京网络赛b

https://nanti.jisuanke.com/t/41299指数循环节,快速幂递归求解,需要注意的是快速幂乘的时候如果超过了m需要+m补全循环节#include <bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1e5+5;const ll inf=...

2019-09-03 13:57:00 268

转载 2019焦作F 以及图论题时限内存经验

http://codeforces.com/gym/102028/problem/FF. Honeycombtime limit per test4.0 smemory limit per test1024 MBinputstandard inputoutputstandard outputA ho...

2019-05-19 23:02:00 146

转载 Codeforces Round #554 (Div. 2) C. Neko does Maths

C. Neko does Mathstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNeko loves divisors. During the latest numbe...

2019-04-25 13:08:00 122

转载 Codeforces Round #549 (Div. 2) D. The Beatles

D. The Beatlestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently a Golden Circle of Beetlovers w...

2019-04-13 01:50:00 170

转载 Codeforces Round #550 (Div. 3) F. Graph Without Long Directed Paths

F. Graph Without Long Directed Pathstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a connected...

2019-04-03 20:51:00 109

转载 Codeforces Round #550 (Div. 3) D. Equalize Them All

D. Equalize Them Alltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an arrayaaconsisting ofn...

2019-04-03 18:33:00 121

转载 Codeforces Round #549 (Div. 2) A—C

A. The Doorstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThree years have passes and nothing changed. It is...

2019-03-31 11:30:00 147

转载 最小费用流模板

可以计算负权边的dijkstra//最小费用流Dijkstra算法//Dijkstra算法求最小费用流核心代码://h[MAX_V]:导入势保证所有边均为非负边 O(FElogV)int min_cost_flow(int n, int v, int s, int t, int f){   int i, ans = 0;  ...

2018-11-01 18:07:00 129

转载 二分图匹配模板

洛谷【P3386】题目背景二分图感谢@一扶苏一 提供的hack数据题目描述给定一个二分图,结点个数分别为n,m,边数为e,求二分图最大匹配数输入输出格式输入格式:第一行,n,m,e第二至e+1行,每行两个正整数u,v,表示u,v有一条连边输出格式:共一行,二分图最大匹配输入输出样例输入样例#1:复制1 ...

2018-10-14 16:21:00 157

转载 网络流的相关定义

网络流的相关定义:源点:有n个点,有m条有向边,有一个点很特殊,只出不进,叫做源点。汇点:另一个点也很特殊,只进不出,叫做汇点。容量和流量:每条有向边上有两个量,容量和流量,从i到j的容量通常用c[i,j]表示,流量则通常是f[i,j].通常可以把这些边想象成道路,流量就是这条道路的车流量,容量就是道路可承受的最大的车流量。很显然的,流量<=容量。而对于每个...

2018-05-25 13:39:00 177

转载 最大流dinic模板 poj1273

DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time t...

2018-05-25 13:36:00 167

转载 CodeForces - 450D Jzzhu and Cities (spfa)

Jzzhu is the president of country A. There arencities numbered from1tonin his country. City1is the capital of A. Also there aremroads connecting the cities. One can go from cityuitov...

2018-05-24 23:56:00 119

转载 POJ 2139 Six Degrees of Cowvin Bacon (floyd)

Six Degrees of Cowvin BaconTime Limit:1000MSMemory Limit:65536KTotal Submissions:6744Accepted:3139DescriptionThe cows have been making movies lately, so ...

2018-04-14 01:31:00 123

转载 POJ 3259 Wormholes (floyd或者spfa)

WormholesTime Limit:2000MSMemory Limit:65536KTotal Submissions:58636Accepted:21921DescriptionWhile exploring his many farms, Farmer John has discovered...

2018-04-14 01:25:00 152

转载 POJ 3615 Cow Hurdles (flyod)

Cow HurdlesTime Limit:1000MSMemory Limit:65536KTotal Submissions:8506Accepted:3751DescriptionFarmer John wants the cows to prepare for the county jumpi...

2018-04-14 01:18:00 104

转载 Codeforces Round #446 (Div. 1) A. Pride

A. Pridetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have an arrayawith lengthn, you can perform op...

2018-04-14 01:09:00 176

转载 Educational Codeforces Round 34 A. Hungry Student Problem

A. Hungry Student Problemtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIvan's classes at the university have...

2018-04-14 01:03:00 278

转载 Codeforces Round #463 (Div. 1 + Div. 2, combined) C. Permutation Cycle (扩展欧几里得)

C. Permutation Cycletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor a permutationP[1...N]of integers...

2018-04-06 19:28:00 138

转载 Codeforces Round #463 (Div. 1 + Div. 2, combined) B. Recursive Queries (打表,前缀和)

B. Recursive Queriestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet us define two functionsfandgon po...

2018-04-06 17:42:00 129

转载 Codeforces Round #466 (Div. 2) A. Points on the line (反向思考)

A. Points on the linetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe've got no test cases. A big olympiad i...

2018-04-06 15:57:00 130

转载 Codeforces Round #469 (Div. 2) C. Zebras

C. Zebrastime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputOleg writes down the history of the days he lived. Fo...

2018-04-06 15:41:00 74

转载 Codeforces Round #462 (Div. 2) C. A Twisty Movement (前缀和)

C. A Twisty Movementtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA dragon symbolizes wisdom, power and weal...

2018-04-06 15:30:00 94

转载 Codeforces Round #471 (Div. 2) C. Sad powers

C. Sad powerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're givenQqueries of the form(L, R).For ...

2018-04-06 13:47:00 174

转载 Codeforces Round #471 (Div. 2) A. Feed the cat B. Not simply beatiful strings

比赛地址:http://codeforces.com/contest/955 A. Feed the cattime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output...

2018-04-06 13:46:00 159

转载 P1064 金明的预算方案 (普通dp)

题目描述金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间金明自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N元钱就行”。今天一早,金明就开始做预算了,他把想买的物品分为两类:主件与附件,附件是从属于某个主件的,下表就是一些主件与附件的例子:主件 附件电脑 打印机,扫描仪书柜 图书书桌 台灯,文...

2018-04-03 23:18:00 83

转载 P1118 [USACO06FEB]数字三角形 (杨辉三角,dfs)

题目描述FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one few...

2018-04-03 16:32:00 178

转载 P1032 字串变换 (字符串,bfs)

题目描述已知有两个字串 A, B 及一组字串变换的规则(至多6个规则):A1 -> B1A2 -> B2规则的含义为:在 A$中的子串 A1 可以变换为 B1、A2 可以变换为 B2 …。例如:A='abcd'B='xyz'变换规则为:‘abc’->‘xu’‘ud’->‘y’‘y’->‘yz’则此时,A 可以经过一系列的变换变...

2018-04-03 01:08:00 212

转载 P1060 开心的金明 (最简单的01背包)

题目描述金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N元钱就行”。今天一早金明就开始做预算,但是他想买的东西太多了,肯定会超过妈妈限定的N元。于是,他把每件物品规定了一个重要度,分为5等:用整数1~5表示,第5等最重要。他还从因特网上查到了每件物品的价...

2018-04-02 22:09:00 93

转载 烦人的幻灯片 (类似拓扑排序)

烦人的幻灯片问题Time Limit:1 SecMemory Limit:64 MBSubmit:18Solved:8Description李教授于今天下午做一个非常重要的演讲。不幸的是他不是一个非常爱整洁的人,他把自己做演讲要用的幻灯片随便堆放在一起。因此,演讲之前他不得不去整理这些幻灯片。做为一个讲求效率的学者,他希望尽可能简单地完成它。情况是这样...

2018-04-02 16:43:00 201

转载 差分约束 poj 1201 (最大路径,区间约束)

关于差分约束,有个很好的博客http://www.cppblog.com/menjitianya/archive/2015/11/19/212292.htmlhttps://blog.csdn.net/consciousman/article/details/53812818DescriptionYou are given n closed, integer inter...

2018-03-28 21:29:00 74

转载 差分约束 poj 3169

DescriptionWindy has a country, and he wants to build an army to protect his country. He has picked upNgirls andMboys and wants to collect them to be his soldiers. To collect a soldier wi...

2018-03-28 17:47:00 105

转载 最大权森林 poj 3723

DescriptionWindy has a country, and he wants to build an army to protect his country. He has picked upNgirls andMboys and wants to collect them to be his soldiers. To collect a soldier wi...

2018-03-27 21:24:00 153

转载 次短路 poj 3255

DescriptionBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the sce...

2018-03-27 17:10:00 104

转载 P1604 B进制星球 (高精度进制计算器)

https://www.luogu.org/problemnew/show/P1604题目背景进制题目,而且还是个计算器~~题目描述话说有一天,小Z乘坐宇宙飞船,飞到一个美丽的星球。因为历史的原因,科技在这个美丽的星球上并不很发达,星球上人们普遍采用B(2<=B<=36)进制计数。星球上的人们用美味的食物招待了小Z,作为回报,小Z希望送一个能够完成B进制加法的...

2018-03-27 00:15:00 304

转载 最小生成树入门 kruskal和堆优化的prim

定义:给定一个无向图,如果它的某个子图中的任意两个顶点都互相连通并且是一棵树,那么这棵树就叫生成树(Spanning Tree)如果边存在权值,那么使得边权和最小的生成树叫做最小生成树(MST Minimum Spanning Tree)。求最小生成树的算法有两种:Prim和Kruskal。Prim在稠密图中效率更高,Kruskal在稀疏图中效率更高。Prim类似于Dijkstr...

2018-03-21 20:51:00 250

转载 并查集入门 POJ 1182(带权并查集)

这是一个关于并查集的入门题目 主要是熟悉并查集这种数据结构 并查集顾名思义就是可以高效查询和合并的一种数据结构 (但是并不能用于分割)并查集的实现可以用数组操作用pa(parent)代表并查集内每个树的父节点 ra(rank)代表树的高度 查询和合并用函数完成int init(int n) //初始化{ for(int i=0; i<n; i++)...

2018-03-20 20:12:00 174

转载 简易模板汇总

1.c++高精度http://blog.csdn.net/code4101/article/details/23020525手写高精度乘法#include<bits/stdc++.h>using namespace std;string a1,b1;int jw=0,lena,lenb,lenc,a[2005],b[2005],c[4005]...

2018-03-19 14:39:00 82

转载 cf 443(div2) 部分题目

http://codeforces.com/contest/879A. Borya's Diagnosistime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt see...

2018-03-14 17:17:00 147

转载 P1019 单词接龙

https://www.luogu.org/problemnew/show/P1019题目描述单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们已知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙”中出现两次),在两个单词相连时,其重合部分合为一部分,例如 beast和astonish,如果接成一条龙则变为beastonish,另外...

2018-03-08 17:57:00 180

转载 P1141 01迷宫

https://www.luogu.org/problemnew/show/P1141题目描述有一个仅由数字0与1组成的n×n格迷宫。若你位于一格0上,那么你可以移动到相邻4格中的某一格1上,同样若你位于一格1上,那么你可以移动到相邻4格中的某一格0上。你的任务是:对于给定的迷宫,询问从某一格开始能移动到多少个格子(包含自身)。输入输出格式输入格式:输入的第...

2018-03-08 17:41:00 97

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除