用户输出
1 2
1 2
2 2
3 2
4 2
5 2
5 2
6 2
6 1
6 1
3
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#116932 | #1474. [L2-4] 数列 | Wrong Answer | 0 | 11558 ms | 3072 K | C++ / 2.5 K | 青春猪头蒟蒻会梦到 0d000721吗 | 2025-04-18 11:21:58 |
#include <bits/stdc++.h>
using namespace std;
struct Route {
int m, p, l;
} lr[100010], rr[100010];
int main() {
int n, ans = 2147483647, t;
int lcnt = 1, rcnt = 1, lmax = 1, rmax = 1;
int llen[100010], rlen[100010];
int lp[100010], rp[100010];
vector<int> a;
cin >> n;
a.push_back(0);
for (int i = 1; i <= n; i++) {
cin >> t;
a.push_back(t);
}
lr[1] = { a[1], 1, 1 };
llen[1] = 1;
lp[1] = 1;
for (int i = 2; i <= n; i++) {
for (int j = 1; j <= lcnt; j++) {
// cout<<j<<' '<<lr[j].m<<' '<<lr[j].p<<' '<<lr[j].l<<endl;
if (a[i] >= lr[j].m + i - lr[j].p) {
lr[j].p = i;
lr[j].m = a[i];
lr[j].l++;
if (lr[j].l > lmax) {
lmax = lr[j].l;
lp[i] = i;
} else if (lr[j].l == lmax && lr[j].p != lp[i]) {
lp[i] = 0;
}
break;
}
if (j == lcnt) {
lr[++lcnt].l = 1;
lr[lcnt].p = i;
lr[lcnt].m = a[i];
if (lr[j].l > lmax) {
lmax = lr[lcnt].l;
lp[i] = i;
} else if (lr[lcnt].l == lmax && lr[lcnt].p != lp[i]) {
lp[i] = 0;
}
break;
}
}
llen[i] = lmax;
}
rr[n] = { a[n], n, 1 };
rlen[n] = 1;
lp[n] = n;
for (int i = n - 1; i >= 1; i--) {
for (int j = 1; j <= rcnt; j++) {
if (a[i] >= rr[j].m - i + rr[j].p) {
rr[j].p = i;
rr[j].m = a[i];
rr[j].l++;
if (rr[j].l > rmax) {
rmax = rr[j].l;
rp[i] = i;
} else if (rr[j].l == lmax && rr[j].p != rp[i]) {
rp[i] = -1;
}
break;
}
if (j == rcnt) {
rr[++rcnt].l = 1;
rr[rcnt].p = i;
rr[rcnt].m = t;
if (rr[j].l > rmax) {
rmax = rr[rcnt].l;
rp[i] = i;
} else if (rr[rcnt].l == lmax && rr[rcnt].p != rp[i]) {
rp[i] = -1;
}
break;
}
}
rlen[i] = rmax;
}
for (int i = 1; i <= n; i++) {
cout << llen[i] << ' ' << rlen[i] << endl;
if (rp[i] != lp[i])
ans = min(ans, n - llen[i] - rlen[i]);
else
ans = min(ans, n - llen[i] - rlen[i] + 1);
}
cout << ans;
}
用户输出
1 2
1 2
2 2
3 2
4 2
5 2
5 2
6 2
6 1
6 1
3
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
1 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
3 3
3 2
3 2
3 2
3 1
4 1
10
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1990
1738 699 2477 2058 1245 665 1007 960 1544 2212 2109 1983 2440 2446 2104 1117 1821 1593 809 2201
<9889 bytes omitted>
用户输出
1 13
1 13
2 13
2 13
2 13
2 13
2 13
2 13
2 13
3 13
3 13
3 13
4 13
5 13
5 13
5 13
5 13
5 13
5 13
5 13
5 13
6 13
7 13
7 13
7 13
7 1
<11201 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1988
1731 2702 1124 2607 964 2566 1897 2691 2349 1428 1952 2353 1415 2805 1996 2114 1631 2652 1145 2
<9939 bytes omitted>
用户输出
1 30
2 30
2 30
2 30
2 30
2 30
2 30
3 30
3 30
3 30
3 30
3 30
3 30
3 30
3 30
4 30
4 30
4 30
4 30
4 30
4 30
5 30
5 30
5 30
5 30
5 3
<11629 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1993
2574 1286 723 2520 1333 1698 2232 886 1858 2442 2473 2124 1094 1289 2031 995 1617 745 1782 952
<9921 bytes omitted>
用户输出
1 12
1 12
1 12
2 12
2 12
3 12
4 12
4 12
4 12
5 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 12
6 1
<11179 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1995
2160 2788 3252 3598 2516 1835 2805 2577 3611 2414 1775 3607 2440 3752 3252 2176 2789 3625 2370
<9833 bytes omitted>
用户输出
1 34
2 34
3 34
4 34
4 34
4 34
4 34
4 34
5 34
5 34
5 34
5 34
5 34
6 34
6 34
6 34
6 34
6 34
6 34
6 34
6 34
6 34
6 34
6 34
6 34
6 3
<11594 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
2000
2126 1787 1871 802 1131 1525 1468 326 965 1805 663 781 1139 833929836 2047 1125 1116 1384 411 1
<9826 bytes omitted>
用户输出
1 10
1 10
2 10
2 10
2 10
3 10
3 10
3 10
3 10
4 10
4 10
4 10
4 10
4 10
4 10
4 10
4 10
4 10
4 10
4 10
4 10
4 10
5 9
5 9
5 9
5 9
5
<9824 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1998
3365 3007 2602 3076 1480 2945 1679 1994 3089 1933 1401 2489 1533 2104 2412 3116 2914 1441 2193
<9955 bytes omitted>
用户输出
1 14
1 14
1 14
2 14
2 14
2 14
2 14
3 14
3 14
3 14
3 14
4 14
4 14
4 14
4 14
4 14
5 14
5 14
5 14
5 14
5 14
5 14
5 14
5 14
5 14
5 1
<11500 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1963
1709 442 1585 1226 1587 518 1764 1167 298 2171 531 562 2130 1958 1074 2068 1007 573 294 1658 41
<9670 bytes omitted>
用户输出
1 14
1 14
2 14
2 14
3 14
3 14
3 14
3 14
3 14
3 14
3 14
3 14
4 14
4 14
4 14
4 14
4 14
4 14
4 14
4 14
4 14
4 14
4 14
5 14
5 14
5 1
<11325 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1692
1203 2261 1930 1878 1607 1966 1782 1629 2189 1383 2116 2235 1820 1200 1427 2249 928 2298 1468 1
<8417 bytes omitted>
用户输出
1 31
2 31
2 31
2 31
2 31
2 31
2 31
2 31
3 31
3 31
3 31
4 31
4 31
4 31
4 31
5 31
5 31
5 31
5 31
5 31
6 31
6 31
6 31
6 31
6 31
6 3
<9854 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
99999
167293 115145 170579 151355 96051 137719 97344 125998 125361 138026 101013 151986 114851 12506
<661694 bytes omitted>
用户输出
1 116
1 116
2 116
2 116
2 116
2 116
2 116
2 116
2 116
3 116
3 116
3 116
3 116
3 116
3 116
3 116
3 116
4 116
4 116
4 116
4 116
5
<290223 bytes omitted>
99998
80897 46816 67664 95905 97471 81232 36626 105313 524551472 71274 82630 88196 77120 36103 10930
<672521 bytes omitted>
用户输出
1 161
1 161
2 161
2 161
3 161
3 161
3 161
4 161
5 161
5 161
5 161
5 161
5 161
5 161
6 161
6 161
6 161
7 161
7 161
7 161
7 161
7
<773310 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
99997
17698 33623 93636 64444 46426 114877 83446 54369 45555 78458 100731 63506 77768 27311 98907 92
<666246 bytes omitted>
用户输出
1 128
2 128
3 128
3 128
3 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4 128
4
<772606 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
99996
536069077 84239 85100 49388 130630 46339 82023 47912 76828 127216 90090 122980 129937 71379 60
<674978 bytes omitted>
用户输出
1 168
1 168
2 168
2 168
3 168
3 168
3 168
3 168
3 168
3 168
4 168
5 168
5 168
5 168
5 168
5 168
5 168
5 168
5 168
5 168
5 168
5
<771791 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
95995
55415 68140 66698 76004 95631 87160 56975 59365 118732 55179 65000 112946 47560 81693 100575 4
<645259 bytes omitted>
用户输出
1 136
2 136
2 136
3 136
4 136
4 136
4 136
4 136
5 136
5 136
5 136
5 136
5 136
5 136
5 136
5 136
6 136
6 136
6 136
6 136
6 136
6
<731481 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
50001
31469 56081 35725 67444 53567 41515 54228 62544 55202 784147106 65594 64852 49072 67172 65388
<301900 bytes omitted>
用户输出
1 87
2 87
2 87
3 87
3 87
3 87
3 87
4 87
4 87
4 87
5 87
5 87
5 87
6 87
6 87
7 87
7 87
7 87
7 87
7 87
7 87
7 87
7 87
7 87
7 87
7 8
<334951 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
60001
46065 61556 35285 503262729 16242 59952 62269 65573 67843 27531 58630 46443 22776 72328 61587
<368588 bytes omitted>
用户输出
1 73
2 73
2 73
3 73
3 73
3 73
3 73
4 73
5 73
5 73
5 73
5 73
5 73
6 73
6 73
6 73
6 73
6 73
6 73
6 73
6 73
6 73
6 73
6 73
6 73
6 7
<407949 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
70001
69379 80286 83543 58544 35068 36071 42462 53669 35951 77751 62203 65475 63385 52726 41581 5478
<444872 bytes omitted>
用户输出
1 92
2 92
3 92
3 92
3 92
3 92
3 92
4 92
4 92
4 92
5 92
6 92
6 92
6 92
6 92
6 92
6 92
6 92
6 92
7 92
8 92
8 92
8 92
8 92
8 92
8 9
<477798 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
80001
78200 25540 36099 86505 39760 54493 46061 67924 86450 54960 34344 23671 87229 45281 52147 7455
<512650 bytes omitted>
90001
56007 98473 35406 80754 18067 66970 57228 85639 88622 23905 92037 97735 31971 29510 73250 3047
<587485 bytes omitted>
100000
102921 87781 38849 39618 66032 88710 113683 104453 34367 78881 50738 82880 103061 82656 12890
<674495 bytes omitted>
100000
131754 141439 114491 99504 57992 104470 98407 95471 104360 116967 124964 48857 100947 137949
<678278 bytes omitted>
用户输出
1 163
2 163
2 163
2 163
2 163
2 163
2 163
2 163
3 163
3 163
3 163
3 163
3 163
4 163
4 163
4 163
4 163
4 163
4 163
4 163
4 163
4
<765689 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
100000
103200 89882 106975 106378 66516 58320 48946 55704 77493 26690 26760 50501 30545 62179 31955
<672359 bytes omitted>
用户输出
1 160
1 160
2 160
2 160
2 160
2 160
2 160
2 160
2 160
2 160
2 160
3 160
3 160
3 160
3 160
3 160
4 160
4 160
4 160
4 160
5 160
5
<771886 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
100000
131102 131024 125414 61134 67464 91162 95011 66129 107749 143626 56062 131968 95373 125137 82
<677915 bytes omitted>
用户输出
1 137
1 137
1 137
1 137
2 137
3 137
4 137
4 137
5 137
5 137
5 137
5 137
5 137
6 137
6 137
6 137
6 137
6 137
6 137
6 137
6 137
6
<761720 bytes omitted>
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
100000
38854 41727 58732 54420 82801 41621 58982 83388 79092 33713 100709 13806 32655 86182 15430 31
<657507 bytes omitted>