- 博客(54)
- 资源 (4)
- 问答 (1)
- 收藏
- 关注
原创 HYSBZ 2463
J - 谁能赢呢?Time Limit:10000MS Memory Limit:131072KB 64bit IO Format:%lld & %lluSubmit Status Practice HYSBZ 2463 Description小明和小红经常玩一个博弈游戏。给定一个n×n的棋盘,一个石头被放在棋盘的左上角。他们轮流移动石头
2016-03-31 22:05:31 498
原创 ZOJ 2736 Daffodil number
E - Daffodil numberTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatusPracticeZOJ 2736DescriptionThe daffodil number is one of the famous interesting
2016-03-31 22:00:57 640
原创 ZOJ 2829 Beautiful Number
Beautiful NumberTime Limit: 2 Seconds Memory Limit: 65536 KB Mike is very lucky, as he has two beautiful numbers, 3 and 5. But he is so greedy that he wants infinite beautiful numbers.
2016-03-31 21:57:28 721
转载 POJ 刷题指导及题目分类
初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法:
2016-03-31 21:43:49 1722
转载 HDU 题目分类
分类二:基础题:1000、1001、1004、1005、1008、1012、1013、1014、1017、1019、1021、1028、1029、1032、1037、1040、1048、1056、1058、1061、1070、1076、1089、1090、1091、1092、1093、1094、1095、1096、1097、1098、1106、1108、1157、1163、
2016-03-31 21:31:08 743
原创 HDU 1556Color the ball
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14884 Accepted Submission(s): 7441Problem DescriptionN个气球排成一排,从左到右依
2016-03-31 11:48:55 413
转载 趣写算法系列之--匈牙利算法
匈牙利算法是由匈牙利数学家Edmonds于1965年提出,因而得名。匈牙利算法是基于Hall定理中充分性证明的思想,它是部图匹配最常见的算法,该算法的核心就是寻找增广路径,它是一种用增广路径求二分图最大匹配的算法。-------等等,看得头大?那么请看下面的版本:通过数代人的努力,你终于赶上了剩男剩女的大潮,假设你是一位光荣的新世纪媒人,在你的手上有N个剩男,M个剩女,每个人都可能对多
2016-03-30 12:03:45 819
原创 HDU 2063 过山车(匈牙利算法)(二分图求最大匹配)
过山车Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16667 Accepted Submission(s): 7281Problem DescriptionRPG girls今天和大家一起去游乐场玩,终于可
2016-03-30 12:00:42 466
原创 HDU 2717(STL)
看的欧阳学长的代码,等我学会了STL,一定自己写一遍,现在一脸蒙蔽!#include#include#include//优先队列using namespace std;int x,y;int sign[200005],t[200005];queueq;void bfs();int main(){ while(scanf("%d %d",&x,&
2016-03-29 22:24:08 388
原创 POJ 2386 Lake Counting(简单dfs)
Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 26942 Accepted: 13532DescriptionDue to recent rains, water has pooled in various places in Fa
2016-03-29 15:25:28 665
原创 HDU 1303 Doubles(简单数组)
点击打开链接----题目-传送门题目大意就是找出数组中存在 一个是另一个二倍 的元素个数,很简单,数组大点!#include#includeusing namespace std;int main(){ int a[20]; while(~scanf("%d",&a[0])&&a[0]!=-1) { int num=1;
2016-03-29 14:27:16 441
原创 LightOJ 1354 - IP Checking
1354 - IP CheckingDescriptionAn IP address is a 32 bit address formatted in the following waya.b.c.dwhere a, b, c, d are integers each ranging from 0 to 255. Now you are given
2016-03-27 22:27:59 1174
原创 FZU 1055 赋值问题
Problem 1055 赋值问题Accept: 1638 Submit: 8909Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description在很多程序设计语言中,忘记给变量赋初值的错误常令人头疼。请编程求出含N(0≤N≤100)行的程序段运行以后有哪些变量中有确定的值。在下面的问题
2016-03-27 15:28:14 638
原创 POJ 1852 Ants
题目意思:让以控制蚂蚁行动方向,来计算所有蚂蚁都掉下去所需的时间。注意不能用暴搜,方向2*2*2*2*2*2*……,2^n会超时。要优化! 以为蚂蚁碰头后会再向回走,所以我们可以考虑忽略蚂蚁的碰头回走,让蚂蚁直接穿越对方,对题目无影响。 代码:#include#include#includeusing namespace std;int a[1000005];v
2016-03-26 22:42:12 538
原创 HDOJ 1302 具体解释(简单模拟)
题目大意:有一只蜗牛从底部向顶部爬,白天爬,晚上休息,但是下一天白天怕的速度会减慢,也就是爬的高度会减少。 //H-总高 U-初始速度 //D-下滑距离 F-速度下降的概率 先计算出每次速度下降的大小为U*F 只需要判断蜗牛什么时候到顶端,或者“低于”底部即可。 需要另输入的变量为double型的,long long或者int都会溢出。代码实现:#inclu
2016-03-26 22:01:28 669
原创 HDOJ 1170 Balloon Comes!(c++)
这个题目其实很简单,我在想用c既然没难度,那就用刚学了的c++啊,顺便熟悉一下格式控制,真熟悉了,看了书才想起怎么用的,所以我认识到了一点,学了的东西一定要练习或复习!代码如下:#include#includeusing namespace std;int main(){ int t,one,two; char mark; cin>>t; while
2016-03-25 21:49:15 657
原创 HDOJ 2094 产生冠军
感觉这个是主要是考虑人的思维呈现,都可以看出来要想输出Yes,就必须有且仅有一个赢家没输过,所以我们要项要如何实现这个思想呢? 先说下我,刚开始我想用赢家和输家比较查找到所有只赢不输的人,但是刚开始没考虑到赢家里面有相同的,后来发现赢家里面又可能有很多相同的,所以这个方法行不通。 那么我来说一下正确的思想,先找出赢家和输家所有不同的人数,然后减去输家里面不同的人数,那么就得到了只赢不输
2016-03-25 21:15:57 456
原创 HDU 1098 Ignatius's puzzle
题目大意:就是给你一个公式:f(x)=5*x^13+13*x^5+k*a*x,是否存在a,其f(x)%65==0. 现在假设存在,然后当f(1)=18+k*a; 有要求f(x)%65==0,所以令f(1)=65*n=18+k*a;若要此方程成立,就要n为正数
2016-03-24 12:23:30 330
原创 HDU 1097 A hard puzzle
快速幂取模就对了啊,开始竟然忘了a了#includeusing namespace std;int main(){ int a,b; while(cin>>a>>b) { int p=1; b=b%4,a%=10; if(!b)//b=0 b=4; while(b--)
2016-03-23 22:41:14 314
原创 LightOJ 1006 Hex-a-bonacci
这个题目摆着是递归,所以你肯定不能用递归吧,但是我没想懂题意,还是别人的提示让我恍然大悟,递归超时用递推啊,明显!!#include#includeusing namespace std;int b,c,d,e,m,f;const int Mod=10000007;int main(){ int n,caseno=0,cases,a[10005]; sca
2016-03-23 22:10:06 519
原创 LightOJ 1015 Brush (I)
#include#include#includeusing namespace std;int main(){ int t,n,a[1005],m=1; cin>>t; while(t--) { cin>>n; long long sum=0; for(int i=0;i<n;i++) {
2016-03-23 22:07:21 640
原创 HDOJ 1003 Max Sum(动态规划)
Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 202159 Accepted Submission(s): 47252Problem DescriptionGiven a sequence a[
2016-03-23 18:01:56 468
原创 POJ 1837 Balance(01背包 动态规划)
BalanceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 12613 Accepted: 7903DescriptionGigel has a strange "balance" and he wants to poise it. Actually,
2016-03-23 11:41:27 564
原创 HDU-1248 寒冰王座(完全背包)
题目:http://acm.split.hdu.edu.cn/showproblem.php?pid=1248思路:完全背包求最大价值代码:#include#include#include#includeusing namespace std;const int N = 50005;int v[N]={0,150,200,350},dp[N];int main(){ in
2016-03-22 22:21:25 526
原创 LightOJ 1232 Coin Change (II)(完全背包)
C - Coin Change (II)Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1232 DescriptionIn a strange shop there are n types of
2016-03-22 22:18:43 626
原创 LightOJ 1231 Coin Change (I)(部分背包)
B - Coin Change (I)Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ 1231 DescriptionIn a strange shop there are n types o
2016-03-22 22:15:28 777
原创 HDU 2099 整除的尾数(格式易题)
整除的尾数Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32799 Accepted Submission(s): 13877Problem Description一个整数,只知道前几位,不知道末二位,被另一
2016-03-20 11:02:08 718 1
原创 HDU 2955 Robberies(01背包)(动态规划)
RobberiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18375 Accepted Submission(s): 6797Problem DescriptionThe aspiring Roy th
2016-03-18 21:27:35 717
原创 HDU 1114 Piggy-Bank(完全背包)
Piggy-BankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18409 Accepted Submission(s): 9300Problem DescriptionBefore ACM can do
2016-03-17 12:02:38 523
原创 codeforces 632C C The Smallest String Concatenation(排序)
C - The Smallest String ConcatenationTime Limit:3000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 632CDescriptionYou're given a list of n
2016-03-16 22:28:46 646
原创 codeforces 632aGrandma Laura and Apples(构造)
A - Grandma Laura and ApplesTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticeCodeForces 632ADescriptionGrandma Laura came to the market
2016-03-16 22:03:58 548
原创 HDU 2602Bone Collector 01背包
Bone CollectorTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 45584 Accepted Submission(s): 18958Problem DescriptionMany years ag
2016-03-16 19:00:21 502
原创 HDU 1999 不可摸数(数论)
不可摸数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10904 Accepted Submission(s): 2831Problem Descriptions(n)是正整数n的真因子之和,即小于n且整除n
2016-03-15 22:14:38 609 1
原创 HDU 2674 N!Again (数论)
N!AgainTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4606 Accepted Submission(s): 2415Problem DescriptionWhereIsHeroFrom:
2016-03-14 22:40:31 463
原创 HDOJ 2176 取(m堆)石子游戏
取(m堆)石子游戏Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2461 Accepted Submission(s): 1443Problem Descriptionm堆石子,两人轮流取.只能在1堆中取.取
2016-03-12 18:10:09 638
原创 HDOJ 1730 Northcott Game(nim博弈)
Northcott GameTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3454 Accepted Submission(s): 1508Problem Description Tom和Jerry正在玩一
2016-03-12 17:35:59 588
原创 对博弈的认知,及刷题总结
博弈主要有两种,一种是bash博弈,另一种是nim博弈。 对于巴士博弈,基本定义见百度文库,其基本题目类型是:只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个。最后取光者得胜。 最简单的题目见杭电2188 2188,杭电2149,杭电1846都是较为简单的巴士博弈题目。而杭电1517和2897,则相对有些变化,因为它的类型从区间【1,n】变成了【m,n
2016-03-11 22:17:26 706
原创 HDOJ 1907 John (nim博弈)
JohnTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3904 Accepted Submission(s): 2211Problem DescriptionLittle John is playing ve
2016-03-11 21:32:14 518
原创 HDOJ 1029 Ignatius and the Princess IV(易题)
Ignatius and the Princess IVTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others)Total Submission(s): 24545 Accepted Submission(s): 10342Problem Description
2016-03-10 22:57:51 432
原创 HDOJ2897 邂逅明下(巴士博弈)
邂逅明下Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3685 Accepted Submission(s): 1678Problem Description当日遇到月,于是有了明。当我遇到了你,便成了侣。
2016-03-10 17:48:51 795
TA创建的收藏夹 TA关注的收藏夹
TA关注的人