fork(1) download
  1. n=int(input())
  2. a=[int(n) for n in input().split(' ')]
  3. k=list(set(a))
  4. k=list(sorted(k))
  5. t=0
  6. print(a)
  7. print(k)
  8. for i in range(len(k)):
  9. if k[i] in a:
  10. a.remove(k[i])
  11. if (k[i]-1) in a:
  12. a.remove(k[i]-1)
  13. if (k[i]+1) in a:
  14. a.remove(k[i]+1)
  15. t=t+k[i]
  16. print(t)
  17. if(len(a)==0):
  18. break
  19. print(t)
  20.  
  21.  
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
8 
7 2 1 8 3 3 6 6
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 125, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./prog.py", line 15
    t=t+k[i]
           ^
TabError: inconsistent use of tabs and spaces in indentation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/py_compile.py", line 129, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: TabError: inconsistent use of tabs and spaces in indentation (prog.py, line 15)
stdout
Standard output is empty