讨论 / ORZ各神,帮忙看看题..
Catch-22 2012-07-31 19:58:00
点我顶贴 收藏 删除
Var

tmp,st:STring;

Arc:AnsiString;

i,n,Sum,xx,Ans,x,t:longint;

ch:char;

Begin

Readln(tmp);

tmp:=' '+tmp+' ';

st:=Upcase(tmp);

xx:=Length(tmp);

{For i:=1 to xx do

st:=st+Upcase(tmp[i]); }

Arc:=' ';

// Writeln(tmp,' ',st);

{ While Not Eoln do

Begin

Read(ch);

ch:=UpCase(ch);

Arc:=Arc+ch;

End; }

Readln(Arc);

Arc:=' '+UpcasE(Arc)+' ';

//Writeln(Arc,'-');

Sum:=0;

t:=1011;

Arc:=Arc+' ';

n:=Pos(st,Arc)-1;

if n=-1 Then Begin Writeln(n); Halt; End

Else

Begin

While t<>0 do

Begin

t:=Pos(st,Arc);

{ Writeln('t=',t,' st=',st);

Writeln('Arc=',Arc);

Writeln('Sum=',Sum);}

if t<>0 Then inc(Sum);

Delete(Arc,1,xx+t-2);

End;

End;

Writeln(Sum,' ',n);

End.

状态: Unaccepted

测评机: Xeond[6]

得分: 80分

有效耗时: 1422毫秒

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

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

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

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

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

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

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

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

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

测试结果10:

测试结果错误.错误结果为:2794 45

正确结果应为:1 555864

我自己测了搜到的数据,AC..

还有第十个点,我搜到的数据中“vcjm”...的那个点,自己测出解是1 555864,

2794 45是第9个点的解.

刚才Writeln出了数据(不知道合不合法,抱歉.),第十个点就是'vcjm...',

求解..

#1 fnoi6bbaiyiwei@2012-02-02 22:11:00
回复 删除
胜利二中的,哇哇 周老师的徒弟?
#2 Catch-22@2012-02-03 01:31:00
回复 删除
回复 沙发fnoi6bbaiyiwei 的帖子

Ls是哪位神?

#3 Catch-22@2012-02-03 18:26:00
回复 删除
TYVJ

刚才在TYVJ上交了一次,只是第九个点超时..

求解..

VijosNT Mini 2.0.5.6

Free Pascal Compiler version 2.4.4 [2011/04/23] for i386

Copyright (c) 1993-2010 by Florian Klaempfl

Target OS: Win32 for i386

Compiling foo.pas

foo.pas(4,3) Note: Local variable "i" not used

foo.pas(4,14) Note: Local variable "Ans" not used

foo.pas(4,18) Note: Local variable "x" not used

foo.pas(5,3) Note: Local variable "ch" not used

Linking foo.exe

42 lines compiled, 0.2 sec , 30384 bytes code, 1544 bytes data

4 note(s) issued

#01: Accepted (0ms, 652KB)

#02: Accepted (0ms, 616KB)

#03: Accepted (0ms, 652KB)

#04: Accepted (0ms, 876KB)

#05: Accepted (0ms, 912KB)

#06: Accepted (0ms, 876KB)

#07: Accepted (0ms, 876KB)

#08: Accepted (92ms, 3964KB)

#09: Time Limit Exceeded (?, 3964KB)

#10: Accepted (115ms, 3964KB)

Time Limit Exceeded / 90 / ? / 3964KB

#4 lzn@2012-07-31 19:56:00
回复 删除
在rq上超时会导致下一个点WA

在rq上超时会导致下一个点WA

#5 lzn@2012-07-31 19:58:00
回复 删除
程序应该没错,优化一下算法

程序应该没错,优化一下算法

查看更多回复
提交回复