Submission #3634485


Source Code Expand

var
  x,y,i,j,n,max,k:longint;
  b:array[0..100000000] of boolean;
  a:array[0..100000000] of longint;
begin
  readln(a[1]);
  x:=1;
  max:=a[1];
  while a[x]<>0 do
  begin
    x:=x+1;
    readln(a[x]);
    if a[x]>max then max:=a[x];
  end;
  b[1]:=true;
  for i:=2 to trunc(sqrt(max)) do
  begin
    if b[i]=false then
    for j:=2 to max div i do b[i*j]:=true;
  end;
  for i:=1 to x-1 do
  begin
    j:=2;
    k:=a[i];
    while k<>1 do
    begin
      while k mod j=0 do begin k:=k div j;end;
      j:=j+1;
    end;
    writeln(j-1);
  end;
end.

Submission Info

Submission Time
Task B - Working for the World
User luogu_bot5
Language Pascal (FPC 2.6.2)
Score 0
Code Size 550 Byte
Status TLE
Exec Time 2104 ms
Memory 98304 KB

Compile Error

/usr/bin/ld.bfd: warning: ./link.res contains output sections; did you forget -T?

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 18
TLE × 9
Set Name Test Cases
All 00-sample, 10-minimum, 11-maximum, 12-little, 13-large, 14-middle, 15-zero, 50-random00, 50-random01, 50-random02, 50-random03, 50-random04, 50-random05, 50-random06, 50-random07, 50-random08, 50-random09, 50-random10, 50-random11, 50-random12, 50-random13, 50-random14, 50-random15, 50-random16, 50-random17, 50-random18, 50-random19
Case Name Status Exec Time Memory
00-sample AC 91 ms 22528 KB
10-minimum AC 1 ms 2176 KB
11-maximum AC 1060 ms 98304 KB
12-little AC 1 ms 2176 KB
13-large TLE 2104 ms 98304 KB
14-middle AC 1070 ms 98176 KB
15-zero AC 1 ms 2176 KB
50-random00 TLE 2104 ms 98304 KB
50-random01 AC 1747 ms 98176 KB
50-random02 TLE 2104 ms 96256 KB
50-random03 AC 1537 ms 98304 KB
50-random04 AC 1505 ms 86016 KB
50-random05 TLE 2104 ms 98304 KB
50-random06 TLE 2104 ms 98304 KB
50-random07 AC 1257 ms 92160 KB
50-random08 AC 1350 ms 98304 KB
50-random09 TLE 2104 ms 98304 KB
50-random10 AC 1192 ms 98176 KB
50-random11 TLE 2103 ms 86016 KB
50-random12 AC 1394 ms 96256 KB
50-random13 TLE 2047 ms 90112 KB
50-random14 AC 1950 ms 98304 KB
50-random15 AC 1576 ms 98304 KB
50-random16 AC 1895 ms 98304 KB
50-random17 AC 1939 ms 98304 KB
50-random18 TLE 2104 ms 98176 KB
50-random19 AC 1254 ms 98304 KB