# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
827557 | Anthony_Liu | Rabbit Carrot (LMIO19_triusis) | C++11 | 25 ms | 5320 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx2")
//#pragma GCC optimization ("unroll-loops")
#define f first
#define s second
#define ll long long
#define pb push_back
#define pi pair <int,int>
#define vi vector <int>
#define size(x) (int)(x).size()
#define all(x) x.begin(), x.end()
void setIO(string name = "") {
cin.tie(0)->sync_with_stdio(0);
if (size(name)) {
freopen((name + ".in").c_str(), "r", stdin);
freopen((name + ".out").c_str(), "w", stdout);
}
}
int lis(vi &a) {
vi dp;
for (auto u : a) {
int p = upper_bound(all(dp), u) - dp.begin();
if (p == size(dp)) dp.pb(u);
else dp[p] = u;
}
return size(dp);
}
int N, M;
int main()
{
setIO();
cin >> N >> M;
vi poles(N);
for (int i = 0; i < N; i++) cin >> poles[i];
vi pos;
for (int i = 1; i <= N; i++) {
if (i * M >= poles[i - 1]) {
pos.pb(i * M - poles[i - 1]);
}
}
cout << N - lis(pos) << endl;
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... |