- 博客(24)
- 收藏
- 关注
原创 2021-04-23
def ci_mean_unknown_var(x, conf_level, alternative): alpha = 1 - conf_level if 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
216
原创 E. Directing Edges(拓扑排序判断有向图是否有环+无向边变为有向边使得图依然没环)
E. Directing Edges 题意: 给你一张n个点m条边的图,其中有一些边是有向边,有一些边是无向边,题目要求你对所有无向边选择一个方向,使得整个图成为有向无环图(DAG),若无法做到则输出-1。 思路: 如果给定的有向边已经形成环了,那么再怎么改无向边,都无法做到。如果有向边没有形成环,那么就可以做到。我们把有向边连接起来,无向边不连接(看做一个个孤立的点),对整张图进行拓扑排序,因为每个点只有1次入队出队的机会,所以我们可以得到每个点出队的顺序。我们把每条边按照这个顺序输出就行。(无向边迎合有
2020-08-11 20:58:57
359
原创 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
192
原创 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
158
原创 2016 Benelux Algorithm Programming Contest (BAPC 16)8/12
7.23 A. B.签到 C.LJX D.DP,分两种情况:1.一艘船单独过去(60+60+20)2.多艘船的情况:又分为两种:(1).把船堆到一起走的时候:只需要开一次门关一次门,60+60,堆在一起的船是可以连续通过的,就是船数*20。(2).桥打开,一艘船过去了之后,桥一直不放下来,这段时间内的船不影响的通过,最后一艘船过去了之后桥再放下。开桥 +通过 + (不落桥,到达通过)+下桥。 E.dij + 二分。傻逼题 F. G.ZYC H. I.素数筛+暴力 J.ZYC K.补: DP+思维 学习一下。
2020-07-24 00:31:13
333
原创 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
200
原创 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. What is the...
2020-02-24 22:16:23
463
原创 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
256
原创 SCAU2020春季个人排位赛div2 #1A - A
1.题目 在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input 输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口...
2020-02-22 17:59:12
279
原创 线段树
1.详细学习 https://www.cnblogs.com/jason2003/p/9676729.html 这个博客写的很详细。 https://blog.youkuaiyun.com/iwts_24/article/details/81484561 还有这个。 2.题目1 H - 线段树各种基础操作 POJ - 3468 A Simple Problem with Integers Time Limit...
2020-02-21 18:24:51
163
原创 J - Wormholes UVA - 558
1.题目 J - Wormholes UVA - 558 In the year 2163, wormholes were discovered. A wormhole is a subspace tunnel through space and time connecting two star systems. Wormholes have a few peculiar properties: ...
2020-02-21 17:32:34
162
原创 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, and i...
2020-02-21 17:23:03
249
原创 H - Lift Hopping UVA - 10801
1.题目 H - Lift Hopping UVA - 10801 A skyscraper has no more than 100 floors, numbered from 0 to 99. It has n (1 ≤ n ≤ 5) elevators which travel up and down at (possibly) different speeds. For each i in...
2020-02-21 09:47:08
245
原创 G - The Tourist Guide UVA - 10099
1.题目 G - The Tourist Guide UVA - 10099 Mr. G. works as a tourist guide. His current assignment is to take some tourists from one city to another. Some two-way roads connect the cities. For each pair o...
2020-02-20 23:05:40
235
原创 D - Connect the Campus UVA - 10397
1.题目 D - Connect the Campus UVA - 10397 Many new buildings are under construction on the campus of the University of Waterloo. The university has hired bricklayers, electricians, plumbers, and a compu...
2020-02-20 22:36:49
180
原创 C - Audiophobia UVA - 10048
1.题目 C - Audiophobia UVA - 10048 Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating in this contest. But we apprehend that many of your descendants may...
2020-02-20 22:30:08
248
1
原创 B - Freckles UVA - 10034
1.题目 B - Freckles UVA - 10034 In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad’s back to form a picture of the Liberty Bell. Alas, one of the freckles turns out ...
2020-02-20 22:00:32
205
原创 A - Risk UVA - 567(Floyd)
1.题目 A - Risk UVA - 567 Risk is a board game in which several opposing players attempt to conquer the world. The gameboard consists of a world map broken up into hypothetical countries. During a playe...
2020-02-20 14:21:19
178
原创 C - 最小生成树 HDU - 3371
1.题目 C - 最小生成树 HDU - 3371 In 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
217
1
原创 E - St表/线段树 POJ - 3264Balanced Lineup【RMQ模版题】
1.题目 E - St表/线段树 POJ - 3264 Balanced 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
166
原创 D - Dequeue SGU - 271
1.题目 SGU - 271 There 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
169
原创 O - 优先队列 CodeForces - 948C
1.O - 优先队列 CodeForces - 948C Alice 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
231
原创 B - 优先队列 POJ - 2970
1. 题目 POJ - 2970 A 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
236
原创 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
529
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅