我真搓
这两场比赛都很郁闷,感觉像梦游,而且都是刚好在这两场加权的网络赛上。- -!
其他队员经过一个暑假集训都成长了好多,但我却好像根本没什么进步,现在也许我是整个集训队最弱的队员吧。记得暑假刚开始,lcy老师曾经在论坛里发贴跟我说:高手都是要以题量为保证的,指出我做题的数量太少。那时候我也听进去了,但心里总还有一点觉得我被刘老师给bs了。今天想想,觉得其实完全不是那样的,正是因为对我抱有期望所以才来指出我的短处啊。唉~~暑假都结束一个月了,可以看看我的这三个月来,只做了那么点题目,专题的跟进更是不行,跟托蒂简直不能比,太可怜啦。。
自从被szm指责后,我已经改掉了老喜欢发表决心的毛病了。但我觉得这次真的有必要下一次决心,要把以前落下的都一样一样补上!
08-9-27
非常舒服的天气,也许是lcd盯太久了,偶尔抬头看天,就会有一种刺眼+震撼的感觉。那种湛蓝的颜色以及从视线边际射过来的光线让我不得不眯着眼睛,但是又充斥着就这么一直看下去的欲望。
是不是说明我真的变成一个宅男啦。
不知道为什么,如果被室外的风吹到有点凉意的时候,就会不由自主回忆起很多小时候的事情。且第一个闪过的画面总是自己趴在窗户边羡慕那些在楼下嬉戏的小孩,因为那时的我就很懒,总是不爱做作业所以老被老妈关在家里;那时候从窗外冲进来的风印象中就是这么带着点低温的伤感的。而后就是想起小学时老爸老妈常常带着我出去郊游的情景,低年级的我还是很乖的,每次都很快的把作文以外作业完成,然后星期天就可以出去郊游啦,我总是手里拿着一份树枝在行人踏出的小路上跑来跑去,并且去抽那些路边的野草。因为郊游大部分都在春天和秋天出去,地点也都在山上或者水边,那时候的风也是凉飕飕的。那时候应该还留下了蛮多照片的,不过我从高中后好像就没有去看过了,也许老爸老妈还偶尔会翻一下吧。
长大到底是好还是坏,很难说啊……
8-20流水帐
看来铃声很有必要换一下,明明是7:30的闹钟,我就偏偏到了8:23才醒来。看到时间差点吓死啦,洗脸刷牙穿衣服,然后把本本和饼干塞进包里,等我冲出寝室时时8:28,有史以来起床最迅速的一次(-_-!)。
到了实验室,还好Teddy已经把机器都开好了(身为队长就是不一样啊),王云斌也在临比赛前赶到,9:00哈尔滨赛区的网络赛就开始啦。比赛过程中我有很多失误,三个人配合的不是很好,蛮郁闷的,就不多说了。
2:00比赛结束后,教练把我们都拉出去吃饭,看了下他脸色MS不太好,有种会被拉到墙角枪毙的感觉。。。不过后来也没发生什么哈。我们学校的食堂这时候都关门了,小饭馆ms也容纳不下我们全部人,最后都去了传媒的食堂吃盖浇饭,中间大家都一直在调侃托蒂,弄得托蒂脸红耳骚,哈哈。餐后买单的时候教练和几位老队员ms激动了一把,不停得喊100、100,那时候没搞清楚状况,后来才知道,现在为了鼓励消费者要发票,上面都有刮奖,一碗盖浇饭开一张发票,怪不得,哈哈。
Read the rest of this entry »
HDOJ 1043
八数码问题,pku上的数据太弱了,zju还在升级中(非常期待啊),我的代码在hdoj上跑了14XXms,用的是优先队列+bfs。
明天整个白天都有课,等有空了再优化吧,花了一天多的时间A了这题,贴下代码先。
- #include <iostream>
- #include <queue>
- using namespace std;
- #define END 123456789
- int hash[362880];
- short path[362880];
- int fa[362880];
- char eight[25];
- int fi[9]={0,1,2,6,24,120,720,5040,40320};
- int ten[10]={1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000};
- inline int lt(const int &x)
- {
- return x-1;
- }
- inline int rt (const int &x)
- {
- return x+1;
- }
- inline int up(const int &x)
- {
- int t0=10-x%10;
- int t1=x/ten[t0];
- int t2=t1%1000;
- t1=t1-t2+(t2%100)*10+t2/100;
- t1*=ten[t0];
- return (t1+x%ten[t0]-3);
- }
- inline int dn(const int &x)
- {
- int t0=7-x%10;
- int t1=x/ten[t0];
- int t2=t1%1000;
- t1=t1-t2+(t2/10)+(t2%10)*100;
- t1*=ten[t0];
- return (t1+x%ten[t0]+3);
- }
- inline int hashfun(const int &x)
- {
- int di=0;
- int cou=8;
- int tem=x;
- int dig[9]={0};
- while(tem>0)
- {
- dig[cou--]=tem%10;
- tem/=10;
- }
- for(int i=1;i<8;i++)
- {
- tem=0;
- for(int j=0;j<i;j++)
- if(dig[j]>dig[i]) tem++;
- di+=tem*fi[i];
- }
- di+=(9-dig[8])*fi[8];
- return di;
- }
- inline int gu(const int &x)
- {
- int di=0;
- int bk;
- int tem=x;
- bk=x%10;tem/=10;bk--;
- for(int i=8;i>=0;i--)
- {
- if(i==bk) continue;
- if(tem%10!=i+1) di++;
- tem/=10;
- }
- return di;
- }
- struct node{
- int sta;
- int no;
- int va;
- int ga;
- };
- bool operator <(const node &x,const node &y)
- {
- return x.va>y.va;
- }
- node now,next;
- priority_queue <node> et;
- int be,bef;
- inline int bfs()
- {
- int bk;
- memset(hash,0,sizeof(hash));
- while(!et.empty()) et.pop();
- now.sta=be;now.ga=0;
- now.va=gu(now.sta);
- now.no=hashfun(now.sta);bef=now.no;
- fa[now.no]=0;path[now.no]=0;
- et.push(now);hash[now.no]=1;
- while(!et.empty()){
- now=et.top();et.pop();
- if(now.sta==END) return now.no;
- bk=now.sta%10;
- for(int i=0;i<4;i++)
- {
- switch(i)
- {
- case 0:if(bk==1 || bk==4 || bk==7) continue;
- next.sta=lt(now.sta);
- next.no=hashfun(next.sta);
- next.va=gu(next.sta);
- next.ga=now.ga+1;
- if((next.ga+next.va)<(now.ga+now.va)) continue;
- if(hash[next.no]==1) continue;
- path[next.no]=i;fa[next.no]=now.no;
- et.push(next);hash[next.no]=1;
- break; //left
- case 1:if(bk==3 || bk==6 || bk==9) continue;
- next.sta=rt(now.sta);
- next.no=hashfun(next.sta);
- next.va=gu(next.sta);
- next.ga=now.ga+1;
- if((next.ga+next.va)<(now.ga+now.va)) continue;
- if(hash[next.no]==1) continue;
- path[next.no]=i;fa[next.no]=now.no;
- et.push(next);hash[next.no]=1;
- break; //right
- case 2:if(bk<4) continue;
- next.sta=up(now.sta);
- next.no=hashfun(next.sta);
- next.va=gu(next.sta);
- next.ga=now.ga+1;
- if((next.ga+next.va)<(now.ga+now.va)) continue;
- if(hash[next.no]==1) continue;
- path[next.no]=i;fa[next.no]=now.no;
- et.push(next);hash[next.no]=1;
- break; //up
- case 3:if(bk>6) continue;
- next.sta=dn(now.sta);
- next.no=hashfun(next.sta);
- next.va=gu(next.sta);
- next.ga=now.ga+1;
- if((next.ga+next.va)<(now.ga+now.va)) continue;
- if(hash[next.no]==1) continue;
- path[next.no]=i;fa[next.no]=now.no;
- et.push(next);hash[next.no]=1;
- break; //down
- }
- }
- }
- return 0;
- }
- inline void dfs(const int &n)
- {
- if(n==bef) return ;
- dfs(fa[n]);
- switch(path[n])
- {
- case 0:printf("l");
- break;
- case 1:printf("r");
- break;
- case 2:printf("u");
- break;
- case 3:printf("d");
- break;
- }
- }
- int main()
- {
- int x,en,xpl;
- int tem,di,cou,dig[9]={0};
- while(gets(eight))
- {
- be=0;xpl=0;
- for(int i=0;eight[i]!='\0';i++)
- {
- if(eight[i]>='0' && eight[i]<='9')
- {be*=10;be+=eight[i]-'0';xpl++;}
- else if(eight[i]=='x')
- x=xpl+1;
- }
- be*=10;be+=x;
- di=0;cou=8;tem=be;
- while(tem>0)
- {
- dig[cou--]=tem%10;
- tem/=10;
- }
- for(int i=1;i<8;i++)
- {
- tem=0;
- for(int j=0;j<i;j++)
- if(dig[j]>dig[i]) tem++;
- di+=tem;
- }
- if((di&1)!=0) printf("unsolvablen");
- else {
- en=bfs();
- dfs(en);
- printf("n");
- }
- }
- return 0;
- }
SRM417
郁闷啊,哭死啦,55555.
250没什么好说的,500分的写到一半觉得怎么查找前缀和后缀字符串的思路很模糊,看看时间还是45分钟左右,去开了1000分。1000分刚开始以为是概率就是长度比,其实没这么简单,估计是一个两头窄中间宽的分布,写着写着时间就怎么没了,结果到最后只有230多分。
然后弄了一组比较长的数据,去cha别人的500,盲cha,失败两次,哭死。
唉,解题报告先欠着,明天软件2+2要开学报名了,下午还有比赛,慢慢来吧。
另外GX黄队终于变蓝啦。









