QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#54042#1297. Hard DriveBaltinicAC ✓77ms6700kbC++821b2022-10-06 17:42:452022-10-06 17:42:48

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-06 17:42:48]
  • 评测
  • 测评结果:AC
  • 用时:77ms
  • 内存:6700kb
  • [2022-10-06 17:42:45]
  • 提交

answer

#include<bits/stdc++.h>
#define MAXN 500005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,c,b;
int z[MAXN];
int ans[MAXN];
int main()
{
    scanf("%d%d%d",&n,&c,&b);
    for(int i=1;i<=b;i++) scanf("%d",&z[i]);
    for(int i=b;i>1;i--)
    {
        int dif=z[i]-z[i-1];
        int now=z[i]-1;
        while(c>=2&&now>z[i-1])
        {
            ans[now]=1;
            now-=2;
            c-=2;
        }
    }
    int now=z[1]-1;
    while(c>=2&&now>=1)
    {
        ans[now]=1;
        now-=2;
        c-=2;
    }
    assert(c<2);
    if(c==1)
    {
        assert(ans[2]!=1);
        ans[1]=1;
    }
    for(int i=1;i<=n;i++) printf("%d",ans[i]);
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3784kb

input:

2 1 1
2

output:

10

result:

ok 

Test #2:

score: 0
Accepted
time: 1ms
memory: 3760kb

input:

9 7 3
4 5 9

output:

101001010

result:

ok 

Test #3:

score: 0
Accepted
time: 2ms
memory: 3812kb

input:

5 1 4
2 3 4 5

output:

10000

result:

ok 

Test #4:

score: 0
Accepted
time: 2ms
memory: 3856kb

input:

7 2 5
2 3 4 6 7

output:

0000100

result:

ok 

Test #5:

score: 0
Accepted
time: 2ms
memory: 3784kb

input:

3 1 1
3

output:

100

result:

ok 

Test #6:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

3 1 2
2 3

output:

100

result:

ok 

Test #7:

score: 0
Accepted
time: 2ms
memory: 3816kb

input:

3 2 1
3

output:

010

result:

ok 

Test #8:

score: 0
Accepted
time: 2ms
memory: 3856kb

input:

7 1 1
7

output:

1000000

result:

ok 

Test #9:

score: 0
Accepted
time: 2ms
memory: 3812kb

input:

7 2 1
7

output:

0000010

result:

ok 

Test #10:

score: 0
Accepted
time: 1ms
memory: 3772kb

input:

4 2 2
2 4

output:

0010

result:

ok 

Test #11:

score: 0
Accepted
time: 24ms
memory: 5272kb

input:

443322 400000 10
2 100001 220021 333333 333334 333335 333337 333338 333339 443322

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #12:

score: 0
Accepted
time: 48ms
memory: 6228kb

input:

450423 366999 225054
2 4 8 9 11 13 15 17 19 21 23 25 26 28 30 33 35 37 39 41 42 44 46 50 52 54 57 59 62 64 65 67 70 72 74 76 78 80 82 84 86 88 90 93 95 97 99 101 104 106 108 110 112 114 116 119 121 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 167 169 171 17...

output:

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #13:

score: 0
Accepted
time: 45ms
memory: 3780kb

input:

500000 8 6
23486 100811 278451 492667 492668 500000

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #14:

score: 0
Accepted
time: 72ms
memory: 5336kb

input:

495445 1274 396704
2 5 7 8 9 10 11 12 13 14 15 17 18 19 20 21 22 24 25 26 28 29 30 31 32 33 35 36 37 38 39 40 42 43 44 46 47 48 49 50 51 52 53 55 56 57 58 60 61 62 63 65 66 67 68 70 71 73 74 75 78 79 80 81 82 83 84 87 88 90 91 92 93 94 95 97 98 100 101 103 104 105 106 107 108 109 110 111 112 113 114...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #15:

score: 0
Accepted
time: 44ms
memory: 5724kb

input:

500000 499999 500
1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 21000 22000 23000 24000 25000 26000 27000 28000 29000 30000 31000 32000 33000 34000 35000 36000 37000 38000 39000 40000 41000 42000 43000 44000 45000 46000 47000 48000 490...

output:

101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010...

result:

ok 

Test #16:

score: 0
Accepted
time: 50ms
memory: 5796kb

input:

499001 498999 24903
24 38 66 114 126 156 210 216 230 244 312 336 350 360 370 410 478 492 494 502 524 546 566 626 638 642 690 696 718 728 736 738 756 776 798 802 862 870 888 916 926 938 988 992 1008 1010 1016 1026 1050 1138 1140 1142 1194 1206 1232 1246 1248 1256 1316 1330 1376 1386 1400 1414 1416 14...

output:

101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010...

result:

ok 

Test #17:

score: 0
Accepted
time: 65ms
memory: 6100kb

input:

474222 474221 118809
2 4 6 8 14 16 26 28 30 38 40 46 50 52 54 56 62 66 68 70 72 74 78 80 82 94 96 98 102 104 106 108 110 112 118 120 124 126 128 130 134 136 138 140 142 144 152 154 156 158 160 164 170 172 180 192 198 202 206 210 214 216 218 220 222 226 228 230 232 236 238 240 246 250 254 258 262 268...

output:

101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010...

result:

ok 

Test #18:

score: 0
Accepted
time: 61ms
memory: 6700kb

input:

499678 499677 249839
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 ...

output:

101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010...

result:

ok 

Test #19:

score: 0
Accepted
time: 43ms
memory: 4464kb

input:

334598 6930 167220
2 8 15 16 17 19 23 25 26 27 29 31 32 33 34 35 36 37 38 39 40 43 44 45 48 49 50 52 53 54 57 62 63 65 66 67 68 72 73 75 76 77 78 79 85 89 91 94 97 100 101 104 105 106 110 111 113 114 115 117 121 122 123 125 126 127 130 131 135 138 140 141 143 144 148 149 150 151 152 153 154 157 159 ...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #20:

score: 0
Accepted
time: 20ms
memory: 3924kb

input:

385749 8576 19242
2 7 22 39 52 64 87 89 115 121 178 181 219 233 261 268 275 325 334 377 401 420 429 453 488 495 579 581 584 589 590 606 624 643 652 654 655 662 695 729 733 755 762 778 821 851 865 874 880 895 926 929 983 1029 1055 1067 1077 1143 1153 1190 1193 1194 1203 1236 1239 1265 1270 1272 1274 ...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #21:

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

input:

90565 45247 4478
4 23 27 80 84 92 93 159 172 178 225 276 327 335 342 358 449 494 513 515 526 530 536 555 556 584 622 625 646 687 707 726 727 749 762 765 782 788 844 850 857 871 955 958 965 996 1024 1029 1046 1093 1101 1123 1168 1241 1258 1321 1336 1370 1384 1385 1389 1390 1409 1440 1453 1460 1464 14...

output:

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #22:

score: 0
Accepted
time: 3ms
memory: 3748kb

input:

16496 8255 830
13 34 37 39 88 144 224 238 253 261 280 331 343 385 423 424 469 510 511 516 525 532 553 570 578 595 647 726 739 751 785 787 793 819 863 871 880 881 890 895 905 906 910 920 935 1003 1049 1120 1201 1207 1208 1209 1210 1223 1224 1238 1252 1288 1302 1306 1311 1341 1371 1373 1381 1398 1421 ...

output:

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #23:

score: 0
Accepted
time: 4ms
memory: 3988kb

input:

95821 47922 4707
17 30 46 50 62 85 120 129 130 139 177 184 207 254 264 266 290 305 309 328 342 378 382 392 400 401 420 436 446 456 461 466 467 495 501 516 529 574 599 602 603 613 618 642 666 713 719 746 761 769 778 788 801 846 901 913 915 927 929 967 983 1002 1013 1026 1027 1069 1070 1121 1153 1163 ...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #24:

score: 0
Accepted
time: 8ms
memory: 3940kb

input:

92487 46227 4530
37 54 89 93 158 164 185 240 250 268 282 337 350 365 380 436 448 489 490 526 527 530 539 544 551 553 557 568 636 675 687 697 700 706 728 730 741 756 777 831 833 855 857 878 881 882 893 910 912 922 924 932 971 973 999 1027 1028 1056 1069 1071 1079 1082 1088 1095 1122 1147 1189 1227 12...

output:

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #25:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

5 3 2
3 5

output:

10010

result:

ok 

Test #26:

score: 0
Accepted
time: 2ms
memory: 3760kb

input:

4 3 2
2 4

output:

1010

result:

ok 

Test #27:

score: 0
Accepted
time: 2ms
memory: 3736kb

input:

4 1 1
4

output:

1000

result:

ok 

Test #28:

score: 0
Accepted
time: 2ms
memory: 3812kb

input:

4 3 1
4

output:

1010

result:

ok 

Test #29:

score: 0
Accepted
time: 31ms
memory: 4740kb

input:

453109 226696 22692
23 56 111 130 132 137 169 192 226 233 262 276 295 346 354 396 411 418 419 435 445 451 470 476 482 484 485 497 506 549 613 660 664 676 750 757 762 810 837 838 865 894 903 1017 1075 1083 1141 1159 1169 1172 1208 1286 1298 1305 1309 1321 1365 1398 1403 1425 1458 1460 1468 1478 1481 ...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #30:

score: 0
Accepted
time: 23ms
memory: 4784kb

input:

457404 228981 22554
17 128 137 182 189 195 211 228 252 259 265 268 281 320 393 427 429 449 462 489 519 520 530 651 664 667 674 681 710 717 738 754 812 830 857 859 889 899 931 941 984 1024 1032 1049 1051 1061 1067 1069 1098 1108 1119 1143 1150 1164 1239 1252 1271 1292 1313 1320 1346 1359 1364 1384 14...

output:

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #31:

score: 0
Accepted
time: 27ms
memory: 4784kb

input:

491042 245420 24522
48 80 83 91 110 134 164 178 184 204 212 231 232 242 244 287 291 315 319 328 378 416 427 428 431 435 449 478 490 497 518 530 553 558 570 580 653 738 775 786 792 815 822 871 922 1000 1012 1017 1035 1050 1051 1082 1099 1119 1148 1211 1212 1222 1228 1238 1265 1282 1293 1305 1321 1337...

output:

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #32:

score: 0
Accepted
time: 77ms
memory: 5708kb

input:

500000 1 499999
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 9...

output:

100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 

Test #33:

score: 0
Accepted
time: 53ms
memory: 6564kb

input:

500000 499999 250000
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 ...

output:

101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010...

result:

ok