QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#133209 | #6540. Beautiful Sequence | 1kri | WA | 1ms | 3480kb | C++14 | 460b | 2023-08-01 18:40:51 | 2023-08-01 18:40:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int n, a[N];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int t;
cin >> t;
while (t--) {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
sort(a + 1, a + n + 1);
for (int i = n, s = 0; i != -1; i--) {
s += a[i] != a[i + 1];
if (s > i) {
cout << n - i << '\n';
break;
}
}
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3460kb
input:
2 6 1 1 2 3 3 4 5 1 2 2 3 3
output:
4 4
result:
ok 2 number(s): "4 4"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3480kb
input:
2 5 1 2 2 3 3 20 1 1 1 1 1 1 4 5 8 8 8 8 9 9 9 9 10 10 10 10
output:
4 15
result:
wrong answer 2nd numbers differ - expected: '17', found: '15'