| Task: | Entrepreneur |
| Sender: | aalto25a_004 |
| Submission time: | 2025-09-03 17:50:42 +0300 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | details |
| #2 | WRONG ANSWER | 0.00 s | details |
| #3 | WRONG ANSWER | 0.00 s | details |
| #4 | TIME LIMIT EXCEEDED | -- | details |
| #5 | TIME LIMIT EXCEEDED | -- | details |
| #6 | WRONG ANSWER | 0.00 s | details |
| #7 | WRONG ANSWER | 0.01 s | details |
| #8 | TIME LIMIT EXCEEDED | -- | details |
| #9 | ACCEPTED | 0.16 s | details |
| #10 | TIME LIMIT EXCEEDED | -- | details |
| #11 | TIME LIMIT EXCEEDED | -- | details |
| #12 | TIME LIMIT EXCEEDED | -- | details |
| #13 | TIME LIMIT EXCEEDED | -- | details |
| #14 | TIME LIMIT EXCEEDED | -- | details |
| #15 | WRONG ANSWER | 0.00 s | details |
Code
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(){
long long n, t;
cin >> n;
cin >> t;
// n number of machines, t number of cars
unordered_map<int, long long> man_times;
priority_queue<pair<int,int> , vector<pair<int,int>>, greater<pair<int,int>> > pq;
priority_queue<pair<int,int> , vector<pair<int,int>>, greater<pair<int,int>> > nq;
priority_queue<pair<int,int> , vector<pair<int,int>>, greater<pair<int,int>> > temp;
long long b;
int i = 0;
while (cin >> b)
{
man_times[i++] = b;
pq.push(make_pair(b, i));
}
long long cars = 0;
long long time = 0;
while (cars < t)
{
pair<int,int> top = pq.top();
int min_time = top.first;
while (!pq.empty()) {
pair<int, int> cur = pq.top();
pq.pop();
int k = cur.first;
if (k == min_time)
{
++cars;
nq.push(make_pair(i, man_times[cur.second]));
}
else
{
nq.push(make_pair(i, k - min_time));
}
}
temp = pq;
pq = nq;
nq = temp;
time += min_time;
}
cout << time;
return 0;
}Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 6 5 1 2 1 5 10 4 6 6 |
| correct output |
|---|
| 4 |
| user output |
|---|
| 11 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 6 6 4 3 4 9 3 2 6 10 |
| correct output |
|---|
| 6 |
| user output |
|---|
| 12 |
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 5 4 10 7 8 4 1 8 9 2 |
| correct output |
|---|
| 5 |
| user output |
|---|
| 11 |
Test 4
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 1 1000000000 1 |
| correct output |
|---|
| 1000000000 |
| user output |
|---|
| (empty) |
Test 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 1 1000000000 1000000000 |
| correct output |
|---|
| 1000000000000000000 |
| user output |
|---|
| (empty) |
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 1000 1000 271 687 392 992 11 410 702 870... |
| correct output |
|---|
| 223 |
| user output |
|---|
| 1002 |
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 1000 1000 598 523 703 794 737 689 724 26... |
| correct output |
|---|
| 282 |
| user output |
|---|
| 1003 |
Test 8
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 200000 1000000000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
| correct output |
|---|
| 5000 |
| user output |
|---|
| (empty) |
Test 9
Verdict: ACCEPTED
| input |
|---|
| 200000 1 760045594 599341056 300698860 ... |
| correct output |
|---|
| 8214 |
| user output |
|---|
| 8214 |
Test 10
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 200000 1000000000 33941840 210038922 596070148 7... |
| correct output |
|---|
| 371045814100 |
| user output |
|---|
| (empty) |
Test 11
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 25 1000000000 1000000000 1 1 1 1 1 1 1 1 1 1... |
| correct output |
|---|
| 41666667 |
| user output |
|---|
| (empty) |
Test 12
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 12 1000000000 1 1 1 1 1 1 1 1 1 1 1 10000000... |
| correct output |
|---|
| 90909091 |
| user output |
|---|
| (empty) |
Test 13
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 23 1000000000 1000000000 1000000000 10000000... |
| correct output |
|---|
| 43478261000000000 |
| user output |
|---|
| (empty) |
Test 14
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 23 1000000000 1000000000 1000000000 10000000... |
| correct output |
|---|
| 43478261000000000 |
| user output |
|---|
| (empty) |
Test 15
Verdict: WRONG ANSWER
| input |
|---|
| 3 3 10 11 12 |
| correct output |
|---|
| 12 |
| user output |
|---|
| 13 |
