mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 19:08:47 +00:00
3831. [Poi2014] Little Bird
https://hydro.ac/d/bzoj/record/62af21eb476f7f4f2b1e29e9
This commit is contained in:
parent
2375fdcf82
commit
5d2b144834
46
BZOJ/3831/3831.cpp
Normal file
46
BZOJ/3831/3831.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include <iostream>
|
||||
#include <deque>
|
||||
#include <vector>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 1000005;
|
||||
|
||||
int n, q, k, d[N];
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
cin >> n;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> d[i];
|
||||
}
|
||||
|
||||
cin >> q;
|
||||
|
||||
while (q--) {
|
||||
cin >> k;
|
||||
|
||||
std::vector<int> f(n + 1);
|
||||
std::deque<int> q;
|
||||
|
||||
q.push_back(1);
|
||||
for (int i = 2; i <= n; i++) {
|
||||
while (!q.empty() && q.front() < i - k) q.pop_front();
|
||||
f[i] = f[q.front()] + (d[q.front()] <= d[i]);
|
||||
while (!q.empty()
|
||||
&& (f[q.back()] > f[i]
|
||||
|| f[q.back()] == f[i] && d[q.back()] <= d[i]))
|
||||
q.pop_back();
|
||||
q.push_back(i);
|
||||
}
|
||||
|
||||
cout << f[n] << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
BIN
BZOJ/3831/data/1.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/1.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/1.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/10.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/10.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/10.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/11.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/11.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/11.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/11.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/12.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/12.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/12.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/12.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/13.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/13.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/13.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/13.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/14.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/14.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/14.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/14.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/15.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/15.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/15.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/15.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/16.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/16.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/16.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/16.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/17.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/17.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/17.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/17.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/18.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/18.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/18.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/18.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/19.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/19.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/19.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/19.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/2.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/2.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/2.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/20.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/20.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/20.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/20.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/21.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/21.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/21.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/21.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/22.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/22.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/22.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/22.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/23.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/23.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/23.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/23.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/24.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/24.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/24.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/24.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/25.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/25.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/25.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/25.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/26.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/26.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/26.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/26.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/27.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/27.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/27.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/27.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/28.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/28.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/28.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/28.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/29.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/29.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/29.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/29.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/3.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/3.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/3.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/30.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/30.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/30.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/30.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/31.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/31.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/31.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/31.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/32.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/32.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/32.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/32.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/33.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/33.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/33.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/33.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/34.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/34.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/34.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/34.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/35.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/35.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/35.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/35.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/36.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/36.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/36.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/36.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/37.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/37.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/37.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/37.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/38.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/38.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/38.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/38.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/39.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/39.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/39.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/39.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/4.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/4.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/4.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/40.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/40.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/40.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/40.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/41.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/41.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/41.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/41.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/42.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/42.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/42.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/42.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/43.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/43.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/43.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/43.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/44.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/44.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/44.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/44.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/45.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/45.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/45.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/45.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/46.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/46.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/46.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/46.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/47.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/47.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/47.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/47.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/48.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/48.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/48.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/48.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/49.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/49.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/49.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/49.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/5.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/5.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/5.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/50.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/50.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/50.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/50.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/51.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/51.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/51.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/51.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/52.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/52.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/52.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/52.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/6.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/6.out
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/6.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
BZOJ/3831/data/7.in
(Stored with Git LFS)
Normal file
BIN
BZOJ/3831/data/7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user