| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1337551 | Rafael_Augusto | Rabbit Carrot (LMIO19_triusis) | C++20 | 21 ms | 2044 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define f first
#define s second
#define get(i, v) get<i>(v)
#define all(v) v.begin(), v.end()
#define dbg(v) cerr << #v << " = " << v << "\n"
#define fall(i, s, n) for(int i=s; i<n; i++)
#define rfall(i, s, n) for(int i=s; i>=n; i--)
typedef pair<int, int> pii;
typedef tuple<int, int, int> trio;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void setIO(string name){
freopen((name+".in").c_str(), "r", stdin);
freopen((name+".out").c_str(), "w", stdout);
}
int32_t main(){
ios::sync_with_stdio(0); cin.tie(0);
int n, m; cin >> n >> m;
deque<int> lis; lis.pb(0);
fall(i, 1, n+1){
int p; cin >> p;
p -= m*i;
int j = lower_bound(all(lis), p)-lis.begin()-1;
if(j == -1) lis.push_front(p);
else if(j+1 != lis.size()) lis[j]=p;
}
int k = lis.size();
cout << n+1-k << "\n";
}컴파일 시 표준 에러 (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... | ||||
