Different GCD Subarray Query Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 681    Accepted Submission(s): 240 Problem Description This is a simple problem. The teacher gives Bob a list of prob…
Football Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 439    Accepted Submission(s): 157 Problem Description A mysterious country will hold a football world championships---Abnormal Cup…
Friends and Enemies Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 291    Accepted Submission(s): 160 Problem Description On an isolated island, lived some dwarves. A king (not a dwarf) ruled t…
Function Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 976    Accepted Submission(s): 375 Problem Description The shorter, the simpler. With this problem, you should be convinced of this tru…
Football Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 802    Accepted Submission(s): 309 Problem Description A mysterious country will hold a football world championships---Abnormal Cup…
Sparse Graph Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 689    Accepted Submission(s): 238 Problem Description In graph theory, the complement of a graph G is a graph H on the same vertic…
Different Circle Permutation Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 208    Accepted Submission(s): 101 Problem Description You may not know this but it's a fact that Xinghai Square is…
hannnnah_j’s Biological Test Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 802    Accepted Submission(s): 269 Problem Description hannnnah_j is a teacher in WL High school who teaches biolog…
QSC and Master Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 859    Accepted Submission(s): 325 Problem Description Every school has some legends, Northeastern University is the same. Enter…
odd-even number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 388    Accepted Submission(s): 212 Problem Description For a number,if the length of continuous odd digits is even and the length…
1009 Sparse Graph(hdu5876) 由于每条边的权值都为1,所以最短路bfs就够了,只是要求转置图的最短路,所以得用两个set来维护,一个用来存储上次扩散还没访问的点,一个用来存储这一次扩散还没访问的点. 算法:bfs+set #include<iostream> #include<cstdio> #include<algorithm> #include<string.h> #include<queue> #include<…
Football Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 5055    Accepted Submission(s): 904 Problem Description A mysterious country will hold a football world championships---Abnormal Cu…
Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2229    Accepted Submission(s): 252 Problem Description The shorter, the simpler. With this problem, you should be convinced of this truth.    Y…
Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 3192    Accepted Submission(s): 371 Problem Description You are given a rooted tree of N nodes, labeled from 1 to N. To the ith node a non-negat…
1006 Football Games 这道题输入也很阴险!!! 这道题过题姿势最优雅的,不是if else if else if.那样很容易wa的. 如果没有平手选项, 赢得加一分的话, 可以用Landau's Theorem(兰道定理)判定. 稍微修改一下这个定理就能做了. 假设S1,S2……Sn是他们的得分序列,从小到排个序.那么这个序列要是合法.那么当且仅当 S1+S2+……+Sn = n(n-1) S1+S2+……+Si >= i(i-1)  ( 1 <= i < n) 其实第…
题意:给一个图 给定一个点s 求补图中s点到达各个点的最短路 思路:从s点开始bfs 在图中与s点有连接的都是在补图中不能直接到达的点 反之在补图中都是可以直接到达的点 由此bfs ((( 诡异的写法... AC代码: #include "iostream" #include "string.h" #include "stack" #include "queue" #include "set" #inclu…
Weak Pair Problem Description   You are given a rooted tree of N nodes, labeled from 1 to N. To the ith node a non-negative value ai is assigned.An ordered pair of nodes (u,v) is said to be weak if  (1) u is an ancestor of v (Note: In this problem a…
因为不是一队……毫无晋级的压力……反正有压力也进不去呵呵呵…… 开场zr看1006我看1010.. 1010我一直在wa... zr的1006倒是比较轻松的过了...然后我让他帮我看10.... 跟他讲了半天我代码的逻辑...然后我自己看出来的....比赛的代码....写的十分混乱.... #include <cstdio> #include <cstring> #include <algorithm> #include <vector> typedef l…
Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Given an integer n, we only want to know the sum of 1/k2 where k from 1 to n.     Input There a…
讲道理我挺想去大连的…… 毕竟风景不错…… 而且这次能去北京也是靠大连网络赛这一场拉开的优势…… 一道补图最短路一道数学推论简直爽爆…… 当然 除了这一场 其他场都非常划水…… 上次看到别人的博客用这个骗百度的爬虫…… 我也来试试…… 最后恭喜我然和两位学长顺利拿到牌子~…
Weak Pair Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 439    Accepted Submission(s): 155 Problem Description You are given a rooted tree of N nodes, labeled from 1 to N. To the ith node a…
N个数(N<=100000),M个询问,每次询问L,R,求F(L,R). F(L,R)=F(L,R-1)%A[R] , L<R 这道题数据比较鶸 可以直接用递减爆 正确做法应该是倍增 用倍增的思想,对于位置i右侧的最长下降子序列,next[i][j]表示位置i右边第2j个的位置,预处理出每个位置的next数组 每次做的时候尽量远跳,直到找到next[j][0]恰好小于当前的值z,则z对A[next[j][0]]取模,移动左标记,继续查找,直到超出R或者没有更小的数 // //by coolxx…
I Count Two Three Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 782    Accepted Submission(s): 406 Problem Description I will show you the most popular board game in the Shanghai Ingress Resis…
Barricade Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 997    Accepted Submission(s): 306 Problem Description The empire is under attack again. The general of empire is planning to defend his…
2016 ACM/ICPC Asia Regional Qingdao Online(部分题解) 5878---I Count Two Three http://acm.hdu.edu.cn/showproblem.php?pid=5878 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1287    Accepted Submissi…
[ HDU 5878 ] I Count Two Three 考虑极端,1e9就是2的30次方,3的17次方,5的12次方,7的10次方. 而且,不超过1e9的乘积不过5000多个,于是预处理出来,然后每次二分找就可以了. /* TASK:I Count Two Three 2^a*3^b*5^c*7^d的最小的大于等于n的数是多少 LANG:C++ URL:http://acm.hdu.edu.cn/showproblem.php?pid=5878 */ #include <iostream>…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5878 题目大意: 给出一个数n ,求一个数X, X>=n. X 满足一个条件 X= 2^a*3^b*5^c*7^d 求靠近n的X值. 解题思路: 打表+二分查找 [切记用 cin cout,都是泪...] AC Code: #include<bits/stdc++.h> using namespace std; ]; int main() { ; long long ans,n,x; ; i…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5884 题目大意:有n个有序的序列,对于第i个序列有ai个元素. 现在有一个程序每次能够归并k个序列, 他的花费为k个序列中的总的元素数.现在想知道在花费不超过t的情况下存在的最小的k为多少? 解题思路:二分k的值,合并k个序列的值, 加入队列,然后用哈夫曼检查最小花费是否超过t! 这时需要注意最后一次合并是否为k个数, 如果不是k个数,就不是最优的哈夫曼的值, 如果最后是k个数, 那么最后n, k一…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5889 解法:http://blog.csdn.net/u013532224/article/details/46992973 然后改改模版 #include <iostream> #include <cstring> #include <cstdio> #include <vector> #include <queue> #include <str…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5883 解法:先判断是不是欧拉路,然后枚举 #pragma comment(linker, "/STACK:102400000,102400000") #include <math.h> #include <time.h> #include <stdio.h> #include <string.h> #include <stdlib.h>…