subject

Имя входного файла: f. in
имя выходного файла: f. out
ограничение по времени: 2 секунды
ограничение по памяти: 64 мегабайт
дан массив, состоящий из n чисел и q запросов. каждый запрос имеет вид l r. l - номер элемента массива, с которого отрезок начинается, r - номер элемента массива, на котором отрезок заканчивается. для каждого запроса найдите сумму элементов на этом отрезке массива.
формат входных данных:
в первой строке входного файла содержатся положительные числа n и q, n - кол-во элементов массива и q - кол-во запросов (01), а в третьей, четвертой и т. д. строках - l (l< =n) номер элемента, с которого начинается отрезок массива и r(r< =n) - номер элемента массива, на котором отрезок заканчивается.
формат выходных данных:
выведите в выходной файл единственное число - количество различных симпатичных узоров, которые можно выложить во дворе размера mxn. узоры, получающиеся друг из друга сдвигом, поворотом тлт отражением считаются различными.
примеры:
f. in
4 1
1 5 3 6
2 4
f. out
14
помогите пожалуйста.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
Rachel completed typing an official document with a word processing program. she wants to make sure that her document has no typographical errors. she also wants all headings to have the same font. which features in a word processing program should she use? rachel should use the feature in a word processing program to find typographical errors. she should apply to have uniform headings.
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
question
Computers and Technology, 24.06.2019 08:30
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
question
Computers and Technology, 24.06.2019 23:30
What is the opening page of a website called? a. web page b. landing page c. homepage d. opening page
Answers: 1
You know the right answer?
Имя входного файла: f. in
имя выходного файла: f. out
ограничение по времени: 2 секун...
Questions
question
Mathematics, 14.12.2020 18:40
question
English, 14.12.2020 18:40
question
Mathematics, 14.12.2020 18:40
question
Mathematics, 14.12.2020 18:40
question
Arts, 14.12.2020 18:40
question
Mathematics, 14.12.2020 18:40
Questions on the website: 13722362