QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#804580 | #9873. Last Chance: Threads of Despair | ucup-team139# | WA | 0ms | 3728kb | C++23 | 623b | 2024-12-08 00:32:20 | 2024-12-08 00:32:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
void solve([[maybe_unused]] int t)
{
int n, m;
cin >> n >> m;
vector<long long> a(n), b(m);
for (auto &i : a)
cin >> i;
for (auto &i : b)
cin >> i;
sort(a.begin(), a.end());
sort(b.begin(), b.end());
long long val = -1;
for (int i = 0; i < n; i++)
val -= a[i] - 1;
for (int i = 0; i < m; i++)
val += max(0ll, b[i] - n - i);
cout << (val > 0 ? "No" : "Yes") << "\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n = 1;
cin >> n;
for (int i = 1; i <= n; i++)
solve(i);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3728kb
input:
3 3 2 1 1 4 2 6 3 2 1 1 4 2 7 2 1 100 100 2
output:
Yes Yes Yes
result:
wrong answer expected NO, found YES [2nd token]