自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(45)
  • 问答 (1)
  • 收藏
  • 关注

原创 spoj ADAFRIEN - Ada and Friends(水题)

ADAFRIEN - Ada and Friends#sorting #datastructures Ada the Ladybug has many friends. They always celebrate something and Ada has to buy them gifts. It is pretty costly so she have decided to unf...

2018-08-06 15:55:43 485

原创 spoj ADAFIELD - Ada and Field(水题)

ADAFIELD - Ada and Field#binary-search #datastructures Ada the Ladybug owns a beautiful field where she grows vegetables. She often visits local Farmers Market, where she buys new seeds. Since t...

2018-08-06 15:54:08 409

原创 spoj ADAFENCE - Ada and Fence(水题)

ADAFENCE - Ada and Fence#datastructures #pointers Ada the Ladybug owns a circular land. She wants to enclose it with fence. Anyway since nobody sells round planks, she has decided to fence it to...

2018-08-06 15:52:32 314

原创 spoj ADACROP - Ada and Harvest(分块+离散化)

ADACROP - Ada and Harvest#datastructures As you might already know, Ada the Ladybug is a farmer. She has a very long furrow with many kinds of vegetables (represented by integer numbers). Whenev...

2018-08-06 15:50:50 338

原创 spoj ADACOINS - Ada and Coins(树状数组+bitset优化)

ADACOINS - Ada and Coins#dynamic-programming #datastructures Ada the Ladybug has several coins in her wallet. She is wondering, how many different values [sum of some subset of coins] is she abl...

2018-08-02 18:28:25 687

原创 spoj ADABEHIVE - Ada and Behives(二维树状数组)

ADABEHIVE - Ada and Behives#datastructures Ada the Ladybug is currently doing her thesis. It is almost complete with one tiny exception - there are some graphs and statistics missing. The topic ...

2018-08-02 18:09:47 317

原创 spoj ADAAPPLE - Ada and Apple(树链刨分+线段树)

ADAAPPLE - Ada and Apple#tree #datastructures Ada the Ladybug is currently on a trip on apple tree. There are many apples on the tree connected with branches. Each apple is inhabited by either P...

2018-08-02 18:04:08 335

原创 spoj CPCRC1C(数位dp)

CPCRC1C - Sum of Digits#dynamic-programmingMajid is a 3rd-grade elementary student and quite well in mathematics. Once, Majid's teacher asked him to calculate the sum of numbers 1 throug

2017-01-26 04:28:07 470

原创 spoj 11404 Save Thy Toys

DCEPC501 - Save Thy ToysLeonard is very fond of buying rare and expensive science fiction toys. He keeps his collection in a sequential order of the date on which the toy was bought in a special

2017-01-17 16:28:22 304

原创 hdu 4405 Aeroplane chess(全期望公式)

Aeroplane chessTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3785    Accepted Submission(s): 2404Problem DescriptionHzz loves aero

2017-01-14 21:53:23 551

原创 hdu 5692 (dfs序+线段树)

SnacksTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1732    Accepted Submission(s): 421Problem Description百度科技园内有n个零食机,零食机之间通过n−1

2016-10-13 00:30:14 283

原创 hdu3887 Counting Offspring(dfs序+树状数组)

Counting OffspringTime Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2635    Accepted Submission(s): 907Problem DescriptionYou are giv

2016-10-12 17:35:54 392

原创 hihoCoder挑战赛23Emulator(floyd算法)

题目1 : Emulator时间限制:5000ms单点时限:1000ms内存限制:256MB描述有一个n个点的无向正权图G,这个图是连通的,小Y知道这些点两两之间的最短路的长度。小J想要构造一个新的无向正权图G',使得新图中两两之间的最短路的长度与原图一样,并且边数最少。输入第一行一个整数n,表示点的个数。接下来n行,每行n个

2016-10-12 11:27:51 395

原创 hdu 3487Play with Chain(Splay)

Play with ChainTime Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5815    Accepted Submission(s): 2356Problem DescriptionYaoYao is fond

2016-10-11 22:30:05 431

原创 poj 3580(Splay)

SuperMemoTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 14372 Accepted: 4489Case Time Limit: 2000MSDescriptionYour friend, Jackson is invited t

2016-10-11 22:23:15 321

转载 平衡树之splay讲解

链接:http://www.cnblogs.com/BLADEVIL/p/3464458.htmlBLADEVILHis judgement cometh and that right soon.平衡树之splay讲解  首先来说是splay是二叉搜索树,它可以说是线段树和SBT的综合,更可以解决一些二者解决不了的问题,splay几乎所有的操作都是由splay这一操

2016-10-10 09:04:35 288

转载 GSS5 - Can you answer these queries V

You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| <= 10000 , 1 <= N <= 10000 ). A query is defined as follows: Query(x1,y1,x2,y2) = Max { A[i]+A[i+1]+...+A[j] ; x1 <= i <= y1 , x2 <= j <= y2 a

2016-09-09 17:35:19 306

原创 GSS4 - Can you answer these queries IV

You are given a sequence A of N(N 18. On this sequence you have to apply M (M (A) For given x,y, for each elements between the x-th and the y-th ones (inclusively, counting from 1), modify it to its p

2016-09-09 13:40:48 231

转载 spoj MKTHNUM - K-th Number(动态查询区间第k小)

DescriptionYou are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be ab

2016-09-09 11:00:19 561

原创 spoj QTREE - Query on a tree(树链刨分)

You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3...N-1.We will ask you to perfrom some instructions of the following form:CHANGE i ti : cha

2016-09-09 00:53:28 359

原创 GSS3 - Can you answer these queries III

You are given a sequence A of N (N modify the i-th element in the sequence or for given x y print max{Ai + Ai+1 + .. + Aj | xInputThe first line of input contains an integer N. The following

2016-09-07 01:02:58 353

转载 GSS2 - Can you answer these queries II(线段树)

题意:询问任意区间内,最大连续序列和(相等的值不重复计算),可以不选输出0;这题可以说一眼看出是线段树了,可是怎么构造确实非常难. 现在假设线段树中的叶子为 s[i]. 每次更新 a[i]的时候,s[1] -s[i]区间内加上a[i];那么s[1] = a[1] + a[2] + a[3] + ... + a[i];s[2] = a[2] + a[3] + ... + a[i]

2016-09-06 23:29:47 220

原创 GSS1 - Can you answer these queries I(动态查询区间最大连续和)

GSS1 - Can you answer these queries I#treeYou are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A query is defined as follows: Query(x,y) = Max { a[i]+a[

2016-09-06 19:13:47 842

转载 专题总结:数据结构总结【转】

常见的数据结构运用总结考虑到Obsidian三个成员的擅长领域,这段时间都在做杂题,算是学习各种算法吧,趁现在休息的时间,而且大家马上要备战今年的比赛了,写写自己专攻方面的一些心得吧扯开线段树、平衡树这些中高级的东西,先说说基础的数据结构栈算是代码量最小的数据结构?出栈进栈都只有一句话而已常见用途:消去一个序列中的相同元素(做法大家应该都知道了吧,见过很

2016-09-05 23:40:03 386

原创 spoj MCUR98(输出数列题)

MCUR98 - Self Numbersno tags BackgroundIn 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to

2016-09-01 14:30:29 209

原创 spoj LITE(线段树)

LITE - Light Switching#treeFarmer John tries to keep the cows sharp by letting them play with intellectual toys. One of the larger toys is the lights in the barn.  Each of the N (2

2016-08-31 21:12:20 649

原创 cdoj 1432 放箱子(二分图匹配)

放箱子Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others)Submit Status给出一个n*m的矩形仓库,仓库里有的位置已经被占用,剩下的位置可以用来放东西。问这个仓库还可以放下多少个1*2或者2*1的箱子。Input

2016-08-26 14:42:47 752

原创 cdoj 1431 不是图论(强联通分量+缩点+拓扑排序+dp)

不是图论Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others)Submit Status给出一个nn个点,mm条边的有向图。每个点上有分值,经过这个点时可以获得一定的分数。一个点可以经过多次,但是一个点上的分数只能获得一次。问最多能获得

2016-08-26 00:54:16 485

原创 codeforces AIM Tech Round 3 (Div. 2)D. Recover the String

D. Recover the Stringtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor each string s consisting of charac

2016-08-26 00:38:14 221

原创 poj 1860 spfa算法判断图中是否有正环

Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 25582 Accepted: 9369DescriptionSeveral currency exchange points are working in our city.

2016-06-15 17:50:00 1129

原创 poj 2367 前向星+拓扑排序

Genealogical treeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4402 Accepted: 2922 Special JudgeDescriptionThe system of Martians' blood relations i

2016-06-12 21:58:08 373 1

原创 2016 UESTC Training for Math Problem F-粗心的谭爷(线性筛素数)

F - 粗心的谭爷Time Limit: 1000/1000MS (Java/Others)    Memory Limit: 262144/262144KB (Java/Others)谭爷喜欢把整数分解质因数,如12=22∗3,1024=210,特别地,1=1。有一天谭爷心血来潮,把1到n所有整数的分解形式写在纸上,然后计算它们的和。但粗心的谭爷把公式中的幂运

2016-06-09 03:33:35 554

原创 2016 UESTC Training for Math Problem D-熄灯啦!(乱搞)

D - 熄灯啦!Time Limit: 3000/1000MS (Java/Others)    Memory Limit: 65535/65535KB (Java/Others)冬天的时候,寝室阿姨会给全栋楼断电,但众所周知,卿学姐的寝室的电是从来不会断!这是什么原理嘞?谭爷想来好好研究下,好让自己的寝室不再断电!假设全栋楼的电闸有 n 个,一开始全部闭合,有强迫症的阿姨

2016-06-09 03:24:39 397

原创 2016 UESTC Training for Math Problem C-咸鱼的跑步比赛(解同余线性方程组)

C - 咸鱼的跑步比赛Time Limit: 3000/1000MS (Java/Others)    Memory Limit: 65535/65535KB (Java/Others)旅行到喵哈村的谭爷,发现一个超自然现象!这里的咸鱼是跳着移动的!而且每次移动的距离相同,而且都是整数!!突然,他有了强烈的好奇心,想知道咸鱼们能不能汇合到一起嘞? 为了简化了问题,他强行将咸

2016-06-09 03:23:10 590 1

原创 2016 UESTC Training for Math Problem B-三角形棋盘上的博弈游戏(打表+DP)

B - 三角形棋盘上的博弈游戏Time Limit: 3000/1000MS (Java/Others)    Memory Limit: 65535/65535KB (Java/Others)柱爷有天上课无聊,于是和同桌卿学姐一起下一种奇特的棋:棋盘如图:在开始游戏前,棋盘上已经放好了一些边,然后柱爷先手,开始在棋盘上没有边的位置添加一条边上去如果添加边后围成一个三角

2016-06-09 03:16:58 616

原创 2016 UESTC Training for Math Problem A-谭爷的黑暗沙拉(组合数学)

A - 谭爷的黑暗沙拉Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) 谭爷有n种不同种类的食材(水果&蔬菜),他想做出一份总重量为k的黑暗沙拉。 他想让机智的你告诉他,他能做多少种不同的黑暗沙拉! 说明: 1.可以重复选择食材,而且不需要选完全部的n种食材,但是最后总

2016-06-09 03:14:24 628

原创 poj 3608 Bridge Across Islands(旋转卡壳求凸包最短距离)

Bridge Across IslandsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9843 Accepted: 2886 Special JudgeDescriptionThousands of thousands years ago th

2016-06-08 23:04:26 387

原创 2016 UESTC Training for Math Problem E- 蹲在墙角画圈圈的愚人王

E - 蹲在墙角画圈圈的愚人王Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others)愚人王发现自己也就是条咸鱼了,只能搞(出)搞(出)套路题了。所以膜拜了下final柱后,默默的蹲在墙角画圈圈去了.....他在一个X*Y

2016-06-08 19:50:12 487

转载 Graham Scan凸包算法

原文链接:https://segmentfault.com/a/1190000000488339;作者: Michael_Lin获得凸包的算法可以算是计算几何中最基础的算法之一了。寻找凸包的算法有很多种,Graham Scan算法是一种十分简单高效的二维凸包算法,能够在O(nlogn)的时间内找到凸包。首先介绍一下二维向量的叉积(这里和真正的叉积还是不同的):对于二维向量a=(x1,y

2016-06-07 11:10:28 5191

原创 ACM ICPC Greater NewYork Region 2015 Problem E-A Rational Sequence

题意理解:就是让你在满二叉树上寻找规律,根据给出的p,q推出对应的编号;思路:显然,pq是右儿子,p=q是根节点;然后继续观察规律;我们可以轻易求出位于树上最左边和最右边上的点的编号;分别为2^(q-1),2^q-1;并且;如果不断沿着左二子的方向走,q以p递增;右儿子则p以q递增;所以只要我们知道一个起点就可以推出它所有后继点的编号。我们可以利用树的特性,写一个很方便的递归函数,减少代码

2016-06-05 09:40:50 563

空空如也

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

TA关注的人

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