#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define mxn 505
#define mxm 105
#define f first
#define s second
#define pb push_back
#define es " "
#define endl '\n'
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define ll long long
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
typedef pair<string, string> pii;
typedef pair<int, pii> pip;
int resp;
int testa(int x, int n, int b, int v[]){
int can=0, soma=0;
vector<int> pont;
for(int i=1; i<=n; i++){
pont.pb(abs(x-v[i]));
}
sort(all(pont));
for(int i:pont){
if(soma+i<=b){
soma+=i;
can++;
}
}
return can;
}
int besthub(int n, int l, int v[], ll b){
for(int i=1; i<=l; i++){
resp=max(resp, testa(i, n, b, v));
}
return resp;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
304 KB |
Output is correct |
5 |
Correct |
1 ms |
308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
3 ms |
204 KB |
Output is correct |
6 |
Correct |
2 ms |
204 KB |
Output is correct |
7 |
Correct |
3 ms |
204 KB |
Output is correct |
8 |
Correct |
3 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
4 ms |
204 KB |
Output is correct |
16 |
Correct |
3 ms |
204 KB |
Output is correct |
17 |
Correct |
1 ms |
204 KB |
Output is correct |
18 |
Correct |
1 ms |
204 KB |
Output is correct |
19 |
Correct |
3 ms |
204 KB |
Output is correct |
20 |
Correct |
3 ms |
204 KB |
Output is correct |
21 |
Correct |
11 ms |
308 KB |
Output is correct |
22 |
Correct |
11 ms |
204 KB |
Output is correct |
23 |
Correct |
173 ms |
284 KB |
Output is correct |
24 |
Correct |
165 ms |
204 KB |
Output is correct |
25 |
Correct |
158 ms |
296 KB |
Output is correct |
26 |
Correct |
162 ms |
300 KB |
Output is correct |
27 |
Correct |
187 ms |
288 KB |
Output is correct |
28 |
Correct |
181 ms |
288 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
44 ms |
204 KB |
Output is correct |
2 |
Correct |
44 ms |
288 KB |
Output is correct |
3 |
Execution timed out |
1095 ms |
204 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1078 ms |
840 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |