| Task: | Lisäykset |
| Sender: | pupukani |
| Submission time: | 2025-11-29 13:49:48 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #2 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #3 | WRONG ANSWER | 0.01 s | 1, 3 | details |
| #4 | WRONG ANSWER | 0.01 s | 1, 3 | details |
| #5 | WRONG ANSWER | 0.34 s | 1, 3 | details |
| #6 | WRONG ANSWER | 0.32 s | 2, 3 | details |
| #7 | WRONG ANSWER | 0.32 s | 3 | details |
| #8 | WRONG ANSWER | 0.32 s | 3 | details |
| #9 | WRONG ANSWER | 0.80 s | 3 | details |
| #10 | TIME LIMIT EXCEEDED | -- | 3 | details |
| #11 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
#include <iostream>
#include <map>
#include <unordered_map>
#include <string>
#include <sstream>
int main(void)
{
int n, m;
std::cin >> n >> m;
std::cin.ignore();
std::string alkusis;
std::getline(std::cin, alkusis);
std::stringstream ss(alkusis);
std::map<int, int> luvut;
int luku;
while (ss >> luku)
luvut[luku]++;
std::string ope;
std::getline(std::cin, ope);
std::stringstream sope(ope);
int k;
while (sope >> k)
{
std::unordered_map<int, int> lis;
while (k > 0)
{
auto it = luvut.begin();
int luku = it->first;
int maara = it->second;
std::cout << "Luku: " << luku << " | maara: " << maara << " | k: " << k << std::endl;
int sub = k >= maara ? maara : k;
k -= sub;
it->second -= sub;
if (it->second == 0)
luvut.erase(it);
lis[luku + 1] += sub;
}
for (const auto& [luku, maara] : lis)
luvut[luku] += maara;
}
std::string str;
for (const auto& [luku, maara] : luvut)
{
for (int i = 0; i < maara; ++i)
str += std::to_string(luku) + " ";
}
std::cout << str << std::endl;
}
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 1 1000 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
| correct output |
|---|
| 1000 |
| user output |
|---|
| Luku: 0 | maara: 1 | k: 1 Luku: 1 | maara: 1 | k: 1 Luku: 2 | maara: 1 | k: 1 Luku: 3 | maara: 1 | k: 1 Luku: 4 | maara: 1 | k: 1 ... |
Feedback: Output is longer than expected
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 1000 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 511 511 511 511 511 511 511 51... |
| user output |
|---|
| Luku: 0 | maara: 1000 | k: 791 Luku: 0 | maara: 209 | k: 725 Luku: 1 | maara: 791 | k: 516 Luku: 1 | maara: 484 | k: 967 Luku: 2 | maara: 516 | k: 483 ... |
Feedback: Output is longer than expected
Test 3
Group: 1, 3
Verdict: WRONG ANSWER
| input |
|---|
| 1000 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 495 495 495 495 495 495 495 49... |
| user output |
|---|
| Luku: 0 | maara: 75 | k: 648 Luku: 1 | maara: 83 | k: 573 Luku: 2 | maara: 107 | k: 490 Luku: 3 | maara: 98 | k: 383 Luku: 4 | maara: 92 | k: 285 ... |
Feedback: Output is longer than expected
Test 4
Group: 1, 3
Verdict: WRONG ANSWER
| input |
|---|
| 1000 1000 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 ... |
| correct output |
|---|
| 562 562 562 562 562 562 562 56... |
| user output |
|---|
| Luku: 0 | maara: 10 | k: 757 Luku: 1 | maara: 11 | k: 747 Luku: 2 | maara: 14 | k: 736 Luku: 3 | maara: 4 | k: 722 Luku: 4 | maara: 12 | k: 718 ... |
Feedback: Output is longer than expected
Test 5
Group: 1, 3
Verdict: WRONG ANSWER
| input |
|---|
| 1000 1000 0 1 3 4 6 9 9 9 10 11 11 11 11... |
| correct output |
|---|
| 997 997 997 997 997 998 998 99... |
| user output |
|---|
| Luku: 0 | maara: 1 | k: 492 Luku: 1 | maara: 1 | k: 491 Luku: 3 | maara: 1 | k: 490 Luku: 4 | maara: 1 | k: 489 Luku: 6 | maara: 1 | k: 488 ... |
Feedback: Output is longer than expected
Test 6
Group: 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 100000 100000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 50033 50033 50033 50033 50033 ... |
| user output |
|---|
| Luku: 0 | maara: 100000 | k: 5... |
Feedback: Output is longer than expected
Test 7
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 100000 100000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 49996 49996 49996 49996 49996 ... |
| user output |
|---|
| Luku: 0 | maara: 9133 | k: 112... |
Feedback: Output is longer than expected
Test 8
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 100000 100000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 50057 50057 50057 50057 50057 ... |
| user output |
|---|
| Luku: 0 | maara: 1007 | k: 906... |
Feedback: Output is longer than expected
Test 9
Group: 3
Verdict: WRONG ANSWER
| input |
|---|
| 100000 100000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... |
| correct output |
|---|
| 50536 50536 50536 50536 50536 ... |
| user output |
|---|
| Luku: 0 | maara: 111 | k: 7638... |
Feedback: Output is longer than expected
Test 10
Group: 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100000 100000 0 4 7 29 33 44 52 75 77 79 82 ... |
| correct output |
|---|
| 100000 100001 100003 100023 10... |
| user output |
|---|
| (empty) |
Test 11
Group: 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100000 100000 1 12 14 16 49 59 59 63 68 73 8... |
| correct output |
|---|
| 100001 100010 100012 100014 10... |
| user output |
|---|
| (empty) |
