搬砖 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 5134    Accepted Submission(s): 1288 Problem Description   小明现在是人见人爱,花见花开的高富帅,整天沉浸在美女环绕的笙歌妙舞当中.但是人们有所不知,春风得意的小明也曾有着一段艰苦的奋斗史. 那时的小明还没剪去长发,没有信用卡没…
Problem Description In an apartment, there are N residents. The Internet Service Provider (ISP) wants to connect these residents with N – 1 cables. However, the friendships of the residents are different. There is a “Happy Value” indicating the degre…
Problem Description Like most of the RPG (role play game), “The Magic Tower” is a game about how a warrior saves the princess. After killing lots of monsters, the warrior has climbed up the top of the magic tower. There is a boss in front of him. The…
Problem Description As the 2010 World Expo hosted by Shanghai is coming, CC is very honorable to be a volunteer of such an international pageant. His job is to guide the foreign visitors. Although he has a strong desire to be an excellent volunteer,…
1005 ACM组队安排 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description   ACM亚洲区比赛结束,意味着开始备战明年的浙江省大学生程序设计竞赛了!   杭州电子科技大学ACM集训队也准备开始组队.   教练想把所有的n个队员组成若干支队伍,原则是每支队伍至少一人,最多三人.   现在问题来了:如果已知集训队队员的数量n,请你帮教练计算出…
Study Words Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 195    Accepted Submission(s): 66 Problem Description Learning English is not easy, vocabulary troubles me a lot. One day an idea cam…
Polygon Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 195    Accepted Submission(s): 41 Problem Description Give you a simple polygon and a line, and your task is to calculate the length of t…
The Country List Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2464    Accepted Submission(s): 576 Problem Description As the 2010 World Expo hosted by Shanghai is coming, CC is very honorabl…
#include<cstdio> #include<cstring> #include<map> #include<string> #include<algorithm> using namespace std; int T; +]; +]; map<string,int>m; struct dan { +]; int num; }d[+]; int sum; int tot; bool cmp(const dan&a,con…
#include<cmath> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int whp,wat,wdef,bhp,bat,bdef; char s; int main() { while(~scanf("%c",&s)) { scanf("%d%d%d",&whp,&wat,&…
#include<stdio.h> #include<string.h> #include<iostream> #include<algorithm> #include<math.h> #include<map> #include<queue> using namespace std; +; char s[maxn][maxn]; int n,m; int c[maxn][maxn]; *maxn][*maxn]; int…
#include<cstdio> #include<algorithm> using namespace std; using namespace std; +; int a[maxn],b[maxn]; int main() { int n,m; while(scanf("%d %d",&n,&m)!=EOF) { ; i<=n; i++) scanf("%d",&a[i]); ; i<=m; i++)…
#include<cstdio> #include<cstring> #include<cmath> #include<vector> #include<algorithm> using namespace std; +; int G[maxn][maxn]; int f[maxn]; int n; struct Egde { int u,v; int val; } e[maxn*maxn]; bool cmp(const Egde&a,…
#include<cmath> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; long long X,K; long long basex[maxn]; long long basek[maxn]; int totx,totk; int main() { int T; scanf("%d",&T); while(T--)…
#include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; struct Point { double x; double y; } p[], px[]; int n; ; int cmp(Point a, Point b) { if(abs(a.x-b.x)<eps) retur…
#include<cstdio> #include<cstring> #include<cmath> #include<string> #include<vector> #include<map> #include<algorithm> using namespace std; +][+]; int n; map<string ,int>m; int main() { while(~scanf("%d…
Problem Description There is a collector who own many valuable jewels. He has a problem about how to store them. There are M special boxes. Each box has a value. And each of the N jewels has a value too. The collector wants to store every jewel in on…
The Magic Tower Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2382    Accepted Submission(s): 615 Problem Description Like most of the RPG (role play game), "The Magic Tower" is a game a…
Pick Game Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 119    Accepted Submission(s): 20 Problem Description This is a pick game. On a n*m matrix, each gird has a value. The player could on…
01 Matrix Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 564    Accepted Submission(s): 121 Problem Description It's really a simple problem.  Given a "01" matrix with size by n*n (the ma…
Bitwise Equations Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 633    Accepted Submission(s): 335 Problem Description You are given two positive integers X and K. Return the K-th smallest po…
Happy Value Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1337    Accepted Submission(s): 392 Problem Description In an apartment, there are N residents. The Internet Service Provider (ISP) w…
Magic boy Bi Luo with his excited tree Problem Description Bi Luo is a magic boy, he also has a migic tree, the tree has N nodes , in each node , there is a treasure, it's value is V[i], and for each edge, there is a cost C[i], which means every time…
Four Operations Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22    Accepted Submission(s): 12 Problem Description Little Ruins is a studious boy, recently he learned the four operations!Now h…
Car Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25    Accepted Submission(s): 12 Problem Description Ruins is driving a car to participating in a programming contest. As on a very tight sche…
朋友 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Description B君在围观一群男生和一群女生玩游戏,具体来说游戏是这样的:给出一棵n个节点的树,这棵树的每条边有一个权值,这个权值只可能是0或1. 在一局游戏开始时,会确定一个节点作为根.接下来从女生开始,双方轮流进行 操作.当一方操作时,他们需要先选择一个不为根的点,满足该点到其父亲的边权为1; 然…
最大的位或 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Description B君和G君聊天的时候想到了如下的问题.给定自然数l和r ,选取2个整数x,y满足l <= x <= y <= r ,使得x|y最大.其中|表示按位或,即C. C++. Java中的|运算.   Input 包含至多10001组测试数据.第一行有一个正整数,表示数据的组数.…
异或密码 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Description 晨晨在纸上写了一个长度为N的非负整数序列{ai}.对于这个序列的一个连续子序列{al,al+1,-,ar}晨晨可以求出其中所有数异或的结果 alxoral+1xor...xorar其 中xor表示位异或运算,对应C.C++. Java等语言中的^运算.小璐提出了M个询问,每个询问用…
传递 Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)     Problem Description 我们称一个有向图G是传递的,当且仅当对任意三个不同的顶点a,,若G中有 一条边从a到b且有一条边从b到c ,则G中同样有一条边从a到c.我们称图G是一个竞赛图,当且仅当它是一个有向图且它的基图是完全图.换句 话说,将完全图每条边定向将得到一个竞赛图.下图展示的是一个有4个顶点…
扫雷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 998    Accepted Submission(s): 289 Problem Description 扫雷游戏是晨晨和小璐特别喜欢的智力游戏,她俩最近沉迷其中无法自拔.该游戏的界面是一个矩阵,矩阵中有些格子中有一个地雷,其余格子中没有地雷. 游戏中,格子可能处于己知和未知的状态…