H - Solve this interesting problem Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5323 Appoint description:  System Crawler  (2015-07-28) Description Have you learned something about segment tr…
Have you learned something about segment tree? If not, don't worry, I will explain it for you.  Segment Tree is a kind of binary tree, it can be defined as this:  - For each node u in Segment Tree, u has two values: $L_u$ and $R_u$.  - If $L_u = R_u$…
MZL's Border Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 909 Accepted Submission(s): 297 Problem Description As is known to all, MZL is an extraordinarily lovely girl. One day, MZL was playing…
#include <cstdio> #include <iostream> #include <cstring> #include <queue> #include <vector> using namespace std; #define INF 0x7fffffff struct edge { int t; long long d; }; vector<edge> g[20005]; int n, m, p, q; void Sp…
#include <cstdio> #include <iostream> #include <cstring> using namespace std; const int INF = 0x3fffffff; int g[1005][1005]; int m; void Floyd() { int i, j, k; for (k=1;k<=m;k++) { for (i=1;i<=m;i++) { for (j=1;j<=m;j++) { if (g…
#include <cstdio> #include <iostream> #include <cstring> using namespace std; const int INF = 0x3fffffff; int g[1005][1005]; int m; int Dijkstra(int s,int t) { bool visit[1005]; int dis[1005]; for(int i = 1; i <= m; ++i) { visit[i] =…
D - Painter Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5319 Appoint description: Description Mr. Hdu is an painter, as we all know, painters need ideas to innovate , one day, he got stuck in rut an…
LCM的个数 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 对于我们来说求两个数的LCM(最小公倍数)是很容易的事,现在我遇到了一个问题需要大家帮助我来解决这问题,问题是:给你一个数n,然后统计有多少对(a<=b) LCM(a,b)=n:例如LCM(a,b)=12; 即(1,12),(2,12),(3,12),(4,12),(6,12),(12,12),(3,4),(4,6): 输入 输入数组有多组,每组数据包含一个整数n(…
完美素数 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 我们定义:如果一个数为素数,且这个数中含有7或3,那么我们称这个数为完美素数.素数的定义为:一个大于1的自然数,除了1和它本身外,不能被其他自然数整除.我们的任务是判断一个数是不是完美素数,是输出YES,否则输出NO . 输入 输入数据有多组测试用例,每组测试的第一行为一个整数n(1<=n<=100),下面n行每行有一个正整数x(2<=x<=1000).…
经济节约 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 由于经济紧张,某国国王决定减少一部分多余的士兵,这些士兵在边界都有各自的管辖范围.例如,士兵x 的管辖范围[ax,bx].我们定义:对于i号士兵,如果存在j号士兵的管辖范围[aj,bj], aj<ai且bi<bj成立,那么i号士兵就是多余的.给出多个士兵的管辖范围,问有多少个士兵是多余的? 输入  有多组数据,每组数据的第一行为一个整数n(1<=n<=10…