Jzzhu has invented a kind of sequences, they meet the following property:
You are given x and y,
please calculate fn modulo 1000000007 (109?+?7).
Input
The first line contains two int...
分类:
其他好文 时间:
2014-07-22 22:49:33
阅读次数:
296
Jzzhu has a big rectangular chocolate bar that consists of n?×?m unit squares. He wants to cut this bar exactly k times.
Each cut must meet the following requirements:
each cut should be straig...
分类:
其他好文 时间:
2014-07-22 22:49:15
阅读次数:
192
在Mahout 学习(三)中,我贴了example的代码,里面生成向量文件的代码:InputDriver.runJob(input, directoryContainingConvertedInput, "org.apache.mahout.math.RandomAccessSparseVector...
分类:
其他好文 时间:
2014-07-19 14:14:04
阅读次数:
218
昨晚CF碰到的题目,昨晚CF跪了啊啊啊题意比较简单,给定一排挨在一起的板子,宽度都为1,高度不一,一个刷子宽度也是1,可以横着刷,也可以竖着刷,但是任何时刻刷子都要在板子上,也就是说,如果横向的时候,出现断层,就要算2次或者多次了 最后求全部刷完的最小刷的次数昨晚真的是想了各种方法,dp也想了,二分...
分类:
其他好文 时间:
2014-07-19 09:09:11
阅读次数:
228
给定n m kn和m为一个矩阵的行和列,都从1开始,矩阵的每个元素的值即为 i*j(行*列),求里面第k个数还想找什么规律,发现虽然矩阵里面很有规律,但是n 和m在不断变化 根本不好找其实元素从 1 到 n*m,直接二分,每次二分完后,枚举所有行,通过min(mid/i,m)可以马上得到该行小于等于...
分类:
其他好文 时间:
2014-07-18 17:28:08
阅读次数:
191
感觉动态规划很模糊,怎么办呢???
狂刷题吧!!!!!!!!!!!!!!!!!!!!!!!!!
1.POJ 2479 Maximum sum
首刷水题!!!!
双向统计最大和。
AC代码如下:
#include
#include
#include
#define inf -1000000000
using namespace std;
int main()
{
int ...
分类:
其他好文 时间:
2014-07-18 12:37:39
阅读次数:
228
分治!首先是一大块,贪行刷和竖刷的最小,再转化为小块。。。。。。。。。。。。
AC代码如下:
#include
#include
#include
using namespace std;
int n;
int a[5005];
int solve(int l,int r)
{
int i,j;
int len=r-l+1;
...
分类:
其他好文 时间:
2014-07-18 11:22:29
阅读次数:
229
题意就是将第一个字符串转化为第二个字符串,支持两个操作,一个是删除,一个是更换字符位置。
简单的字符串操作!!
AC代码如下:
#include
#include
#include
#include
#define M 50010
#define inf 100000000
using namespace std;
char a[1005],b[1005];
int la,lb;
bo...
分类:
其他好文 时间:
2014-07-18 11:03:48
阅读次数:
273
今天在VMWARE里安装了一个Linux 操作系统,重新启动后,出现如下的警告提示:
starting sendmail: make: warning: file 'sendmil.cf' has modification time 2.3e+04 in the future
clock skew detected. Your build may be incomplete
这个错误的...
分类:
其他好文 时间:
2014-07-17 14:39:55
阅读次数:
253
【吐槽】:本来没打算写这题的题解的,但惨不忍睹得WA了13次,想想还是记录一下吧。自己的“分类讨论能力”本来就很差。刚开始第一眼扫过去以为是LIS,然后忽略了复杂度,果断TLE了,说起来也好惭愧,也说明有时候太懒得动脑了,总是习惯利用惯性思维,这不是一件好事。【题意】:给你大小为n的整型数组a[n]...
分类:
其他好文 时间:
2014-07-15 09:34:02
阅读次数:
268