We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
you should create a generator because when the test it have big number of queries your program delay too much.
len_array,queries=map(int,raw_input().strip().split())array=[0]*len_arraydefgenerator_queries(queries):init=0index=0whileindex<queries:yieldmap(int,raw_input().strip().split())index+=1fora,b,kingenerator_queries(queries):foriinxrange(a-1,b):# another generatorarray[i]+=k# maybe use threads hereprintmax(array)
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
you should create a generator because when the test it have big number of queries your program delay too much.