摘要:
The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ... 阅读全文
摘要:
5-27 QQ Account Management (25分)You are supposed to implement the functions of account “Log in” and “Register” for the most popular instant... 阅读全文
摘要:
http://codeforces.com/problemset/problem/687/A 阅读全文
摘要:
实现一种简单原始的文件相似度计算,即以两文件的公共词汇占总词汇的比例来定义相似度。为简化问题,这里不考虑中文(因为分词太难了),只考虑长度不小于3、且不超过10的英文单词,长度超过10的只考虑前10个字母。输入格式:输入首先给出正整数NNN(≤100\le 100≤100),为文件... 阅读全文
摘要:
DP基础吧。A掉还是挺爽的。就是考虑在两端只能是从前一秒的内部一米或原来的点来进行,但是在5秒以内可到达点是逐渐外扩的,并不是[0,10],所以就特殊考虑了一下。后面两端是0和10,中间的点可以从上一秒的左边/本身/右边过来,保证每次最优这样下来就好了。#include #incl... 阅读全文
摘要:
习题4-2 求幂级数展开的部分和 (20分)已知函数e^x可以展开为幂级数1+x+x2/2!+x3/3!+⋯+xk/k!+⋯1+x+x^2 /2! + x^3 /3! + \cdots + x^k /k! + \cdots1+x+x 2/2!+x3/3!+⋯+xk/k!+⋯。... 阅读全文
摘要:
基础DP。#include #include #include #include #include #include #include #include #include #include using namespace std;#define LL long long#defin... 阅读全文
摘要:
O(nlog(n))的方法; 定义d[k]:长度为k的上升子序列的最末元素,若有多个长度为k的上升子序列,则记录最小的那个最末元素。 d中元素也是单调递增的。#include #include #include #include #include #include #include... 阅读全文
摘要:
这道题目的DP,写到现在才明白。。。 每次加或者不加的条件就是这个前面这个子序列合是不是大于等于0,如果不是加了就会让这个位置的值没有意义,如果大于0,他还是在往递增的方向继续前进。 以及这个条件的继续理解:我想用三个例子 )1:5 -1 -2 -3 )2:5 1 -2 )3:5 ... 阅读全文