上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页
摘要: B. Two Heapstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputValera has 2·n cubes, each cube contains an integer from 10 to 99. He arbitrarily chooses n cubes and puts them in the first heap. The remaining cubes form the second heap.Valera dec 阅读全文
posted @ 2013-10-11 22:33 Ramanujan 阅读(321) 评论(0) 推荐(0) 编辑
摘要: Problem AACM contest and BlackoutIn order to prepare the “The First National ACM School Contest”(in 20??) the major of the city decided to provide all the schools with a reliable source of power. (The major is really afraid of blackoutsJ). So, in order to do that, power station “Future” and one scho 阅读全文
posted @ 2013-10-11 22:22 Ramanujan 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 1.二分图判定染色模板bool dfs(int u, int cur){ col[u]=cur; for(int i=0; i1) ans=0; if(ans==INF) ans=-1;}4.tarjan 求强连通分量void tarjan(int u){ dfn[u]=low[u]=++tsp; s.push(u); ins[u]=true; int i, v, tl=g[u].size(); for(i=0; i=dfn[u]){ iscut[u]=1; edge k; ... 阅读全文
posted @ 2013-10-11 22:16 Ramanujan 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 1.最佳完美匹配------km算法bool match(int u){ s[u]=true; for(int v=1; v<=n; v++){ if(t[v]) continue; int d=lx[u]+ly[v]-w[u][v]; if(!d){ t[v]=true; if(lft[v]==-1 || match(lft[v])){ lft[v]=u; return true; } } ... 阅读全文
posted @ 2013-10-11 21:44 Ramanujan 阅读(547) 评论(0) 推荐(0) 编辑
摘要: Hua and Shen have invented a simple solitaire board game that they call ``The Great Wall Game." The game is played with n stones on an n×n grid. The stones are placed at random in the squares of the grid, at most one stone per square. In a single move, any single stone can move into an uno 阅读全文
posted @ 2013-10-10 22:31 Ramanujan 阅读(374) 评论(0) 推荐(0) 编辑
摘要: A big city wants to improve its bus transportation system. One of the improvement is to add scenic routes which go es through attractive places. Your task is to construct a bus-route-plan for sight-seeing buses in a city.You are given a set of scenic lo cations. For each of these given lo cations, t 阅读全文
posted @ 2013-10-10 22:26 Ramanujan 阅读(261) 评论(0) 推荐(0) 编辑
摘要: Problem C - Cat vs. DogTime limit: 2 secondsThe latest reality show has hit the TV: ``Cat vs. Dog''. In this show, a bunch of cats and dogs compete for the very prestigious Best Pet Ever title. In each episode, the cats and dogs get to show themselves off, after which the viewers vote on whi 阅读全文
posted @ 2013-10-10 22:18 Ramanujan 阅读(410) 评论(0) 推荐(0) 编辑
摘要: uva 1161 图论 无从下手。。。uva 10938 LCA && RMQ。。uva 10246 应该可以用变形floyd预处理,然后O(1)回答询问。WA代码:#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#define LL long long#define UINT unsigned int#define MAX_INT 0x7fffffff#define cint const int#define 阅读全文
posted @ 2013-10-10 10:57 Ramanujan 阅读(164) 评论(0) 推荐(0) 编辑
摘要: ComputerTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2390Accepted Submission(s): 1219Problem DescriptionA school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers 阅读全文
posted @ 2013-10-08 23:24 Ramanujan 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Sightseeing tourTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 6821Accepted: 2816DescriptionThe city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beautiful city. They want to construct the tour so that every stre 阅读全文
posted @ 2013-10-08 21:03 Ramanujan 阅读(195) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页