摘要: C. Coloring Trees time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder and Chris 阅读全文
posted @ 2018-04-10 20:25 你的女孩居居 阅读(256) 评论(0) 推荐(0) 编辑
摘要: E - Tozan and Gezan Time limit : 2sec / Memory limit : 256MB Score : 700 points Problem Statement You are given sequences A and B consisting of non-ne 阅读全文
posted @ 2018-04-08 19:55 你的女孩居居 阅读(523) 评论(0) 推荐(1) 编辑
摘要: Maximum Value Time limit 1000 ms Memory limit 262144 kB You are given a sequence a consisting of n integers. Find the maximum possible value of (integ 阅读全文
posted @ 2018-02-06 23:36 你的女孩居居 阅读(336) 评论(0) 推荐(0) 编辑
摘要: Desert King Time limit 3000 ms Memory limit 65536 kB David the Great has just become the king of a desert country. To win the respect of his people, h 阅读全文
posted @ 2018-02-05 22:52 你的女孩居居 阅读(291) 评论(1) 推荐(0) 编辑
摘要: C - Vacant Seat Time limit : 2sec / Memory limit : 256MB Score : 500 points Problem Statement This is an interactive task. Let N be an odd number at l 阅读全文
posted @ 2018-02-04 04:40 你的女孩居居 阅读(655) 评论(0) 推荐(0) 编辑
摘要: D. Substring time limit per test 3 seconds memory limit per test 256 megabytes You are given a graph with n nodes and m directed edges. One lowercase 阅读全文
posted @ 2018-02-01 23:08 你的女孩居居 阅读(399) 评论(0) 推荐(0) 编辑
摘要: C. The Monster time limit per test 1 second memory limit per test 256 megabytes C. The Monster time limit per test 1 second time limit per test memory 阅读全文
posted @ 2018-01-30 19:20 你的女孩居居 阅读(465) 评论(0) 推荐(0) 编辑
摘要: N皇后问题 Time limit 1000 ms Memory limit 32768 kB 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有 阅读全文
posted @ 2018-01-27 19:06 你的女孩居居 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 最小正子段和 基准时间限制:1 秒 空间限制:131072 KB N个整数组成的序列a[1],a[2],a[3],…,a[n],从中选出一个子序列(a[i],a[i+1],…a[j]),使这个子序列的和>0,并且这个和是所有和>0的子序列中最小的。 例如:4,-1,5,-2,-1,2,6,-2。-1 阅读全文
posted @ 2018-01-27 17:13 你的女孩居居 阅读(675) 评论(1) 推荐(0) 编辑
摘要: 过河问题 时间限制:1000 ms | 内存限制:65535 KB 过河问题 时间限制:1000 ms | 内存限制:65535 KB 在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两 阅读全文
posted @ 2018-01-26 00:16 你的女孩居居 阅读(227) 评论(0) 推荐(0) 编辑
摘要: POJ-1321 题目: 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k 阅读全文
posted @ 2018-01-21 14:55 你的女孩居居 阅读(107) 评论(0) 推荐(0) 编辑
摘要: title: HDU - 1513 A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are t 阅读全文
posted @ 2017-12-03 17:40 你的女孩居居 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 51Nod - 1413 权势二进制 题意:就是讲给出一个数n,让你求最少由多少个像0,1,10,11......这样的二进制数相加构成;样例n=9就是由9个二进制1相加组成,我不懂比赛的时候我为什么没有看懂题目在讲什么;再举个例子吧!n=2333 就有二进制1111,1111,111三个数相加而成 阅读全文
posted @ 2017-12-02 15:26 你的女孩居居 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 题目: An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to l 阅读全文
posted @ 2017-12-02 15:25 你的女孩居居 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Repository When you go shopping, you can search in repository for avalible merchandises by the computers and internet. First you give the search syste 阅读全文
posted @ 2017-11-29 19:54 你的女孩居居 阅读(352) 评论(0) 推荐(0) 编辑
摘要: Pipeline Vova, the Ultimate Thule new shaman, wants to build a pipeline. As there are exactly n houses in Ultimate Thule, Vova wants the city to have 阅读全文
posted @ 2017-11-20 21:05 你的女孩居居 阅读(301) 评论(0) 推荐(0) 编辑
摘要: Dropping tests In a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be . 阅读全文
posted @ 2017-11-20 14:59 你的女孩居居 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 题目:(POJ—1006) Description 人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为23天、28天和33天。每一个周期中有一天是高峰。在高峰这天,人会在相应的方面表现出色。例如,智力周期的高峰,人会思维敏捷,精力容易高度集中。因为三个周期的周长不同,所以通常三个周 阅读全文
posted @ 2017-11-10 20:17 你的女孩居居 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problem/show?pid=1525#sub 题目描述 S 城现有两座监狱,一共关押着N 名罪犯,编号分别为1~N。他们之间的关系自然也极不和谐。很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。我们用“怨气值”(一个正整数值) 阅读全文
posted @ 2017-10-24 20:36 你的女孩居居 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.org/problem/show?pid=2024 题目描述 动物王国中有三类动物 A,B,C,这三类动物的食物链构成了有趣的环形。A 吃 B,B 吃 C,C 吃 A。 现有 N 个动物,以 1 - N 编号。每个动物都是 A,B,C 中的一种,但是我们 阅读全文
posted @ 2017-10-24 17:59 你的女孩居居 阅读(271) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; typedef long long ll; #define N 500010 ll a[N],b[N]; ll n,ans; void merge_sort(ll x,ll y) { if (y-x>1) { ll m=x+(y-x)/2; ll p=x,q=m,i=x... 阅读全文
posted @ 2017-10-19 22:35 你的女孩居居 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 并查集+路径压缩 parent[MAX_N] //父节点 rank[MAX_N] //树的高度 初始化: 查询根节点: 合并集合: 路径压缩: ①递归: ②非递归: 阅读全文
posted @ 2017-10-19 20:10 你的女孩居居 阅读(4376) 评论(1) 推荐(1) 编辑
摘要: 题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1013 题目: 求:3^0 + 3^1 +...+ 3^(N) mod 1000000007 求:3^0 + 3^1 +...+ 3^(N) mod 1000000 阅读全文
posted @ 2017-10-17 19:02 你的女孩居居 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1242 题目: 斐波那契数列的定义如下: F(0) = 0 F(1) = 1 F(n) = F(n - 1) + F(n - 2) (n >= 2) (1, 1, 阅读全文
posted @ 2017-10-14 19:55 你的女孩居居 阅读(555) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1433 题目: 1433 0和5 小K手中有n张牌,每张牌上有一个一位数的数,这个字数不是0就是5。小K从这些牌在抽出任意张(不能抽0张),排成一行这样就组成了一个 阅读全文
posted @ 2017-10-14 19:06 你的女孩居居 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1279 题目: 有一口井,井的高度为N,每隔1个单位它的宽度有变化。现在从井口往下面扔圆盘,如果圆盘的宽度大于井在某个高度的宽度,则圆盘被卡住(恰好等于的话会下去) 阅读全文
posted @ 2017-10-14 19:06 你的女孩居居 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1264 题目: 给出平面上两条线段的两个端点,判断这两条线段是否相交(有一个公共点或有部分重合认为相交)。 如果相交,输出"Yes",否则输出"No"。 给出平面上 阅读全文
posted @ 2017-10-14 19:05 你的女孩居居 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1092 题目: 回文串是指aba、abba、cccbccc、aaaa这种左右对称的字符串。每个字符串都可以通过向中间添加一些字符,使之变为回文字符串。 例如:abb 阅读全文
posted @ 2017-10-14 19:05 你的女孩居居 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目: Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking 阅读全文
posted @ 2017-08-24 19:38 你的女孩居居 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题目: 有一个字符串S,求S最少可以被划分为多少个回文串。 例如:abbaabaa,有多种划分方式。 a|bb|aabaa - 3 个回文串 a|bb|a|aba|a - 5 个回文串 a|b|b|a|a|b|a|a - 8 个回文串 其中第1种划分方式的划分数量最少。 a|bb|aabaa - 3 阅读全文
posted @ 2017-08-23 20:46 你的女孩居居 阅读(331) 评论(0) 推荐(0) 编辑