- 博客(407)
- 收藏
- 关注
原创 bzoj 1260: [CQOI2007]涂色paint
Description假设你有一条长度为5的木版,初始时没有涂过任何颜色。你希望把它的5个单位长度分别涂上红、绿、蓝、绿、红色,用一个长度为5的字符串表示这个目标:RGBGR。 每次你可以把一段连续的木版涂成一个给定的颜色,后涂的颜色覆盖先涂的颜色。例如第一次把木版涂成RRRRR,第二次涂成RGGGR,第三次涂成RGBGR,达到目标。 用尽量少的涂色次数达到目标。Input输入
2017-05-20 18:59:31 352
原创 codeforces796E Exam Cheating
Zane and Zane's crush have just decided to date! However, the girl is having a problem with her Physics final exam, and needs your help.There are n questions, numbered from 1 to n. Question i co
2017-05-02 20:27:03 1183
原创 codeforces796D Police Stations
Inzane finally found Zane with a lot of money to spare, so they together decided to establish a country of their own.Ruling a country is not an easy job. Thieves and terrorists are always ready to
2017-05-02 20:24:14 407
原创 codeforces788C The Great Mixing
Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentration . Today, on the party in honour of Sergiy
2017-05-02 20:22:05 522
原创 codeforces788B Weird journey
Little boy Igor wants to become a traveller. At first, he decided to visit all the cities of his motherland — Uzhlyandia.It is widely known that Uzhlyandia has n cities connected with m bidirectio
2017-05-02 20:19:16 394
原创 codeforces788A Functions again
Something happened in Uzhlyandia again... There are riots on the streets... Famous Uzhlyandian superheroes Shean the Sheep and Stas the Giraffe were called in order to save the situation. Upon the arr
2017-05-02 20:15:15 338
原创 zoj 3949 Edge to the Root 2017浙大校赛B
Given a tree with n vertices, we want to add an edge between vertex 1 and vertex x, so that the sum of d(1, v) for all vertices v in the tree is minimized, where d(u, v) is the minimum number of edg
2017-04-13 20:53:31 1057
原创 hdu 5723 Abandoned country
Problem DescriptionAn abandoned country has n(n≤100000) villages which are numbered from 1 to n. Since abandoned for a long time, the roads need to be re-built. There are m(m≤1000000) roads
2017-04-13 20:44:28 282
原创 hdu 5996 dingyeye loves stone
Problem Descriptiondingyeye loves play stone game with you.dingyeye has an n-point tree.The nodes are numbered from 0 to n−1,while the root is numbered 0.Initially,there are a[i] stones
2017-03-19 21:30:31 331
原创 hdu 6016 Count the Sheep
Problem Descriptiondingyeye loves play stone game with you.dingyeye has an n-point tree.The nodes are numbered from 0 to n−1,while the root is numbered 0.Initially,there are a[i] stones
2017-03-19 21:29:11 335
原创 hdu 5946 Fxx and tree
Problem DescriptionYoung theoretical computer scientist Fxx has a tree.You are given a rooted tree with n vertices,numbered from 1 to n(vertex 1 is the root).Each vertex of the tree has a valu
2017-03-19 21:26:01 518
原创 hdu 5995 Kblack loves flag
Problem DescriptionKblack loves flags, so he has infinite flags in his pocket.One day, Kblack is given an n∗m chessboard and he decides to plant flags on the chessboard where the position of
2017-03-19 21:20:35 350
原创 hdu 5945 Fxx and game
Problem DescriptionYoung theoretical computer scientist Fxx designed a game for his students.In each game, you will get three integers X,k,t.In each step, you can only do one of the followin
2017-03-19 21:19:29 448
原创 hdu 6012 Lotus and Horticulture
Problem DescriptionThese days Lotus is interested in cultivating potted plants, so she wants to build a greenhouse to meet her research desires.Lotus placed all of the n pots in the new gree
2017-03-19 21:17:29 424
原创 hdu 5944 Fxx and string
Problem DescriptionYoung theoretical computer scientist Fxx get a string which contains lowercase letters only.The string S contains n lowercase letters S1S2…Sn.Now Fxx wants to know how m
2017-03-19 21:14:28 272
原创 hdu 6011 Lotus and Characters
Problem DescriptionLotus has n kinds of characters,each kind of characters has a value and a amount.She wants to construct a string using some of these characters.Define the value of a string is
2017-03-19 21:13:34 294
原创 hdu 6015 Skip the Class
Problem DescriptionFinally term begins. luras loves school so much as she could skip the class happily again.(wtf?)Luras will take n lessons in sequence(in another word, to have a chance to sk
2017-03-19 21:11:14 248
原创 hdu 5997 rausen loves cakes
Problem DescriptionRausen loves cakes. One day, he bought n cakes and the color of each cake is described as an integer in [1,1000000]. Rausen lines the cakes from left to right.Before eat
2017-03-19 21:09:44 312
原创 Google Kickstart 2017 Round A 题解
AProblem A. Square CountingThis contest is open for practice. You can try every problem as many times as you like, though we won't keep track of which problems you solve. Read the Quick-
2017-03-07 15:00:16 4077 1
原创 hdu 3303 Harmony Forever
Problem DescriptionWe believe that every inhabitant of this universe eventually will find a way to live together in harmony and peace; that trust, patience, kindness and loyalty will exist between
2016-12-21 18:32:53 516
原创 bzoj 4720: [Noip2016]换教室
Description对于刚上大学的牛牛来说,他面临的第一个问题是如何根据实际情况申请合适的课程。在可以选择的课程中,有2n节课程安排在n个时间段上。在第i(1≤i≤n)个时间段上,两节内容相同的课程同时在不同的地点进行,其中,牛牛预先被安排在教室ci上课,而另一节课程在教室di进行。在不提交任何申请的情况下,学生们需要按时间段的顺序依次完成所有的n节安排好的课程。如果学生想更
2016-12-07 19:55:42 652
原创 hdu5560 The Shields
Problem DescriptionGeneral Zhang recently got a plasma shield to intercept incoming missiles.The shape of the plasma shield is basically a square with a horizontal diagonal. Due to some techno
2016-12-01 19:13:23 567
原创 bzoj 4066: 简单题
Description你有一个N*N的棋盘,每个格子内有一个整数,初始时的时候全部为0,现在需要维护两种操作: 命令参数限制内容1 x y A1将格子x,y里的数字加上A2 x1 y1 x2 y2112112输出x1 y1 x2 y2这个矩形内的数字和
2016-11-23 21:13:35 499
原创 bzoj 2648: SJY摆棋子
Description这天,SJY显得无聊。在家自己玩。在一个棋盘上,有N个黑色棋子。他每次要么放到棋盘上一个黑色棋子,要么放上一个白色棋子,如果是白色棋子,他会找出距离这个白色棋子最近的黑色棋子。此处的距离是 曼哈顿距离 即(|x1-x2|+|y1-y2|) 。现在给出N Input第一行两个数 N M以后M行,每行3个数 t x y如果t=1 那么放下一个黑
2016-11-20 19:17:55 302
原创 hdu2844 Coins
Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in
2016-11-09 19:20:14 358
原创 hdu 5969 最大的位或 2016ACM/CCPC合肥赛区现场赛I
Problem DescriptionB君和G君聊天的时候想到了如下的问题。给定自然数l和r ,选取2个整数x,y满足l 其中|表示按位或,即C、 C++、 Java中的|运算。 Input包含至多10001组测试数据。第一行有一个正整数,表示数据的组数。接下来每一行表示一组数据,包含两个整数l,r。保证 0 1018。
2016-11-05 20:25:07 964
原创 hdu 5968 异或密码 2016ACM/CCPC合肥赛区现场赛H
Problem Description晨晨在纸上写了一个长度为N的非负整数序列{ai}。对于这个序列的一个连续子序列{al,al+1,…,ar}晨晨可以求出其中所有数异或的结果 alxoral+1xor...xorar其 中xor表示位异或运算,对应C、C++、 Java等语言中的^运算。小璐提出了M个询问,每个询问用一个整数 xi描述。对于每个询问,晨晨需要找到序列{ai}的
2016-11-05 20:21:31 574
原创 hdu 5965 扫雷 2016ACM/CCPC合肥赛区现场赛E
Problem Description扫雷游戏是晨晨和小璐特别喜欢的智力游戏,她俩最近沉迷其中无法自拔。该游戏的界面是一个矩阵,矩阵中有些格子中有一个地雷,其余格子中没有地雷。 游戏中,格子可能处于己知和未知的状态。如果一个己知的格子中没有地雷,那么该 格子上会写有一个一位数,表示与这个格子八连通相邻的格子中地雷总的数量。现在,晨晨和小璐在一个3行N列(均从1开始用连续正整数编号)
2016-11-05 20:19:17 856
原创 hdu 5963 朋友 2016ACM/CCPC合肥赛区现场赛C
Problem DescriptionB君在围观一群男生和一群女生玩游戏,具体来说游戏是这样的:给出一棵n个节点的树,这棵树的每条边有一个权值,这个权值只可能是0或1。 在一局游戏开始时,会确定一个节点作为根。接下来从女生开始,双方轮流进行 操作。当一方操作时,他们需要先选择一个不为根的点,满足该点到其父亲的边权为1; 然后找出这个点到根节点的简单路径,将路径上所有边的权值翻转(即
2016-11-05 20:16:39 748
原创 hdu 5961 传递 2016ACM/CCPC合肥赛区现场赛A
Problem Description我们称一个有向图G是传递的,当且仅当对任意三个不同的顶点a,,若G中有 一条边从a到b且有一条边从b到c ,则G中同样有一条边从a到c。我们称图G是一个竞赛图,当且仅当它是一个有向图且它的基图是完全图。换句 话说,将完全图每条边定向将得到一个竞赛图。下图展示的是一个有4个顶点的竞赛图。现在,给你两个有向图P = (V,Ep)和Q
2016-11-05 20:13:10 734
原创 bzoj 1006: [HNOI2008]神奇的国度
Description K国是一个热衷三角形的国度,连人的交往也只喜欢三角原则.他们认为三角关系:即AB相互认识,BC相互认识,CA相互认识,是简洁高效的.为了巩固三角关系,K国禁止四边关系,五边关系等等的存在.所谓N边关系,是指N个人 A1A2...An之间仅存在N对认识关系:(A1A2)(A2A3)...(AnA1),而没有其它认识关系.比如四边关系指ABCD四个人 AB,B
2016-11-02 19:42:36 420
原创 hdu 5949 Relative atomic mass 2016ACM/ICPC沈阳赛区现场赛B
Problem DescriptionRelative atomic mass is a dimensionless physical quantity, the ratio of the average mass of atoms of an element (from a single given sample or source) to 12of the mass of an a
2016-10-31 20:30:18 934
原创 hdu 5952 Counting Cliques 2016ACM/ICPC沈阳赛区现场赛E
Problem DescriptionA clique is a complete graph, in which there is an edge between every pair of the vertices. Given a graph with N vertices and M edges, your task is to count the number of clique
2016-10-31 20:15:21 640
原创 hdu 5950 Recursive sequence 2016ACM/ICPC沈阳赛区现场赛C
Problem DescriptionFarmer John likes to play mathematics games with his N cows. Recently, they are attracted by recursive sequences. In each turn, the cows would stand in a line, while John writes
2016-10-31 20:10:33 991
原创 hdu 5948 Thickest Burger 2016ACM/ICPC沈阳赛区现场赛A
Problem DescriptionACM ICPC is launching a thick burger. The thickness (or the height) of a piece of club steak is A (1 ≤ A ≤ 100). The thickness (or the height) of a piece of chicken steak is B (
2016-10-31 20:05:18 4541
原创 hdu 5956 The Elder 2016ACM/ICPC沈阳赛区现场赛I
Problem DescriptionOnce upon a time, in the mystical continent, there is a frog kingdom, ruled by the oldest frog, the Elder. The kingdom consists of N cities, numbered from east to west. The 1-th
2016-10-31 16:43:31 1624
原创 bzoj 1499: [NOI2005]瑰丽华尔兹
Description你跳过华尔兹吗?当音乐响起,当你随着旋律滑动舞步,是不是有一种漫步仙境的惬意?众所周知,跳华尔兹时,最重要的是有好的音乐。但是很少有几个人知道,世界上最伟大的钢琴家一生都漂泊在大海上,他的名字叫丹尼•布德曼•T.D.•柠檬•1900,朋友们都叫他1900。 1900在20世纪的第一年出生在往返于欧美的邮轮弗吉尼亚号上,很不幸他刚出生就被抛弃了,成了孤儿。1900孤独的
2016-10-28 16:02:54 496
原创 bzoj 1143: [CTSC2008]祭祀river
Description 在遥远的东方,有一个神秘的民族,自称Y族。他们世代居住在水面上,奉龙王为神。每逢重大庆典, Y族都会在水面上举办盛大的祭祀活动。我们可以把Y族居住地水系看成一个由岔口和河道组成的网络。每条河道连接着两个岔口,并且水在河道内按照一个固定的方向流动。显然,水系中不会有环流(下图描述一个环流的例子)。 由于人数众多的原因,Y族的祭祀活动会在多个岔口上
2016-10-28 13:53:04 587
原创 3674: 可持久化并查集加强版
DescriptionDescription:自从zkysb出了可持久化并查集后……hzwer:乱写能AC,暴力踩标程KuribohG:我不路径压缩就过了!ndsf:暴力就可以轻松虐!zky:……n个集合 m个操作操作:1 a b 合并a,b所在集合2 k 回到第k次操作之后的状态(查询算作操作)3 a b 询问a,b是否属于同一集合,是则输出1
2016-10-28 13:32:03 339
原创 3673: 可持久化并查集 by zky
Descriptionn个集合 m个操作操作:1 a b 合并a,b所在集合2 k 回到第k次操作之后的状态(查询算作操作)3 a b 询问a,b是否属于同一集合,是则输出1否则输出00InputOutputSample Input5 61 1 23 1 22 03 1 22 13 1 2S
2016-10-28 13:29:36 363
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人