You are viewing a single comment's thread. Return to all comments →
four lines in python3
from bisect import bisect_left, bisect_right def solve(a,b,c,d): return sum(bisect_right(c,v) for v in b)-sum(bisect_left(d,u) for u in a) (a,b),(c,d)=(zip(*(map(int,input().split()) for _ in range (k))) for k in map(int,input().split())) print(solve(a,b,sorted(c),sorted(d)))
unreadable, but fun to write
Seems like cookies are disabled on this browser, please enable them to open this website
Mr. X and His Shots
You are viewing a single comment's thread. Return to all comments →
four lines in python3
unreadable, but fun to write