제출 #219289

#제출 시각아이디문제언어결과실행 시간메모리
219289quocnguyen1012Rabbit Carrot (LMIO19_triusis)C++14
100 / 100
43 ms5484 KiB
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back #define eb emplace_back using namespace std; typedef long long ll; typedef pair<int, int> ii; const int maxn = 2e5 + 5; ll a[maxn]; int N, M; vector<ll> f; signed main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef LOCAL freopen("A.INP", "r", stdin); freopen("A.OUT", "w", stdout); #endif // LOCAL cin >> N >> M; for(int i = 1; i <= N; ++i){ cin >> a[i]; a[i] = i * M - a[i]; if(a[i] < 0) continue; int idx = upper_bound(f.begin(), f.end(), a[i]) - f.begin(); if(idx == f.size()){ f.eb(a[i]); } else{ f[idx] = a[i]; } } cout << N - f.size(); }

컴파일 시 표준 에러 (stderr) 메시지

triusis.cpp: In function 'int main()':
triusis.cpp:32:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if(idx == f.size()){
        ~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...