Submission #743249

# Submission time Handle Problem Language Result Execution time Memory
743249 2023-05-17T09:10:45 Z vjudge1 Rice Hub (IOI11_ricehub) C++17
0 / 100
1000 ms 1708 KB
#include<bits/stdc++.h>
#include "ricehub.h"
using namespace std;
int besthub(int R, int L, int X[], long long B)
{
    long long mx = -1;
    for(int i=1;i<=L;++i)
    {
        priority_queue<int,vector<int>,greater<int>> pq;
        for(int j=0;j<R;++j)
        {
            int dist = abs(i-X[j]);
            pq.push(dist);
        }
        long long cost = 0,rice = 0;
        while(!pq.empty() && cost < B)
        {
            cost += pq.top();
            ++rice;
            pq.pop();
        }
        mx = max(mx,rice);
    }
    return mx;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1073 ms 1708 KB Time limit exceeded
2 Halted 0 ms 0 KB -