#include <bits/stdc++.h>
using namespace std;
#define ll long long
map <int, int> m;
int besthub(int R, int L, int X[], ll B) {
for (int i = 0; i < R; ++i) {
m[X[i]] = 1;
}
int jog = 0, ans;
ll op;
for (int i = 1; i <= L; ++i) {
op = 0;
ans = 0;
for (int j = i; j <= L; ++j) {
op++;
if (op > B) break;
if (m.find (j) != m.end ()) {
ans++;
}
}
jog = max (jog, ans);
}
return jog;
}
//int main() {
// freopen("kk.txt", "r", stdin);
// int R, L;
// ll B;
// cin >> R >> L >> B;
// int X[R];
// for (int i = 0; i < R; ++i) {
// cin >> X[i];
// }
// cout << besthub (R, L, X, B);
//}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
341 ms |
296 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1082 ms |
1236 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |