Submission #1015136

# Submission time Handle Problem Language Result Execution time Memory
1015136 2024-07-06T06:35:36 Z KasymK Rice Hub (IOI11_ricehub) C++17
0 / 100
1000 ms 440 KB
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define ff first
#define ss second
#define all(v) v.begin(), v.end()

int besthub(int r, int l, int x[], ll b){
    int answer = 1;
    deque<int> diff;
    for(int cor = 1; cor <= l; ++cor){
        diff.clear();
        int sm = 0;
        for(int i = 0; i < r; ++i)
            diff.push_back(abs(cor-x[i]));
        sort(all(diff));
        while(1){
            if(b-diff[0] >= 0)
                b -= diff[0], diff.pop_front(), sm++;
            else
                break;
        }
        answer = max(answer, sm);
    }
    return answer;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Runtime error 1 ms 348 KB Execution killed with signal 11
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1068 ms 348 KB Time limit exceeded
2 Halted 0 ms 0 KB -