QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#407452 | #6528. Sequence | stegatxins0# | 28 | 1981ms | 4100kb | C++17 | 1.3kb | 2024-05-08 18:41:19 | 2024-05-08 18:41:20 |
Judging History
answer
#include <bits/stdc++.h>
#include "sequence.h"
using namespace std;
#ifdef DEBUG
#include "debug.cpp"
#else
#define dbg(...)
#define dbgarr(...)
#endif
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
int sequence(int N, std::vector<int> A) {
// oset<int> s;
// s.insert(1);
// s.insert(1);
// for(auto x:s)dbg(x);
int ans = 0;
for(int i=0; i<N; i++){
multiset<int> m;
m.insert(A[i]);
auto med_it = m.begin();
auto med_it2 = m.begin();
// auto med_it3 = m.begin();
int med_idx = 0;
int med_idx2 = 0;
for(int j=i+1; j<N; j++){
m.insert(A[j]);
if(A[j] < *med_it){med_idx++;}
if(A[j] < *med_it2){med_idx2++;}
int med1 = (j-i)/2;
int med2 = (j-i+1)/2;
if(med_idx < med1){ med_it++; }
if(med_idx > med1) --med_it;
if(med_idx2 < med2) ++med_it2;
if(med_idx2 > med2) --med_it2;
med_idx = med1;
med_idx2 = med2;
ans = max(ans, (int)m.count(*med_it));
ans = max(ans, (int)m.count(*med_it2));
// dbg(m);
// dbg(i, j, med1, med2, *med_it, *med_it2, ans);
}
}
return ans;
}
详细
Subtask #1:
score: 11
Accepted
Test #1:
score: 11
Accepted
time: 1ms
memory: 3804kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 98 92 89 9 86 80 6 42 20 84 82 46 56 52 30 44 39 35 82 57 33 18 38 32 63 27 55 33 44 41 39 62 26 46 59 21 85 36 60 7 36 50 22 87 83 71 27 4 3 87 47 17 62 70 24 9 20 81 21 57 50 13 32 68 70 11 95 5 56 64 90 47 42 44 72 71 46 84 72 56 63 37 35 80 78 4 54 74 79 ...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 3
result:
ok
Test #2:
score: 11
Accepted
time: 2ms
memory: 4008kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 96 1 6 1 4 6 2 5 1 1 2 8 2 4 4 1 9 8 9 8 5 3 6 6 4 9 4 2 8 8 8 2 9 1 3 6 6 1 6 5 5 3 7 9 7 1 8 5 6 8 5 1 1 4 9 6 7 2 6 6 7 4 2 2 8 5 6 4 8 2 6 5 8 6 1 6 2 1 3 4 6 3 6 8 2 5 7 8 2 4 1 5 6 2 3 6 6
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 18
result:
ok
Test #3:
score: 11
Accepted
time: 1ms
memory: 3732kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 99 1 3 5 1 2 4 1 3 4 1 5 5 3 1 1 4 2 1 4 5 5 4 1 4 4 2 1 2 2 1 5 2 4 2 1 5 1 3 3 4 3 2 3 1 3 2 2 4 1 5 4 2 2 2 4 5 3 4 3 2 3 4 5 4 5 1 2 2 2 5 3 1 3 5 1 2 1 2 1 2 3 1 4 4 4 5 3 3 3 5 1 3 4 2 4 4 2 1 2
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 19
result:
ok
Test #4:
score: 11
Accepted
time: 2ms
memory: 3764kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 100 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 ...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 100
result:
ok
Test #5:
score: 11
Accepted
time: 1ms
memory: 4028kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 97 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 8...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 1
result:
ok
Test #6:
score: 11
Accepted
time: 1ms
memory: 3744kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 100 48 40 13 1 8 31 46 19 42 9 13 8 33 43 85 9 36 21 83 49 4 49 49 24 49 82 9 88 24 33 23 99 79 46 83 49 2 4 40 92 49 44 92 99 49 49 38 49 12 29 49 89 100 81 79 85 22 38 49 8 27 29 3 100 100 42 82 49 31 26 40 49 46 10 49 49 84 77 93 20 33 90 49 18 49 49 18 84...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 18
result:
ok
Test #7:
score: 11
Accepted
time: 1ms
memory: 3744kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 97 42 47 7 23 9 10 53 75 53 53 2 1 75 14 4 16 53 35 32 37 97 31 47 91 77 84 53 87 93 85 70 80 2 19 53 53 67 85 25 3 37 41 52 21 30 84 25 15 37 30 97 53 22 97 33 97 53 9 69 38 71 6 74 4 13 26 27 90 91 47 11 90 7 76 97 17 80 53 23 95 73 53 1 21 43 42 2 33 29 32...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 11
result:
ok
Test #8:
score: 11
Accepted
time: 1ms
memory: 3772kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 98 72 73 8 81 47 26 17 61 93 69 95 7 25 42 15 45 17 88 42 94 68 49 23 50 93 42 97 43 11 7 83 42 43 42 57 12 76 54 61 76 71 42 62 87 87 7 42 83 92 47 72 66 88 1 23 51 42 26 74 42 84 70 59 42 83 14 60 81 53 56 42 20 56 8 92 69 42 76 42 24 87 70 4 80 79 61 66 93...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 5
result:
ok
Test #9:
score: 11
Accepted
time: 1ms
memory: 3772kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 99 85 88 94 94 59 47 63 75 75 40 38 35 59 56 81 48 96 47 46 34 96 62 35 46 83 34 95 34 69 48 15 10 3 92 67 34 38 92 84 84 42 49 86 63 82 65 39 89 80 14 34 69 55 42 67 34 68 86 15 72 18 96 2 7 1 89 16 68 65 97 52 38 92 34 87 16 2 62 34 18 34 74 34 8 21 77 45 8...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 7
result:
ok
Subtask #2:
score: 17
Accepted
Dependency #1:
100%
Accepted
Test #10:
score: 17
Accepted
time: 295ms
memory: 3876kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1999 486 1494 1286 1247 138 393 816 1646 971 1657 1284 1320 702 194 602 1775 13 1856 61 1264 1005 681 1679 1174 718 1781 1407 97 365 1949 1805 1609 1066 637 98 1686 1361 584 146 1879 941 62 1433 1850 729 1754 71 1292 1945 1328 1705 362 591 407 998 1909 1690 2...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 4
result:
ok
Test #11:
score: 17
Accepted
time: 296ms
memory: 3956kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1996 1475 182 1399 123 1593 884 1167 1543 663 302 16 217 1284 1777 1875 1996 1238 1368 52 1935 881 235 1437 1002 1000 1473 1248 540 139 282 850 451 797 1595 803 1050 293 1827 1677 1323 1617 1760 13 151 1329 74 1828 1609 532 1224 103 685 1040 48 88 238 501 873...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 3
result:
ok
Test #12:
score: 17
Accepted
time: 485ms
memory: 3952kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1996 12 36 13 34 17 23 24 32 24 36 28 31 27 19 26 31 24 6 42 32 19 43 25 32 13 39 34 39 24 29 15 32 16 28 36 2 3 37 7 42 34 11 43 25 31 17 43 24 27 43 6 28 17 25 33 44 41 14 27 11 2 5 20 20 7 17 11 19 8 16 2 26 20 43 4 7 43 42 15 19 40 14 31 24 39 16 13 23 19...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 52
result:
ok
Test #13:
score: 17
Accepted
time: 457ms
memory: 3880kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1998 25 16 15 17 25 1 7 36 24 40 30 2 34 13 38 39 33 1 5 4 3 37 36 17 41 29 21 29 19 12 2 38 18 2 42 11 40 39 21 18 43 26 9 10 11 36 36 38 12 13 8 28 23 26 3 44 32 33 18 15 15 27 18 9 25 36 16 27 4 30 10 26 35 27 43 5 29 33 8 14 43 42 6 12 34 6 28 22 30 3 24 ...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 49
result:
ok
Test #14:
score: 17
Accepted
time: 1981ms
memory: 3876kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1999 4 5 1 2 5 4 4 4 2 5 3 5 3 3 1 2 5 5 2 3 3 2 2 4 5 3 4 3 2 1 4 2 3 5 2 2 2 5 4 3 5 1 4 2 5 4 3 2 5 3 4 3 5 2 1 1 4 3 2 5 2 1 5 3 5 3 2 4 5 4 1 2 1 2 1 4 3 5 5 2 1 3 3 4 4 4 2 5 4 2 1 2 4 2 5 3 1 1 4 2 3 4 5 2 5 1 3 3 1 2 2 5 1 5 5 4 4 3 2 2 5 4 1 2 3 1 5 ...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 378
result:
ok
Test #15:
score: 17
Accepted
time: 276ms
memory: 3864kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 1
result:
ok
Test #16:
score: 17
Accepted
time: 604ms
memory: 3872kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1997 831 845 694 533 66 466 615 401 522 181 171 87 245 250 581 66 257 441 723 212 992 910 126 106 798 939 845 214 654 754 761 109 684 708 167 693 44 255 492 586 122 295 637 565 827 487 436 630 97 454 117 814 403 306 637 822 223 327 105 95 996 416 650 181 917 ...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 261
result:
ok
Test #17:
score: 17
Accepted
time: 1562ms
memory: 3876kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1998 696 737 209 283 554 1052 842 822 892 502 136 1036 301 8 855 900 228 338 233 954 326 410 770 850 455 582 579 993 213 319 562 894 541 947 1010 14 743 908 277 859 458 763 463 816 923 585 880 618 352 622 780 619 11 429 133 180 258 139 807 753 350 197 616 471...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 398
result:
ok
Test #18:
score: 17
Accepted
time: 312ms
memory: 4100kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1997 657 1176 941 515 903 1021 551 1103 491 661 1188 961 1073 923 78 355 1094 1112 1092 1006 1243 297 92 1052 223 1005 61 123 116 771 250 1080 874 1238 1046 128 360 1119 212 451 1173 13 303 443 303 1198 119 467 361 1168 784 1062 369 685 366 126 436 272 1141 8...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 29
result:
ok
Test #19:
score: 17
Accepted
time: 313ms
memory: 3956kb
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 1997 1079 227 1250 808 655 731 548 961 966 324 922 1264 376 203 925 805 692 1086 186 832 399 817 899 917 317 1056 737 246 936 180 90 1277 375 790 1006 934 1055 24 1138 1017 265 601 970 1160 600 994 262 340 20 1197 889 1251 885 522 106 972 602 616 990 332 1159...
output:
nfp39szm23aa01pcmyosi03slwpeksnfjri3opqp OK 30
result:
ok
Subtask #3:
score: 0
Time Limit Exceeded
Test #20:
score: 0
Time Limit Exceeded
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 499996 53 78 81 111 119 124 126 130 164 175 219 227 233 249 282 298 332 341 348 436 437 448 452 455 462 465 495 535 557 558 576 600 620 627 632 642 643 659 695 696 713 730 743 805 816 865 869 872 875 882 883 902 924 937 990 998 1025 1092 1137 1145 1166 1176 1...
output:
Unauthorized output
result:
Subtask #4:
score: 0
Time Limit Exceeded
Test #28:
score: 0
Time Limit Exceeded
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 499999 2 1 2 2 2 1 2 3 1 3 1 2 2 1 2 1 1 2 1 1 2 1 1 2 1 2 1 1 1 1 1 2 2 1 1 2 1 1 1 2 1 2 1 1 1 2 3 3 3 3 1 3 1 2 2 1 1 1 3 1 3 1 1 2 1 2 2 2 1 3 2 1 1 1 2 2 1 2 2 3 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 2 1 1 1 1 2 2 1 1 1 1 1 2 1 1 2 1 1 3 2 1 1 1 3 1 1 2 1 3 1 1 ...
output:
Unauthorized output
result:
Subtask #5:
score: 0
Time Limit Exceeded
Test #33:
score: 0
Time Limit Exceeded
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 499999 490225 471440 499001 369862 494577 479599 486292 476071 471988 486939 482356 482290 497141 488452 495446 494292 404798 493826 482595 481107 447196 477441 418064 495941 448927 483365 418585 489220 443224 482574 487957 467944 493253 472016 475543 442250 ...
output:
Unauthorized output
result:
Subtask #6:
score: 0
Time Limit Exceeded
Dependency #2:
100%
Accepted
Test #41:
score: 0
Time Limit Exceeded
input:
8wq90di9812978rqwiok0k0o21klklm21oiwi121 79997 36415 18516 420 60790 49058 32960 27785 69895 74029 21962 53361 43308 54680 77334 61363 1780 62171 23208 1130 78835 79364 37259 45646 54570 72797 56842 34418 10553 28532 11521 52797 29973 58123 42899 62212 289 4565 10345 73305 14960 70036 68229 4746 966...
output:
Unauthorized output
result:
Subtask #7:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
0%