Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
(P3) Zadanie Kolokwium 2013: Trójkąty i trójkąty
Ozan Taşdemir 9/B 499
Code
ACII_Art
unhex 16 bit word python (string to hex)
H.W 5-Solution
BasicPattern.py
Считалка через массив
just Comment
oppo mobile
stackse - search stackoverflow differently
Please log in to post a comment.