답안 #1010812

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1010812 2024-06-29T11:54:13 Z Muhammet 쌀 창고 (IOI11_ricehub) C++17
17 / 100
1000 ms 1372 KB
#include <bits/stdc++.h>
#include "ricehub.h"

#define sz(s) (int)s.size()

using namespace std;

#define ll long long

int besthub(int n, int l, int a[], ll b){
    multiset <ll> s;
    ll ans = 0;
    for(int i = 0; i < n; i++){
        s.clear();
        for(int j = 0; j < n; j++){
            if(a[i] != a[j]){
                s.insert(abs(a[i]-a[j]));
            }
        }
        ll b1 = b, x = 0;
        while(b1 > 0 and sz(s) > 0){
            ll k = *s.begin();
            s.erase(s.begin());
            if(b1 < k) break;
            b1 -= k;
            x++;
        }
        ans = max(ans,x);
    }
    return ans+1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 448 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 448 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Incorrect 1 ms 348 KB Output isn't correct
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 33 ms 344 KB Output is correct
4 Correct 44 ms 348 KB Output is correct
5 Incorrect 9 ms 348 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1028 ms 1372 KB Time limit exceeded
2 Halted 0 ms 0 KB -