HDU 5878 I Count Two Three】的更多相关文章

题目链接: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…
I Count Two Three Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 767    Accepted Submission(s): 403 Problem Description I will show you the most popular board game in the Shanghai Ingress Resis…
I will show you the most popular board game in the Shanghai Ingress Resistance Team. It all started several months ago. We found out the home address of the enlightened agent Icount2three and decided to draw him out. Millions of missiles were detonat…
题目链接 题意:给定一个数n,求大于n的第一个只包含2357四个因子的数(但是不能不包含其中任意一种),求这个数. 题解:打表+二分即可. #include <iostream> #include <math.h> #include <stdio.h> #include<algorithm> using namespace std; ],tot=; int main() { ; long long a,b,c,d; ;a<=maxn;a*=) ;a*b…
题意:给出一个整数nnn, 找出一个大于等于nnn的最小整数mmm, 使得mmm可以表示为2a3b5c7d2^a3^b5^c7^d2​a​​3​b​​5​c​​7​d​​. 析:预处理出所有形为2a3b5c7d2^a3^b5^c7^d2​a​​3​b​​5​c​​7​d​​即可, 大概只有5000左右个.然后用二分查找就好. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio…
I Count Two Three 31.1% 1000ms 32768K   I will show you the most popular board game in the Shanghai Ingress Resistance Team. It all started several months ago. We found out the home address of the enlightened agent Icount2three and decided to draw hi…
为甚么16年Qingdao Online 都是暴力题emm///... 先暴力预处理 然后lower _bound二分 #include <iostream> #include <cstdio> #include <sstream> #include <cstring> #include <map> #include <cctype> #include <set> #include <vector> #incl…
Count the Buildings Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1249    Accepted Submission(s): 408 Problem Description There are N buildings standing in a straight line in the City, numbere…
http://acm.hdu.edu.cn/showproblem.php?pid=3336 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10917    Accepted Submission(s): 5083 Problem Description It is well known that AekdyCoin is good a…
贪心算法.需要计算分别以每个字母结尾的且每个字母出现的次数不超过k的字符串,我们设定一个初始位置s,然后用游标i从头到尾遍历字符串,使用map记录期间各个字母出现的次数,如果以s开头i结尾的字符串满足要求,则把结果增加i-s+1.否则的话向前移动s,不断维护map,直到s指向的字母与i相同,从而满足字符串条件,把结果增加i-s+1. 需要注意的是结果可能会超int,需要用long long. 代码如下: #define MAXS 100002 #include <cstdlib> #inclu…