自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 LDU B - LCM CodeForces - 1068B

van has number b. He is sorting through the numbers a from 1 to 10^18, and for every a writes [a,b]/a on blackboard. Here [a,b] stands for least common multiple of a and b. Ivan is very lazy, that's w...

2018-11-23 21:48:01 395

原创 9367: 【动态规划】雷涛的小猫

9367: 【动态规划】雷涛的小猫时间限制: 1 Sec  内存限制: 128 MB提交: 183  解决: 53[提交] [状态] [讨论版] [命题人:admin]题目描述雷涛的小猫雷涛同学非常的有爱心,在他的宿舍里,养着一只因为受伤被救助的小猫(当然,这样的行为是违反学生宿舍管理条例的)。  在他的照顾下,小猫很快恢复了健康,并且愈发的活泼可爱了。可是有一天,雷涛下课回到寝...

2018-11-10 18:32:43 316

原创 upc 9300 Problem A AKU NEGARAKU

题目描述1st Academy is an international leadership training academy based in Kuala Lumpur. Every year, the company trains thousands of people to be supplied to companies around the world. To be fair am...

2018-10-17 18:17:16 352

原创 UPC 9260: Almost Sorted Array

题目描述We are all familiar with sorting algorithms: quick sort, merge sort, heap sort, insertion sort, selection sort, bubble sort, etc. But sometimes it is an  overkill to use these algorithms for an ...

2018-10-14 15:14:14 233

原创 upc 8262: LARGEST POINT

题目描述Given the sequence A with n integers t1 , t2 , …… , tn . Given the integral coefficients a and b. The fact that select two elements ti and tj of A and i ≠ j to maximize the value of  becomes the...

2018-10-10 19:45:15 235

原创 upc7224 Problem J The puzzle

题目描述Kayaking is playing a puzzle game containing n different blocks. He marks the blocks with integers from 1 to n, which show the blocks’ original positions. Each time he can exchange two blocks an...

2018-09-13 12:48:26 475

原创 upc7221 Problem G Flower

题目描述Rabbit loves flowers very much and she plants n pots of flowers in her house. But she never prunes them because she is lazy. So the flowers have different heights and look ugly. One day, Kayakin...

2018-09-12 19:04:03 598 1

原创 组队训练赛第五场5058 Problem D Network Report

问题 D: Network Report时间限制: 1 Sec  内存限制: 128 MB提交: 140  解决: 59[提交] [状态] [讨论版] [命题人:admin]题目描述For time efficiency, data transmission is often done along the shortest path (with minimum number of ...

2018-08-29 20:47:26 148

原创 组队训练赛第三场4897 Problem E Envious Exponents

问题 E: Envious Exponents时间限制: 1 Sec  内存限制: 128 MB提交: 334  解决: 58[提交] [状态] [讨论版] [命题人:admin]题目描述Alice and Bob have an integer N. Alice and Bob are not happy with their integer. Last night they w...

2018-08-28 20:15:48 219

原创 组队训练赛第一场5215 Problem D Fence Building

题目描述Farmer John owns a farm. He first builds a circle fence. Then, he will choose n points and build some straight fences connecting them. Next, he will feed a cow in each region so that cows cann...

2018-08-22 10:00:17 268

原创 2018年第三阶段个人训练赛第九场6759 Problem A 异或序列

题目描述已知一个长度为n的整数数列a1,a2,…,an,给定查询参数l、r,问在al,al+1,…,ar区间内,有多少子序列满足异或和等于k。也就是说,对于所有的x,y(l≤x≤y≤r),满足ax⊕ax+1⊕⋯⊕ay=k的x,y有多少组。 输入输入第一行为3个整数n,m,k。第二行为空格分开的n个整数,即a1,a2,…,an。接下来m行,每行两个整数lj,rj,代表一次查询。 ...

2018-08-13 15:56:20 195

原创 小Z的袜子(洛谷)

题目描述作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意袜子的颜色,毕竟穿两只不同色的袜子会很尴尬。你的任务便是告诉小Z,他有多大的概率抽...

2018-08-10 20:52:05 373

原创 2018年第三阶段个人训练赛第十场2654 Problem M 序列合并

题目描述有两个长度都是N的序列A和B,在A和B中各取一个数相加可以得到N^2个和,求这N^2个和中最小的N个。 输入第一行一个正整数N;第二行N个整数Ai,满足Ai<=Ai+1且Ai<=10^9;第三行N个整数Bi, 满足Bi<=Bi+1且Bi<=10^9. 输出仅一行,包含N个整数,从小到大输出这N个最小的和,相邻数字之间用空格隔开。...

2018-08-10 17:53:48 218

原创 优先队列

其特点:自动排序首先,你需要#include<queue>using namespace std;这两个头文件。其次,一个优先队列声明的基本格式是: priority_queue<结构类型> 队列名; 比如:priority_queue <int> i;priority_queue <double> d;不过,我们最...

2018-08-10 17:30:01 195

原创 子串查询

度度熊的字符串课堂开始了!要以像度度熊一样的天才为目标,努力奋斗哦!为了检验你是否具备不听课的资质,度度熊准备了一个只包含大写英文字母的字符串 A[1,n] = a_1 a_2 \cdots a_nA[1,n]=a​1​​a​2​​⋯a​n​​,接下来他会向你提出 qq 个问题 (l,r)(l,r),你需要回答字符串 A[l,r] = a_l a_{l+1} \cdots a_rA[l,r]=...

2018-08-10 10:38:27 205

原创 2018年第三阶段个人训练赛第九场6760 Problem H 九连环

题目描述九连环是一种源于中国的传统智力游戏。如图所示,九个圆环套在一把“剑”上,并且互相牵连。游戏的目标是把九个圆环从“剑”上卸下。圆环的装卸需要遵守两个规则。第一个(最右边)环任何时候都可以装上或卸下。如果第k个环没有被卸下,且第k个环右边的所有环都被卸下,则第k+1个环(第k个环左边相邻的环)可以任意装上或卸下。与魔方的千变万化不同,解九连环的最优策略是唯一的。为简单起见,我...

2018-08-09 10:16:48 209

原创 树状数组

int lowbit(int i){ return i & -i;//或者是return i-(i&(i-1));表示求数组下标二进制的非0最低位所表示的值}void update(int i,int val)//更新单节点的值{ while(i<=n){ a[i]+=val; i+=lowbit(i);//由叶子节点...

2018-08-06 10:37:45 657

原创 LDU暑假集训(十)1209 Problem I NEW RDSP MODE I

题目描述 Little A has became fascinated with the game Dota recently, but he is not a good player. In all the modes, the rdsp Mode is popular on online, in this mode, little A always loses games if he ...

2018-08-03 20:39:46 228

原创 2018年第三阶段个人训练赛第六场6604 Problem I Sandglass

题目描述We have a sandglass consisting of two bulbs, bulb A and bulb B. These bulbs contain some amount of sand. When we put the sandglass, either bulb A or B lies on top of the other and becomes the up...

2018-08-03 10:12:16 235

原创 LDU暑假集训(三)1263 Problem B B. Rolling The Polygon

 按照逆时针绕向给出一个凸多边形的 n 个顶点 P0,P1,··· ,Pn−1,再给出凸多边形内部(含边界) 一点 Q。现在要将这个凸多边形在地上无滑动地滚动一周,初始时 P0P1 边与地面接触,假设当前是 PiP(i+1) mod n 边与地面接触,那么滚动一下之后则是 P(i+1) mod nP(i+2) mod n 边与地面接触。不难发现, 从初始状态滚动 n 下之后 P0P1 ...

2018-08-02 10:08:28 264

原创 LDU暑假集训(三)1265 Problem D D. Take Your Seat

 Duha decided to have a trip to Singapore by plane.The airplane had nn seats numbered from 11 to nn, and nn passengers including Duha which were also counted from 11 to nn.The passenger with numbe...

2018-07-31 20:05:38 391

原创 2018年第三阶段个人训练赛第五场 5725 Problem K 小奇画画

题目描述红莲清泪两行欲吐半点却无如初是你杳然若绯雾还在水榭畔画楼处是谁衣白衫如初谁红裳如故——《忆红莲》小奇想画几朵红莲,可惜它刚开始学画画,只能从画圆开始。小奇画了n个圆,它们的圆心都在x轴上,且两两不相交(可以相切)。现在小奇想知道,它画的圆把画纸分割成了多少块?(假设画纸无限大) 输入第一行包括1个整数n。接下来n行,每行两个整数x,r,表示小奇画了圆心在(x,0)...

2018-07-30 20:56:00 186

原创 LDU暑假集训(三)1269 Problem H H. Fight Against Monsters

It is my great honour to introduce myself to you here. My name is Aloysius Benjy Cobweb Dartagnan Egbert Felix Gaspar Humbert Ignatius Jayden Kasper Leroy Maximilian. As a storyteller, today I decide ...

2018-07-30 08:53:07 627

原创 2018年第三阶段个人训练赛第四场5501 Problem J 果实计数

题目描述淘淘家有棵奇怪的苹果树,这棵树共有n+1层,标号为0~n。这棵树第0层只有一个节点,为根节点。已知这棵树为b叉树,且保证是一颗满b叉树。如图为一颗满3叉树。现在,该树第n层的每个节点上都结出了一个苹果,淘淘想知道共结了多少苹果。由于数量可能很大,答案要求输出mod k后的结果。 输入给出第1层的节点数b和层数n和k. 输出输出苹果数mod k后的结果。...

2018-07-29 11:04:09 196

原创 LDU暑假集训(三)1262 Problem A A. Maximum Element In A Stack

As an ACM-ICPC newbie, Aishah is learning data structures in computer science. She has already known that a stack, as a data structure, can serve as a collection of elements with two operations:• pu...

2018-07-29 10:42:02 382

原创 2018年第三阶段个人训练赛第四场5500 Problem I 经营与开发

题目描述4X概念体系,是指在PC战略游戏中一种相当普及和成熟的系统概念,得名自4个同样以“EX”为开头的英语单词。eXplore(探索)eXpand(拓张与发展)eXploit(经营与开发)eXterminate(征服)——维基百科今次我们着重考虑exploit部分,并将其模型简化:你驾驶着一台带有钻头(初始能力值w)的飞船,按既定路线依次飞过n个星球。星球笼统的分为2类:资源...

2018-07-29 09:58:03 211

原创 2018年第三阶段个人训练赛第四场6690 Problem D Transit Tree Path

题目描述You are given a tree with N vertices.Here, a tree is a kind of graph, and more specifically, a connected undirected graph with N−1 edges, where N is the number of its vertices.The i-th edge (1...

2018-07-29 08:43:49 438

原创 LDU暑假集训(二)B Button Bashing

You recently acquired a new microwave, and noticed that it provides a large number of buttons to be able to quickly specify the time that the microwave should be running for. There are buttons both fo...

2018-07-27 15:47:20 256

原创 2018年第三阶段个人训练赛第二场 6586 Problem I: Decrease (Judge ver.)

题目描述We have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes N−1 or smaller...

2018-07-27 08:47:46 257

原创 2018年第三阶段个人训练赛第四场5502 Problem K 打地鼠游戏

题目描述伟大的2320学长特别喜欢打地鼠游戏,这个游戏开始后,会在地板上冒出一些地鼠来,你可以用榔头去敲击这些地鼠,每个地鼠被敲击后,将会增加相应的游戏分值。可是,所有地鼠只会在地上出现一段时间(而且消失后再也不会出现),每个地鼠都在0时刻冒出,但停留的时间可能是不同的,而且每个地鼠被敲击后增加的游戏分值也可能是不同。最近2320学长经常玩这个游戏,以至于敲击每个地鼠只要1秒。他在想如何敲击...

2018-07-25 17:08:08 327

原创 bfs

题目:A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find theshortest closed tour of knight moves that visits each square of a given set of n squares on a chessb...

2018-06-11 18:34:02 149

原创 Multiplication Game

时间限制: 5 Sec  内存限制: 128 MB提交: 241  解决: 57[提交][状态][讨论版][命题人:admin]题目描述Alice and Bob are in their class doing drills on multiplication and division. They quickly get bored and instead decide to play a ga...

2018-04-27 22:04:52 212

原创 Palindromic Password

时间限制: 3 Sec  内存限制: 128 MB提交: 210  解决: 58[提交][状态][讨论版][命题人:admin]题目描述The IT department at your school decided to change their password policy. Each password will have to consist of N 6-digit numbers se...

2018-04-25 20:10:37 303

原创 Boxes

题目描述There are N boxes arranged in a circle. The i-th box contains Ai stones.Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation:Se...

2018-04-23 21:30:04 241

空空如也

空空如也

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

TA关注的人

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