QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 128 MB Total points: 100

#469. 等差子序列

الإحصائيات

给出一个长度为 $N$ 的正整数序列,问是否存在一个长度不小于三的等差子序列。

输入格式

第一行一个正整数 $T$,表示数据组数。

接下来 $T$ 组数据,每组数据第一行一个正整数 $N$,表示序列长度,接下来第二行有 $N$ 个正整数,依次表示序列中的数。

输出格式

对于每组数据,输出单独的一行 YESNO

样例数据

样例 1 输入

3
4
4 3 2 1
2
1 100
5
1 17 9 18 17

样例 1 输出

YES
NO
YES

子任务

对于 $20\%$的数据:$N\le 100$。

对于 $40\%$的数据:$N\le 10^3$。

对于 $100\%$的数据:$1\le T \le 10$,$1\le N\le 2\times 10^4$,序列中的数 $\le 2\times 10^4$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.