- 博客(16)
- 收藏
- 关注
原创 UVA10054
Problem D: The Necklace My little sister had a beautiful necklace made of colorful beads. Two successive beads in the necklace shared a common color at their meeting point.
2014-07-24 10:24:34 510
原创 LA4255
Given a sequence of integers, a1, a2,..., an , we define its sign matrix S such that, for 1ijn , Sij = `` + " if ai +...+ aj > 0 ; Sij = `` - " if ai +...+ aj < 0 ; and Sij = ``0" otherwise.
2014-07-23 23:07:34 463
原创 UVA11624
Problem B: Fire! Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze.Given
2014-07-20 20:55:34 487
原创 UVA10047
Problem A: The Monocycle A monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special. It has a solid wheel colored with five different co
2014-07-20 20:34:16 390
原创 UVA_10881 - Piotr's Ants
Problem DPiotr's AntsTime Limit: 2 seconds"One thing is for certain: there is no stopping them;the ants will soon be here. And I, for one, welcome ournew insect overlords."
2014-07-13 09:14:57 369
原创 AOJ-0121
Seven PuzzleTime Limit : 1 sec, Memory Limit : 65536 KBSeven Puzzle7パズルは8つの正方形のカードとこれらのカードがぴたりと収まる枠を使って行います。それぞれのカードは互いに区別できるように、0,1,2....7と番号がつけられています。枠には、縦に2個、横に4個のカードを並べることができます。
2014-04-12 11:50:12 531
原创 POJ-1948
Triangular PasturesTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 6124 Accepted: 1978DescriptionLike everyone, cows enjoy variety. Their current fancy
2014-04-11 22:03:15 466
原创 POJ-3669
Meteor ShowerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7755 Accepted: 2194DescriptionBessie hears that an extraordinary meteor shower is coming; r
2014-04-11 14:11:54 401
原创 LIS
Prob I. Just LISYou are to find the length of the longest increasing subsequence (LIS) of a given sequence A whose length is n.InputThere multiple test cases. Each case contains n+1 inte
2014-03-20 19:32:27 379
原创 POJ-1852
其实如果之前没有遇到过这种问题就是感到无从下手,本题实际不难。模拟两只蚂蚁相遇的情景,就会发现其实他们是“保持原样交错而过继续前进”(如果不考虑蚂蚁的个体差异),这样就可以认为每只蚂蚁是独立运动的。由于没有给出蚂蚁的朝向问题,所以要求最短时间时:首先针对每只蚂蚁求出它到竿子两个端点的最小距离,然后从所有蚂蚁的最小距离中求出最大的值(因为需要的是当所有的蚂蚁都下落的最小时间);要求最长时
2014-03-19 10:49:13 375
原创 最大连续子序列问题(含环路)
Prob III. More than MSPIn computer science, the maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers which has the largest sum. For examp
2014-03-19 10:34:01 556
原创 Pouring water
#include#include#include#define MAX 10000000using namespace std;int f[201][201][201];//用来存放到达某个状态所需倒的最少水量short inQ[201][201][201];//用来标记某个状态是否在队列中int main(){ queue q; short s[3], d;
2014-03-18 17:59:55 1070
原创 SPFA
#include#include#include#includeusing namespace std;#define MAXV 10000#define INF 1000000000 //此处建议不要过大或过小,过大易导致运算时溢出,过小可能会被判定为真正的距离using std::vector;using std::queue;struct Edge{ int v; /
2014-03-18 17:15:12 342
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人