#include <queue>
#include <vector>
#include "holiday.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
long long findMaxAttraction(int n, int start, int d, int attraction[])
{
long long ans=0;
if (start==0)
{
priority_queue<int>pq;
for (int j=0;j<min(n,d);j++)
{
vector<int>F;
long long z=attraction[j];
int x=d-1-j;
for (int k=0;k<j&&x>0;k++)
{
x--;
z+=pq.top();
F.push_back(pq.top());
pq.pop();
}
ans=max(ans,z);
pq.push(attraction[j]);
for (auto i:F)
pq.push(i);
}
return ans;
}
// for (int i=0;i<n;i++)
// {
// }
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5102 ms |
1704 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
840 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
1628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |