QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#499617 | #1147. Wall | tunjeek# | 8 | 1088ms | 9432kb | C++20 | 395b | 2024-07-31 16:20:55 | 2024-07-31 16:20:57 |
Judging History
answer
#include "wall.h"
#include <algorithm>
using namespace std;
const int N = 1e4 + 10;
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int f[]){
for(int i = 0; i < k; ++i) {
for(int j = left[i]; j <= right[i]; ++j) {
if(op[i] == 1) {
f[j] = max(f[j], height[i]);
} else {
f[j] = min(f[j], height[i]);
}
}
}
return;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 8
Accepted
Test #1:
score: 8
Accepted
time: 0ms
memory: 1576kb
input:
1 1 1 0 0 79348
output:
79348
result:
ok single line: '79348'
Test #2:
score: 8
Accepted
time: 1ms
memory: 1708kb
input:
1 5000 2 0 0 91858 1 0 0 85391 2 0 0 5015 1 0 0 41611 1 0 0 42982 1 0 0 70801 1 0 0 14431 2 0 0 14050 2 0 0 70240 2 0 0 84517 1 0 0 42618 1 0 0 92678 1 0 0 63376 1 0 0 36582 2 0 0 39214 2 0 0 22581 2 0 0 10970 1 0 0 67580 2 0 0 44016 2 0 0 12053 1 0 0 42450 1 0 0 12995 2 0 0 71888 2 0 0 29992 2 0 0 ...
output:
18711
result:
ok single line: '18711'
Test #3:
score: 8
Accepted
time: 0ms
memory: 1572kb
input:
267 1952 1 30 144 71757 1 170 257 86481 2 112 115 42915 2 11 144 6908 1 141 161 3819 1 91 126 47581 1 107 149 6466 2 81 204 50010 1 9 103 77557 2 115 202 42541 2 199 230 18052 2 98 230 553 1 125 235 36745 2 59 114 71005 1 18 65 78224 2 24 52 21249 1 16 84 47198 1 131 207 81016 2 162 263 21662 1 8 24...
output:
58284 58284 60534 58284 83411 83411 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 34807 ...
result:
ok 267 lines
Test #4:
score: 8
Accepted
time: 14ms
memory: 1720kb
input:
10000 5000 1 2237 2818 16629 2 3559 7378 25221 2 5353 6596 18247 2 7 8525 7339 2 7753 9730 78256 2 6301 8598 74433 1 5372 6260 23526 2 8231 9732 89822 2 1050 6451 41238 1 6362 6459 90393 2 1812 4993 90638 2 3518 4329 88017 2 412 6273 45512 1 6297 8927 87237 2 763 8022 2387 1 8561 8995 32427 2 1364 3...
output:
0 0 8060 8060 8060 8060 8060 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 96327 9...
result:
ok 10000 lines
Test #5:
score: 8
Accepted
time: 15ms
memory: 1696kb
input:
10000 5000 1 3 9999 99990 2 3 9998 6 1 4 9997 99982 2 4 9997 15 1 5 9996 99978 2 5 9993 24 1 5 9991 99974 2 8 9989 29 1 10 9989 99973 2 12 9989 44 1 13 9986 99961 2 16 9986 62 1 18 9985 99951 2 18 9982 78 1 19 9981 99950 1 19 9981 99937 2 20 9981 92 1 20 9981 99929 2 23 9978 98 1 23 9975 99917 2 23 ...
output:
0 0 0 6 15 99974 99974 99974 29 29 99973 99973 44 99961 99961 99961 62 62 78 99950 99929 99929 99929 98 98 99916 99916 99916 99916 99916 130 130 99904 99904 140 140 152 99894 99894 99894 166 166 166 99887 99887 99887 168 168 99877 99877 178 178 178 99863 193 193 99853 205 99852 99852 99852 99843 998...
result:
ok 10000 lines
Test #6:
score: 8
Accepted
time: 16ms
memory: 1704kb
input:
10000 5000 1 2 9997 99990 2 5 9996 0 1 8 9996 99981 1 11 9995 99976 2 14 9995 6 1 15 9995 99973 2 15 9995 16 1 18 9993 99964 2 18 9991 29 2 21 9990 39 1 22 9987 99960 2 22 9984 40 1 25 9983 99947 2 26 9982 50 1 27 9982 99934 2 30 9982 54 1 32 9979 99931 2 33 9977 55 1 35 9974 99928 2 37 9972 69 1 40...
output:
0 0 99990 99990 99990 0 0 0 99981 99981 99981 99981 99981 99981 6 16 16 16 29 29 29 29 40 40 40 99947 50 99934 99934 99934 54 54 99931 55 55 99928 99928 69 69 69 99913 99913 99913 99913 99913 99913 71 71 71 99896 99896 99896 82 98 98 98 99885 99885 99885 118 118 118 99876 99876 118 118 118 99868 998...
result:
ok 10000 lines
Subtask #2:
score: 0
Time Limit Exceeded
Test #7:
score: 24
Accepted
time: 0ms
memory: 1596kb
input:
1 1 1 0 0 51569
output:
51569
result:
ok single line: '51569'
Test #8:
score: 24
Accepted
time: 59ms
memory: 9432kb
input:
1 500000 1 0 0 92201 1 0 0 88187 1 0 0 78173 1 0 0 57498 1 0 0 95946 1 0 0 72895 1 0 0 46122 1 0 0 67752 1 0 0 45557 1 0 0 46888 1 0 0 84250 1 0 0 24947 1 0 0 30575 1 0 0 54171 1 0 0 80874 1 0 0 81939 1 0 0 88805 1 0 0 71685 1 0 0 28774 1 0 0 33813 1 0 0 41164 1 0 0 78447 1 0 0 85126 1 0 0 30919 1 0...
output:
1
result:
ok single line: '1'
Test #9:
score: 24
Accepted
time: 1088ms
memory: 4924kb
input:
18190 207265 1 1435 13396 14900 1 6250 8319 35530 1 7963 12194 50416 1 8286 12081 65629 1 11253 17172 87794 1 9886 16510 63411 1 2728 11446 61035 1 14426 17678 41533 1 2545 7233 6656 1 2158 8796 66853 1 10860 14353 55751 1 4751 14591 72745 1 6971 7654 82848 1 5292 15990 14033 1 10090 16771 27152 1 4...
output:
15148 15148 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 840 ...
result:
ok 18190 lines
Test #10:
score: 0
Time Limit Exceeded
input:
100000 500000 1 16546 96152 61778 1 65633 84347 81918 1 1167 33153 33889 1 14638 68983 49183 1 77051 89744 25931 1 45554 54937 92578 1 2701 86999 44372 1 42630 54711 86636 1 64766 75528 57550 1 46752 55820 25508 1 56987 75749 15422 1 44733 80957 83290 1 25573 58009 56972 1 49550 96862 72047 1 16419 ...
output:
result:
Subtask #3:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%