QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#380337 | #6670. Niz | ltunjic# | 20 | 876ms | 13788kb | C++14 | 582b | 2024-04-07 00:26:36 | 2024-07-04 03:33:30 |
Judging History
answer
#include <cstdio>
#include <chrono>
#include <random>
using namespace std;
typedef long long ll;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 1e6 + 10;
int n, A[N];
int R[N], P[N];
int main() {
for(int i = 1; i < N; ++i) {
R[i] = rng();
P[i] = P[i - 1] ^ R[i];
}
scanf("%d", &n);
ll ans = 0;
for(int i = 0; i < n; ++i) {
scanf("%d", A + i);
int res = 0;
for(int j = i; j >= 0; --j) {
res ^= R[A[j]];
ans += (res == P[i - j + 1]);
}
}
printf("%lld\n", ans);
return 0;
}
详细
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 0
Time Limit Exceeded
input:
998929 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 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
result:
Subtask #2:
score: 20
Accepted
Test #13:
score: 20
Accepted
time: 14ms
memory: 13076kb
input:
4977 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
4977
result:
ok single line: '4977'
Test #14:
score: 0
Accepted
time: 13ms
memory: 13052kb
input:
4971 2 2 2 1 1 1 2 1 1 1 1 1 1 1 2 1 2 2 2 1 1 2 2 1 1 2 1 1 2 2 2 1 1 2 1 1 2 1 2 2 2 2 2 1 1 2 2 2 2 2 2 1 2 1 1 1 1 2 2 1 2 1 2 2 1 2 1 2 1 1 1 2 2 2 1 1 1 2 2 2 2 2 1 1 1 2 1 1 1 1 1 2 1 1 2 1 1 1 2 1 1 2 2 1 2 1 1 1 2 1 2 2 2 1 2 2 1 2 1 1 2 1 2 2 1 1 2 1 2 2 1 2 1 2 2 2 1 2 2 2 2 1 1 1 2 2 1 1...
output:
4921
result:
ok single line: '4921'
Test #15:
score: 0
Accepted
time: 9ms
memory: 11964kb
input:
4972 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...
output:
7457
result:
ok single line: '7457'
Test #16:
score: 0
Accepted
time: 13ms
memory: 13068kb
input:
4978 1 8 9 3 2 6 6 9 5 9 1 2 1 3 3 1 1 5 7 1 2 5 5 7 3 3 4 7 5 6 10 1 8 6 10 3 5 5 6 3 4 7 6 5 3 2 5 6 8 8 9 4 3 3 9 4 8 10 1 10 2 7 4 10 9 9 4 4 5 1 5 7 8 6 8 4 1 3 4 5 6 5 8 3 7 3 3 5 7 9 7 6 9 3 9 3 4 5 1 3 8 3 1 6 9 1 7 5 5 4 4 8 6 8 5 7 9 7 4 4 9 7 5 4 6 6 9 4 6 5 2 1 4 3 9 10 4 3 1 7 5 7 1 8 6...
output:
653
result:
ok single line: '653'
Test #17:
score: 0
Accepted
time: 13ms
memory: 12868kb
input:
4999 91 55 18 98 86 72 61 70 60 22 15 98 23 1 70 26 91 44 64 78 1 20 58 87 37 99 61 17 40 60 82 1 62 39 27 5 65 96 82 44 2 95 4 79 95 87 45 18 45 8 7 61 18 17 87 74 85 41 93 53 88 94 84 53 27 11 4 16 23 55 22 53 19 64 32 41 25 65 38 40 64 63 23 77 14 18 58 38 36 51 47 69 36 26 9 56 26 63 5 90 93 37 ...
output:
40
result:
ok single line: '40'
Test #18:
score: 0
Accepted
time: 13ms
memory: 12172kb
input:
4961 56 871 832 207 364 919 980 489 90 612 397 766 355 519 487 297 991 188 809 81 650 739 820 442 243 159 765 880 111 275 205 415 120 297 878 629 524 580 493 600 732 266 15 285 94 254 827 328 834 145 893 166 959 964 562 961 91 189 996 25 478 205 685 700 844 780 617 23 564 578 369 2 691 516 817 640 9...
output:
3
result:
ok single line: '3'
Test #19:
score: 0
Accepted
time: 8ms
memory: 12620kb
input:
4995 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 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
4995
result:
ok single line: '4995'
Test #20:
score: 0
Accepted
time: 13ms
memory: 11756kb
input:
4953 4953 4952 4951 4950 4949 4948 4947 4946 4945 4944 4943 4942 4941 4940 4939 4938 4937 4936 4935 4934 4933 4932 4931 4930 4929 4928 4927 4926 4925 4924 4923 4922 4921 4920 4919 4918 4917 4916 4915 4914 4913 4912 4911 4910 4909 4908 4907 4906 4905 4904 4903 4902 4901 4900 4899 4898 4897 4896 4895 ...
output:
4953
result:
ok single line: '4953'
Test #21:
score: 0
Accepted
time: 9ms
memory: 12668kb
input:
4994 2576 2750 4180 2695 4302 4893 397 4522 1471 1131 1844 1578 3865 4104 282 1290 2729 2139 1860 2542 4012 4233 882 2915 65 4547 3283 3976 1661 605 1862 3902 3524 2368 4822 21 1575 3587 3762 515 560 170 3554 2589 3205 3517 4262 1659 3170 1646 609 3922 2507 2546 2171 4946 755 4932 1248 2634 3017 309...
output:
2
result:
ok single line: '2'
Test #22:
score: 0
Accepted
time: 13ms
memory: 12544kb
input:
4950 2475 2474 2473 2472 2471 2470 2469 2468 2467 2466 2465 2464 2463 2462 2461 2460 2459 2458 2457 2456 2455 2454 2453 2452 2451 2450 2449 2448 2447 2446 2445 2444 2443 2442 2441 2440 2439 2438 2437 2436 2435 2434 2433 2432 2431 2430 2429 2428 2427 2426 2425 2424 2423 2422 2421 2420 2419 2418 2417 ...
output:
4950
result:
ok single line: '4950'
Test #23:
score: 0
Accepted
time: 13ms
memory: 13420kb
input:
4989 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 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
4990
result:
ok single line: '4990'
Test #24:
score: 0
Accepted
time: 13ms
memory: 12792kb
input:
4959 2479 2478 2477 2476 2475 2474 2473 2472 2471 2470 2469 2468 2467 2466 2465 2464 2463 2462 2461 2460 2459 2458 2457 2456 2455 2454 2453 2452 2451 2450 2449 2448 2447 2446 2445 2444 2443 2442 2441 2440 2439 2438 2437 2436 2435 2434 2433 2432 2431 2430 2429 2428 2427 2426 2425 2424 2423 2422 2421 ...
output:
4959
result:
ok single line: '4959'
Test #25:
score: 0
Accepted
time: 14ms
memory: 11904kb
input:
4957 1707 544 969 1762 1776 1369 1806 1848 2314 634 407 1653 240 628 211 2133 57 946 455 254 1993 557 272 277 111 52 961 1903 1164 671 348 1368 861 2332 1858 127 1385 89 2043 369 2184 1582 789 581 825 1942 1596 1973 890 268 312 1902 179 48 1043 2284 1244 2151 1795 1710 1468 75 1257 624 1450 1149 864...
output:
2481
result:
ok single line: '2481'
Test #26:
score: 0
Accepted
time: 10ms
memory: 11660kb
input:
4989 4989 4988 4987 4986 4985 4984 4983 4982 4981 4980 4979 4978 4977 4976 4975 4974 4973 4972 4971 4970 4969 4968 4967 4966 4965 4964 4963 4962 4961 4960 4959 4958 4957 4956 4955 4954 4953 4952 4951 4950 4949 4948 4947 4946 4945 4944 4943 4942 4941 4940 4939 4938 4937 4936 4935 4934 4933 4932 4931 ...
output:
4989
result:
ok single line: '4989'
Test #27:
score: 0
Accepted
time: 13ms
memory: 13752kb
input:
4976 4976 4975 4974 4973 4972 4971 4970 4969 4968 4967 4966 4965 4964 4963 4962 4961 4960 4959 4958 4957 4956 4955 4954 4953 4952 4951 4950 4949 4948 4947 4946 4945 4944 4943 4942 4941 4940 4939 4938 4937 4936 4935 4934 4933 4932 4931 4930 4929 4928 4927 4926 4925 4924 4923 4922 4921 4920 4919 4918 ...
output:
2490
result:
ok single line: '2490'
Test #28:
score: 0
Accepted
time: 13ms
memory: 12824kb
input:
4993 4063 895 2954 273 556 1806 4088 1376 4627 2647 126 1529 4106 1521 3595 559 1060 1249 4357 4582 164 1320 2508 3585 2752 4323 4916 4030 2110 1053 4163 836 3525 235 3869 198 584 1001 1817 4986 4112 1862 1295 3798 438 2365 4809 2546 1368 4719 1140 548 2386 2323 1730 708 1850 2689 3637 1494 1751 268...
output:
0
result:
ok single line: '0'
Test #29:
score: 0
Accepted
time: 10ms
memory: 13568kb
input:
4961 4961 4959 4957 4956 4954 4950 4948 4943 4941 4938 4937 4934 4933 4931 4925 4923 4922 4920 4919 4918 4915 4910 4908 4906 4905 4904 4900 4899 4892 4891 4889 4888 4887 4886 4884 4883 4881 4876 4875 4873 4872 4871 4868 4867 4864 4863 4861 4859 4857 4856 4850 4848 4846 4844 4839 4838 4836 4834 4833 ...
output:
4961
result:
ok single line: '4961'
Test #30:
score: 0
Accepted
time: 13ms
memory: 13464kb
input:
4965 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 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
464
result:
ok single line: '464'
Test #31:
score: 0
Accepted
time: 13ms
memory: 13604kb
input:
4983 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 1462 1461 1460 1459 1458 1457 1456 1455 1454 1453 1452 1451 1450 1449 1448 1447 1446 1445 1444 1443 1442 1441 1440 1439 1438 1437 143...
output:
119
result:
ok single line: '119'
Test #32:
score: 0
Accepted
time: 13ms
memory: 13244kb
input:
4954 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 4868 4867 4866 4865 4864 4863 4862 4861 4860 4859 4858 4857 4856 4855 4854 4853 4852 4851 4850 4849 4848 4847 4846 4845 4844 4843 4842 4841 4840 4839 4838 4837 4836 4835 4834 4833 4832...
output:
127
result:
ok single line: '127'
Test #33:
score: 0
Accepted
time: 13ms
memory: 11860kb
input:
4979 4419 4470 4753 4439 4742 4063 3095 179 3189 3445 4733 1886 3351 2582 206 3276 4191 966 4066 1356 3897 3578 3661 3899 2377 4234 4313 3860 1571 183 4514 582 7 3741 2866 1192 2363 1269 1355 4271 1337 4729 4915 2797 4630 891 921 3836 2258 2452 2228 3144 1260 4180 4353 2296 1439 2480 1591 3383 2868 ...
output:
1
result:
ok single line: '1'
Test #34:
score: 0
Accepted
time: 14ms
memory: 13384kb
input:
4952 3958 1432 3367 3571 180 108 4713 1020 3455 252 777 1497 4191 3288 1686 1526 4083 2890 866 345 2293 4296 489 660 3821 883 1859 2456 2109 4278 4789 3759 1397 4806 2883 3761 2474 1903 1442 2024 2823 3533 4337 1341 4588 4230 4739 4522 1450 3768 1152 2559 1323 832 422 1480 3719 1407 1909 1621 3005 2...
output:
0
result:
ok single line: '0'
Test #35:
score: 0
Accepted
time: 14ms
memory: 12064kb
input:
4960 3482 2390 3624 2086 3162 4262 3869 849 4200 1681 4431 1342 1164 3428 57 1094 2302 4028 3979 53 763 2784 553 4037 442 3696 4311 938 2193 31 640 3830 1695 4751 2018 3482 2 1476 4369 3810 4692 3414 4638 1921 278 3052 478 2121 4397 2899 1977 3486 4733 556 3693 4580 3857 4905 4605 3360 4664 3945 271...
output:
1
result:
ok single line: '1'
Test #36:
score: 0
Accepted
time: 0ms
memory: 13120kb
input:
1 1
output:
1
result:
ok single line: '1'
Subtask #3:
score: 0
Wrong Answer
Dependency #2:
100%
Accepted
Test #37:
score: 33
Accepted
time: 869ms
memory: 13500kb
input:
49774 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
49774
result:
ok single line: '49774'
Test #38:
score: 0
Accepted
time: 866ms
memory: 13328kb
input:
49708 2 2 2 1 1 1 2 1 1 1 1 1 1 1 2 1 2 2 2 1 1 2 2 1 1 2 1 1 2 2 2 1 1 2 1 1 2 1 2 2 2 2 2 1 1 2 2 2 2 2 2 1 2 1 1 1 1 2 2 1 2 1 2 2 1 2 1 2 1 1 1 2 2 2 1 1 1 2 2 2 2 2 1 1 1 2 1 1 1 1 1 2 1 1 2 1 1 1 2 1 1 2 2 1 2 1 1 1 2 1 2 2 2 1 2 2 1 2 1 1 2 1 2 2 1 1 2 1 2 2 1 2 1 2 2 2 1 2 2 2 2 1 1 1 2 2 1 ...
output:
49380
result:
ok single line: '49380'
Test #39:
score: 0
Accepted
time: 867ms
memory: 12532kb
input:
49718 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...
output:
74576
result:
ok single line: '74576'
Test #40:
score: 0
Accepted
time: 870ms
memory: 13356kb
input:
49775 1 8 9 3 2 6 6 9 5 9 1 2 1 3 3 1 1 5 7 1 2 5 5 7 3 3 4 7 5 6 10 1 8 6 10 3 5 5 6 3 4 7 6 5 3 2 5 6 8 8 9 4 3 3 9 4 8 10 1 10 2 7 4 10 9 9 4 4 5 1 5 7 8 6 8 4 1 3 4 5 6 5 8 3 7 3 3 5 7 9 7 6 9 3 9 3 4 5 1 3 8 3 1 6 9 1 7 5 5 4 4 8 6 8 5 7 9 7 4 4 9 7 5 4 6 6 9 4 6 5 2 1 4 3 9 10 4 3 1 7 5 7 1 8 ...
output:
6524
result:
ok single line: '6524'
Test #41:
score: 0
Accepted
time: 876ms
memory: 13788kb
input:
49984 91 55 18 98 86 72 61 70 60 22 15 98 23 1 70 26 91 44 64 78 1 20 58 87 37 99 61 17 40 60 82 1 62 39 27 5 65 96 82 44 2 95 4 79 95 87 45 18 45 8 7 61 18 17 87 74 85 41 93 53 88 94 84 53 27 11 4 16 23 55 22 53 19 64 32 41 25 65 38 40 64 63 23 77 14 18 58 38 36 51 47 69 36 26 9 56 26 63 5 90 93 37...
output:
482
result:
ok single line: '482'
Test #42:
score: -33
Wrong Answer
time: 864ms
memory: 11908kb
input:
49611 56 871 832 207 364 919 980 489 90 612 397 766 355 519 487 297 991 188 809 81 650 739 820 442 243 159 765 880 111 275 205 415 120 297 878 629 524 580 493 600 732 266 15 285 94 254 827 328 834 145 893 166 959 964 562 961 91 189 996 25 478 205 685 700 844 780 617 23 564 578 369 2 691 516 817 640 ...
output:
43
result:
wrong answer 1st lines differ - expected: '42', found: '43'
Subtask #4:
score: 0
Skipped
Dependency #1:
0%