双端队列做的,感觉写的很一般,有大佬分享一下写的么? #include<iostream> #include<deque> using namespace std; int func(int* a, int length) { deque<int> s; int max = 0; for (int i = 1; i < length; i++) { if (a[i] > a[max]) max = i; } for (int i = 0; i <= max; i++) s.push_back(a[i]); for ...