1 solutions

  • 0
    @ 2025-11-5 15:46:32

    Pascal :

    var
     n,j,i,y:integer;
     s:array[1..10000] of integer;
    begin
        readln(n);
        j:=1;
        for i:=1 to n do
         s[i]:=1;
        for i:=1 to n-1 do
         begin
         inc(j);
         y:=1;
         while y<=n do
          begin
          s[y]:=s[y]+1;
          s[y]:=s[y] mod 8;
          y:=y+j;
          end;
          end;
         for i:=1 to n do
        if i=n then write(s[i]) else write(s[i],' ');
    end.
    
    • 1

    Information

    ID
    17154
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By