Harry Potter and the Hide Story Problem Description iSea is tired of writing the story of Harry Potter, so, lucky you, solving the following problem is enough.   Input The first line contains a single integer T, indicating the number of test cases. E…
Harry Potter and the Hide Story Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2193    Accepted Submission(s): 530 Problem Description iSea is tired of writing the story of Harry Potter, so,…
Harry Potter and the Hide Story Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2809    Accepted Submission(s): 715 Problem Description iSea is tired of writing the story of Harry Potter, so, l…
Harry Potter and the Forbidden Forest Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2089    Accepted Submission(s): 702 Problem Description Harry Potter notices some Death Eaters try to slip…
Harry Potter and the Final Battle Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2118    Accepted Submission(s): 580 Problem Description The final battle is coming. Now Harry Potter is located…
view code//hdu 3987 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <queue> using namespace std; typedef long long ll; const ll INF = 1LL<<59; const ll E = 100001; const int N = 10…
http://acm.hdu.edu.cn/showproblem.php?pid=3986 [题意] 给定一个有重边的无向图,T=20,n<=1000,m<=5000 删去一条边,使得1~n的最短路最长 求最短路最长是多少 [思路] 一定是删最短路上的边 可以先跑一个Dijkstra,求出最短路,然n后枚举删边 朴素的Dijkstra为n^2,枚举删边(n条)需要的总时间复杂度是n^3 堆优化Dijkstra(nlogn),总复杂度为n^2logn 有多重边,用邻接矩阵不方便,用邻接表方便,…
一个水题WA了60发,数组没开大,这OJ也不提示RE,光提示WA...... 思路:先求出最短路,如果删除的边不是最短路上的,那么对结果没有影响,要有影响,只能删除最短路上的边.所以枚举一下最短路上的边,每次求最短路即可. #include<stdio.h> #include<vector> #include<string.h> #include<queue> #include<algorithm> using namespace std; +…
状压BFS 注意在用二维字符数组时,要把空格.换行处理好. #include<stdio.h> #include<algorithm> #include<string.h> #include<queue> using namespace std; #define INF 0x3f3f3f3f int sx,sy,C,n,m; int ans; ][][<<]; ][]; ][]; ,,-,},dy[]={,,,-}; <=a&&am…
Problem - 3982 题意就是给出一个圆心在原点半径为R的圆形蛋糕,上面有一个cherry,对蛋糕切若干刀,最后要求求出有cherry的那块的面积占整个蛋糕的多少. 做法显而易见,就是一个半平面交,将有向直线的方向根据cherry的位置确定好,然后就进行半平面交,得到一个多边形. 再将多边形用之前几个代码的圆与多边形交,求出区域的大小,再除以整个蛋糕的面积即可. 注意,这样做的时候,精度是要用1e-6或者是1e-4,太高了反而过不了数据. ——written by Lyon…