YY's new problem Time Limit: 12000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 5422    Accepted Submission(s): 1522 Problem Description Given a permutation P of 1 to N, YY wants to know whether there exists…
题目链接 用p[a]保存的是输入的a在第p[a]个,  然后根据差值查找. #include<stdio.h> #include<string.h> int main() { ]; scanf("%d",&t); while(t--) { flag=; scanf("%d",&n); ;i<n;i++) { scanf("%d",&a); p[a]=i; } m=n/; ;j<m;j++…
  Time Limit:4000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 3833 Description Given a permutation P of 1 to N, YY wants to know whether there exists such three elements P[i1], P[i2], P[i3] that P[i1]-P[i2]…
HDU 4974 A simple water problem pid=4974" target="_blank" style="">题目链接 签到题,非常easy贪心得到答案是(sum + 1) / 2和ai最大值的最大值 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N =…
HDU 5572 An Easy Physics Problem (计算几何) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5572 Description On an infinite smooth table, there's a big round fixed cylinder and a little ball whose volume can be ignored. Currently the ball stands still at p…
HDU 3861 The King's Problem 题目链接 题意:给定一个有向图,求最少划分成几个部分满足以下条件 互相可达的点必须分到一个集合 一个对点(u, v)必须至少有u可达v或者v可达u 一个点仅仅能分到一个集合 思路:先强连通缩点,然后二分图匹配求最小路径覆盖 代码: #include <cstdio> #include <cstring> #include <vector> #include <algorithm> #include &l…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5349 MZL's simple problem Description A simple problemProblem DescriptionYou have a multiple set,and now there are three kinds of operations:1 x : add number x to set2 : delete the minimum number (if the…
Mr. Frog's Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 312    Accepted Submission(s): 219 Problem Description One day, you, a clever boy, feel bored in your math class, and then fall…
A simple probability problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 43    Accepted Submission(s): 14 Problem Description Equally-spaced parallel lines lie on an infinite plane. The sep…
2015上海区域赛现场赛第5题. 题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5572 题意:在平面上,已知圆(O, R),点B.A(均在圆外),向量V. 一个小球从A出发,沿速度向量V匀速前进,若撞到圆则发生弹性碰撞,沿“反射方向”继续匀速前进.问A点能否经过B点. 题目读懂了,把所有情况都考虑全,流程图就出来了,然后直接套模版即可(注意有些功能可剪裁~) 我的第一道计算几何,WA了一个星期啊...原因有姿势不对,精度不对,还有输出不对的. 不…