QOJ.ac

QOJ

Süre Sınırı: 1 s Bellek Sınırı: 1024 MB Toplam puan: 100

#18802. Dãy số và Truy vấn 44

İstatistikler

Một dãy $A_1, A_2, \ldots, A_N$ độ dài $N$ được cho trước. Hãy viết chương trình xử lý các truy vấn sau:

  • m k: Trong số các dãy con của $A_1, A_2, \ldots, A_m$, độ dài lớn nhất của một dãy con mà độ dài dãy con tăng dài nhất của nó không vượt quá $k$. ($1 \le k \le m \le N$)

Dữ liệu vào

Dòng đầu tiên chứa độ dài của dãy $N$ và số lượng truy vấn $Q$. ($1 \le N \le 50\,000$, $1 \le Q \le 200\,000$)

Dòng thứ hai chứa $A_1, A_2, \ldots, A_N$. ($1 \le A_i \le 50\,000$)

$Q$ dòng tiếp theo, mỗi dòng chứa một truy vấn theo định dạng đã mô tả ở trên.

Dữ liệu ra

Với mỗi truy vấn, in ra câu trả lời trên một dòng riêng biệt.

Ví dụ

Dữ liệu vào 1

11 6
9 6 3 1 5 12 8 4 2 2 2
5 1
7 2
9 1
9 2
11 1
11 11

Dữ liệu ra 1

4
6
5
8
7
11

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.