fork(1) download
  1. n=int(input())
  2. a=[int(n) for n in input().split(' ')]
  3. k=list(set(a))
  4. k=sorted(k)
  5. print(k)
  6. t=0
  7. for i in k:
  8. print(i)
  9. a.remove(i)
  10. if (i-1) in a:
  11. a.remove(i-1)
  12. if (i+1) in a:
  13. a.remove(i+1)
  14. t=t+i
  15. if(len(a)==0):
  16. break
  17. print(t)
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 9
    a.remove(i)
              ^
IndentationError: unindent does not match any outer indentation level

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: IndentationError: unindent does not match any outer indentation level (prog.py, line 9)
stdout
Standard output is empty