Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Skillenza - Marker Count
#python 3.5.2 ''' Input: 2 3 -4 7 2 3 8 10 2 -1 3 8 11 ''' from sys import stdin, stdout def main(): T = int(stdin.readline().strip()) while(T): L = int(stdin.readline().strip()) pl = 32767 ph = -32768 res = set() for i in range(L): x,y = map(int, stdin.readline().strip().split()) if x < pl: pl = x if y > ph: ph = y for i in range(x,y+1): res.add(i) #stdout.write(str(len(res))+'\n') print(len(res)) T-=1 if __name__ == "__main__": main()
run
|
edit
|
history
|
help
0
Factorial number using recursion
PySuper
isStrong.py
https://rextester.com/HYVN80193
kenken1
sheru1
Metric failed
hw11
Add missing person on list with default age 30
Hw