自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

天翼之城的博客

菜鸟的记录

  • 博客(54)
  • 收藏
  • 关注

原创 2018秦皇岛ccpc赛后总结

在赛前一周左右知道了自己要去参加这个比赛,怎么说,第一次参加这比赛还是有一点激动的(主要是出去这么远外加第一次坐飞机),在24号的时候便和女朋友买完了该带的东西。26号早上7点钟起来开始收拾东西,以为自己把所有该带的东西都带了,结果坐上动车检查的时候发现完蛋了。事情是这样的,在告诉我妈出去比赛了以后她给了一个新书包来装东西,由于26号早上转移书包的时候太过匆忙便落下了一些东西:充电器,电宝,一小...

2018-09-29 15:38:58 573

原创 高精度乘法

高精度乘法其实就是再现小学乘法方法,其实就是每一位的相加,比如123123就是1233+12320+123100,然后123再用数组的方式算出来,就好了贴上代码:#include<iostream>#include<string.h>using namespace std;const int maxn=1e3+5;int a[maxn],b[maxn],ans[m...

2018-09-25 14:52:51 82

原创 Gym 101879C Promenade by the lake —— dfs+并查集 找构成欧拉回路需要添加的边

The city of Porto will host the ICPC World Finals in 2019. One of the secret touristic spots in the city is the so-called “lake of the thousand bridges”. Mr. Manoel Pontes (Pontes stands for “bridges”...

2018-09-25 10:08:09 331

原创 ACM/ICPC 2018亚洲区预选赛北京赛站网络赛 80 Days ——尺取

描述80 Days is an interesting game based on Jules Verne’s science fiction “Around the World in Eighty Days”. In this game, you have to manage the limited money and time.Now we simplified the game as b...

2018-09-23 12:00:19 200

原创 ACM/ICPC 2018亚洲区预选赛北京赛站网络赛 Saving Tang Monk II —— dijkstra+优先队列

描述《Journey to the West》(also 《Monkey》) is one of the Four Great Classical Novels of Chinese literature. It was written by Wu Cheng’en during the Ming Dynasty. In this novel, Monkey King Sun Wukong, p...

2018-09-23 11:44:34 238

原创 Codeforces Round #471 (Div. 2) C - Sad powers —— 区间n次方数的个数

题目链接:http://codeforces.com/contest/955/problem/C题意:给你一段区间,让你求出这段区间apa^pap有多少个数(a>0,p>1)题解:范围是1e18,所以肯定是预处理,怎么预处理?我们可以发现一个范围内的平方数是r−l−1个\sqrt{r}-\sqrt{l-1}个r​−l−1​个那么我们就从三次方开始算,把所有不是平方数的次方数都...

2018-09-21 17:49:50 257

原创 Educational Codeforces Round 39 (Rated for Div. 2) D - Timetable背包

由于我复制粘贴会自动换行,也不知道怎么办,就直接放链接了。 题目链接:http://codeforces.com/contest/1039/problem/A这道题我真的是看了好久,一直不知道为什么,好像也找不到题解,只有自己慢慢想了。 首先它第i个输入是不能小于i的,因为如果是都在最短时间到达,那么他就是第i个,所以小于i非法...

2018-09-20 21:43:17 136

原创 uoj 长度测量鸡

新年到新年到!计算鸡村全村上下家家户户开始贴起了春联。比起贴春联,计算鸡更喜欢制作春联,除了每家每户制作自己的春联之外,还可以两家一起,一家写上联,一家写下联,凑成一整幅春联。计算鸡村共有 nn 户村民,现在每两户计算鸡都合作制作了一副春联,加上每家每户自己的,一共有 n(n+1)2n(n+1)2 副春联。计算鸡对春联的长度有这特殊的癖好,他们希望这 n(n+1)2n(n+1)2 副春联长度...

2018-09-20 16:01:12 399

原创 Codeforces Round #484 (Div. 2) D. Shark—— 并查集维护区间 + 想法

题目链接:http://codeforces.com/contest/982/problem/D题意:给你n天一只鲨鱼每天游的距离,让你找一个k,并有三个要求:1.在每一个区间逗留的天数相同(比如说k=3,那么假设有5天,1 3 2 4 5,第一天在一个区间逗留,第二第三天在一个区间逗留,只要每天游的距离不超过k就算在一个区间内)2.逗留的区间尽可能多3.k在满足1,2的情况下尽可能小...

2018-09-20 12:21:20 197

原创 线性表的顺序存储——顺序表

Description实现一个顺序线性表的初始化、插入、删除、访问、清空等操作,调用这些操作,实现如下功能:I a b,在顺序表的第a位置插入元素b;D a,删除顺序表中位序为a的元数,并输出该元素值;G a,输出顺序表中位序为a的元数值;L a,输出顺序表中元素值为a的第一个位置;C,清空顺序表中的所有元数;顺序表的定义如下: typedef int ElemType; ...

2018-09-19 20:00:36 1056

原创 ACM-ICPC 2018 焦作赛区网络预赛 H. String and Times—— 后缀自动机

Now you have a string consists of uppercase letters, two integersAAA andBBB. We call a substring wonderful substring when the times it appears in that string is betweenAAA andBBB (A≤times≤BA ...

2018-09-19 13:11:45 373

原创 hdu 6194 string string string —— 后缀数组找出现k次的串

Problem DescriptionUncle Mao is a wonderful ACMER. One day he met an easy problem, but Uncle Mao was so lazy that he left the problem to you. I hope you can give him a solution.Given a string s, we ...

2018-09-18 19:23:42 258

原创 ACM-ICPC 2018 焦作赛区网络预赛 Jiu Yuan Wants to Eat ——树链剖分(区间加与区间乘)

You ye Jiu yuan is the daughter of the Great GOD Emancipator. And when she becomes an adult, she will be queen of Tusikur, so she wanted to travel the world while she was still young. In a country, sh...

2018-09-17 18:27:23 226

原创 The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online J Press the Button —— 暴力

J Press the Button BaoBao and DreamGrid are playing a game using a strange button. This button is attached to an LED light (the light is initially off), a counter and a timer and functions as follows...

2018-09-16 19:14:19 256

原创 The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online H Traveling on the Axis ——dp

H Traveling on the Axis BaoBao is taking a walk in the interval [0,n] on the number axis, but he is not free to move, as at every point (i−0.5) for all i∈[1,n], where i is an integer, stands a traffi...

2018-09-16 19:05:55 254

原创 ACM-ICPC 2018 焦作赛区网络预赛 Transport Ship—— 二进制优化的01背包

There are NN different kinds of transport ships on the port. The i^{th}i th kind of ship can carry the weight of V[i]V[i] and the number of the i^{th}i th kind of ship is 2^{C[i]} - 12 C[i...

2018-09-15 18:49:47 298

原创 ACM-ICPC 2018 焦作赛区网络预赛 B Mathematical Curse —— dp

A prince of the Science Continent was imprisoned in a castle because of his contempt for mathematics when he was young, and was entangled in some mathematical curses. He studied hard until he reached ...

2018-09-15 18:00:15 163

原创 ACM-ICPC 2018 焦作赛区网络预赛 G Give Candies —— 大数

There are NN children in kindergarten. Miss Li bought them NN candies. To make the process more interesting, Miss Li comes up with the rule: All the children line up according to their student number ...

2018-09-15 17:46:43 235

原创 Of Groups and Rights Gym - 100247E ——树上dfs

Computer security specialist Alexey is setting up the access rights for the secret information about a certain programming contest. Security system is organized so that users are united into the group...

2018-09-15 09:44:23 183

原创 Problem G. Interstellar Travel——水平排序凸包

Problem Description After trying hard for many years, Little Q has finally received an astronaut license. To celebrate the fact, he intends to buy himself a spaceship and make an interstellar travel....

2018-09-15 09:39:38 235

原创 Triangle Partition——极角排序

下载LOFTER我的照片书 | Problem Description Chiaki has 3n points p1,p2,…,p3n. It is guaranteed that no three points are collinear. Chiaki would like to construct n disjoint triangles where each vertex com...

2018-09-15 09:38:20 220

原创 Balanced Sequence——括号匹配

Problem Description Chiaki has n strings s1,s2,…,sn consisting of ‘(’ and ‘)’. A string of this type is said to be balanced:if it is the empty stringif A and B are balanced, AB is balanced,if A ...

2018-09-15 09:37:29 168

原创 hdu 4027 Can you answer these queries? —— 线段树

Problem Description A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be ...

2018-09-15 09:23:44 152

原创 Count the Colors —— 线段树区间更新,覆盖问题

Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task is counting the segments of different colors you can see at last.Inp...

2018-09-14 17:48:54 184

原创 Mayor's posters —— 线段树区间更新

The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally d...

2018-09-14 17:42:48 129

原创 Educational Codeforces Round 44 (Rated for Div. 2) C - Liebig's Barrels —— 思维

题目链接:http://codeforces.com/contest/985/problem/C 很简单的一道题目,但是想了半天还把自己气得要死,因为又读错题意了。。 题意: 给你3个数,n,k,lll,再给你n*k的a[],表示叫你凑n个木桶出来,木桶的长度取决于最小的a,最终的n个木桶最大和最小的差值不超过lll,问这些木桶长度加起来最长有多少。 那么我们先排个序,如果第n个数和第1个...

2018-09-13 20:40:42 118

原创 Educational Codeforces Round 45 (Rated for Div. 2) D - Graph And Its Complement —— 想法,构造

题目链接:http://codeforces.com/contest/990/problem/D题意给你三个数n,a,b,表示有n个点,要你输出一个无向图,a个强连通块,你输出的图的补图有b个强连通块,什么是补图? 就是所有点都连遍的完全图,减去当前图的边。 模一下就可以发现a,b至少有一个是1,因为有对角线的存在,但是如果a,b都是1的时候,由于n=2,3的时候没有对角线,那么就...

2018-09-13 15:47:13 93

原创 Codeforces Round #489 (Div. 2) Nastya and a Game ——想法,利用题目数据范围

题目链接:http://codeforces.com/contest/992/problem/D 这道题的数据是真的狗,我乘出去爆ll了然后答案是符合的我就加了1,但是不能爆ll的,所以答案应该是0,,就是第15个数据。。以后得记住是inf/a[i]而不是mul*a[i]。 因为它k是1e5,∑i=1nai∑i=1nai\displaystyle\sum_{i=1}^{n} a_i<=2...

2018-09-12 20:06:48 134

原创 Codeforces Round #491 (Div. 2) E Bus Number —— 排列组合

题目链接:http://codeforces.com/contest/991/problem/E 有重复问题的全排列是AnnAnum[0]num[0]Anum[1]num[1]...Anum[9]num[9]AnnAnum[0]num[0]Anum[1]num[1]...Anum[9]num[9]\dfrac{A^n_n}{A^{num[0]}_{num[0]}A^{num[1]}_{num[1...

2018-09-12 12:44:38 191

原创 Codeforces Round #487 (Div. 2) C. A Mist of Florescence 构造

题目链接:http://codeforces.com/contest/989/problem/C 题意就是花园里有A,B,C,Ds四种颜色的花,如果同一种颜色的两种花可以通过同一种颜色的花上下左右四个方向到达,那么这算一条路,给你a,b,c,d四种颜色的花的路径数量,叫你输出解决方案。 构造题果然只有有脑子的人才做得出来,自己写判断了好多情况,写了上百行,感觉不对,去看了别人的题解才发现是这样...

2018-09-11 09:10:51 154

原创 Codeforces Round #495 (Div. 2)D. Sonya and Matrix

题目链接:http://codeforces.com/contest/1004/problem/D 我们模一遍就可以发现如果没有到边界的时候,所有数字往外扩都是4的倍数,那我们只要找到第一个个数不是4的倍数的数就是横轴下标,然后我们for一遍n,y就是n+m-maxn-x,因为x+maxn的横轴就是m,再减去maxn的纵轴就是y了,看看每个数的个数是否符合。#include<ios...

2018-09-10 21:31:48 136

原创 ACM-ICPC 2018 徐州赛区网络预赛 B. BE, GE or NE —— 暴力+想法

这个复制下来有点丑。。题目链接:https://nanti.jisuanke.com/t/31454 大意就是一个人想要得到good end,大于k就是good,另一个想要得到bad end,小于l就是bad,如果自己得不到他们会想办法让对方也得不到(好邪恶),给你n个操作次数,每个人轮番来,第一个人先。每个操作里有3个选择,加上a,减去b,取反,只能选择一种操作,如果是0表示无此操作。 一道...

2018-09-10 20:38:21 198

原创 ACM-ICPC 2018 徐州赛区网络预赛 C. Cacti Lottery —— 暴力dfs

Morgana is playing a game called cacti lottery. In this game, morgana has a 3×33 \times 3 3×3 grid graph, and the graph is filled with 11 1 ~ 99 9 , each number appears only once. The game is...

2018-09-10 17:01:54 249

原创 ACM-ICPC 2018 徐州赛区网络预赛 G. Trace —— 想法+upper_bound

There’s a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xx , yy ) means the wave is a rectangle whose vertexes are ( 00 , 00 ), ( xx , 00 ), ( 00 , yy ), ( xx , yy ...

2018-09-09 22:16:28 350

原创 ACM-ICPC 2018 徐州赛区网络预赛 H. Ryuji doesn't want to study—— 树状数组

Ryuji is not a good student, and he doesn’t want to study. But there are n books he should learn, each book has its knowledge a[i]a[i].Unfortunately, the longer he learns, the fewer he gets.That m...

2018-09-09 22:08:32 229

原创 ACM-ICPC 2018 徐州赛区网络预赛 A. Hard to prepare——涂色问题

After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the show, every audience has to wear a Nogaku mask, and seat...

2018-09-09 21:59:34 674

原创 ACM-ICPC 2018 沈阳赛区网络预赛 I. Lattice's basics in digital electronics 字典树

LATTICE is learning Digital Electronic Technology. He is talented, so he understood all those pieces of knowledge in 10^{-9}10 −9 second. In the next 10^{-9}10 −9 second, he built a data dec...

2018-09-09 08:44:39 215

原创 hdu 6191 Query on A Tree —— 可持久化字典树

Problem Description Monkey A lives on a tree, he always plays on this tree.One day, monkey A learned about one of the bit-operations, xor. He was keen of this interesting operation and wanted to pr...

2018-09-07 15:54:56 232

原创 Problem C —— 字典树

Problem Description 度熊手上有一本神奇的字典,你可以在它里面做如下三个操作:1、insert : 往神奇字典中插入一个单词2、delete: 在神奇字典中删除所有前缀等于给定字符串的单词3、search: 查询是否在神奇字典中有一个字符串的前缀等于给定的字符串Input 这里仅有一组测试数据。第一行输入一个正整数N(1≤N≤100000),代表度熊对于字典的...

2018-09-06 20:23:28 180

原创 spoj 1036: [ZJOI2008]树的统计Count

Description   一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成 一些操作: I. CHANGE u t : 把结点u的权值改为t II. QMAX u v: 询问从点u到点v的路径上的节点的最大权值 I II. QSUM u v: 询问从点u到点v的路径上的节点的权值和 注意:从点u到点v的路径上的节点包括u和v本身Inp...

2018-09-06 17:08:33 129

空空如也

空空如也

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

TA关注的人

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