最后超时,怎么改?

program p1042;

var n,m:int64;

I,J,LS:LONGINT;

b:boolean;

ns:string;

begin

readln(n,m);

for i:=n to m do

IF (I MOD 4 0) THEN

begin

str(i,ns);

b:=true;

ls:=length(ns);

for j:=1 to (ls div 2)do

if ns[j]ns[ls+1-j] then

BEGIN

b:=false;

break;

end;

if b then

begin

for j:=2 to trunc(sqrt(i)) do

if i mod j=0 then

begin

b:=false;

break;

end;

end;

if b then writeln(i);

end;

end.

0 条评论

目前还没有评论...

信息

ID
1042
难度
7
分类
搜索 | 搜索与剪枝 点击显示
标签
(无)
递交数
6585
已通过
1516
通过率
23%
被复制
13
上传者