| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 768828 | Doncho_Bonboncho | Rabbit Carrot (LMIO19_triusis) | C++14 | 21 ms | 5176 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
#define endl "\n"
template<class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; }
template<class T, class T2> inline bool chkmin(T &x, const T2 &y) { return x > y ? x = y, 1 : 0; }
#ifndef LOCAL
#define cerr if(false) cerr
#define endl "\n"
#endif
template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {
return os << "(" << p.first << ", " << p.second << ")";
}
template<typename T, typename B = decay<decltype(*begin(declval<T>()))>, typename enable_if<!is_same<T, string>::value>::type* = nullptr>
ostream& operator <<(ostream &os, const T &c) {
bool f = false;
os << "(";
for(const auto &x : c) {
if(f) os << ", "; f = true;
os << x;
}
return os << ")";
}
#define out(x) #x << "=" << x << " "
struct debug {
debug(const string &msg) { cerr << "LINE " << msg << ": "; }
~debug() { cerr << endl; }
template<class T>
debug& operator <<(const T x) {
cerr << x;
return *this;
}
};
#define dbg debug(to_string(__LINE__))
typedef long long ll;
const ll mod = 1e9 + 7;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
const int MAX_N = 2e5 + 42;
int a[MAX_N];
std::vector<ll> v;
signed main() {
#ifndef LOCAL
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#endif
int n, m;
std::cin>>n>>m;
for( int i=1 ; i<=n ; i++ ) std::cin>>a[i];
for( int i=1 ; i<=n ; i++ ){
if( m*i < a[i] ) continue;
ll curr = m*i - a[i];
int ind = std::upper_bound( v.begin(), v.end(), curr ) - v.begin();
if( ind == v.size() ) v.push_back( curr );
else v[ind] = curr;
cerr<<v<<endl;
}
std::cout<<n - v.size()<<endl;
return 0;
}
// To the OGs, I'm thankin' you now
// Was watchin' you when you was pavin' the ground
// I copied your cadence, I mirrored your style
// I studied the greats, I'm the greatest right now컴파일 시 표준 에러 (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... | ||||
