| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 654261 | bane | Rabbit Carrot (LMIO19_triusis) | C++17 | 37 ms | 7580 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()
#define ite( x, n) for (int i = x; i<n; i++)
#define jte( x, n) for (int j = x; j<n; j++)
using pii = pair<int,int>;
using pll = pair<ll,ll>;
#define fr first
#define sc second
#define mp make_pair
void setIO(string name = "") {
cin.tie(0)->sync_with_stdio(0); // see /general/fast-io
if (sz(name)) {
freopen((name + ".in").c_str(), "r", stdin); // see /general/input-output
freopen((name + ".out").c_str(), "w", stdout);
}
}
ll inf = 100000000;
int MOD = 1e9 + 7;
int main() {
setIO();
int n,m;
cin >> n >> m;
vector<ll>a(n);
vector<ll>b(n);
ite(0,n){
cin >> a[i];
b[i] = m*(i + 1) - a[i];
}
vector<ll>dp;
for (auto e : b){
if (e < 0)continue;
auto it = upper_bound(dp.begin(), dp.end(), e);
if (it == dp.end()){
dp.pb(e);
}else *it = e;
}
cout<<n - dp.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... | ||||
