Arek.姚远 的个人资料雄起的佛照片日志列表更多 工具 帮助
2007/6/28

Observations for Students[zz]

1. All learning occurs in the students" head.
2. At best, the teacher is only a coach to guide, encourage and criticize your style.
3. The purpose of the examples and exercises cannot be "to get the right answers", because they are already known! Their purpose, like that of running a mile, is to improve you.
4. Apparently, that which you actively learn for yourself you can use later creatively; that which you learn passively you can only use to follow others.
5. The attitude that you are here to be taught rather than to learn is counter productive. So is the attitude that you already know all that is really worth knowing.
6. If you want to succeed (in whatever way you believe is worthwhile), then failing to plan for that success is just plain foolish; you live only once.
7. The purpose of an education is to change you; especially the way you think. Often this is a painful process, but if it does not occur then your time in school was wasted; all you got was a degree.
8. Passively reading a book is not studying - time spent is not a measure of how much you study. Your problem is to get yourself into a mood where you actively want to learn, where you are searching for specific understanding.
9. If you find that the school and the professors are not perfect, then it is a good preparation for life! Profit from their defects.
10. While you need to learn current technologies to do things tomorrow and get ahead, experience strongly suggests that before you are ready to use it much of the material will be only partly relevant, some misleading, and some wrong. Cling to fundamentals, they seem to change more slowly.
11. If lifting 250 pounds is the final test in a weight lifting class, and you cut the weights in half, lift the two 125 pounds separately, and think that you can lift 250 pounds, you are only fooling yourself. Be careful that things that appear to make "getting through" a course easier are not just as foolish. Remember to develop yourself.
12. The most important things you can do while here are:
a. Learn to learn;
b. Learn to qusetion things;
c. Acquire the permanent habit of learning. 
2007/6/25

[zz]POJ1050 To the Max 解题报告

题目大意:

读入一个n*n的数组,比如

0 -2 -7 0

9 2 -6 2

-4 1 -4 1

-1 8 0 -2 

从里面任意截取一个矩阵,使得矩阵所包含的数字的和最大.

截取出来的矩阵,和为15

9 2

-4 1

-1 8

---------------------------------------------------------

POJ 1050 我的解题报告:

这个题目很经典的说,O(N^3)的DP。

首先偶们考察这样的题目,简化版:

已知一列数,求任意连续若干个数和的最大值。

SAMPLE: 3 2 -6 2 -1 7

原数3         2       -6        2       -1        7

处理3         5       -1        2        1        8

因为是连续若干个自然数的和,那么,前面的某个数字取与不取的条件在于:以前面这个数字为结尾的连续数的和最大值是否大于0,如果大于0,那么这个数字必然要会出现在包括数字的序列中,否则无法做到最大。

所以,显然。处理的原则是maxn[i]=max{0,maxn[i-1]}+a[i];

由于无须记录位置。所以,可以直接用一个变量sum代替maxn数组。O(n)的扫描即可。

单列数字的问题解决了,下面我们考察多列数字的

sample:

          0     -2     -7     0

          9      2     -6     2

         -4      1     -4     1

         -1      8      0    -2

 

我们可以将多列数字转换成单列数字来做! 可以这样设想,结果是一个长方形,我们把他压扁,使得宽为1。

引入辅助数组st,st[i][j]代表第i列从第1行开始的数字累加到第j行的值。那么,我们每次压扁的时候,就可以用st[i][j]-st[i][k-1]来表示第i列从第k个数字累加到第j个数字的值。达到压缩的效果。然后用上面单列数字的方法来做。算法时间复杂度O (N^3)

Source

 

Problem Id:1050   User Id:galaxy

Memory:112K   Time:0MS

Language:G++   Result:Accepted

 

/*

   Name:POJ 1050

   Copyright: flymouse@galaxy                                        

   Author:chenlei

   Date: 15-02-06 07:36

   Description: DP O(N^3)

*/

#include <stdio.h>

#include <string.h>

#define mt 101

int main()

{

int a[mt][mt];

int st[mt][mt];

int p,k,n,i,j,sum,maxn;

//freopen("in.txt","r",stdin);

scanf("%d",&n);

for (i=1;i<=n;i++)

for (j=1;j<=n;j++)

scanf("%d",&a[i][j]);

memset(st,0,sizeof(st));

for (i=1;i<=n;i++)

    for (j=1;j<=n;j++)

   st[i][j]=st[i][j-1]+a[j][i];

   maxn=0;

    for (i=1;i<=n;i++)

    {

for (j=i;j<=n;j++)

{

p=st[1][j]-st[1][i-1];

sum=p;

for (k=2;k<=n;k++)

{

if (sum>0)

sum+=st[k][j]-st[k][i-1];

else sum=st[k][j]-st[k][i-1];

if (sum>p) p=sum;

}

if (p>maxn) maxn=p;

}

    }

    printf("%d\n",maxn);

    return 0;

}  


original source:http://hi.baidu.com/flymouse/blog/item/fd1378f05c7ff7c37931aac3.html
 

2007/6/19

对不起,我是党员

党员之歌
我是党的一条狗,
站在党的大门口。
党叫咬谁就咬谁,
叫咬几口就几口!
昨天

话说2003年4月1日,愚人节,一个反共的共产党员出现了,那就是偶!
从此我入党的日子记得甭提有多熟了。
每当年华老去的时候,我会想起那一天。
每当被人整蛊的时候,我会想起那一天。
就是在那一天以后,以后工资的*%成为了党费。
就是在那一天以后,俺可以骄傲地骂共产党,为啥?因为这是自我反省!
就是在那一天以后,俺爸俺妈可以大声的说:“我不是党员,我儿才是党员!”

今天

师兄拿出一张1元的rmb,露出奇怪的眼神。仔细一看,原来有一面迎着所谓党团的什么宣传口号。
这伙人还真是有创意,利用这个来做宣传,高,实在是高!

这几天访问我的msn space都很奇怪,就是south park那个entry访问不起,一到评论block就马上转该页无法显示。让同学试,也是一样,猜想是评论搞的鬼!GFW!!!通过加密代理浏览一试,果然。两个反共评论!又是党团!

赞一个baidu的效率,高!昨天在baidu hi发的一个<黑砖窑结案了>,今天就被删了。
还是qq zone和msn space好!它好,我也好!

明天

明天?明天就是人的后颈窝,摸的着,看不着,可以有着unlimited imagination!
谁管呢?
只是希望所谓党团不要再来骚扰偶了,只想悄悄对它说:对不起,我是党员!

South Park主题曲歌词中英赏析

I'm going out to South Park
gonna have myself a time
我要离家乡
孤独去流浪
Friendly faces everywhere
humble folks without temptation
贫贱之交不忘
友谊久且长
I'm goin out to south park
gonna leave my woes behind
那里没有痛苦
那里没有哀伤
独坐不彷徨
Ample parking day or night
people spouting howdy neighbor
鸡犬声相闻
阡陌通八方
人渐行
家愈远
莫回首
I'm heading out to south park
to see if i cant unwind
我欲何往
何处可以得解放
I like girls with big fat titties
really big fat titties
窈窕淑女成行
任我左拥右抱
真他妈的爽
So come on out to south park
and meet some friends of mine
前路有知己
四海皆故乡
2007/6/18

黑砖窑结案了[zt]

全国总工会的张总下午召开新闻发布会,宣布了这一振奋人心的消息
发布会主要有以下几点精神:
1:案件性质为“严重侵犯农民工权益”
敢情现在中国八岁小孩都成民工了
看来不与时俱进真不行啊
2:案件是在山西公安的民爆物品排查行动中查出的
真是要感谢敬业的山西公安啊,真不知道那100多对父母是去旅游度假还是咋个的。
3:一名高官落马,那就是村支书兼县人大代表
估计接下来还有一系列的表彰大会
表彰奖励在此案中作出贡献的各级领导、工会人员及公安战警等
这么大一个案件能在这么快的时间内迅速结案,真是让人激动啊!
让我们为和谐盛世尽情欢呼吧
2007/6/2

六一游园记

为庆祝自己的第二十四个儿童节的到来,也为了对成都GDP做出自己应有的贡献,特提前买好了通票去国色天香耍耍。
    <记不来流水账,但是会当领导>
    一,鄙视篇!
    1.1
    国色天香这个名字名字首当其冲。一个游乐园,取个这个名字,真是没水准。
    1.2
    所谓的美国馆,日本馆,xx馆,名字倒是取得好听,可惜名不副实!无论是什么馆,其实里面都是卖东西的,更关键的是,卖的仍然是德克士和台湾热狗。
    1.3
    偌大一个游乐园,居然不知道把地图印到门票后面这一个基本常识。并且离开时乘车路线的提示牌放到也很成问题,第一次去的人都是绕了一圈才找对了的,然后才发现,“哦,原来tmd的还有提示牌,并且还是5米就是一个!”
    1.4
    里面的东西,贵是应该的,关键是还相当难吃。
    二,快乐篇
    2.1
    魔马秀还是不错的,自己近距离的看了看空中飞人,特别值得一提是那个圈圈带圈圈O---|---O。整个dd在空中旋转,一个圈站一个人。时而在圈内壁,时而在圈外壁。最绝的是在圈的外壁跳绳和蒙眼走,不要忘了整个dd还是空中旋转哦。
    2.2
    魔马秀出来,在排大风车的过程中,遇到了两个小mm,7,8岁的样子,甚是可爱,手上都写她大人的手机。她们在我们几个前面,晃来晃去,拼命的护着她们的turn。看我们要超队<当然偶们是假装的>,马上又是点穴,又是什么掌的,我们几个也甚是配合她们,被点穴了还得假装不能动。进门后,居然主动要我们中一女的和她们一起。阿姨,阿姨的叫的甚是好听~~最后分别时,两小孩一句,“阿姨再见,两小爸爸再见~”笑死我们了。
    2.3
    晚饭吃的相当爽啊。又是冷稀饭,又是凉菜,又是馒头,又是皮蛋,又是凉面,又是排骨汤,又是桃子,又是绿豆汤。。。啊,人生如此,足矣!
    三,总结篇
    由于是儿童节,大人带小孩来玩的居多。可怜天下父母心啊!排队的是父母,给钱的是父母,流汗的是父母,玩的却不是他们,而是那些不争气的用脚踢父母的小不点儿。转车时,看到一老爸对他儿大发脾气,狂扁,微微点点头,It's right time now.