#include <bits/stdc++.h>
using namespace std;
#define designed ios_base::sync_with_stdio(0);
#define by cin.tie(0);
#define AndreasK cout.tie(0);
#define ii pair <int,int>
#define vi vector <int>
#define iii pair <int,ii>
#define vii vector <ii>
#define vc vector <char>
#define vb vector <bool>
int besthub(int R, int L, int X[], long long B)
{
int mx=0;
for (int f=0;f<R;f++){
int c=X[f];
vi a;
for (int r=0;r<R;r++)
a.push_back(abs(X[r]-c));
sort(a.begin(),a.end());
int ttl=0;
int b=B;
for (int r=0;r<R;r++){
if (a[r]<=b){
b-=a[r];
ttl++;
}
}
mx=max(mx,ttl);
}
return mx;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
452 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
2 ms |
348 KB |
Output is correct |
22 |
Correct |
2 ms |
348 KB |
Output is correct |
23 |
Correct |
3 ms |
348 KB |
Output is correct |
24 |
Correct |
4 ms |
344 KB |
Output is correct |
25 |
Correct |
4 ms |
348 KB |
Output is correct |
26 |
Correct |
3 ms |
348 KB |
Output is correct |
27 |
Correct |
3 ms |
452 KB |
Output is correct |
28 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
13 ms |
348 KB |
Output is correct |
4 |
Correct |
14 ms |
464 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
448 KB |
Output is correct |
7 |
Correct |
7 ms |
464 KB |
Output is correct |
8 |
Correct |
9 ms |
464 KB |
Output is correct |
9 |
Correct |
3 ms |
448 KB |
Output is correct |
10 |
Correct |
3 ms |
344 KB |
Output is correct |
11 |
Correct |
9 ms |
460 KB |
Output is correct |
12 |
Correct |
13 ms |
612 KB |
Output is correct |
13 |
Correct |
14 ms |
464 KB |
Output is correct |
14 |
Correct |
14 ms |
348 KB |
Output is correct |
15 |
Correct |
3 ms |
348 KB |
Output is correct |
16 |
Correct |
4 ms |
348 KB |
Output is correct |
17 |
Correct |
8 ms |
464 KB |
Output is correct |
18 |
Correct |
9 ms |
344 KB |
Output is correct |
19 |
Correct |
14 ms |
348 KB |
Output is correct |
20 |
Correct |
14 ms |
348 KB |
Output is correct |
21 |
Correct |
269 ms |
516 KB |
Output is correct |
22 |
Correct |
278 ms |
600 KB |
Output is correct |
23 |
Correct |
577 ms |
344 KB |
Output is correct |
24 |
Correct |
520 ms |
344 KB |
Output is correct |
25 |
Correct |
501 ms |
532 KB |
Output is correct |
26 |
Correct |
501 ms |
536 KB |
Output is correct |
27 |
Correct |
445 ms |
348 KB |
Output is correct |
28 |
Correct |
459 ms |
536 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1031 ms |
924 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |