#include <bits/stdc++.h>
#include "ricehub.h"
#define ll long long
#define pb push_back
using namespace std;
inline ll min(ll a,ll b){
return a<b?a:b;
}
inline ll max(ll a,ll b){
return a<b?b:a;
}
inline ll abs(ll a,ll b){
return max(a,b)-min(a,b);
}
int besthub(int r,int l,int x[],ll b){
int MAX = 0;
for(int i=0;i<r;i++){
vector<ll> vec;
for(int j=0;j<r;j++){
vec.pb(abs(x[i],x[j]));
}
sort(vec.begin(),vec.end());
int Count = 0;
ll cost = b;
while(cost>0){
if(vec[Count]<=cost)
cost -= vec[Count++];
else
break;
}
MAX = max(MAX,Count);
}
return MAX;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
5 |
Correct |
5 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Incorrect |
4 ms |
256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Runtime error |
5 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1085 ms |
1184 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |