c/c++
chinaeli
这家伙很懒,什么都没留下。。。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
网络流(poj1459)
最近正在学习网络流,找了几道非常典型的简单网络流题,不用自己花心思去建图。----------------------------------------------------------------------------------DescriptionA powernetwork consists of nodes (power stations, consumers and disp原创 2008-10-17 01:18:00 · 2808 阅读 · 0 评论 -
生日蛋糕(noi99)
经过几天的研究。。。终于完成了生日蛋糕~(noi99)剪枝非常明显~注意:2*(n-v)/r+s>=opt,不能写成2/r*(n-v)+s,之前犯了这个错误,就tle,估计还可能是死循环。。。main函数里就不要用for循环了,用了也会tle.3个重要的剪枝:当已有体积加上剩余的最小体积大于总体积时剪枝;当已有面积加上剩余最小体积大于当前最优面积时剪枝;当2倍的剩余体积除以当前半径加上已有面积大于原创 2008-10-04 16:28:00 · 2643 阅读 · 1 评论 -
挺有意思的题(数独)poj2676
DescriptionSudoku is avery simple task. A square table with 9 rows and 9 columns is dividedto 9 smaller squares 3x3 as shown on the Figure. In some of the cellsare written decimal digits from 1原创 2008-10-05 18:01:00 · 2203 阅读 · 1 评论 -
求助noi99 生日蛋糕 cake
#include#includeusing namespace std;bool flag;const int oo = 1e10;int mins[21],minv[21],maxv[10001][21];int m,n,opt,rr[1000],hh[1000],bestr[1000],besth[1000]; void solve ( int v ,int s ,int level , in原创 2008-10-04 01:27:00 · 1115 阅读 · 1 评论 -
原来可以这样插入代码,以前没发现。。。
#includeusing namespace std;int main ( ){ cout"Hello , World"}//原来可以这样插入代码,以前没发现。。。随便发一个,试验一下~~原创 2008-10-04 15:58:00 · 761 阅读 · 2 评论 -
poj1321
Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <=原创 2008-10-04 21:11:00 · 1048 阅读 · 0 评论 -
线段树学习(3)离散化 POJ 2528
看了好多关于线段树离散化的资料,对离散化还是很陌生,于是尝试着做一道需要离散化的线段树题,来找一找感觉。资料上的离散化的知识,用不到题中(我好笨。。。),于是在网上找到了这题的代码,经过一番研究后,顿悟。POJ 2528 对于初学者来说,是道不错的题。-----------------------------------------题目-------------------------------原创 2008-10-23 23:15:00 · 6139 阅读 · 4 评论 -
线段树学习(2)POI Promotion
今天尝试写了一个线段树的题,POI2000 的Promotion,(参考了李睿的论文)一开始建了一个[1,1000000]的线段树,结果超内存了~后来hash了一下,优化了一下结构,但是wrong answer了,最后把所有的int改为了__int64,终于AC了------------------------------------------题目------------------------原创 2008-10-23 00:41:00 · 1150 阅读 · 0 评论 -
利用stl的map判重poj3087
DescriptionAcommon pastime for poker players at a poker table is to shuffle stacksof chips. Shuffling chips is performed by starting with two stacks ofpoker chips, S1 and S2, each stack containi原创 2008-10-08 22:34:00 · 1947 阅读 · 1 评论 -
Bloxorz很有意思的一个游戏(POJ3322)
DescriptionLittleTom loves playing games. One day he downloads a little computer gamecalled Bloxorz which makes him excited. Its a game about rolling abox to a specific position on a special原创 2008-10-10 00:31:00 · 2748 阅读 · 0 评论 -
线段树学习(1)
今天开始学习线段树,写了两个函数,也没有调试过,不知对不对~呵呵。。。#includeusing namespace std;struct segment_tree{ int l,r,n; struct segment_tree *left , *right;};void build ( segment_tree *t , int l , int r ){ int m; s原创 2008-10-14 01:31:00 · 577 阅读 · 0 评论 -
pku上的数据结构题
数据结构(1)串 (poj1035,poj3080,poj1936)(2)排序(快排、归并排(与逆序数有关)、堆排) (poj2388,poj2299)(3)简单并查集的应用. (4)哈希表和二分查找等高效查找法(数的Hash,串的Hash)(poj3349,poj3274,POJ2151,poj1840,poj2002,poj2503)(5)哈夫曼树(poj3253)原创 2008-10-11 20:49:00 · 752 阅读 · 0 评论 -
线段树小节
哎~由于智力因素,线段树看了N个星期,今天终于看懂了(只是停留在看懂的阶段,还不是用的很熟练)。线段树的数据结构:const int SIZE = 10010;const double EPS = 1e-6;int MAX = 99999999;struct node // the node of line tree{ int i,j; // 区间范围 node * lson;原创 2008-11-01 15:44:00 · 1122 阅读 · 0 评论 -
Range Minimum Query and Lowest Common Ancestor
Range Minimum Query and Lowest Common Ancestor Introduction Notations Range Minimum Query (RMQ) Trivial algorithms for RMQ A solution Sparse Table (ST) algorithm Segment Trees Lowes转载 2008-12-29 22:29:00 · 850 阅读 · 0 评论 -
突发奇想,对于a+b问题的一个另类代码。。。
#include using namespace std;class ANS{ int a,b;public: ANS(){cin>>a>>b;} ~ANS(){cout};int main ( ){ANS run;}哈哈,很奇特!原创 2008-11-24 01:14:00 · 774 阅读 · 0 评论
分享