제출 #885523

#제출 시각아이디문제언어결과실행 시간메모리
885523MongHwaRabbit Carrot (LMIO19_triusis)C++17
100 / 100
22 ms6868 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; #define ll long long int main() { ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; vector<ll> cand; for(int i = 1; i <= n; i++) { int x; cin >> x; if(m*i - x >= 0) cand.push_back(m*i-x); } vector<ll> ans; for(int i = 0; i < (int)cand.size(); i++) { int pos = upper_bound(ans.begin(), ans.end(), cand[i]) - ans.begin(); if(pos == ans.size()) ans.push_back(cand[i]); else ans[pos] = cand[i]; } cout << n-ans.size() << '\n'; }

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

triusis.cpp: In function 'int main()':
triusis.cpp:30:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |   if(pos == ans.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...