# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
890192 | 2023-12-20T16:29:36 Z | Azzmi | Rabbit Carrot (LMIO19_triusis) | C++14 | 0 ms | 500 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n, m; int a[200'001]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> a[i]; a[i] -= i * m; } vector<int> dp; for (int i = 0; i < n+1; ++i) { auto pos = lower_bound(dp.begin(), dp.end(), a[i]) - dp.begin(); if (pos == dp.size()) { dp.push_back(a[i]); } else { dp[pos] = a[i]; } } // for (int i = 0; i < n+1; ++i) { // cout << a[i] << ' '; // } // cout << endl; if (a[n] > 0) { cout << n << '\n'; } else { cout << (int)dp.size() - 1 << '\n'; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 500 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 500 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 500 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 500 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |