Archive for 07月, 2010

我是谁?

Jul 31 2010 Published by yo2BcHo under 生活

跨过了16个年头,跨过了一年高中,跨过了一场场考试,跨过了半个暑假.
培根说过:历史使人明智;诗词使人灵秀;数学使人周密;自然哲学使人深刻;伦理使人庄重;逻辑修辞学使人善辨。那么喘喘流逝的时间又会使人发生什么变化呢?当然我更希望是化学变化,体内的肉快快变成脚上的肉吧!然而时间唯独在我的心胸汹涌流淌,点点滴滴在心头,剪不断,理还乱.

一位MM以过来人的身份告诫过:"16岁很幼稚,18岁成熟了,17岁刚刚好."
17岁的这一年已经过去了39天,我倒是还没有找到关于"刚刚好"的好在哪里,却被这浩荡而又不安的时光所折腾,想过不羁,也爱放荡与自由;幻想过采菊东篱下,悠然见南山;却还没有走出这个牢笼,日复一日,Here comes the saddest part ,the seasons are passing one by one;却被囧途包围,寻声暗问"我是谁?"

生活
小时候确实觉得抬头看看蓝天就可以拥有所有,但是再次抬头,不见蓝天;再别悲愁,才下眉头,又上心头.家里生活不是那么的好,有一对不定期就会吵起来的父母,有一个彪悍而又有时不讲道理的母亲,有一个父亲.一直很羡慕别人暑假去那里这里旅游,我只有坐在大地里,忙活着,忙着那个这个,忙,却鲜有快乐,忙,却不能疲倦.开始要为家里着想,开始要为人生漫漫路铺行,开始要为学费着想,开始要为父母吵架着想,开始要为避违父母着想,开始要为下一步着想.深吸一口气,淡定,淡定.
成功人士的事迹见过不少,但又有谁能告诉你漫漫人生的方向呢?我想,我需要一张地图.

地图
想在地图上标记出自己走过的痕迹,或许去过的地方很容易就被淡忘,可是一些人,一些事,一些情总会纠结在你的心头.
每每走在路上,万千思绪涌上心头.上一年的这个时候,正是夏季,正是初恋经历的时候.
走过夏天,踏过秋季,渡过寒冬,逃离倦春,
再没有继续,没有继续在地图上雕刻走过的路.
多少时光,雕刻这一份感觉?多少时光,摧毁这一份感觉?
遥想12个月以前,还在屁滚尿流地写下夏日里的甜蜜点滴,
曾几何时,想像着这些人的生活,并试图扮演他们.
差时症!差时症!为什么不能 患上差时症?
给我个机会,一个机会,以世纪为单位和你在一起?
不知道有否挂念当天丑小子?
极灿烂时光一去难再遇上一次.

孤独
我的心是一杯调和过的咖啡,怀念着往日淡薄的青草味,
想问你也问问自己,是否还会记得从前?

我是谁
这么久以来,时间都只在我身上汹涌流过,或许某一天找到另一个我时,就像瞬间经历整个人生,心里很平静.

No responses yet

最近的计划

Jul 25 2010 Published by yo2BcHo under OI,学习,生活

嗯,还有几天就8月了,最近一直在看搜索和切题,收获就是上一年的NOIP可以拿到二等了!

不过还是有许多不足的,所以得抓紧时间把搜索(双向,A*,IDDFS什么的)再看看,然后再学习DP.

最近在看lrj的黑书白书,黑书里面的东西实在是太太太太太难了,白书又有点不够.争取这个暑假白书竞赛篇和黑书第一章看完吧~

还想买部MP3啊~想在开学之后练VOA,看情况吧,希望人品真的能够提升.

No responses yet

NOIP2002p-马拦过河卒

Jul 23 2010 Published by yo2BcHo under OI,noip

题目描述

很不错的一道题目,一开始想用DFS去做,结果发现如果全图来遍历(20x20)的话铁定TLE,结果30分也拿不到...
后来看题解才知道用加法原理做,递推公式很简单啦,关键是马还控制自己那个点......

[cc lang="pascal"]const
dx:array[1..8]of longint=(2,1,-1,-2,-2,-1,1,2);
dy:array[1..8]of longint=(1,2,2,1,-1,-2,-2,-1);
maxn=22;
type
mm=array[-1..maxn,-1..maxn] of int64;
var
map,g:mm;
i,j,n,m,x,y:integer;

begin
readln(n,m,x,y);
fillchar(map,sizeof(map),0);
fillchar(g,sizeof(g),0);
for i:=1 to 8 do g[x+dx[i],y+dy[i]]:=1;
g[x,y]:=1;
map[0,0]:=1;
for i:=1 to n do
if g[i,0]=0 then map[i,0]:=map[i-1,0];
for j:=1 to m do
if g[0,j]=0 then map[0,j]:=map[0,j-1];
for i:=1 to n do
for j:=1 to m do
if g[i,j]=0 then map[i,j]:=map[i-1,j]+map[i,j-1];
writeln(map[n,m]);
end.
[/cc]

No responses yet

usaco-Superprime Rib

Jul 18 2010 Published by yo2BcHo under OI,USACO

题目描述
[cc lang="pascal"]{
ID:bcxx
PROG:sprime
LANG :P ASCAL
}
const
main:array[1..9] of integer=(23,29,31,37,53,59,71,73,79);
maxn=10000000;
var
i,n:byte;

function isPrime(n:longint):boolean;
var
i:longint;
begin
if n mod 2=0 then exit(false);
for i:=2 to trunc(sqrt(n)) do
if n mod i=0 then exit(false);
exit(true);
end;

procedure Search(num:longint;depth:byte);
var
i:integer;
begin
i:=1;
if depth=n
then writeln(num)
else
while i<=9 do
begin
if i=5 then inc(i,2);
if isPrime(num*10+i) then Search(num*10+i,depth+1);
inc(i,2);
end;
end;
begin
assign(input,'sprime.in' ;) ;reset(input);
assign(output,'sprime.out' ;) ;rewrite(output);
readln(n);
if n=1 then begin writeln('2' ;) ;writeln('3' ;) ;writeln('5' ;) ;writeln('7' ;) ;end;
if n=2 then for i:=1 to 9 do writeln(main[i]) else
for i:=1 to 9 do Search(main[i],2);
close(input);close(output);
end.
[/cc]
好久没有做过那么简单的题目了啊...直接数学方法解决!

USER: bcxx Ho [bcxxxxx1]
TASK: sprime
LANG: PASCAL

Compiling...
Compile: OK

Executing...
Test 1: TEST OK [0.000 secs, 208 KB]
Test 2: TEST OK [0.000 secs, 208 KB]
Test 3: TEST OK [0.000 secs, 208 KB]
Test 4: TEST OK [0.000 secs, 208 KB]
Test 5: TEST OK [0.000 secs, 208 KB]

All tests OK.
YOUR PROGRAM ('sprime') WORKED FIRST TIME! That's fantastic
-- and a rare thing. Please accept these special automated
congratulations.

No responses yet

usaco-Arithmetic Progressions

Jul 17 2010 Published by yo2BcHo under OI,USACO

暴力搜索...
题目描述
自己写的搜索剪枝太差了,第7个点以后的过不了...

[cc lang="pascal"]{
ID:bcxx
PROG:ariprog
LANG :P ASCAL
}
type
bis=array[1..125000] of boolean;
lBis=array[0..40000] of longint;
aa=array[0..10000,0..1] of longint;
var
listBis:lBis;
bisquares:bis;
ans:aa;
n,m:integer;
procedure qsort(l,r:longint);
var
i,j,k,t:longint;
begin
i:=l;j:=r;
k:=listBis[(i+j) div 2];
repeat
while listBis[i]k do dec(j);
if ij);
if il then qsort(l,j);
end;
procedure qsort2(l,r:longint);
var
i,j,k1,k2,t:longint;
begin
i:=l;j:=r;
k1:=ans[(i+j) div 2,1];
k2:=ans[(i+j) div 2,0];
repeat
while (ans[i,1]<k1) or ((ans[i,1]=k1) and (ans[i,0]k1) or ((ans[j,1]=k1) and (ans[j,0]>k2)) do dec(j);
if ij;
if il then qsort2(l,j);
end;
procedure Init;
var
i,j,k:longint;
begin
readln(n);readln(m);
k:=0;
fillchar(listBis,sizeof(listBis),0);
fillchar(bisquares,sizeof(bisquares),false);
for i:=0 to m do
for j:=0 to m do
begin
if bisquares[i*i+j*j]=false then
begin
inc(k);
bisquares[i*i+j*j]:=true;
listBis[k]:=i*i+j*j;
end;
end;{end for,mark the bisquares}
listBis[0]:=k;{store bisquares length}
qsort(1,k);
end;
function calAri(a,b:longint):longint;
begin
exit(abs(b-a));
end;
procedure Find;
var
i,j,tempBis,tempLength,a,b,k,counter:longint;
begin
counter:=0;
for i:=1 to listBis[0]-n do
begin
for j:=i+1 to listBis[0] do
begin
a:=listBis[i];k:=2;tempLength:=2;
b:=calAri(listBis[j],listBis[i]);
repeat
tempBis:=a+k*b;
if (bisquares[tempBis])then
inc(tempLength);
inc(k);
until (bisquares[tempBis]=false);
if tempLength>=n
then begin
inc(counter);
ans[counter,0]:=a;
ans[counter,1]:=b;
end;
end;{end for}
end;
if counter=0 then writeln('NONE') else
begin
qsort2(1,counter);
for i:=1 to counter do writeln(ans[i,0],' ',ans[i,1]);
end;
end;
begin
assign(input,'ariprog.in');reset(input);
assign(output,'ariprog.out');rewrite(output);
Init;
Find;
close(input);close(output);
end.
[/cc]
赶明儿把剪枝写好吧~囧...

No responses yet

USACO-Clocks

Jul 17 2010 Published by yo2BcHo under OI,USACO

题目描述
[cc lang="pascal"]{
ID:bcxx
PROG:clocks
LANG :P ASCAL
}
const
operation:array[1..9,0..5] of integer=((4,1,2,4,5,0),
(4,1,2,3,0,0),
(4,2,3,5,6,0),
(3,1,4,7,0,0),
(5,2,4,5,6, 8) ,
(3,3,6,9,0,0),
(4,4,5,7,8,0),
(3,7,8,9,0,0),
(4,5,6,8,9,0));
type
cc=array[1..9] of byte;
var
move,clock:cc;
procedure Init;
var
i,j,counter:integer;
begin
assign(output,'clocks.out');rewrite(output);
assign(input,'clocks.in');reset(input);
counter:=1;
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
read(clock[counter]);
clock[counter]:=clock[counter] div 3;
inc(counter);
end;
end;{end reading the clock}
end;
procedure PrintMove(m,c:cc);
var
i,j:integer;
ans:string;
begin
for i:=1 to 9 do
if c[i] mod 40 then exit;
ans:='';
for i:=1 to 9 do
for j:=1 to m[i] do
ans:=ans+chr(i+4 8) +' ';
delete(ans,length(ans),1);
writeln(ans);
close(input);close(output);
halt;
end;
procedure Search(depth:byte;c:cc);
var
i,j:integer;
begin
if depth=10 then PrintMove(move,c)
else
for i:=0 to 3 do
begin
move[depth]:=i;
for j:=1 to operation[depth,0] do
inc(c[operation[depth,j]],i);
Search(depth+1,c);
for j:=1 to operation[depth,0] do
dec(c[operation[depth,j]],i);
end;{end for}
end;{end Search}
begin
Init;
Search(1,clock);
end.

[/cc]

朴素搜索,关键是每种方法可以用0~3次

最近一直在考虑要不要转C...可是对于C的字符串之类的东西真是不熟悉啊,连个hello name都不会做~

No responses yet

统计数字

Jul 15 2010 Published by yo2BcHo under OI,学习

题目描述

一年级的英语课上,,

老师在黑板上写着一个句子,,
问你这个句子有多少个单词

你不屑于回答这种问题,
所以你打算编一个程序来回答。

思路

是否是一个单词,关键就是看前面一个字符是不是字母和当前字符是不是字母

将前面一个字符记作pre,当前字符记作now,

[cc lang="pascal"]if (letter[ord(pre)]=false) and (letter[ord(now)]) then inc(counter)[/cc]

其中letter是ascii码表数组,脚标是1~128

话说这种水题我一直都不会做啊...今天爬百度才知道= =

不知道wordpress的后台是不是用这个算法来统计的呢?因为中文输入的情况下,word count是错的......

No responses yet

暑假计划

Jul 14 2010 Published by yo2BcHo under 学习,生活

0.早睡早起

1.OI方面继续搜索和DP的学习,

2.多去切题,希望USACO能做到3

3.把研究性学习的网站重写

4.配置好ubuntu(麻痹,ibus真是垃圾啊)

5.多看几本书,多看几部电影

6.听听VOA,学学英语

No responses yet

Installing&Config on ubuntu&openbox

Jul 14 2010 Published by yo2BcHo under linux,学习

Install with USB disk

因为这个lubuntu的特殊性(bug吧,xubuntu没有这个情况),所以在用usb-creator时记住选Discarded on shutdown(就是默认写入内存,而不是U盘)

Installing

安装时没有多大问题,因为ubuntu出了名是傻瓜的.

Source配置

Path: /etc/apt/source.list

我觉得用官方源和163的就已经足够了(当然ppa也是需要的,日后再加)

然后当然是

[cc lang="bash"]sudo apt-get update

sudo apt-get upgrade[/cc]

考虑到我机器的特殊性,所以我直接将lxde去除了

[cc lang="bash"]sudo apt-get remove lxde[/cc]

只用openbox做wm,顺带装上obmenu obconf tint2

[cc lang="bash"]sudo apt-get install obmenu obconf tint2[/cc]

终端方面选用urxvt

配置文件
[cc lang="bash"]! font
URxvt.font :x ft :D ejaVu Sans Mono:pixelsize=14,xft:LiHei Pro:pixelsize=14

! color
URxvt.foreground:#FFFFFF
URxvt.background:#2E3436
URxvt.color0:#2E3436
URxvt.color1:#CC0000
URxvt.color2:#4E9A06
URxvt.color3:#C4A000
URxvt.color4:#3465A4
URxvt.color5:#75507B
URxvt.color6:#06989A
URxvt.color7:#D3D7CF
URxvt.color8:#555753
URxvt.color9:#EF2929
URxvt.color10:#8AE234
URxvt.color11:#FCE94F
URxvt.color12:#729FCF
URxvt.color13:#AD7FA8
URxvt.color14:#34E2E2
URxvt.color15:#EEEEEC

! follow URL
URxvt.urlLauncher:chromium-browser
URxvt.matcher.button:1
Urxvt.perl-ext-common:matcher

! scrollbar
URxvt.scrollBar:False
!URxvt.scrollBar_right:True
!URxvt.scrollBar_floating:False
!URxvt.scrollstyle:plain
URxvt.saveLines:500

! other
Rxvt.preeditType:Root
[/cc]

然后就是做了点美化,都是些很简单的东西.至于vim配置,rc.xml捆佳节又重阳绑之类的以后再贴,当然,备份包什么的还是需要的,赶明儿写几个脚本

No responses yet

新的开始,新的杯具

Jul 13 2010 Published by yo2BcHo under linux,,生活

话说期末考试的杯具还没过去,家里的电脑又出现杯具了.

因为内存被降级成512M,所以用XP娘都会卡,所以就想回到linux了.关注了下ubuntu 10.04 和arch 10.05(话说arch真的是好东西啊!但是为什么我装了半秃呢,待会讲),然后试了下xubuntu...杯具了,xubuntu和xp娘一样卡,要我情可以堪?本以为xfce应该比gnome这种大而无当的东西会好一点...结果却发现是相差不多啊,在官方那里看到的内存是300M+,结果我刚装完就发现内存加上burffer之后还剩4MB...要人怎么活啊,囧!

然后呢,觉得还是装arch吧,下载了那个号称可dd去U盘的iso,结果呢,结果是不能启动......再回去下09.08的img,结果还是不行...玩的不是linux,玩的是rp,上次还行,这次就没有任何反应了...加上ubuntu 1004是LTS,而且家里网速又不是一般的慢(512K下行/78包月,电信真js)

好吧,下决心用lubuntu吧,在我苦苦等待下载完镜像之后,迫不及待地dd了镜像到u盘之后...你猜发生了什么?啊呀,居然能启动了!看见了live cd的选项,太好了!比那个arch好多了,LTS果然是LTS!在赞美的同时,已经load到了install part----然而杯具总是接踵而至,这次直接弹个busybox出来,说是can not mount /dev/loop1 on /cow,哎呀,那是多么的心急如焚啊,无奈只能切回去查......天啊,居然说不能让live cd在booting时写入USB...只好重来呗,唉,linuxer就是浪费时间在折腾上了.

到了最激动的分区环节了,本来已经用纸写好了划法,可杯具的光芒却引领我点向use the entire disk,结果满盘电影没了,重要的资料没了...杯具啊...

好吧,好吧,我承认我该打,重格了那么多次,硬盘你要撑着啊!

结果我就在杯具中回到了linux的怀抱,现在的工作环境是ubuntu 1004+openbox,用着还行,编译时有点卡,估计到时会觉得抓襟见肘了,不管如何,还是用着吧,毕竟还要切题,还要上网...不过让我欣惠的是,现在ubuntu(应该说是wqy的功劳吧)的字体越来越好看了.

No responses yet

Next »