- 博客(8)
- 资源 (4)
- 收藏
- 关注
原创 Codeforces Round #216 (Div. 2)
A.分别记录两种食物的数量,先统计第一种洗盘数,后统计第二种洗餐具数。#include#include#include#include#include#include#include#include#include#include#include#define PI acos(-1.0)#define maxn 160#define INF
2013-11-30 12:25:07 1010
原创 UVa 11181 Probability|Given
Problem GProbability|GivenInput: Standard InputOutput: Standard Output N friends go to the local super market together. The probability of their buying something from the market is respectiv
2013-11-29 09:32:49 983
原创 UVa 10047 The Monocycle
The MonocycleA monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special. It has a solid wheel colored with five different colors as shown in the f
2013-11-29 08:10:14 889
原创 Timus 1057 数位dp
1057. Amount of DegreesTime limit: 1.0 secondMemory limit: 64 MBCreate a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactlyK different integer de
2013-11-28 13:14:07 802
原创 hdu 1506 Largest Rectangle in a Histogram
Largest Rectangle in a Histogramdp。思路:分别用两个数组记录对应的每个矩形左侧和右侧高度大于等于它本身的矩形的数量,这样用(高度*(左侧数量+右侧数量+1))即可表示对应高度的最大矩形面积。100000的数据量用O(n2)的暴力肯定会T,分别从左到右更新左侧数量和从右到左更新右侧数量。刚开始用long long 一直wa,后来改成__int64就过了。
2013-11-21 13:32:58 882
原创 hdu 3037 Saving Beans
lucas原理加乘法逆元。1.卢卡斯原理。设为质数,,且,,其中都是整数,。。 2.乘法逆元求(a/b)%c,但a又特别大,就要求乘法逆元k,使(a*k)%c与(a/b)%c等价。满足a*k≡1(modc)的k值就是a关于c的乘法逆元。证明略过,可以用欧几里得扩展算法或欧拉定理求得。欧拉定理表明,若
2013-11-20 02:13:02 914
原创 HDU 1864 最大报销额
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1864刚开始题意理解错了,没看明白题里单项物品是什么意思,还脑抽的用dfs写了一下,结果T掉了。其实就是01背包问题。英语题读错尚且能找理由,汉语题读错就太逗了。浮点型保留两位小数直接把数据乘100就能处理了。#include#include#include#include#incl
2013-11-18 11:07:48 657
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人