
需要注意的
文章平均质量分 67
akxxsb
写写博客装装逼,存代码
展开
-
hdu 2044 (水题)
简单递推,还是wa了很多次没过,原来hdu的long long要用%I64d才能过。。。不明白,不是只比对输出的吗。。。。#define Max 55#includeint M;char s[Max];int a,b;long long c[Max];int main(){ //freopen("input.txt","r",stdin); scanf("%d\n"原创 2014-02-22 01:34:57 · 988 阅读 · 0 评论 -
微软面试题之以递增顺序打印2^i*3^j*5^k
以递增顺序打印出2^i*3^j*5^k的前n项。假设当前已经求出第x项,那么第x+1项一定是由前x项中的某项乘2,或乘3,或乘5,得到的大于第x项中最小的那个数,于是我们立即得到一个n^2的算法,代码如下#include using namespace std;typedef long long LL;const int MAX = 1e4+10;LL a[MAX];int main原创 2015-01-21 21:38:07 · 1698 阅读 · 1 评论 -
ural 2030
Awesome Backup SystemTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice URAL 2030DescriptionIt is known that all people can be d原创 2014-12-02 00:03:15 · 1551 阅读 · 0 评论 -
POJ 2513(字典树hash+并查集+欧拉通路)
Colored SticksTime Limit: 5000MS Memory Limit: 128000KTotal Submissions: 31015 Accepted: 8180DescriptionYou are given a bunch of wooden sticks. Each endpoint of e原创 2014-10-21 23:21:27 · 1280 阅读 · 0 评论 -
POJ 3380 最大流
L -ParatroopersTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 3308Appoint description:DescriptionIt is year 2500 A.D. and t原创 2014-10-15 00:29:22 · 1305 阅读 · 0 评论 -
hdu 5015 233 Matrix(最快的搞法)
233 MatrixTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 191 Accepted Submission(s): 125Problem DescriptionIn our daily lif原创 2014-09-14 22:03:35 · 2405 阅读 · 5 评论 -
C. DZY Loves Sequences
C. DZY Loves Sequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDZY has a sequence a, consisting of n原创 2014-07-14 16:10:55 · 1062 阅读 · 0 评论 -
暴力??
又是苹果Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)Total Submission(s) : 54 Accepted Submission(s) : 12Font: Times New Roman | Verdana | GeorgiaFont原创 2014-08-23 22:48:38 · 1254 阅读 · 0 评论 -
UVA 133(循环链表)
C - The Dole QueueTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescription The Dole Queue In a serious attempt to down原创 2014-05-16 15:08:43 · 1311 阅读 · 0 评论 -
HDU 2095
好吧,这题我开始先排序超时了,后来用了异或,再次见识到位运算的强大。。。 我们知道A^A=0A^0=A所以只要把输入的数字全部异或 那么留下来的就是奇数个的数字。find your present (2)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/1024 K (Ja原创 2014-03-31 22:19:43 · 1128 阅读 · 0 评论 -
湘潭大学第八届程序设计竞赛B题
本题要注意测试数据相当的多啊,所以要先构造出所有解并排序,然后用二分查找即可Bob's ProblemAccepted : 29 Submit : 193Time Limit : 1000 MS Memory Limit : 65536 KB 题目描述Bob今天碰到一个问题,他想原创 2014-03-15 19:44:23 · 1393 阅读 · 0 评论 -
哈理工校赛1C题
C.长长长长龙Time Limit: 3000 MSMemory Limit: 32768 KTotal Submit: 202 (73 users)Total Accepted: 50 (46 users)Special Judge: NoDescription时间:今天是原创 2014-03-09 23:33:24 · 1318 阅读 · 0 评论 -
hdu 2058(水)
#include#define MAX 1000010int N,M;int ans1[MAX],ans2[MAX];int main(){ //freopen("input.txt","r",stdin); while(scanf("%d%d",&N,&M)!=EOF) { if(!M&&!N)return 0; int t=-1; for(i原创 2014-03-05 22:48:43 · 883 阅读 · 0 评论 -
uva 465
要说的都在注释里#include#include#define MAX 10010#define LL strlenchar INT_MAX[15]="2147483648";int judge(char *str){ int len=LL(str),ok=LL(INT_MAX); if(len<ok)return 0; if(len==ok&&strcmp(INT_原创 2014-03-02 19:35:15 · 1176 阅读 · 0 评论 -
hdu 2046(递推)
n规模的格子只能从n-1和n-2得来,n-1的时候我们增加一个2×1格子,竖着放,可以有f(n-1)种放法,n-2时候我们可以增加2×2个格子,2个都横着放,可以有f(n-2)种方法。注意本题思想不错,如何从一种状态达到另一种状态,递归有时候还是很有用的。#define Max 55#include#include#includeint n;long long c[Max];i原创 2014-02-24 00:26:47 · 958 阅读 · 0 评论 -
POJ 1742(特别技巧之多重背包转完全背包)
DescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e.,原创 2014-04-15 19:46:57 · 1135 阅读 · 0 评论