Блог пользователя LeoLeuLeo0

Автор LeoLeuLeo0, история, 2 года назад, По-английски

Given an array of N numbers, all of which are initially 0. You need to process 2 types of queries: • Query type 1 has the form 1 L R A B, we add to the ith element (i − L)A + B the unit with all L <= i <= R • Type 2 query has the form 2 L R, we need to print the sum of the elements in the range [L..R], get the remainder for 10^9 + 7. Input data • The first line contains 2 numbers N and M which are the number of elements in the array and the number of queries (1 N, M 105 ). • The next M lines each record a query in one of the two categories above. • The numbers in the input are all greater than or equal to 1 and less than or equal to 10^9 . Result out • For each type 2 query, write 1 line of the answer

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится