QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#261319 | #7678. The Game | Fr1nGeLove | WA | 75ms | 8564kb | C++20 | 2.2kb | 2023-11-22 20:16:44 | 2023-11-22 20:16:45 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
void solve() {
int n, m;
std::cin >> n >> m;
std::multiset<int> f1, f2;
std::vector<int> b(m);
for (int i = 0; i < n; i++) {
int x;
std::cin >> x;
f1.emplace(x);
}
for (int i = 0; i < m; i++) {
std::cin >> b[i];
}
i64 sum = 0;
int cnt = m - 1;
for (auto x : std::ranges::views::reverse(f1)) {
if (cnt == -1) {
break;
}
f2.emplace(x);
if (x > b[cnt]) {
std::cout << "-1\n";
return;
}
sum += b[cnt--] - x;
}
if (sum > n - m) {
std::cout << "-1\n";
return;
}
cnt = n - m - sum;
std::vector<int> ans;
while (cnt) {
int x = *f1.begin();
f1.erase(f1.begin());
f1.emplace(x + 1);
f1.erase(f1.begin());
ans.push_back(x);
if (x + 1 > *f2.begin()) {
f2.erase(f2.begin());
f2.emplace(x + 1);
sum -= 1;
if (sum < 0) {
std::cout << "-1\n";
return;
}
} else {
cnt -= 1;
}
}
int r = m - 1;
while (r != -1) {
if (f1.empty() || b[r] < *f1.rbegin()) {
std::cout << "-1\n";
return;
}
while (*f1.rbegin() != b[r]) {
if (f1.size() == 1) {
std::cout << "-1\n";
return;
}
int x = *f1.rbegin();
ans.push_back(x);
f1.erase(std::prev(f1.end()));
f1.emplace(x + 1);
f1.erase(f1.begin());
}
r--;
f1.erase(std::prev(f1.end()));
}
if (int(f1.size()) != 0) {
std::cout << "-1\n";
return;
}
std::cout << int(ans.size()) << "\n";
for (auto x : ans) {
std::cout << x << " ";
}
std::cout << "\n";
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3736kb
input:
6 5 3 1 2 2 3 3 2 3 4 4 2 1 2 2 4 2 4 5 2 2 3 3 4 4 5 5 6 1 1 1 1 1 1 1 4 4 2 1 1 1 2 2 2 4 1 1 1 1 1 2
output:
2 1 3 -1 3 2 4 4 5 1 1 1 2 3 2 1 1 -1
result:
ok ok (6 test cases)
Test #2:
score: 0
Accepted
time: 3ms
memory: 3616kb
input:
7056 4 3 1 1 1 1 1 1 1 4 3 1 1 1 1 1 1 2 4 3 1 1 1 1 1 1 3 4 3 1 1 1 1 1 1 4 4 3 1 1 1 1 1 1 5 4 3 1 1 1 1 1 1 6 4 3 1 1 1 1 1 2 2 4 3 1 1 1 1 1 2 3 4 3 1 1 1 1 1 2 4 4 3 1 1 1 1 1 2 5 4 3 1 1 1 1 1 2 6 4 3 1 1 1 1 1 3 3 4 3 1 1 1 1 1 3 4 4 3 1 1 1 1 1 3 5 4 3 1 1 1 1 1 3 6 4 3 1 1 1 1 1 4 4 4 3 1 1...
output:
-1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 2 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (7056 test cases)
Test #3:
score: 0
Accepted
time: 3ms
memory: 3596kb
input:
5880 4 2 1 1 1 1 1 1 4 2 1 1 1 1 1 2 4 2 1 1 1 1 1 3 4 2 1 1 1 1 1 4 4 2 1 1 1 1 1 5 4 2 1 1 1 1 1 6 4 2 1 1 1 1 1 7 4 2 1 1 1 1 2 2 4 2 1 1 1 1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7 3 1 ...
output:
-1 -1 -1 -1 4 1 2 3 4 -1 -1 4 1 2 3 1 -1 4 1 2 1 2 -1 -1 -1 -1 -1 4 1 1 1 1 4 1 2 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 2 3 4 1 -1 4 2 3 1 2 -1 -1 -1 -1 -1 4 1 1 1 2 4 2 3 1 1 -1 4 2 1 2 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...
result:
ok ok (11550 test cases)
Test #18:
score: 0
Accepted
time: 7ms
memory: 3604kb
input:
16632 7 2 1 1 1 1 1 1 1 1 1 7 2 1 1 1 1 1 1 1 1 2 7 2 1 1 1 1 1 1 1 1 3 7 2 1 1 1 1 1 1 1 1 4 7 2 1 1 1 1 1 1 1 1 5 7 2 1 1 1 1 1 1 1 1 6 7 2 1 1 1 1 1 1 1 2 2 7 2 1 1 1 1 1 1 1 2 3 7 2 1 1 1 1 1 1 1 2 4 7 2 1 1 1 1 1 1 1 2 5 7 2 1 1 1 1 1 1 1 2 6 7 2 1 1 1 1 1 1 1 3 3 7 2 1 1 1 1 1 1 1 3 4 7 2 1 1 ...
output:
-1 -1 -1 -1 -1 5 1 2 3 4 5 -1 5 1 1 1 1 2 5 1 1 1 2 3 5 1 2 3 4 1 -1 5 1 1 1 2 2 5 1 2 3 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 1 1 1 2 3 5 1 1 2 3 4 5 2 3 4 5 1 5 1 1 1 2 2 5 1 1 2 3 2 5 2 3 4 1 2 -1 5 2 3 1 2 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 1 1 1 3 4 5 1 ...
result:
ok ok (16632 test cases)
Test #19:
score: 0
Accepted
time: 17ms
memory: 3744kb
input:
27456 7 1 1 1 1 1 1 1 1 1 7 1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-1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 ...
result:
ok ok (225 test cases)
Test #24:
score: 0
Accepted
time: 10ms
memory: 3752kb
input:
15876 5 5 1 1 1 1 1 1 1 1 1 1 5 5 1 1 1 1 1 1 1 1 1 2 5 5 1 1 1 1 1 1 1 1 1 3 5 5 1 1 1 1 1 1 1 1 1 4 5 5 1 1 1 1 1 1 1 1 1 5 5 5 1 1 1 1 1 1 1 1 2 2 5 5 1 1 1 1 1 1 1 1 2 3 5 5 1 1 1 1 1 1 1 1 2 4 5 5 1 1 1 1 1 1 1 1 2 5 5 5 1 1 1 1 1 1 1 1 3 3 5 5 1 1 1 1 1 1 1 1 3 4 5 5 1 1 1 1 1 1 1 1 3 5 5 5 1 ...
output:
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (15876 test cases)
Test #25:
score: 0
Accepted
time: 30ms
memory: 3620kb
input:
6000 50 30 2 3 3 1 10 6 8 8 6 8 6 2 4 7 1 2 9 10 3 7 2 4 9 7 10 8 1 2 10 9 2 2 1 10 8 2 6 3 3 9 1 1 9 7 6 6 5 8 10 8 5 4 4 4 9 2 3 4 8 3 10 5 7 3 7 7 10 2 8 5 9 10 1 5 10 8 2 4 2 8 50 30 5 2 2 8 10 9 4 1 8 8 6 10 6 9 2 1 2 2 3 9 10 10 5 1 6 7 4 4 6 5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Accepted
time: 33ms
memory: 3604kb
input:
3000 100 50 17 14 4 19 12 10 20 20 8 2 20 2 20 6 9 16 18 13 5 9 19 14 10 12 15 5 4 5 10 11 6 9 20 5 5 13 18 9 9 3 15 3 14 16 8 2 8 20 12 13 7 14 1 2 12 17 13 14 6 12 10 7 18 7 2 5 8 20 19 14 12 3 12 5 13 14 3 10 9 13 9 4 7 11 13 7 16 3 1 8 11 16 11 4 9 2 14 12 17 7 10 2 1 15 16 3 11 4 15 3 1 14 12 1...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (3000 test cases)
Test #28:
score: 0
Accepted
time: 31ms
memory: 3764kb
input:
1500 200 100 3 2 6 6 3 4 10 5 10 10 2 10 4 8 1 3 4 1 2 1 2 9 10 6 9 4 2 3 1 6 4 1 6 5 7 1 3 7 3 9 8 1 5 5 8 6 8 4 4 2 5 5 2 4 4 1 2 5 2 10 9 2 9 9 4 10 3 10 10 6 9 3 1 1 3 8 8 10 8 4 1 6 10 4 8 5 2 2 10 3 3 6 5 7 8 5 1 9 10 3 9 4 5 5 2 2 3 9 4 1 1 5 9 1 8 4 9 4 9 3 7 10 7 3 9 6 2 4 5 2 10 5 1 2 4 3 ...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (1500 test cases)
Test #29:
score: 0
Accepted
time: 66ms
memory: 8564kb
input:
3 100000 98000 8 1 8 5 5 9 1 1 7 6 7 9 1 7 10 9 1 6 10 7 4 6 4 8 3 8 6 2 9 3 1 6 4 7 9 4 5 1 3 8 2 3 1 6 9 10 10 9 5 7 4 2 4 5 4 10 9 3 5 7 6 6 5 7 4 1 3 2 6 4 9 4 9 9 5 5 8 8 8 9 3 7 10 7 4 1 9 3 8 8 3 1 9 10 4 7 3 4 6 1 7 1 4 7 2 1 7 6 2 1 8 5 5 1 6 1 6 5 4 1 4 8 2 4 9 4 9 7 5 8 2 4 6 3 6 8 10 3 6...
output:
-1 -1 -1
result:
ok ok (3 test cases)
Test #30:
score: 0
Accepted
time: 75ms
memory: 8184kb
input:
3 100000 100 26628 15576 98990 43976 49647 68346 23924 26821 38507 73889 64208 7286 8583 43126 43052 76461 583 97495 60100 38769 3107 93747 71788 5884 62213 23247 35912 89245 73679 25668 84434 1943 8147 35006 4375 60512 7641 68542 90586 51747 18780 49625 38064 55647 67725 65368 51875 80357 97039 783...
output:
-1 -1 -1
result:
ok ok (3 test cases)
Test #31:
score: 0
Accepted
time: 27ms
memory: 3628kb
input:
6000 50 20 1 1 2 1 2 1 2 1 1 1 2 1 2 1 1 2 2 1 1 1 1 2 1 2 1 2 2 2 2 1 1 2 1 1 2 2 2 2 1 1 1 1 2 2 1 2 1 2 1 2 2 2 2 1 2 2 2 1 2 1 1 1 1 2 2 1 1 1 2 1 50 20 1 1 1 1 1 2 1 1 1 2 2 1 1 2 2 1 1 2 2 1 1 1 2 2 1 2 1 2 1 1 1 1 2 1 1 1 2 2 2 2 1 1 1 2 2 1 2 1 1 1 1 2 1 2 2 2 2 1 2 2 2 2 1 2 1 1 1 2 2 1 50 ...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (6000 test cases)
Test #32:
score: -100
Wrong Answer
time: 40ms
memory: 3808kb
input:
30000 10 6 1 2 3 1 2 3 1 2 2 2 3 3 3 2 3 2 10 6 2 1 1 3 1 1 3 1 3 2 2 3 2 2 4 4 10 6 2 1 2 1 2 2 3 3 2 1 3 2 2 3 2 4 10 6 3 2 2 2 3 2 1 1 2 2 3 3 2 3 3 3 10 6 1 2 3 2 3 2 3 2 3 1 3 3 3 3 3 3 10 6 1 3 3 2 1 3 2 2 2 3 3 3 3 3 3 3 10 6 3 1 1 3 2 2 1 1 1 3 2 3 4 2 2 3 10 6 2 3 3 1 2 2 2 3 1 3 3 3 3 3 3 ...
output:
-1 -1 -1 4 1 2 2 2 4 1 2 2 2 4 1 2 2 2 -1 4 1 2 2 2 4 1 2 2 3 4 1 2 2 2 4 1 2 2 3 4 1 2 2 2 -1 4 1 2 2 3 4 1 2 2 3 -1 -1 -1 4 1 1 1 2 4 1 1 1 2 3 1 1 2 -1 4 1 1 2 2 -1 4 1 2 2 2 4 1 2 2 3 -1 4 1 2 2 2 4 1 1 2 2 -1 4 2 2 3 2 4 1 2 2 2 4 1 2 3 4 4 1 2 2 2 4 1 2 3 3 4 1 1 2 2 4 ...
result:
wrong answer Jury has answer but participant has not (test case 1)