| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 250660 | kingfran1907 | Studentsko (COCI14_studentsko) | C++14 | 44 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long llint;
const int maxn = 5010;
const int inf = 0x3f3f3f3f;
int n, k;
int niz[maxn];
vector< int > v;
int dp[maxn];
int main() {
scanf("%d%d", &n, &k);
for (int i = 0; i < n; i++)
scanf("%d", niz+i);
for (int i = 0; i < n; i++) v.push_back(niz[i]);
sort(v.begin(), v.end());
for (int i = 0; i < n; i++)
niz[i] = lower_bound(v.begin(), v.end(), niz[i]) - v.begin();
for (int i = 0; i < n; i++) niz[i] /= k;
int sol = 0;
for (int i = 0; i < n; i++) {
dp[i] = 0;
for (int j = 0; j < i; j++) {
if (niz[j] <= niz[i])
dp[i] = max(dp[i], dp[j]);
}
dp[i]++;
sol = max(sol, dp[i]);
}
printf("%d", n - sol);
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... | ||||
| # | 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
