fork download
  1. const
  2. tfi='';//c11seq3.inp';
  3. tfo='';//c11seq3.out';
  4.  
  5. var
  6. fi,fo:text;
  7. n:longint;
  8. f:array[0..24]of qword;
  9. t:array[0..5] of qword=(244445,48889, 77789, 155578, 111356, 122227);
  10.  
  11. procedure dao(i:longint);
  12. var s:string;
  13. tg:char;
  14. i1,j,code:longint;
  15. begin
  16. str(f[i],s);
  17. for i1:=1 to length(s)-1 do
  18. for j:=i1+1 to length(s) do
  19. if s[i1]>s[j] then
  20. begin
  21. tg:=s[i1];
  22. s[i1]:=s[j];
  23. s[j]:=tg;
  24. end;
  25. val(s,f[i],code);
  26. end;
  27.  
  28. procedure xuli;
  29. var i:longint;
  30. begin
  31. read(fi,n);
  32. f[1]:=1;
  33. for i:=2 to 24 do
  34. begin
  35. f[i]:=f[i-1]*2;
  36. dao(i);
  37. end;
  38. if n<=24 then write(f[n])
  39. else writeln(fo,t[n mod 6]);
  40. end;
  41.  
  42.  
  43. begin
  44. assign(fi,tfi);
  45. assign(fo,tfo);
  46. reset(Fi);
  47. rewrite(fo);
  48. xuli;
  49. close(fo);
  50. end.
Success #stdin #stdout 0s 328KB
stdin
Standard input is empty
stdout
Standard output is empty