제출 #1330136

#제출 시각아이디문제언어결과실행 시간메모리
1330136alexaaa쌀 창고 (IOI11_ricehub)C++20
17 / 100
1 ms344 KiB
#include "ricehub.h"
using namespace std;
#include<bits/stdc++.h>

int besthub(int R, int L, int X[], long long B)
{
  int max_count = 0;
  for(int i = 1; i <= L; i ++){
    int count = 0;
    int total = 0;
    priority_queue<int,vector<int>,greater<int>> q;
    for(int j = 0; j < R; j++){
      q.push(abs(i-X[j]));

    }
    for(int m = 0; m < R; m++){
      total += q.top();
      q.pop();
      if(total > B){
        max_count = max(count, max_count);
        break;
      }
      count ++;
    }
  }
  return max_count ++;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...