# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1075349 | theehann | Rabbit Carrot (LMIO19_triusis) | C++17 | 20 ms | 6676 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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
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(m*i - a[i]);
}
}
vector<int> ans;
for(int i = 0;i < b.size();++i){
int pos = upper_bound(ans.begin(), ans.end(), b[i]) - ans.begin();
if(pos == ans.size()){
ans.push_back(b[i]);
}
else{
ans[pos] = b[i];
}
}
cout << n - ans.size();
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |