Submission #563388

# Submission time Handle Problem Language Result Execution time Memory
563388 2022-05-17T05:39:33 Z guagua0407 Rabbit Carrot (LMIO19_triusis) C++17
0 / 100
0 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main() {_
	ll n,m;
	cin>>n>>m;
	ll b[n];
	for(ll i=0;i<n;i++){
		ll x;
		cin>>x;
		b[i]=m*(i+1)-x;
		//cout<<b[i]<<' ';
	}
	multiset<ll> s;
	for(ll i=0;i<n;i++){
		if(s.upper_bound(b[i])!=s.end()) s.erase(s.upper_bound(b[i]));
		s.insert(b[i]);
	}
	/*for(auto it=s.begin();it!=s.end();it++){
		cout<<*it<<' ';
	}*/
	cout<<n-s.size();
	return 0;
}
# 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 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 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 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -