链接:http://acm.hdu.edu.cn/showproblem.php?pid=5882 解法:一个点必须出度和入度相同就满足题意,所以加上本身就是判断奇偶性 #include<stdio.h> #include<math.h> #include<string.h> #include<stack> #include<set> #include<queue> #include<vector> #include<…
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>…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5879 解法:我们知道到某个极限之后结果相同,所以找到那个极限,其他保存之后输出就好了 #include<stdio.h> //#include<bits/stdc++.h> #include<string.h> #include<iostream> #include<math.h> #include<sstream> #include<…