讨论 / 谁解释一下?
8da2k 2009-06-20 06:48:00
点我顶贴 收藏 删除
同一题,同样程序,为什么会有如此搞笑的状况?

第一次提交:

PROGRAM FBI;

var s:ansistring;

n:longint;

procedure try(st:ansistring);

var i,j:char;

begin

if length(st)>1 then

begin

try(copy(st,1,length(st) div 2));

try(copy(st,length(st)div 2+1,length(st)div 2));

end;

if pos(’0’,st)=0 then write(’I’) else

if pos(’1’,st)=0 then write(’B’) else

write(’F’)

end;

begin

readln(n);

readln(s);

try(s);

end.

状态: Unaccepted

测评机: Xeost[5]

得分: 50分

提交日期: 2008-10-2 17:25:00

有效耗时: 6454毫秒

测试结果1: 选手程序运行超过时限

测试结果2: 选手程序无输出

测试结果3: 选手程序运行超过时限

测试结果4: 通过本测试点|有效耗时1266:ms

测试结果5: 通过本测试点|有效耗时1266:ms

测试结果6: 通过本测试点|有效耗时1281:ms

测试结果7: 通过本测试点|有效耗时1391:ms

测试结果8: 通过本测试点|有效耗时1250:ms

测试结果9: 选手程序运行超过时限

测试结果10: 选手程序运行超过时限

第二次提交:

program fbi;

var s:ansistring;

n:longint;

procedure try(st:ansistring);

var i,j:char;

begin

if length(st)>1 then

begin

try(copy(st,1,length(st) div 2));

try(copy(st,length(st)div 2+1,length(st)div 2));

end;

if pos(’0’,st)=0 then write(’I’) else

if pos(’1’,st)=0 then write(’B’) else

write(’F’)

end;

begin

readln(n);

readln(s);

try(s);

end.

状态: Accepted

测评机: Xeond[6]

得分: 100分

提交日期: 2008-10-2 17:27:00

有效耗时: 862毫秒

测试结果1: 通过本测试点|有效耗时172:ms

测试结果2: 通过本测试点|有效耗时47:ms

测试结果3: 通过本测试点|有效耗时47:ms

测试结果4: 通过本测试点|有效耗时47:ms

测试结果5: 通过本测试点|有效耗时47:ms

测试结果6: 通过本测试点|有效耗时47:ms

测试结果7: 通过本测试点|有效耗时63:ms

测试结果8: 通过本测试点|有效耗时63:ms

测试结果9: 通过本测试点|有效耗时157:ms

测试结果10: 通过本测试点|有效耗时172:ms

两段程序只在标题处有大小写之分啊?

#1 Jollwish@2008-10-02 02:38:00
回复 删除
貌似评测机那段时间有些卡

我也遇到了同样状况

#2 Jollwish@2008-10-02 02:46:00
回复 删除
明白了

是评测机的问题

Xeost[5]貌似爆了

所有在Xeost[5]上评测的程序都TLE

#3 可爱的风@2009-06-20 06:48:00
回复 删除
#include<stdio.h>

#include<stdlib.h>

#include<string.h>

#include<conio.h>

typedef struct node

{

char data[1025];

int u;

struct node *lch,*rch;

}tnode;

char s[1025];

int length;

void preorder(tnode *p)

{

char k;

int i,o,l=0;

if(p!=NULL)

{

o=strlen(p->data);

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

if(p->data[i]==’1’)

l++;

if(l==p->u)

k=’I’;

else

if(l==0)

k=’B’;

else

k=’F’;

preorder(p->lch);

preorder(p->rch);

printf("%c",k);

}

}

tnode *find(int x1,int y1)

{

tnode *p;

int i,k;

k=y1-x1+1;

p=(tnode *)malloc(sizeof(tnode));

if(k>0)

{

p->u=k;

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

p->data[i]=s[x1+i-1];

p->lch=find(x1,x1+k/2-1);

p->rch=find(y1-k/2+1,y1);

return p;

}

else

return NULL;

}

int main()

{

int n,i;

scanf("%d",&n);

scanf("%s",&s);

length=strlen(s);

for(i=length;i>=1;i--)

s[i]=s[i-1];

tnode *tree=find(1,length);

preorder(tree);

}

查看更多回复
提交回复