/ SB域 /

记录详情

Time Exceeded

/usr/bin/ld.bfd: warning: /out/link.res contains output sections; did you forget -T?
# 状态 耗时 内存占用
#1 Accepted 1ms 256.0 KiB
#2 Accepted 1ms 256.0 KiB
#3 Accepted 5ms 256.0 KiB
#4 Accepted 17ms 256.0 KiB
#5 Accepted 4ms 188.0 KiB
#6 Accepted 10ms 256.0 KiB
#7 Time Exceeded ≥1004ms ≥380.0 KiB
#8 Time Exceeded ≥1006ms ≥256.0 KiB
#9 Accepted 19ms 256.0 KiB
#10 Accepted 24ms 256.0 KiB

代码

var k,i,ans:longint;
    s:ansistring;
function check(l,r:longint):boolean;
var th:ansistring;
    i:longint;
begin
 th:='';
 for i:=l to r do th:=th+s[i];
// writeln(th);
 for i:=1 to length(th)div 2+1 do
  if th[i]<>th[length(th)-i+1] then exit(false);
 exit(true);
end;
begin
 readln(k);
 readln(s);
 for i:=1 to length(s) do begin
  if i+k-1>length(s) then break;
  if check(i,i+k-1) then inc(ans);
 end;
 writeln(ans);
close(input);
close(output);
end.

信息

递交者
类型
递交
题目
【模板】回文子串
题目数据
下载
语言
Pascal
递交时间
2017-08-22 16:22:57
评测时间
2017-08-22 16:22:57
评测机
分数
80
总耗时
≥2096ms
峰值内存
≥380.0 KiB