- 博客(50)
- 收藏
- 关注
原创 Codeforces Round #306 (Div. 2)C. Divisibility by Eight--模拟
You are given a non-negative integer n, its decimal representation consists of at most 100 digits and doesn't contain leading zeroes.Your task is to determine if it is possible in this case to r
2015-06-09 17:56:23
336
原创 Codeforces Round #306 (Div. 2)B. Preparing Olympiad--状态压缩
You have n problems. You have estimated the difficulty of the i-th one as integer ci. Now you want to prepare a problemset for a contest, using some of the problems you've made.A problemset fo
2015-06-08 22:08:17
486
原创 Codeforces Round #302 (Div. 2)D. Destroying Roads-最短路
In some country there are exactly n cities and m bidirectional roads connecting the cities. Cities are numbered with integers from 1 to n. If cities a and b are connected by a road, then in an h
2015-06-03 13:20:28
328
原创 Codeforces Round #302 (Div. 2)C. Writing Code--dp
C. Writing Codetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProgrammers working on a large project have
2015-06-02 12:20:29
314
原创 信息院赛-小红灌溉 bfs
Description小红家有n行田地,每行田地由m块大小为1*1的小田地组成。这些田地构成了一个n*m的矩形。小红在某些小田地里种植了蔬菜。现在小红要给蔬菜灌溉。小红每次可以选择给某一行或某一列的田地灌溉。但是一块种植了蔬菜的田地只能被灌溉一次。由于种种原因,灌溉某行或某列的耗电量不同。所以小红想知道,灌溉完所有蔬菜的耗电量最少为多少?Input第一行输入
2015-05-31 20:47:11
680
原创 219C - Color Stripe-模拟
DescriptionA colored stripe is represented by a horizontal row of n square cells, each cell is pained one of k colors. Your task is to repaint the minimum number of cells so that no two neighbou
2015-05-25 20:27:49
438
原创 swustoj2521 acmer的约会—状态压缩+bfs
Description一个acmer想要去和妹子约会,他们处于一个N行M列的方格地图中,acmer在地图左上角坐标为(1,1)的位置,而妹子在地图右下角坐标为(n,m)的位置,acmer一个单位时间只可以移动到上下左右相邻的一个格子上。然而在这个地图中有许多墙和不同颜色的门,墙是不可以穿越的,只有拿到和门颜色一样的钥匙,才能打开对应颜色的门,只有两个格子之间的门都被打开了acmer才可
2015-05-23 13:03:14
542
原创 胜利大逃亡—bfs+状态压缩
Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(ex,ey)的位置。Ignatius每分钟只能从一个坐标走到相邻四个坐标中的其中一个。
2015-05-19 20:44:06
282
原创 islands的难题—线段是单点更新
Description最近islands遇到一个难题,他想请人帮他解决。给一个数列a1,a2……an。有m个操作,每个操作是下面2种之一。第1种操作是询问区间[l,r]上的值。第2种操作是使得第k个数加上v。Input首先输入T表示测试数据组数(T<=5)每组数据第一行输入n,m(n,m<=100000)表示n个数和m个操作。接下来1行输入n个数,表示a
2015-05-16 23:21:47
259
原创 islands打炉石传说—01背包
Descriptionislands最近在完一款游戏“炉石传说”,又名“魔兽英雄传”。炉石传说是一款卡牌类对战的游戏。游戏是2人对战,总的来说,里面的卡牌分成2类,一类是法术牌,另一类是随从牌(所谓随从就是怪物)。为了简化问题,现在假设随从牌的作用是召唤一个具有一定攻击力的怪物,法术牌的作用是给某个随从增加一定攻击力。随从牌和法术牌的使用都需要消耗一定的法力值。现在islands有10
2015-05-16 23:19:15
715
原创 bfs+路径记录
移动 IITime Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 324(85 users)Total Accepted: 144(78 users)Rating: Special Judge: NoDescription在坐标轴[0,500]上存在两点A,B。点A可以多次移动,每次移动需要遵循如下规则:1.向后移动一步。2.向前
2015-05-16 23:16:27
412
原创 Codeforces Round #299 (Div. 2)B. Tavas and SaDDas
B. Tavas and SaDDastime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce again Tavas started eating coffee m
2015-05-08 20:42:14
490
原创 Codeforces Round #301 (Div. 2)C - Ice Cave-bfs
You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through
2015-05-08 18:08:29
573
原创 hdu3829—二分图求最大独立集
DescriptionThe zoo have N cats and M dogs, today there are P children visiting the zoo, each child has a like-animal and a dislike-animal, if the child's like-animal is a cat, then his/hers dislik
2015-05-07 19:48:16
278
原创 hdu 4619—二分图求最大独立集
Description Some 1×2 dominoes are placed on a plane. Each dominoe is placed either horizontally or vertically. It's guaranteed the dominoes in the same direction are not overlapped, but horizonta
2015-05-06 21:32:53
314
原创 poj-3026—bfs+最小生成树
DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Bor
2015-04-29 16:47:36
303
原创 hdu4198-优先队列+bfs
DescriptionCaptain Clearbeard decided to go to the harbour for a few days so his crew could inspect and repair the ship. Now, a few days later, the pirates are getting landsick(Pirates get landsic
2015-04-28 19:30:27
261
原创 编程之美之质数相关--二分图最大匹配+素数筛选
描述两个数a和 b (a输入第一行为一个数T,为数据组数。之后每组数据包含两行。第一行为N,为集合S的大小。第二行为N个整数,表示集合内的数。输出对于每组数据输出一行,形如"Case #X: Y"。X为数据编号,从1开始,Y为最大的子集的大小。数据范围1 ≤ T ≤ 20集合S内的数两两不同且范围在1到500000之间。小数据1 ≤ N ≤
2015-04-28 15:00:55
457
原创 hdu1247-字典树,单词拆分
DescriptionA hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words in a dictionary. In
2015-04-25 20:48:45
352
原创 poj2513—并查集+欧拉回路+线段树
DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpo
2015-04-22 21:55:51
366
原创 编程之美2015第一题
描述给定两个日期,计算这两个日期之间有多少个2月29日(包括起始日期)。只有闰年有2月29日,满足以下一个条件的年份为闰年:1. 年份能被4整除但不能被100整除2. 年份能被400整除输入第一行为一个整数T,表示数据组数。之后每组数据包含两行。每一行格式为"month day, year",表示一个日期。month为{"January"
2015-04-21 14:19:10
362
原创 ACdream - 1063平衡树
这道题的意思就不说了中文题,就是叫你先建一棵树,然后查询树中是否有一个值a,这个值a和x的异或值最大或者最小。当要求最大值的时候,每次就劲量向这一位的反向走(因为这个树的节点要么是0,要么是1)。当要求最小值的时候,每次就劲量向这一位的同向走#include#include#include#includeusing namespace std;struct node
2015-04-07 15:53:20
370
原创 Let the Balloon Rise—STL(map)
DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over
2015-03-19 15:02:56
381
原创 hdu1251统计难题—简单字典树
DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分
2015-03-12 20:56:21
274
原创 Strange fuction—裸地三分
DescriptionNow, here is a fuction: F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 Can you find the minimum value when x is between 0 and 100.InputThe first line of the input contains an i
2015-03-10 15:52:32
362
原创 hdu3400 Line belt_嵌套三分
题意是有两条线段ab,cd,给你a,b,c,d点的坐标,和在ab,cd,还有其他地方的运动的速度p,q,r,问从a到d的最短时间;第一次做三分的题目,完全不会,看了大神的解题报告才知道这是三分的题目,哎!!!!!!!!!!!!!!!!!http://blog.csdn.net/scnujack/article/details/6277534这是大神的博客。。。里面有证明,思路也是有的。。。
2015-03-10 14:52:32
324
1
原创 Taxi Cab Scheme———最小路径覆盖
DescriptionRunning a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick up the customers calling to get a cab as soon as
2015-02-07 16:22:07
478
原创 Oil Skimming——最大二分匹配
DescriptionThanks to a certain "green" resources company, there is a new profitable industry of oil skimming. There are large slicks of crude oil floating in the Gulf of Mexico just waiting to be
2015-02-06 19:49:49
655
原创 过山车——二分图最大匹配
DescriptionRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Grass只愿意和linle或LL做partner,PrincessSnow愿意和水域浪子
2015-02-06 10:41:31
303
转载 最大二分匹配——匈牙利算法详解
【书本上的算法往往讲得非常复杂,我和我的朋友计划用一些简单通俗的例子来描述算法的流程】匈牙利算法是由匈牙利数学家Edmonds于1965年提出,因而得名。匈牙利算法是基于Hall定理中充分性证明的思想,它是部图匹配最常见的算法,该算法的核心就是寻找增广路径,它是一种用增广路径求二分图最大匹配的算法。-------等等,看得头大?那么请看下面的版本:通
2015-02-05 21:21:43
290
转载 B. Fox And Two Dots———简单DFS
B. Fox And Two Dotstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is playing a mobile puzzle game called
2015-02-03 19:29:46
364
原创 G - Coins-------多重背包
这道题是多重背包的题:这道题的大意是给你n,m,m代表总价值,接下来2n个数,a1,a2,a3,....an代表价值,c1,c2,c3代表个数。求出从1到m中有多少个可以凑出多少种价值;思路:我们将多重背包拆分成01背包和完全背包,再用二进制优化,所谓用二进制优化,其实就是将ci拆分成1,2,。。。。#include#include#include#includeusi
2015-02-02 15:29:28
317
原创 L - Registration system——STL库函数
用STL库中的MAPDescriptionA new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's
2015-01-24 21:57:20
374
原创 N - Little Girl and Maximum Sum——贪心
Description The little girl loves the problems on array queries very much.One day she came across a rather well-known problem: you've got an array of n elements (the elements of the array are
2015-01-24 14:47:32
270
原创 A - Wow! Such Sequence!——线段树+lazy
####线段树+lazy操作 Recently, Doge got a funny birthday present from his new friend, Protein Tiger from St. Beeze College. No, not cactuses. It's a mysterious blackbox. After some r
2015-01-23 19:22:45
322
原创 I - DZY Loves Modification--行列单独操作+优先队列
行列单独操作+优先队列 As we know, DZY loves playing games. One day DZY decided to play with a n × m matrix. To be more precise, he decided to modify the matrix with exactly k operations.Each modifica
2015-01-22 21:38:44
307
原创 M - Sereja and Suffixes--dp
M - Sereja and SuffixesTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionSereja has an array a, consisting of n integers a1, a2, ..
2015-01-22 21:25:32
324
原创 6424 Russian Dolls--贪心
6424 Russian Dolls Maybe you know the famous russian souvenir Russian Dolls. It looks like a set of nested wooden dolls.A doll with a smaller size is placed inside a bigger one. Let’s co
2015-01-20 19:10:35
398
原创 T - Olympiad—贪心或者STL
A boy named Vasya has taken part in an Olympiad. His teacher knows that in total Vasya got at least x points for both tours of the Olympiad. The teacher has the results of the first and the second t
2015-01-19 20:46:43
299
原创 Problem C - Vasya and Basketball——贪心加STL
S - Vasya and BasketballTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionVasya follows a basketball game and marks the distances
2015-01-19 16:34:21
340
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人