自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 2021-04-23

def ci_mean_unknown_var(x, conf_level, alternative):alpha = 1 - conf_levelif alternative == ‘two.sided’:conf_l = x.mean() - x.std() * t.ppf(1-alpha/2,len(x) - 1)/(math.sqrt(len(x)))conf_u = x.mean() + x.std() * t.ppf(1 - alpha/2, len(x)-1)/math.sqrt(le

2021-04-23 14:55:16 132

原创 E. Directing Edges(拓扑排序判断有向图是否有环+无向边变为有向边使得图依然没环)

E. Directing Edges题意: 给你一张n个点m条边的图,其中有一些边是有向边,有一些边是无向边,题目要求你对所有无向边选择一个方向,使得整个图成为有向无环图(DAG),若无法做到则输出-1。思路: 如果给定的有向边已经形成环了,那么再怎么改无向边,都无法做到。如果有向边没有形成环,那么就可以做到。我们把有向边连接起来,无向边不连接(看做一个个孤立的点),对整张图进行拓扑排序,因为每个点只有1次入队出队的机会,所以我们可以得到每个点出队的顺序。我们把每条边按照这个顺序输出就行。(无向边迎合有

2020-08-11 20:58:57 280

原创 1385D a-Good String(二分递归)

1385D a-Good String(二分递归)题意:一个小写字母串称为 c−good stringc−good string,如果至少满足以下条件之一:字符串长度为 1,包含字母 c字符串前一半都为字母 c,后一半为 (c+1)−good string字符串后一半都为字母 c,前一半为 (c+1)−good string计算将一个长为 n=2k的小写字母串变为a−good string 至少需要替换多少个字符。int n;char s[maxn];int dfs(int l,int

2020-08-11 17:31:12 140

原创 Gym 102346G G(有关行列关系的建图+最小费用流)

1题意:n行m列,每次在一列中选一个数,这些数相乘要最大,这些数不能在同一行,输出每列你选了第几行的数2建图:每行每列只能取一个数,就相当于行列是拆开的点,因为需要输出的是列的信息,那么源点向每一列建一条流量为1,费用为0的边,而每一行向汇点建一条流量为1,费用为0的边。再对于每个格子,每一列向它这一列的格子建一条流量为1,费用为0的点,而每个格子向它所在的行建一条流量为1,费用为-log(格子上的数)的边。(ps:将乘积转换成加法可以考虑用log,注意转成double)#include<i

2020-07-24 00:35:28 107

原创 2016 Benelux Algorithm Programming Contest (BAPC 16)8/12

7.23A.B.签到C.LJXD.DP,分两种情况:1.一艘船单独过去(60+60+20)2.多艘船的情况:又分为两种:(1).把船堆到一起走的时候:只需要开一次门关一次门,60+60,堆在一起的船是可以连续通过的,就是船数*20。(2).桥打开,一艘船过去了之后,桥一直不放下来,这段时间内的船不影响的通过,最后一艘船过去了之后桥再放下。开桥 +通过 + (不落桥,到达通过)+下桥。E.dij + 二分。傻逼题F.G.ZYCH.I.素数筛+暴力J.ZYCK.补:DP+思维学习一下。

2020-07-24 00:31:13 269

原创 SCAU2020春季个人排位赛div2 #5 F

1.题目While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time t...

2020-03-07 17:27:17 150

原创 I - Sending email UVA - 10986(dijkstra)

1.题目There are n SMTP servers connected by network cables. Each of the m cables connects two computers and has a certain latency measured in milliseconds required to send an email message. Whatis the...

2020-02-24 22:16:23 302

原创 SCAU2020春季个人排位赛div2 #2E - E(prime最小生成树)

1.题目There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are connected, if and only...

2020-02-23 17:34:24 201

原创 SCAU2020春季个人排位赛div2 #1A - A

1.题目在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口...

2020-02-22 17:59:12 214

原创 线段树

1.详细学习https://www.cnblogs.com/jason2003/p/9676729.html这个博客写的很详细。https://blog.csdn.net/iwts_24/article/details/81484561还有这个。2.题目1H - 线段树各种基础操作 POJ - 3468A Simple Problem with IntegersTime Limit...

2020-02-21 18:24:51 120

原创 J - Wormholes UVA - 558

1.题目J - Wormholes UVA - 558In the year 2163, wormholes were discovered. A wormhole is a subspace tunnel through space and timeconnecting two star systems. Wormholes have a few peculiar properties:...

2020-02-21 17:32:34 117

原创 K - King UVA - 515

1.题目Once, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed:“If my child was a son and if only he was a sound king.” After nine months her child was born, andi...

2020-02-21 17:23:03 171

原创 H - Lift Hopping UVA - 10801

1.题目H - Lift Hopping UVA - 10801A skyscraper has no more than 100 floors, numbered from 0 to 99. It has n (1 ≤ n ≤ 5) elevatorswhich travel up and down at (possibly) different speeds. For each i in...

2020-02-21 09:47:08 196

原创 G - The Tourist Guide UVA - 10099

1.题目G - The Tourist Guide UVA - 10099Mr. G. works as a tourist guide. His current assignment is to take some tourists from one city toanother. Some two-way roads connect the cities. For each pair o...

2020-02-20 23:05:40 177

原创 D - Connect the Campus UVA - 10397

1.题目D - Connect the Campus UVA - 10397Many new buildings are under construction on the campus of the University of Waterloo. The universityhas hired bricklayers, electricians, plumbers, and a compu...

2020-02-20 22:36:49 133

原创 C - Audiophobia UVA - 10048

1.题目C - Audiophobia UVA - 10048Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating inthis contest. But we apprehend that many of your descendants may...

2020-02-20 22:30:08 173 1

原创 B - Freckles UVA - 10034

1.题目B - Freckles UVA - 10034In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad’s back to form apicture of the Liberty Bell. Alas, one of the freckles turns out ...

2020-02-20 22:00:32 161

原创 A - Risk UVA - 567(Floyd)

1.题目A - Risk UVA - 567Risk is a board game in which several opposing players attempt to conquer the world. The gameboardconsists of a world map broken up into hypothetical countries. During a playe...

2020-02-20 14:21:19 116

原创 C - 最小生成树 HDU - 3371

1.题目C - 最小生成树 HDU - 3371In 2100, since the sea level rise, most of the cities disappear. Though some survived cities are still connected with others, but most of them become disconnected. The govern...

2020-02-20 13:40:46 129 1

原创 E - St表/线段树 POJ - 3264Balanced Lineup【RMQ模版题】

1.题目E - St表/线段树 POJ - 3264Balanced Lineup【RMQ模版题】一段范围内的最大值与最小值之差For the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organiz...

2020-02-19 23:25:07 127

原创 D - Dequeue SGU - 271

1.题目SGU - 271There is a pile of N books on the table. Two types of operations are performed over this pile:a book is added to the top of the pile,top K books are rotated. If there are less than K...

2020-02-18 23:19:39 128

原创 O - 优先队列 CodeForces - 948C

1.O - 优先队列 CodeForces - 948CAlice likes snow a lot! Unfortunately, this year’s winter is already over, and she can’t expect to have any more of it. Bob has thus bought her a gift — a large snow maker...

2020-02-17 23:25:26 166

原创 B - 优先队列 POJ - 2970

1. 题目 POJ - 2970A new web-design studio, called SMART (Simply Masters of ART), employs two people. The first one is a web-designer and an executive director at the same time. The second one is a prog...

2020-02-17 13:39:32 193

原创 C++ Bitset类用法

C++ Bitset类用法定义和初始化首先要使用bitset 类我们必须包含相关的头文件#include <bitset>然后可以如下声明一个该类型变量:bitset<8>varm (M)其中varm为变量名。8表示该类型在内存中占的位数,是二进制。M表示变量varm的初始值。例如:bitset的构造函数:bitset<8>bit;/...

2020-02-07 22:07:37 412

空空如也

空空如也

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

TA关注的人

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