#include "elephants.h"
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}
int n,l;
vi s;
void init(int N, int L, int X[])
{
n = N;
l = L;
for (int i = 0;i < n;++i)
s.pb(X[i]);
}
int update(int i, int y)
{
s[i] = y;
int ans = 0;
set < int > ss(all(s));
int prev = -(l + 1);
for (auto it : ss) {
if (it > prev) {
++ans;
prev = it + l;
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
492 KB |
Output is correct |
3 |
Correct |
3 ms |
552 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
492 KB |
Output is correct |
3 |
Correct |
3 ms |
552 KB |
Output is correct |
4 |
Correct |
5 ms |
552 KB |
Output is correct |
5 |
Correct |
4 ms |
552 KB |
Output is correct |
6 |
Correct |
3 ms |
624 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
492 KB |
Output is correct |
3 |
Correct |
3 ms |
552 KB |
Output is correct |
4 |
Correct |
5 ms |
552 KB |
Output is correct |
5 |
Correct |
4 ms |
552 KB |
Output is correct |
6 |
Correct |
3 ms |
624 KB |
Output is correct |
7 |
Execution timed out |
9014 ms |
1828 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
492 KB |
Output is correct |
3 |
Correct |
3 ms |
552 KB |
Output is correct |
4 |
Correct |
5 ms |
552 KB |
Output is correct |
5 |
Correct |
4 ms |
552 KB |
Output is correct |
6 |
Correct |
3 ms |
624 KB |
Output is correct |
7 |
Execution timed out |
9014 ms |
1828 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
492 KB |
Output is correct |
3 |
Correct |
3 ms |
552 KB |
Output is correct |
4 |
Correct |
5 ms |
552 KB |
Output is correct |
5 |
Correct |
4 ms |
552 KB |
Output is correct |
6 |
Correct |
3 ms |
624 KB |
Output is correct |
7 |
Execution timed out |
9014 ms |
1828 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |