#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ft first
#define se second
#define NAME "A"
#define file freopen(NAME".INP","r",stdin); freopen(NAME".OUT","w",stdout);
#define sdf ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define el cout << "\n"
const int MOD = 1e9 + 7, N = 1e5 + 5;
int n, m;
int32_t main(){
sdf
// file
cin >> n >> m;
vector<int> a(n+1), b;
for(int i = 1;i <= n;++i){
cin >> a[i];
if(a[i] <= m * i){
b.push_back(a[i] - m * i);
}
}
multiset<int> st;
st.insert(0);
for(int i = 0;i < 12312;++i){
auto it = st.lower_bound(b[i]);
if(it == st.end()){
continue;
}
if(it != st.begin()){
it--;
st.erase(it);
}
st.insert(b[i]);
}
st.erase(0);
cout << n - st.size();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |