- 博客(15)
- 资源 (1)
- 收藏
- 关注
原创 HDU-1010-Tempter of the Bone(DFS+剪枝)
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 167684 Accepted Submission(s): 44500Problem DescriptionThe doggie foun...
2019-09-29 16:49:45 116
原创 Codeforces-1196-D. RGB Substring(滑动窗口)
D2. RGB Substring (hard version)The only difference between easy and hard versions is the size of the input.You are given a string s consisting of n characters, each character is ‘R’, ‘G’ or ‘B’.Yo...
2019-09-26 17:44:24 205
原创 默认模板
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Ma...
2019-09-26 17:22:46 192
原创 树的重心学习
原文链接:https://www.cnblogs.com/zjl192628928/p/11155816.html树的重心(模板)代码定义:树的重心也叫树的质心。对于一棵树n个节点的无根树,找到一个点,使得把树变成以该点为根的有根树时,最大子树的结点数最小。换句话说,删除这个 [1] 点后最大连通块(一定是树)的结点数最小。性质:树中所有点到某个点的距离和中,到重心的距离和是最小的,如...
2019-09-24 20:51:26 184
原创 Codeforces-1230-D. Marcin and Training Camp(位运算+思维)
D. Marcin and Training CampMarcin is a coach in his university. There are n students who want to attend a training camp. Marcin is a smart coach, so he wants to send only the students that can work c...
2019-09-24 14:19:34 796
转载 _int128输入输出模板
__int128有时候题目会爆long long,可以用__int128抢救一下(int128的前面是两个下划线)但是不能直接用cin、cout输入输出__int128,需要手写输入输出函数输入输出模板:其实就是快读的板子改了个数据类型只有Linux可以编译(如果用win就只能套模板盲交了,板子千万不能错)__int128 read(){ __int128 x=0,f=1; ...
2019-09-23 16:51:35 407 1
原创 2019-CCPC-秦皇岛站-I题-Problem I. Invoker(DP)
题意:一个人有QWE三个基础技能,和一个大招R技能,每释放一个基础技能就会获得一个相应的技能点,最多同时拥有三个技能点,最早获得的技能点会被最新释放的技能点给挤走,每次释放R技能,就会根据现有的三个技能点的组合,释放出一个特殊技能,但是释放R技能不会消耗目前拥有的技能点。技能点组合对应的特殊技能名称如上图所示。现给出一列按时间顺序释放的特殊技能,问如何释放基础QWE技能以及R技能,使得释放的技...
2019-09-23 16:42:53 1813 5
原创 Codeforces-1216-C. White Sheet(基础几何)
C. White SheetThere is a white sheet of paper lying on a rectangle table. The sheet is a rectangle with its sides parallel to the sides of the table. If you will take a look from above and assume tha...
2019-09-22 15:59:41 480
原创 19校赛J题(单调栈)
Problem Description给出一个极大36进制正整数(0-9,a~z),可以选择其中n位留下,将剩余的数位按原有的顺序组合成一个新的数,我们暂且把这种重新组合到的数称为组合数,求组合数中最小的值为多少。Input首先输入T,表示有T组数据(T<20)。每组数据先输入一个36进制正整数(长度<100000),再输入n。题目保证n不大于输入数的长度。Output每...
2019-09-20 16:38:53 81
原创 Codeforces-1209-D. Cow and Snacks(并查集)
D. Cow and SnacksThe legendary Farmer John is throwing a huge party, and animals from all over the world are hanging out at his house. His guests are hungry, so he instructs his cow Bessie to bring o...
2019-09-20 12:03:25 287
原创 Codeforces-1215-B. The Number of Products(前缀积+枚举)
B. The Number of ProductsYou are given a sequence a1,a2,…,an consisting of n non-zero integers (i.e. ai≠0).You have to calculate two following values:the number of pairs of indices (l,r) (l≤r) such...
2019-09-20 11:47:47 682
原创 HDU-2522 求1/n循环节(模拟除法)
A simple problemProblem DescriptionZty很痴迷数学问题.。一天,yifenfei出了个数学题想难倒他,让他回答1 / n。但Zty却回答不了_. 请大家编程帮助他.Input第一行整数T,表示测试组数。后面T行,每行一个整数 n (1<=|n|<=10^5).Output输出1/n. (是循环小数的,只输出第一个循环节).Sample ...
2019-09-20 11:36:07 317
原创 Codeforces-1221-D. Make The Fence Great Again (DP)
D. Make The Fence Great AgainYou have a fence consisting of n vertical boards. The width of each board is 1. The height of the i-th board is ai. You think that the fence is great if there is no pair ...
2019-09-20 11:26:01 359
原创 并查集模板
基础并查集:How Many TablesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 56924 Accepted Submission(s): 28381Problem DescriptionToday is Igna...
2019-09-18 01:08:21 165
原创 记一次BFS踩坑经历
越狱Problem Description众所周知,平平是一个遵纪守法的好孩子,可万万想不到的是,这孩子居然把老黄的牙套偷走了。身为警察局局长的老黄是绝不会让平平逍遥法外的,于是他逮捕了平平,把平平关在了戒备森严的监狱里,每天对他严刑拷打,可平平始终不招出牙套的下落,因为他把牙套当做生日礼物送给了别人。终于有一天,平平受不了了,他决定要越狱。可是老黄的监狱危机四伏……OK,下面游戏开始了。我...
2019-09-18 00:40:05 249
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人