fork(1) download
  1. for _ in xrange(input()):
  2. n=input()
  3. count=0
  4. lst=map(int, raw_input().split(" "))
  5. i=0
  6. while 1:
  7. if lst[i]*2 in lst:
  8. count+=1
  9. del(lst[lst.index(lst[i]*2)])
  10. i+=1
  11. print count
Runtime error #stdin #stdout #stderr 0.01s 9016KB
stdin
2
2
1 2
3 
1 2 4
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 7, in <module>
IndexError: list index out of range