제출 #374128

#제출 시각아이디문제언어결과실행 시간메모리
374128mariowongBigger segments (IZhO19_segments)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; long long n,a[500005],dp[500005],ps[500005]; deque <pair<long long,long long> > q; pair<long long,long long> now; int main(){ ios::sync_with_stdio(false); cin >> n; for (int i=1;i<=n;i++){ cin >> a[i]; ps[i]=ps[i-1]+a[i]; } for (int i=1;i<=n;i++){ while (!q.empty() && q.front().first <= ps[i]-ps[q.front().second]){ now=q.front(); q.pop_front(); } q.push_Front(now); dp[i]=dp[now.second]+1; while (!q.empty() && q.back().first >= ps[i]-ps[now.second]){ q.pop_back(); } q.push_back(make_pair(ps[i]-ps[now.second],i)); } cout << dp[n] << "\n"; return 0; }

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

segments.cpp: In function 'int main()':
segments.cpp:19:10: error: 'class std::deque<std::pair<long long int, long long int> >' has no member named 'push_Front'; did you mean 'push_front'?
   19 |        q.push_Front(now);
      |          ^~~~~~~~~~
      |          push_front