文章列表
 
您正在查看 "Usaco" 分类下的文章

2009/04/08 22:29
N久没去做USACO了,今天看了一题以前完全没思路的DP题,今天居然想到了怎么做
(-_-!!PKU类似题~被虐完以后有感触了的说,看来DP需要积累啊)

从后到前的DP,学习学习了:)
USER: A e [chenh193]
TASK: range
LANG: C++

Compiling...
Compile: OK

Executing...
Test 1: TEST OK [0.000 secs, 3208 KB]
Test 2: TEST OK [0.011 secs, 3212 KB]
Test 3: TEST OK [0.000 secs, 3204 KB]
 
2009/02/27 16:33
USER: A e [chenh193]
TASK: camelot
LANG: C++

Compiling...
Compile: OK

Executing...
Test 1: TEST OK [0.011 secs, 8284 KB]
Test 2: TEST OK [0.011 secs, 8284 KB]
Test 3: TEST OK [0.022 secs, 8284 KB]
Test 4: TEST OK [0.011 secs, 8280 KB]
Test 5: TEST OK [0.076 secs, 8284 KB]
Test 6: TEST OK [0.097 secs, 8280 KB]
Test 7: TEST OK [0.011 secs, 8280 KB]
 
2009/02/17 21:08
Sweet Butter
Greg Galperin -- 2001

Farmer John has discovered the secret to making the sweetest butter in all of Wisconsin: sugar. By placing a sugar cube out in the pastures, he knows the N (1 <= N <= 500) cows will lick it and thus will produce super-sweet butter which can be marketed at better prices. Of course, he spends the extra money on luxuries for the cows.

FJ is a sly farmer. Like Pavlov of old, he knows he can train the cows to go to a cer

 
2009/02/17 18:16
Magic Squares
IOI'96

Following the success of the magic cube, Mr. Rubik invented its planar version, called magic squares. This is a sheet composed of 8 equal-sized squares:

1 2 3 4
8
 
2009/02/06 22:40

PKU已经挂了6天了,一直想验证自己写的logn的计算n!最后一位的算法是否正确,这次USACO告诉我我写对了!

USER: A e [chenh193]
TASK: fact4
LANG: C++

Compiling...
Compile: OK

Executing...
Test 1: TEST OK [0.000 secs, 4000 KB]
Test 2: TEST OK [0.022 secs, 4000 KB]
Test 3: TEST OK [0.000 secs, 3996 KB]
Test 4: TEST OK [0.011 secs, 3996 KB]
Test 5: TEST OK [0.011 secs, 3996 KB]
Test 6: TEST OK [0.
 
2009/02/06 22:39

easy dp.

dp[i]表示达到i分所需要的最少的邮票数,如果扫描到某个i超出了所给出的限制,那么输出i-1.

dp[i]=min(dp[i-s[j]]+1) (i-s[j]>=0&&1<=j<=stacnt)

代码就不贴拉

荒废了好几天...终于进3.2了...

 
2009/02/06 22:39

本人使用字符集为{'0','1'}的trie AC掉了,不过该题的输入输出比较恶心...因为这个错了好几次...

USER: A e [chenh193]
TASK: contact
LANG: C++

Compiling...
Compile: OK

Executing...
Test 1: TEST OK [0.011 secs, 8524 KB]
Test 2: TEST OK [0.011 secs, 8520 KB]
Test 3: TEST OK [0.011 secs, 8524 KB]
Test 4: TEST OK [0.022 secs, 8520 KB]
Test 5: TEST OK [0.130 secs, 8652 KB]
Test 6: TEST OK [0.238
 
2009/02/06 22:38

由于数据规模实在大的BT,所以只能使用离散化构线段树...

首先对x离散化,然后构造一个一维的线段树,并重复操作,最后统计该X区间内所有颜色映射在Y上的长度,就可以得到这个区间内的每种颜色的面积,至于颜色1,我是在最后把n*m减去所有颜色的面积得到的。。

最后一个BT数据跑了1。3XS才过。。。瀑布汗....

USER: A e [chenh193]
TASK: rect1
LANG: C++

Compiling...
Compile: OK

Executing...
Test 1: TEST OK [0
 
2009/02/06 22:36

第一次接触flood fill,不过做完才发现原来这就是所谓的flood fill...我怎么觉的就是土土BFS呢....

我的思路是找到2个出口,做2次BFS,更新每一格的值,对于每一个格来说取最小的,最后取所有的格子中的最大值就可以了...还是不能理解flood fill是啥~标程怎么写的也和BFS长那么象~

不管如何总算AC了...

呵呵现在最喜欢的就是看到下面这种情况了..

Executing...
Test 1: TEST OK [0.011 secs, 3124 KB]
Test 2: TEST OK [0.000 secs, 3124
 
2009/02/06 22:34

Checker Challenge

Examine the 6x6 checkerboard below and note that the six checkers are arranged on the board so that one and only one is placed in each row and each column, and there is never more than one in any diagonal. (Diagonals run from southeast to northwest and southwest to northeast and include all diagonals, not just the major two.)

Column
 
2009/02/06 22:33

原文翻译:

翻译者:timgreen

转载自:OIBH

一个等差数列是一个能表示成a, a+b, a+2b,..., a+nb (n=0,1,2,3,...)
在这个问题中a是一个非负的整数,b是正整数。
写一个程序来找出在双平方数集合S中长度为n

 
 
   
 
 
文章分类
 
   
 
文章存档
 
     
 
最新文章评论
  

猜到你把m出成20的用意了 。。。我只随机了30次,而没有随机到有解为止,难道就是这
 

orzorz
 

YM啊
 

福大核武 景润后人 Orz!!!
 

福大核武 景润后人 Orz!!!
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu