MPI Maelstrom 总时间限制:  1000ms 内存限制:  65536kB 描述 BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research advisor…
题意:建一个家庭树,找出有第d代子孙的名字,按照要求的第d代子孙的数从大到小输出三个人名,如果有一样大小子孙数的,就按字母序从小到大将同等大小的都输出,如果小于三个人的就全输出. 题目链接:http://poj.org/problem?id=2732 分析:数据量很小,直接建树,枚举暴力输出.我直接套模板用map建树的. 注意:1.每次测试数据时要清空map和vector!!! 2.注意输出要从大到小输出答案,如果答案有一样的按名字的字母序从小到大输出.答案用vector保存,vector排序:…
A:Abstract Art 题意:给出n个多边形,求n个多边形分别的面积和,以及面积并 思路:模板 #include <bits/stdc++.h> using namespace std; #define N 1010 #define mkp make_pair ; inline int sgn(double x) { ; ) ; ; } struct Point { double x, y; inline Point() {} inline Point(double x, double…
A .Abstract Art 题意:求多个多边形的面积并. 思路:模板题. #include<bits/stdc++.h> using namespace std; typedef long long ll; const double inf=1e200; ; *atan(1.0); :(x<?-:);} struct point{ double x,y; point(,):x(a),y(b){} }; point operator +(point A,point B) { retur…
题目链接 问题描述 : We are all familiar with pre-order, in-order and post-order traversals of binary trees. A common problem in data structure classes is to find the pre-order traversal of a binary tree when given the in-order and post-order traversals. Alte…
任意门:http://codeforces.com/gym/100641/attachments Con + tin/(ued + Frac/tions) Time Limit: 3000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 217     Accepted Submission(s): 27 Description The (simple) contin…
题目大意: 输入n,有n个地方(1~n)需要送pizza pizza点为0点 接下来n+1行每行n+1个值 表示 i 到 j 的路径长度 输出从0点到各点送pizza最后回到0点的最短路(点可重复走) Sample Input 30 1 10 101 0 1 210 1 0 1010 2 10 00 Sample Output 8 #include <bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; ][],dp[][]; /…
Problem D Lost in Translation The word is out that you’ve just finished writing a book entitled How to Ensure Victory at a Programming Contest and requests are flying in. Not surprisingly, many of these requests are from foreign countries, and while…
E 每过一秒,当前点会把它的值传递给所有相邻点,问t时刻该图的值 #include <iostream> #include <cstdio> #include <algorithm> #include <list> #include <map> #include <stack> #include <vector> #include <cstring> #include <sstream> #incl…
Problem F Removal GameBobby Roberts is totally bored in his algorithms class, so he’s developed a little solitaire game. He writes down a sequence of positive integers and then begins removing them one at a time. The cost of each removal is equal to…