Live2d Test Env

随笔分类 -  优化技巧

摘要:注意一:卡map的时间,但是好好写+运气还是可以卡过,哇。。。求人品爆发 注意二:去前导0,毕竟‘0’也有ASCII码 阅读全文
posted @ 2017-10-23 20:39 nimphy 阅读(186) 评论(0) 推荐(0)
摘要:特殊的剪枝,整体上和辗转相除法有点像 #1599 : 逃离迷宫4 #1599 : 逃离迷宫4 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi被坏女巫抓进一座由无限多个格子组成的矩阵迷宫。 小Hi一开始处于迷宫(x, y)的位置,迷宫的出口在(a, b)。小Hi发 阅读全文
posted @ 2017-10-23 18:03 nimphy 阅读(210) 评论(0) 推荐(0)
摘要:Consider equations having the following form: a*x1^2+b*x2^2+c*x3^2+d*x4^2=0 a, b, c, d are integers from the interval [-50,50] and any of them cannot 阅读全文
posted @ 2017-10-22 20:20 nimphy 阅读(367) 评论(0) 推荐(0)
摘要:Given a permutation P of 1 to N, YY wants to know whether there exists such three elements P[i 1], P[i 2], P[i 3] that P[i 1]-P[i 2]=P[i 2]-P[i 3], 1< 阅读全文
posted @ 2017-10-22 19:43 nimphy 阅读(269) 评论(0) 推荐(0)
摘要:1599 逆向bfs+优化 #include<cstdio> #include<cstdlib> #include<iostream> #include<cstring> #include<algorithm> #include<string> using namespace std; int a, 阅读全文
posted @ 2017-10-20 15:56 nimphy 阅读(735) 评论(0) 推荐(0)
摘要:昨天睡得太晚,今天又在看新算法,明天事情也多,烦,所以今天刷刷水题就过去了。 叫我用线段树,我反而搞不来 阅读全文
posted @ 2017-10-17 19:28 nimphy 阅读(195) 评论(0) 推荐(0)
摘要:要是c语言可以和java一样写大数就好了,或者我会写重载就好了,最后还是只能暴力一把。 开始写的记忆化搜索,然而n=10就超过LL了 阅读全文
posted @ 2017-10-15 17:21 nimphy 阅读(134) 评论(0) 推荐(0)
摘要:像这样有维度的一定要记忆化啊。。。。。。。。。。。 阅读全文
posted @ 2017-10-15 15:52 nimphy 阅读(182) 评论(0) 推荐(0)
摘要:HDU1506 HDU2870 HDU4328 以前做的是单调队列的方法,现在试一试DP 注意的是对于i,向左延伸的L[i]到i不一定是单调的,比如1 3 2 1 2,对于i=4,L[i]=1而是2所以不能简单的和左边第一个比较 错: if(a[i]<=a[i-1]) L[i]=L[i-1]+1; 阅读全文
posted @ 2017-10-14 23:35 nimphy 阅读(307) 评论(0) 推荐(0)
摘要:Claris loves bitwise operations very much, especially XOR, because it has many beautiful features. He gets four positive integers a,b,c,da,b,c,d that 阅读全文
posted @ 2017-10-13 11:34 nimphy 阅读(333) 评论(0) 推荐(0)
摘要:思想:缩点+sap Max,t还可以缩小,优化,高数课写的,有点丑,暂时懒得改。 阅读全文
posted @ 2017-10-12 11:51 nimphy 阅读(214) 评论(0) 推荐(0)
摘要:(或与还可以用贪心的方式或者数学姿势来解决,想了一下,头疼,QwQ) 主要是注意几个细节: 1:拆点方式。大于一个ccl(巧克力)的要一个一个的拆点,而不是拆成一坨,毕竟要没到不同的盒子里。 2:循环对象。毕竟是cnt1!=cnt2 ,即男女不是1:1,有的人匹配不到,所以最后有空盒子。匹配的时候以 阅读全文
posted @ 2017-10-11 20:04 nimphy 阅读(206) 评论(0) 推荐(0)
摘要:开始以为是容斥原理,想着做一下,应该是可以用容斥解决的,有空再过来写一下。题解是进制转换,开始没想到,不过很好理解。 如在10进制里: 1254= (1*10^3 + 2*10^2 + 5* 10^1+ 4*10^0) 而faulty的大小:1254= (1* 8^3 + 2* 8^2 + 4* 8 阅读全文
posted @ 2017-10-11 08:08 nimphy 阅读(182) 评论(0) 推荐(0)
摘要:1,先离散化,然后DP: 注意这个解法中,dp[i][j][k]代表a序列中前i个和b序列中前j个数结尾为k或小于k时的最大。 但是由于i是单增(一次1->n),而j反复变化(多次1->m),因此i可以滚动,而j不可以。 2, LCIS套模板: 阅读全文
posted @ 2017-10-07 18:44 nimphy 阅读(139) 评论(0) 推荐(0)
摘要:大数MOD 阅读全文
posted @ 2017-09-27 21:06 nimphy 阅读(127) 评论(0) 推荐(0)
摘要:一:pow,曾经用递归溢出void _pow(int a,int b){ while(b){ if(b%2&1) { ans*a;b--; ans=ans*pow(pos(a,b/2),2); } else ans=ans*pow(pos(a,b/2),... 阅读全文
posted @ 2017-09-27 21:06 nimphy 阅读(620) 评论(0) 推荐(0)
摘要:Kinds of FuwasTime Limit: 2 Seconds Memory Limit:65536 KBIn the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the ... 阅读全文
posted @ 2017-09-27 21:06 nimphy 阅读(118) 评论(0) 推荐(0)
摘要:题目:一个由‘.’和‘#’组成矩形,统计里面'.'组成的矩形的个数。 点击打开链接 自己写挂了,懒得搞了 阅读全文
posted @ 2017-09-27 21:06 nimphy 阅读(201) 评论(0) 推荐(0)
摘要:最大字段和题型,推荐做题顺序: HDU1003 HDU1024 HDU1081 ZOJ2975 ZOJ2067 阅读全文
posted @ 2017-09-27 21:06 nimphy 阅读(230) 评论(0) 推荐(0)
摘要:Max Sum Plus Plus Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 31583 Accepted Submission(s): 1 阅读全文
posted @ 2017-09-27 21:06 nimphy 阅读(314) 评论(0) 推荐(0)