fork download
  1. local read, write = io.read, io.write
  2. local b=2
  3. local n, sum = 1,0
  4. while n <= 100 do
  5. sum = 0
  6. b = 2
  7. while b*b <= n do
  8. if n%b == 0 then
  9. sum = sum + b
  10. if b*b == n then
  11. else
  12. sum = sum + (n/b)
  13. end
  14. end
  15. b = b+1
  16. end
  17.  
  18. if sum == n then write(n)
  19. end
  20. end
Time limit exceeded #stdin #stdout 5s 2536KB
stdin
stdout
Standard output is empty