답안 #639747

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
639747 2022-09-11T13:00:46 Z bonk 쌀 창고 (IOI11_ricehub) C++14
0 / 100
1000 ms 524 KB
#include <bits/stdc++.h>
#include <ricehub.h>

using namespace std;
using ll = long long;

int besthub(int r, int l, int x[], ll b){
    ll ans = 0;

    for(int i = 1; i <= l; i++){
        priority_queue<ll>pq;
        ll cost = 0;
        ll tmp = 0;
        for(int j = 0; j < r; j++){
            ll a = abs(x[j] - i);
            if(cost + a <= b){
                pq.push(a);
                cost += a;
                tmp++;
            } else if(!pq.empty() && pq.top() > a){
                cost -= pq.top();
                cost += a;
                pq.push(a);
            }
        }

        ans = max(ans, tmp);
    }

    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1075 ms 524 KB Time limit exceeded
2 Halted 0 ms 0 KB -