UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#205736#3698. 海港Allen123456hello100346ms8392kbC++11850b2024-07-19 18:14:362024-07-19 20:10:00

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int n,k[100005],t[100005],cnt[100005],ans[100005];
vector<int> x[100005];
queue< pair<int,int> > apple;
int main(){
    scanf("%d",&n);
    for (int i=1;i<=n;++i){
        scanf("%d%d",t+i,k+i);
        x[i].resize(k[i]+2);
        for (int j=1;j<=k[i];++j){scanf("%d",&x[i][j]);}
    }
    int tmp;
    for (int i=1;i<=n;++i){
        ans[i]=ans[i-1];
        while ((!apple.empty())&&(apple.front().first<=t[i]-86400)){
            tmp=apple.front().second;
            for (int j=1;j<=k[tmp];++j){if (!(--cnt[x[tmp][j]])){--ans[i];}}
            apple.pop();
        }
        apple.push({t[i],i});
        for (int j=1;j<=k[i];++j){if (!(cnt[x[i][j]])){++ans[i];}++cnt[x[i][j]];}
    }
    for (int i=1;i<=n;++i){printf("%d\n",ans[i]);}
    return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 5
Accepted
time: 0ms
memory: 3592kb

input:

1
10 10 6 2 7 2 1 5 6 1 6 10

output:

6

result:

ok single line: '6'

Test #2:

score: 5
Accepted
time: 0ms
memory: 3592kb

input:

1
8 10 2 4 8 6 9 4 8 3 8 3

output:

6

result:

ok single line: '6'

Test #3:

score: 5
Accepted
time: 0ms
memory: 3592kb

input:

9
2531 10 66 18 67 72 4 15 98 33 74 71
9303 17 16 27 77 40 64 75 100 95 14 79 36 63 22 76 40 69 11
1...

output:

10
26
37
43
48
51
55
62
67

result:

ok 9 lines

Test #4:

score: 5
Accepted
time: 0ms
memory: 3588kb

input:

9
22 9 52 66 38 96 27 86 35 86 9
400 16 23 56 67 30 21 7 8 85 100 82 14 36 87 47 44 14
15105 9 73 5 ...

output:

8
23
29
36
41
49
53
61
65

result:

ok 9 lines

Test #5:

score: 5
Accepted
time: 0ms
memory: 3588kb

input:

62
795 1 31
1373 1 90
2055 2 96 60
2537 2 64 17
5432 3 37 88 58
5671 3 12 22 75
6364 2 23 2
6783 1 4...

output:

1
2
4
6
9
12
14
15
17
18
20
21
22
23
24
25
26
27
29
32
36
36
37
38
38
39
39
39
40
41
42
43
44
44
45
...

result:

ok 62 lines

Test #6:

score: 5
Accepted
time: 2ms
memory: 3588kb

input:

65
1415 2 42 36
2064 3 23 26 42
4789 2 27 22
5013 1 7
5843 1 67
6801 3 7 100 27
6809 1 86
7363 3 57 ...

output:

2
4
6
7
8
9
10
13
15
15
17
18
20
21
21
22
24
25
27
29
32
33
34
35
36
38
39
40
40
40
41
41
41
42
44
4...

result:

ok 65 lines

Test #7:

score: 5
Accepted
time: 0ms
memory: 3588kb

input:

63
197 1 64
1184 1 69
2967 2 88 16
5701 2 7 16
5813 2 35 96
6239 2 74 96
6722 1 11
8220 2 87 7
10790...

output:

1
2
4
5
7
8
9
10
11
11
12
12
13
13
14
15
16
18
19
20
20
22
22
23
23
23
24
27
27
27
28
29
31
32
32
32...

result:

ok 63 lines

Test #8:

score: 5
Accepted
time: 0ms
memory: 3592kb

input:

68
3260 1 73
5670 1 73
6667 2 20 81
7213 1 6
7351 1 81
7931 1 24
9642 1 20
10014 1 64
11349 1 99
114...

output:

1
1
3
4
4
5
5
6
7
8
8
8
9
10
12
13
14
14
14
14
15
16
17
18
20
20
21
22
22
23
23
24
25
25
25
26
26
27...

result:

ok 68 lines

Test #9:

score: 5
Accepted
time: 0ms
memory: 3644kb

input:

954
102828 4 316 697 832 681
692505 3 325 781 495
1213951 2 404 352
3029205 2 674 520
3138055 3 375 ...

output:

4
3
2
2
3
5
9
1
7
4
4
1
2
7
3
2
3
3
4
3
4
4
1
6
3
2
1
2
6
2
3
3
5
3
4
5
3
4
2
1
2
4
4
2
7
3
9
2
2
6
...

result:

ok 954 lines

Test #10:

score: 5
Accepted
time: 2ms
memory: 3640kb

input:

960
543714 4 657 679 850 714
2253751 3 201 467 265
2367579 4 899 632 676 54
2752334 1 207
2846951 4 ...

output:

4
3
4
1
4
6
3
4
3
3
1
6
11
2
2
5
4
3
5
3
6
3
6
3
5
4
2
6
5
1
7
2
4
2
2
3
3
2
5
3
1
1
4
4
1
4
2
5
6
2...

result:

ok 960 lines

Test #11:

score: 5
Accepted
time: 2ms
memory: 3644kb

input:

946
1822906 1 609
2497173 1 202
2630211 1 296
5238763 2 729 166
7454877 3 326 992 943
9085393 3 574 ...

output:

1
1
1
2
3
3
5
8
5
3
3
2
5
3
1
2
1
2
1
2
2
4
5
5
2
6
8
2
3
5
5
4
6
5
7
1
2
1
4
1
4
2
1
5
5
3
5
1
1
4
...

result:

ok 946 lines

Test #12:

score: 5
Accepted
time: 0ms
memory: 3640kb

input:

947
1636848 4 834 80 616 716
2977515 5 964 578 592 891 632
3666371 1 559
4266903 4 72 744 291 414
42...

output:

4
5
1
4
7
2
7
6
4
7
3
6
4
6
5
8
2
2
4
7
1
4
3
4
5
3
4
4
5
4
3
6
1
3
3
3
3
5
9
3
1
3
5
2
2
3
1
2
3
2
...

result:

ok 947 lines

Test #13:

score: 5
Accepted
time: 0ms
memory: 3644kb

input:

943
1462719 4 45 750 799 268
2319019 1 558
4485756 2 34 993
5731858 4 178 853 22 767
6957595 3 63 94...

output:

4
1
2
4
3
2
6
5
8
6
4
3
2
2
3
4
3
3
5
2
1
4
2
3
2
3
2
5
3
5
3
3
3
1
2
10
2
3
2
1
2
2
3
1
4
5
3
3
3
1...

result:

ok 943 lines

Test #14:

score: 5
Accepted
time: 0ms
memory: 3644kb

input:

959
651769 7 230 671 443 291 254 449 817
1106157 3 130 675 837
3453587 2 588 407
4117948 5 767 396 6...

output:

7
3
2
5
3
3
2
5
6
3
5
1
2
4
2
3
2
5
3
6
4
8
4
5
4
2
2
2
4
3
2
2
4
6
7
3
1
5
1
1
4
2
1
3
8
3
1
1
3
3
...

result:

ok 959 lines

Test #15:

score: 5
Accepted
time: 62ms
memory: 8372kb

input:

94832
44 5 77292 97385 67969 47829 77081
70 2 76702 72902
74 4 9010 62977 82967 63848
80 5 29663 339...

output:

5
7
11
16
22
25
29
31
33
34
36
38
40
41
44
48
51
53
55
59
60
63
64
66
69
72
75
78
80
83
87
90
91
92
...

result:

ok 94832 lines

Test #16:

score: 5
Accepted
time: 50ms
memory: 8388kb

input:

95054
18 3 5338 43914 28245
72 6 56712 12196 94707 42510 37541 28957
249 6 32120 49330 15969 59412 6...

output:

3
9
15
17
21
22
26
31
34
40
44
51
53
55
58
60
63
68
70
72
77
80
86
87
90
92
96
97
99
104
106
107
111...

result:

ok 95054 lines

Test #17:

score: 5
Accepted
time: 62ms
memory: 8392kb

input:

95087
9 2 9517 45906
28 1 2209
85 5 56355 95845 73323 10066 309
92 5 62872 40197 53749 31519 54023
1...

output:

2
3
8
13
14
18
20
23
25
26
28
33
37
39
43
45
48
52
55
57
59
62
68
72
76
77
79
83
88
90
93
97
104
107...

result:

ok 95087 lines

Test #18:

score: 5
Accepted
time: 54ms
memory: 8384kb

input:

95012
15 4 93806 26503 40884 53890
34 2 78441 86380
66 7 80662 92868 5260 16865 70294 65795 1968
108...

output:

4
6
13
16
20
26
32
34
37
40
41
42
44
47
52
56
57
59
61
63
64
65
69
72
74
78
82
85
94
100
102
105
113...

result:

ok 95012 lines

Test #19:

score: 5
Accepted
time: 53ms
memory: 8392kb

input:

95092
129 3 6078 93567 73282
152 2 8937 4813
187 2 2568 50555
191 1 4007
217 7 6075 26458 47839 6753...

output:

3
5
7
8
15
18
19
21
24
26
29
33
37
38
42
46
51
53
56
59
60
63
67
70
71
74
80
86
88
91
96
106
108
111...

result:

ok 95092 lines

Test #20:

score: 5
Accepted
time: 59ms
memory: 8388kb

input:

95009
240 3 74760 83944 85331
264 3 86894 88991 19266
285 5 60072 79199 15183 2572 31111
299 1 5027
...

output:

3
6
11
12
17
21
24
28
31
37
40
42
44
51
53
55
59
62
67
71
73
77
79
81
85
88
90
91
93
97
101
103
109
...

result:

ok 95009 lines