自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 面经(待更新)

文章目录字节后台(待更新)一面(约60分钟)计网操作系统面向对象编程腾讯PCG后台(待更新)一面(约60分钟)字节后台(待更新)1月11日投递简历,18/19日简历通过一面(约60分钟)1月24日约面试,25日面试,emm好多记得了,没答出来的印象比较深TAT用牛客面试计网TCP三次握手 四次挥手A发送FIN之后B是否可以继续发送信息输入URL回车发生了什么操作系统创建子进程(不会)面向对象继承多重继承(不会)编程多个非负整数连接在一起组成的最大数给一串数字,问有多少种方式

2021-01-30 15:51:48 223 2

原创 cf 405E Graph Cutting(dfs)

传送门:https://codeforces.com/problemset/problem/405/E题目大意:给一个无向图,没有重边,自环,问能否切割成由3个点,2条边组成的图,每条边只能用一次,每个点可用多次。思路:dfs。把环展开,把图变成树,操作如图。dfs完自动形成的一棵dfs树。对一棵树来说,如果只有奇数条边,肯定NO solution,偶数有解,原因如下:从下网上删边,如...

2019-03-28 13:06:21 173

原创 cf 420b Online Meeting(前缀和)

传送门:http://codeforces.com/problemset/problem/420/B题目大意:有n个人m个登入/登出,如果一个人在其他所有人登入期间都是登入状态,那么这个人就是领导,给出一部分的记录,问有那些人可能是领导。思路:change数组记录登入/登出,登入记为1,登出记为-1,talking记录change的前缀和即为此时登入状态的人数,如果某个时刻有人登出,talki...

2019-03-28 09:26:26 159

原创 Team Tic Tac Toe & Out of Sorts II & Family Tree

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFarmer John owns 26 cows, which by happenstance all have names starting with different letters ...

2019-03-17 00:35:19 149

原创 Milking Order(拓扑排序)

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFarmer John’s N cows (1≤N≤105), numbered 1…N as always, happen to have too much time on their h...

2019-03-17 00:32:44 223

原创 Teleportation

time limit per test15 secondsmemory limit per test1024 megabytesinputstandard inputoutputstandard outputOne of the farming chores Farmer John dislikes the most is hauling around lots of cow manure...

2019-03-17 00:29:46 134

原创 Taming the Herd(2)dp

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputEarly in the morning, Farmer John woke up to the sound of splintering wood. It was the cows, an...

2019-03-17 00:27:20 142

原创 Rest Stops(贪心)

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFarmer John and his personal trainer Bessie are hiking up Mount Vancowver. For their purposes (...

2019-03-17 00:22:12 178

原创 Hoofball

time limit per test5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputIn preparation for the upcoming hoofball tournament, Farmer John is drilling his N cows (conve...

2019-03-17 00:19:36 108

原创 Taming the Herd

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputEarly in the morning, Farmer John woke up to the sound of splintering wood. It was the cows, an...

2019-03-17 00:16:39 76

原创 Convention II(优先队列)

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDespite long delays in airport pickups, Farmer John’s convention for cows interested in eating ...

2019-03-17 00:13:33 156

原创 Mixing Milk

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFarming is competitive business – particularly milk production. Farmer John figures that if he ...

2019-03-17 00:06:00 118

原创 Back and Forth

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFarmer John has two milking barns, each of which has a large milk tank as well as a storage clo...

2019-03-17 00:00:55 128

原创 Convention

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputCows from all over the world are arriving at the local airport to attend the convention and eat...

2019-03-16 23:57:30 136

原创 The Bucket List

A. The Bucket Listtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFarmer John is considering a change in how he allocates buckets for milking ...

2019-03-16 23:51:28 331

原创 第三次排位赛-A Out of Sorts S(找规律,数学题?)

传送门:https://www.luogu.org/problemnew/show/P4378题目大意:给一串数字,问经过以下伪代码冒泡排序后,moo了多少次。sorted = falsewhile (not sorted): sorted = true moo for i = 0 to N-2: if A[i+1] < A[i]: s...

2019-03-08 22:15:25 137

原创 第二次排位赛-G(dfs)

传送门:https://www.luogu.org/problemnew/show/P5118题目大意:第一第二个奶棚都有1000的奶,周二FJ把在第一个奶棚的任意一桶奶搬到第二个奶棚,周三从第二个奶棚搬任意一桶到第一个奶棚,周四同周二,周五同周三,问周五搬完之后第一个奶棚的奶量有多少种可能。思路:dfs,搬了的桶标记一下,搬过去的桶扔到数组里,记录桶的数量,此时桶的数量+1代码:#inc...

2019-03-07 23:22:28 111

原创 第一次排位赛-C(贪心)

传送门:https://www.luogu.org/problemnew/show/P4266题目大意:牛和FJ登山,速度均匀,牛比FJ跑的快,牛在途中一些特定位置吃草,吃的草量为吃的时间*美味值,但保证不被FJ超过,求最多可以吃多少草。思路:贪心,在美味值最高的地方吃草,直到被追上,重复过程。代码:#include <bits/stdc++.h>#define ll lon...

2019-03-07 22:45:48 84

原创 第一次排位赛B-Teamwork(dp)

传送门:https://www.luogu.org/problemnew/show/U29999题目大意:给一个长度为NNN的数列,每个数可以跟与它相邻的数字组队,并全部变成队伍中最大的数字,一个队最多有KKK个数字,求组队后数列最大和。思路:dpdpdp,f(i)=max(f[j−1]+max(a[t])∗(i−j+1))(max(1,i−k+1)<j<=i,j&...

2019-03-07 21:17:32 82

原创 POJ-3177(双联通分量缩点)

题目大意:给一个无向图,保证联通,求至少需要添加多少边,使得图双联通。思路:缩点,度为1的叶子节点的数量/2向上取整即为答案(使图双联通等价于使图内所有节点都至少处于一个环里,连接任意两个叶子节点就形成一个环)代码:#include <cstdio>#include <vector>#include <iostream>#include <cm...

2019-03-06 23:16:28 134

原创 POJ 2186(Tarjan缩点)

题目大意:给一个有向图,求有多少个点,除自身外的所有点都可以到达。思路:反向建边然后n次bfs Tarjan缩点,得到一颗树,在树上建边(块与块之间),找到没有出度的块,如果有多个,则不可能有满足条件的点,答案为0,有一个这样的块时,里面的顶点数即为答案(所有其他块里的点都可以到这个块,这个块内的又是强连通的,所有点都可以到这个块里的任意点)代码:#include <cstdio&gt...

2019-03-04 22:16:29 105

原创 第一次排位赛 D-Cowpatibility(bitset暴力/位运算枚举子集)

题目描述研究证明,有一个因素在两头奶牛能否作为朋友和谐共处这方面比其他任何因素都来得重要——她们是不是喜欢同一种口味的冰激凌!Farmer John 的 NN 头奶牛(2≤N≤5×104{2\leq N\leq 5×10^4\\}2≤N≤5×104)各自列举了她们最喜欢的五种冰激凌口味的清单。为使这个清单更加精炼,每种可能的口味用一个不超过10610^6106 的正整数 ID 表示。如果两头...

2019-02-17 16:02:10 269

原创 第二次训练赛 B. Mike and Shortcuts-bfs

题目传送门:https://codeforces.com/problemset/problem/689/B题目大意:有n个城市在一排,两两间距为1,每个城市可以用1的距离到一个给定的城市,问城市1到其他所有城市的最短距离。思路:bfs。比赛时脑抽写了个dijkstra,还wa了。。。bfs的时候一定要搜到一个标记一个。。。代码:#include <bits/stdc++.h&gt...

2019-02-03 22:45:08 147

原创 第二次训练赛G. Nephren gives a riddle-dfs

题目传送门:https://codeforces.com/contest/897/problem/C题目大意:给出字符串f(0),s1,s2,s3,满足f(n)=s1+f(n-1)+s2+f(n-1)+s3,求fn的第k个字符思路:dfs,字符串长度会爆long long,k<=1e18,超出范围后,可以直接用-1代表字符串长度代表。比赛的时候被这题坑的半死,就是没想到会爆long l...

2019-02-03 21:59:53 760

原创 第一次训练赛D - Peter and Snow Blower-简单几何

题目传送门:https://codeforces.com/problemset/problem/614/C题目大意:求一个多边形绕他外面一个点转扫过的面积。mmp比赛时看错题了,以为那个点可以在图形内,浪费了半个钟。思路:S=PI*(点到图形最远距离^2 - 点到图形最近距离^2),点到图形最远距离即点到图中的最远的点的距离,最近距离可能是点到点,也可能是点到边,比赛时忘了点到边的情况。算点...

2019-02-02 21:26:16 137

原创 Codeforces Round #485 (Div. 1) C-AND Graph

题目传送门:https://codeforces.com/problemset/problem/986/C题目大意:给出m个数,二进制小于等于n位,两个数按位与为0时连接,问有多少个联通块。思路:dfs,每层不用搜索一个数跟x的所有跟x按位与为0的数(即跟2**n-1按位异或后的子集),只需要x中一个1换成0之后的数,然后继续递归就可以遍历所有数,不会tle。代码:#include &lt...

2019-02-02 20:27:27 92

空空如也

空空如也

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

TA关注的人

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