#include <bits/stdc++.h>
//#include "elephants.h"
#define F first
#define S second
#define P push
#define pb push_back
#define MEM(dp,i) memset(dp,i,sizeof(dp))
#define W while
#define R return
#define C continue
#define SI size()
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define SF(x) scanf("%I64d",&x)
#define SF2(x,y) scanf("%I64d%I64d",&x,&y)
#define SF3(x,y,z) scanf("%I64d%I64d%I64d",&x,&y,&z)
#define SF4(x,y,z,o) scanf("%I64d%I64d%I64d%I64d",&x,&y,&z,&o)
#define all(v) v.begin(),v.end()
#define MAX_R 1000000
using namespace std;
const long long INF = 1e9+5e8;
const int MX=109;
int n;
vector<int> v;
int l;
void init(int N, int L, int X[])
{
n = N;
for(int i=0;i<n;i++)
v.pb(X[i]);
}
int update(int x, int y)
{
for(auto &i : v){
if(i==x){i=y;break;}
}
sort(all(v));
ll ret=0;
int ind=v[0];
W(1){
ret++;
auto a=upper_bound(all(v),ind+l-1);
if(a==v.end())break;
ind=*a;
}
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9000 ms |
17644 KB |
Execution timed out |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9000 ms |
17644 KB |
Execution timed out |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9000 ms |
17784 KB |
Execution timed out |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9000 ms |
17916 KB |
Execution timed out |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9000 ms |
19264 KB |
Execution timed out |
2 |
Halted |
0 ms |
0 KB |
- |