CF1742B.Increasing
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given an array a of n positive integers. Determine if, by rearranging the elements, you can make the array strictly increasing. In other words, determine if it is possible to rearrange the elements such that a1<a2<⋯<an holds.
给你一个包含 n 个正整数的数组 a。判断是否可以通过重新排列这些元素,使得该数组严格递增。换言之,判断是否存在一种元素重排方式,使得 a1<a2<⋯<an 成立。
输入格式
The first line contains a single integer t (1≤t≤100) — the number of test cases.
The first line of each test case contains a single integer n (1≤n≤100) — the length of the array.
The second line of each test case contains n integers ai (1≤ai≤109) — the elements of the array.
第一行包含一个整数 t(1≤t≤100)——测试用例的数量。
每个测试用例的第一行包含一个整数 n(1≤n≤100)——数组的长度。
每个测试用例的第二行包含 n 个整数 ai(1≤ai≤109)——数组的元素。
输出格式
For each test case, output "YES" (without quotes) if the array satisfies the condition, and "NO" (without quotes) otherwise.
You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
对于每个测试用例,如果数组满足条件,则输出 "YES"(不带引号),否则输出 "NO"(不带引号)。
您可以以任意大小写形式输出答案(例如,字符串 "yEs"、"yes"、"Yes" 和 "YES" 均会被识别为肯定回答)。
输入输出样例
输入#1
3 4 1 1 1 1 5 8 7 1 3 4 1 5
输出#1
NO YES YES
说明/提示
In the first test case any rearrangement will keep the array [1,1,1,1], which is not strictly increasing.
In the second test case, you can make the array [1,3,4,7,8].
在第一个测试用例中,任何重排都会使数组保持为 [1,1,1,1],该数组不是严格递增的。
在第二个测试用例中,你可以将数组变为 [1,3,4,7,8]。
输入解题思路,AI测评打分。不知道怎么写?