Submission #521750

# Submission time Handle Problem Language Result Execution time Memory
521750 2022-02-03T00:54:59 Z penguin133 Rabbit Carrot (LMIO19_triusis) C++14
0 / 100
1 ms 332 KB
#include <bits/stdc++.h>
using namespace std;

int dp[200005], A[200005];

int main(){
	int n,m, maxi =0 ;cin >> n >> m;
	for(int i=1;i<=n;i++)cin >> A[i], A[i] = m * i - A[i];
	vector<int>v;
	vector<int> :: iterator it;
	for(int i=1;i<=n;i++){
		if(A[i] < 0)continue;
		if(A[i] >= v.back())v.push_back(A[i]);
		else it = lower_bound(v.begin(), v.end() , A[i]), *it = A[i];
	}
	cout << n-v.size();
}

Compilation message

triusis.cpp: In function 'int main()':
triusis.cpp:7:11: warning: unused variable 'maxi' [-Wunused-variable]
    7 |  int n,m, maxi =0 ;cin >> n >> m;
      |           ^~~~
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -