Problem 2155 盟国
Problem Description
世界上存在着N个国家,简单起见,编号从0~N-1,假如a国和b国是盟国,b国和c国是盟国,那么a国和c国也是盟国。另外每个国家都有权宣布退盟(注意,退盟后还可以再结盟)。
定义下面两个操作:
“M X Y” :X国和Y国结盟
“S X” :X国宣布退盟
Input
多组case...
分类:
其他好文 时间:
2014-07-24 10:33:03
阅读次数:
278
链接:http://acm.fzu.edu.cn/problem.php?pid=1015Problem 1015 土地划分Accept: 714Submit: 1675Time Limit: 1000 mSecMemory Limit : 32768 KBProblem Description在D...
分类:
其他好文 时间:
2014-07-23 16:58:41
阅读次数:
348
Problem 2156 Climb Stairs
Problem Description
Jason lives on the seventh floor. He can climb several stairs at a time, and he must reach one or more specific stairs before he arrives home becau...
分类:
其他好文 时间:
2014-07-22 14:36:28
阅读次数:
211
题意:三维空间给出n个蚊子的初始位置(ax,ay,az)和移动趋势(dx,dy,dz),那么每个蚊子坐标随时间变化的函数就是(ax+dx*t, ay+dy*t, ax+dz*t)。每次射杀一枪,可以把距离原点距离len之内的蚊子全部杀死。问最多能射杀几只蚊子,这时至少要射杀几次?
解法:先求出每只蚊子在射程之内的时间区间,即(ax+dx*t, ay+dy*t, ax+dz*t)^...
分类:
其他好文 时间:
2014-07-22 00:26:36
阅读次数:
217
矩阵的快速幂sn 1 1 0 0 sn-1fn+1 = 0 3 2 7* fnfn 0 1 0 0 fn-1fn-1 0 0 1 0 fn-2#include #include using namespace std;int n;struct M{ int t[4][4]...
分类:
其他好文 时间:
2014-07-21 08:07:13
阅读次数:
221
枚举两点,然后同步BFS,看代码吧,很容易懂的。代码:#include #include #include #include #include #include #include #define Mod 1000000007using namespace std;struct Point{ i...
分类:
其他好文 时间:
2014-07-19 20:21:38
阅读次数:
245
Another Easy ProblemTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionxtt最近学习了高斯消元法解方程组,现在他的问题来了,如果是以下的方程,那么应该如...
分类:
其他好文 时间:
2014-07-18 19:08:50
阅读次数:
198
http://acm.fzu.edu.cn/problem.php?pid=1894Problem 1894 志愿者选拔Accept: 1328Submit: 4200Time Limit: 1500 mSecMemory Limit : 32768 KBProblem Description世博会...
分类:
其他好文 时间:
2014-07-18 16:26:23
阅读次数:
188
http://acm.fzu.edu.cn/problem.php?pid=2171Problem 2171 防守阵地 IIAccept: 105Submit: 415Time Limit: 3000 mSecMemory Limit : 32768 KBProblem Description部队中...
分类:
其他好文 时间:
2014-07-16 15:25:12
阅读次数:
212
Description
Are you interested in pets? There is a very famous pets shop in the center of the ACM city. There are totally m pets in the shop, numbered from 1 to m. One day, there are n customers in...
分类:
其他好文 时间:
2014-07-16 09:17:29
阅读次数:
325