QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#864508#6390. Inspectionsearlyamazon11 4ms9952kbC++14778b2025-01-20 17:38:352025-01-20 17:38:43

Judging History

你现在查看的是最新测评结果

  • [2025-01-20 17:38:43]
  • 评测
  • 测评结果:11
  • 用时:4ms
  • 内存:9952kb
  • [2025-01-20 17:38:35]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define int long long

const int mn = 2e5+7;
const int oo = 1e18+7;
int n,m,q;
int l[mn], r[mn], s[mn];
int ost[mn];

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin>>n>>m>>q;
    for (int i = 0; i < m; i++){
        cin>>l[i]>>r[i];
    }
    for (int i = 0; i < q; i++){
        cin>>s[i];
        int ind = 0;
        int w = 0;
        for (int j = 1; j <= n; j++){
            ost[j] = oo;
        }
        for (int j = 0; j < m; j++){
            for (int k = l[j]; k <= r[j]; k++){
                // cerr<<k<<" ";
                ind++;
                if (ind - ost[k] > s[i]) w++;
                ost[k] = ind;
            }
        }
        cout<<w<<" ";
    }
}

詳細信息

Subtask #1:

score: 11
Accepted

Test #1:

score: 11
Accepted
time: 0ms
memory: 7780kb

input:

20 20 10
3 16
8 17
17 18
6 16
7 7
3 19
8 13
4 15
5 7
1 18
17 18
3 13
1 10
6 10
2 8
11 18
1 14
9 18
3 16
4 15
8 2 17 19 12 15 7 17 4 3

output:

150 165 64 40 122 79 150 64 165 165 

result:

ok single line: '150 165 64 40 122 79 150 64 165 165 '

Test #2:

score: 11
Accepted
time: 2ms
memory: 7908kb

input:

200 200 200
30 198
22 155
10 175
113 178
48 70
12 39
139 189
162 183
128 164
153 181
29 81
48 153
87 163
45 71
47 125
25 118
68 76
43 102
160 179
33 129
18 95
74 122
66 124
180 193
81 198
151 152
94 113
66 121
165 199
25 118
45 195
4 161
41 176
129 163
16 58
50 171
168 177
171 198
134 194
54 120
56 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #3:

score: 11
Accepted
time: 2ms
memory: 7908kb

input:

200 200 200
179 197
137 140
14 56
101 189
48 188
4 150
55 104
57 65
46 141
172 173
15 144
134 179
28 147
76 175
109 189
43 189
46 100
31 83
57 118
91 159
19 116
6 58
101 190
91 100
142 167
135 162
28 59
133 143
42 150
16 188
105 157
106 192
13 22
184 197
31 184
47 122
75 84
150 159
8 166
70 70
51 13...

output:

1 1 1 9 0 1648 0 8364 0 1 0 0 0 0 0 2 2 0 23 0 2 9 0 5 0 0 216 5 0 9 0 0 0 0 0 0 2 5 9 2 0 0 6 0 0 1 0 1 0 6 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 2 0 0 52 0 418 0 449 0 0 0 0 0 0 2 0 0 0 0 0 1 0 0 1 0 0 1 9476 2 5607 0 1 6 0 1 2 0 0 0 47 0 2 0 1 5 0 0 0 0 0 117 90 0 1 0 90 5 1 5 0 17 0 0 0 47 0 2 207 13099...

result:

ok single line: '1 1 1 9 0 1648 0 8364 0 1 0 0 ...0 30 6 1 0 0 2 6 0 0 0 0 0 0 0 '

Test #4:

score: 11
Accepted
time: 0ms
memory: 7776kb

input:

200 200 200
1 2
3 17
18 22
23 27
28 40
41 75
76 84
85 86
87 111
112 118
119 123
124 134
135 156
157 166
167 174
175 175
176 199
200 200
1 6
7 14
15 74
75 76
77 83
84 90
91 102
103 116
117 117
118 120
121 123
124 131
132 162
163 166
167 178
179 192
193 200
1 7
8 9
10 39
40 43
44 59
60 82
83 86
87 90
...

output:

1748 1748 0 0 0 1748 0 0 1748 1748 0 0 0 1748 0 1748 1748 0 0 0 1748 1748 0 0 1748 1748 0 0 1748 0 1748 1748 1748 0 0 1748 0 1748 1748 1748 1748 1748 0 0 0 1748 1748 1748 0 0 0 1748 0 1748 1748 1748 1748 0 1748 0 1748 1748 1748 1748 1748 0 1748 1748 1748 0 1748 1748 1748 0 1748 0 1748 0 1748 1748 0 ...

result:

ok single line: '1748 1748 0 0 0 1748 0 0 1748 ...748 0 0 0 1748 1748 0 1748 0 0 '

Test #5:

score: 11
Accepted
time: 4ms
memory: 9820kb

input:

200 200 200
1 200
8 190
9 186
16 184
32 173
40 152
61 127
89 89
1 200
8 188
11 176
19 173
20 167
28 165
30 161
31 141
32 132
38 131
39 129
59 99
63 89
66 86
72 72
1 200
14 183
32 166
48 138
51 133
99 112
101 108
103 103
1 200
5 184
19 175
25 170
62 148
80 124
104 113
110 110
1 200
5 186
19 185
24 18...

output:

0 308 0 0 0 0 0 0 0 0 0 516 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 222 0 0 0 0 0 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2058 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1435 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok single line: '0 308 0 0 0 0 0 0 0 0 0 516 79... 236 0 0 0 0 0 0 0 0 0 0 0 143 '

Test #6:

score: 11
Accepted
time: 2ms
memory: 7900kb

input:

200 200 200
1 200
64 156
28 60
81 166
65 186
24 87
94 160
86 108
83 157
99 156
32 75
126 164
153 172
55 157
29 69
27 149
34 114
122 143
164 174
55 66
27 160
67 86
30 154
32 34
21 160
77 95
88 176
54 146
66 150
103 178
28 97
22 192
125 175
32 69
45 194
92 176
149 157
54 153
41 85
35 84
59 193
155 191...

output:

31 230 7730 20 24 24 18 24 1533 24 35 36 26 13388 4194 20 24 18 24 36 2799 65 24 391 24 198 825 100 55 39 20 46 825 24 26 126 24 20 20 20 24 20 55 52 121 20 26 288 24 20 20 270 1252 1420 24 24 24 35 13988 79 24 26 24 38 20 24 20 21 501 24 825 21 31 288 685 1420 24 20 13033 20 36 20 20 695 24 31 501 ...

result:

ok single line: '31 230 7730 20 24 24 18 24 153...14633 26 24 101 24 24 24 20 20 '

Test #7:

score: 11
Accepted
time: 4ms
memory: 9952kb

input:

200 200 200
1 197
1 179
1 140
1 137
1 56
1 14
1 189
1 101
1 188
1 48
1 4
1 150
1 55
1 104
1 57
1 65
1 46
1 141
1 173
1 172
1 144
1 15
1 134
1 179
1 147
1 28
1 175
1 76
1 109
1 189
1 189
1 43
1 100
1 46
1 83
1 31
1 118
1 57
1 159
1 91
1 19
1 116
1 58
1 6
1 101
1 190
1 100
1 91
1 167
1 142
1 135
1 162...

output:

22 0 0 0 31 0 0 0 2 32 35 18001 0 0 0 32 0 0 0 0 0 26 34 0 26 0 113 7 0 0 0 0 34 0 32 0 9 16096 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 34 0 19542 0 0 113 33 0 0 0 3569 0 0 0 0 0 0 0 0 0 31 0 33 0 82 0 0 0 0 0 0 214 32 0 0 0 0 0 32 22 187 0 0 0 0 0 0 0 0 32 0 0 0 0 7 0 378 0 0 214 0 0 0 0 9 9 214 478 20372 ...

result:

ok single line: '22 0 0 0 31 0 0 0 2 32 35 1800...1 22 0 0 82 26 91 0 26 0 0 0 9 '

Test #8:

score: 11
Accepted
time: 0ms
memory: 7908kb

input:

98 76 54
1 94
5 18
4 65
18 21
29 72
53 67
62 94
5 45
12 41
20 75
17 40
42 88
8 9
33 60
48 98
37 54
16 93
14 15
68 80
57 92
2 94
3 96
68 97
95 96
38 83
55 81
3 50
24 40
14 31
25 41
49 93
14 80
10 90
41 55
45 82
15 41
39 60
16 89
12 81
2 92
30 50
24 44
81 90
14 54
23 91
48 73
29 31
46 95
18 18
9 69
50...

output:

2425 2369 2442 2407 2284 2084 2442 2407 2379 2369 2379 2327 2455 2393 2464 2449 2455 2455 2379 2274 2442 2464 2464 2464 2305 2379 2425 2369 2379 2155 2274 2455 2464 2284 2393 2464 2425 2455 2442 2284 2379 2284 2464 2211 2284 2464 2393 2455 2442 2369 2393 2455 2425 2369 

result:

ok single line: '2425 2369 2442 2407 2284 2084 ... 2442 2369 2393 2455 2425 2369 '

Test #9:

score: 11
Accepted
time: 0ms
memory: 7904kb

input:

1 1 1
1 1
0

output:

0 

result:

ok single line: '0 '

Test #10:

score: 11
Accepted
time: 0ms
memory: 7740kb

input:

1 1 1
1 1
1000000000000

output:

0 

result:

ok single line: '0 '

Subtask #2:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Test #11:

score: 0
Time Limit Exceeded

input:

2000 2000 200000
909 1547
1182 1944
81 1117
549 958
45 881
662 916
496 1045
1333 1409
796 857
1047 1624
637 1673
745 1642
437 648
1056 1655
205 262
1018 1761
1188 1543
14 950
439 1430
178 1087
59 1907
282 1422
1068 1787
1162 1502
235 1088
1565 1609
452 1151
439 650
1297 1857
470 1912
963 1134
1418 1...

output:


result:


Subtask #3:

score: 0
Time Limit Exceeded

Test #18:

score: 0
Time Limit Exceeded

input:

200000 2000 200000
1 120424
1 117468
1 120525
1 165913
1 120671
1 173649
1 177086
1 160439
1 113657
1 1024
1 172987
1 46445
1 141508
1 72552
1 166171
1 71764
1 129090
1 59615
1 157163
1 44185
1 24107
1 127434
1 157165
1 64831
1 2536
1 138854
1 96084
1 11803
1 162841
1 171842
1 116681
1 47063
1 65296...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #2:

0%

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%