QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#142270#3611. Smoothie StandAnwar_Gehad_Maghraby#AC ✓12ms8112kbC++23849b2023-08-18 21:17:122023-08-18 21:17:13

Judging History

This is the latest submission verdict.

  • [2023-08-18 21:17:13]
  • Judged
  • Verdict: AC
  • Time: 12ms
  • Memory: 8112kb
  • [2023-08-18 21:17:12]
  • Submitted

answer

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

typedef long long ll  ;

const int N = 1e5 + 10;

int main() {
    cin.tie(0);cin.sync_with_stdio(0);
    cout.tie(0);cout.sync_with_stdio(0);
    int k, r;
    cin >> k >> r;
    vector<ll> have(k);
    for (int i = 0; i < k; ++i) {
        cin >> have[i];

    }
    vector<long long> b(r);
    vector<vector<long long>> a(r, vector<long long>(k));
    for (int i = 0; i < r; ++i) {
        for (int j = 0; j < k; ++j) {
            cin >> a[i][j];
        }
        cin >> b[i];
    }
    ll ans = 0;
    for (int i = 0; i < r; ++i) {
        ll val = LLONG_MAX;
        for (int j = 0; j < k; ++j) {
            if (a[i][j] == 0) { continue; }
            val = min(val, have[j] / a[i][j]);
        }
        ans = max(ans, val * b[i]);
    }
    cout << ans;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3516kb

input:

3 2
5 10 10
1 4 1 5
3 3 3 3

output:

10

result:

ok single line: '10'

Test #2:

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

input:

4 3
10 9 8 7
0 1 2 4 10
3 1 1 2 4
2 0 3 3 5

output:

12

result:

ok single line: '12'

Test #3:

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

input:

3 2
5 10 10
1 4 1 5
3 3 3 3

output:

10

result:

ok single line: '10'

Test #4:

score: 0
Accepted
time: 12ms
memory: 8112kb

input:

1 77195
4889
365 7261
676 357
310 3460
330 2917
670 8783
415 133
316 6618
466 6812
344 6875
672 603
104 7762
303 5937
125 6301
681 1269
452 3048
605 9387
296 9317
588 6777
691 828
501 4085
613 9912
528 9659
177 630
727 3030
313 1356
142 5432
337 9420
675 1821
371 3701
215 4914
678 1146
451 6913
220 ...

output:

48801998

result:

ok single line: '48801998'

Test #5:

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

input:

424 202
9519 8315 8785 1011 6085 6730 8840 5176 488 2369 7036 774 4380 158 7820 9643 2687 2872 6277 6859 1631 9899 6110 5034 6942 4332 7981 842 7625 4878 2230 5612 3614 5595 2253 1149 1896 813 3520 5413 1682 2361 9238 5196 264 6029 5115 923 449 2761 9406 6340 8547 1945 3815 1189 2755 9186 3735 6568 ...

output:

17432

result:

ok single line: '17432'

Test #6:

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

input:

481 74
838 2944 9996 3965 5003 3135 6380 4022 4228 737 5224 4480 297 8441 3446 1162 7074 2991 529 1614 9369 2668 1172 8459 7871 1257 131 4248 4919 9936 346 9663 5881 4654 6786 7331 8158 7983 1653 650 8922 8400 4583 5622 2519 1864 6922 1653 7956 9438 9149 228 7693 7789 6857 1775 2292 8770 7548 1033 8...

output:

8990

result:

ok single line: '8990'

Test #7:

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

input:

67 1159
3467 6319 3320 4471 1219 3182 7129 612 112 6522 2806 6630 8159 7012 9714 4627 6915 7392 6242 4662 6199 3457 3210 1684 5482 9244 7404 1907 9057 9885 9847 767 3700 4670 4781 2729 1499 2985 4865 2708 7965 6287 4290 2930 7125 6140 4293 9220 9181 54 7708 8351 620 9709 8007 8254 1246 902 508 1100 ...

output:

385154

result:

ok single line: '385154'

Test #8:

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

input:

334 1
7173 5325 5254 7189 3355 8214 1870 2489 7610 3040 1572 65 5134 1828 1334 4236 8507 2002 2145 2649 9401 9061 3249 1487 3720 5229 6043 6388 5156 4397 7233 2596 3805 3063 9235 9130 5481 8735 2559 8310 7657 6127 8656 3149 9985 2449 7845 5044 6664 7905 3036 9563 9356 6037 6958 1825 3328 1803 7416 6...

output:

0

result:

ok single line: '0'

Test #9:

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

input:

75272 1
4289 7585 3643 2636 9943 3044 764 1049 1613 1173 7850 8106 7054 5508 674 1648 9090 3052 7353 9528 8870 1662 9159 2266 8448 9379 7159 3092 745 143 8869 6739 6321 2369 4826 571 328 1702 7093 7143 4229 7691 8687 9326 3884 8376 2901 1713 9468 4139 1266 595 4946 9974 6609 3602 8240 3000 846 966 9...

output:

0

result:

ok single line: '0'

Test #10:

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

input:

27 337
5680 6712 5256 8264 9511 6997 5083 7036 4402 1772 8661 8478 9172 7624 4974 2331 7011 184 6530 2661 8483 727 9877 3856 4514 1883 3755
27 24 3 0 18 32 12 21 9 36 1 0 17 8 12 13 29 22 15 18 12 14 3 9 27 24 9 9992
28 6 10 12 36 7 25 5 32 28 35 34 22 7 8 36 18 31 5 22 13 34 19 30 21 33 22 2652
21 ...

output:

758403

result:

ok single line: '758403'

Test #11:

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

input:

3 31589
5966 7173 2732
72 35 10 5634
29 60 18 812
46 0 62 6976
64 50 18 6923
23 1 50 2146
70 49 37 2428
74 56 46 7804
39 23 12 8813
41 17 71 3591
80 46 24 6259
12 50 86 1337
2 54 12 4826
46 59 53 206
85 41 76 1341
51 75 15 2151
50 50 6 4475
58 58 4 4425
12 74 83 1856
70 6 84 7385
72 58 54 6447
46 43...

output:

9859072

result:

ok single line: '9859072'

Test #12:

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

input:

13 756
3901 1232 8377 9949 3922 3677 5965 8897 3037 5230 7036 7939 5766
125 85 39 65 34 21 96 34 108 39 123 101 28 9706
4 90 44 28 145 110 15 56 24 36 119 57 65 4149
54 49 56 61 25 55 130 102 56 89 8 74 159 6922
161 20 143 133 140 42 49 92 59 2 152 101 54 6950
141 75 125 15 107 31 54 84 66 114 9 35 ...

output:

438416

result:

ok single line: '438416'

Test #13:

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

input:

394 145
9080 7164 9398 5078 2402 6404 7214 6415 1918 4210 7132 3679 3825 8736 3370 6997 6280 7609 4510 3966 5081 2908 9411 6004 5097 7183 1589 2708 6214 1351 7776 3783 9405 6188 9782 1849 5913 3794 4075 735 2656 8553 8780 912 2510 9701 1490 5898 6184 3485 3440 8866 5048 8689 3273 3308 3197 5539 2737...

output:

0

result:

ok single line: '0'

Test #14:

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

input:

4 3
10 9 8 7
0 1 2 4 10
3 1 1 2 4
2 0 3 3 5

output:

12

result:

ok single line: '12'

Test #15:

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

input:

9 8212
2020 560 1809 5957 3211 8816 4716 9875 9506
391 61 80 380 284 451 439 409 20 526
554 304 481 478 529 565 122 348 35 3165
25 499 140 616 356 414 559 467 32 929
59 81 268 615 93 604 47 471 332 7127
469 100 586 447 18 566 434 432 52 353
606 2 514 576 540 128 1 388 110 4826
131 218 596 499 387 63...

output:

122746

result:

ok single line: '122746'

Test #16:

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

input:

448 133
5864 9753 6550 9098 1888 4868 7983 8197 5377 3737 4403 9194 3900 7044 8020 862 2005 5686 6465 6111 4819 6593 6730 2370 6606 2448 765 6771 879 4495 5525 2993 4160 5245 7443 3107 4849 1891 4061 3720 7403 7657 8706 1258 4466 8666 4685 2182 5286 3933 6902 5300 9534 798 8630 7365 2848 4155 5857 2...

output:

0

result:

ok single line: '0'

Test #17:

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

input:

1118 51
370 352 4641 1016 3965 5089 6884 4033 8960 8316 1364 6119 8621 485 3966 5366 4304 3184 2393 9053 624 1801 858 8765 7766 5 2832 3898 7795 8154 2750 6349 3503 5814 842 2058 3479 2859 3886 5220 6384 1288 1134 5542 6761 5423 3424 4652 9118 9241 8260 3857 922 7732 6207 21 1802 6333 7120 9941 5715...

output:

9355

result:

ok single line: '9355'

Test #18:

score: 0
Accepted
time: 6ms
memory: 3888kb

input:

27 3392
1463 9828 8341 4668 6495 1806 9214 3101 5936 5587 4554 3374 348 7144 3737 465 7662 1607 4553 3481 2139 2478 6600 3387 8110 5148 3017
310 217 38 211 502 372 86 460 566 617 435 119 385 637 487 356 241 169 312 57 358 688 589 453 345 492 91 7855
670 468 162 303 525 455 228 19 274 682 523 641 10 ...

output:

31104

result:

ok single line: '31104'

Test #19:

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

input:

13 3937
7347 9926 7929 4659 8411 3284 5920 3672 7036 130 3728 3502 6430
403 380 211 268 370 375 111 285 364 215 5 190 511 1909
535 395 202 513 332 111 393 47 413 101 318 25 178 4627
138 28 3 118 32 105 220 115 247 392 361 103 502 1382
535 511 441 167 491 189 170 31 542 412 236 43 313 8853
308 279 21...

output:

92640

result:

ok single line: '92640'

Test #20:

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

input:

1908 50
793 6915 4023 3949 7259 5878 7944 6807 7881 6773 4526 9031 1419 8141 1705 5304 5995 5026 9140 256 4792 3483 6857 5823 3034 6671 4693 6373 5237 1104 366 2732 2522 9991 9207 6306 7389 222 4074 9448 4854 4035 6043 6800 3357 4534 9673 6305 8564 9022 3348 8450 1156 6964 8017 7379 7013 3707 644 81...

output:

0

result:

ok single line: '0'

Test #21:

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

input:

16 3058
6143 2199 4367 8688 3378 2981 7321 2512 9221 5414 3247 4791 3064 4355 8164 8559
394 537 391 158 206 185 648 607 467 79 164 587 530 127 701 596 7443
202 133 560 198 169 323 2 14 354 28 709 680 93 560 567 165 1681
22 618 630 64 49 15 585 578 21 525 313 223 280 681 189 512 8426
479 2 408 657 42...

output:

84465

result:

ok single line: '84465'

Test #22:

score: 0
Accepted
time: 7ms
memory: 4124kb

input:

18615 5
2114 4434 9352 233 2245 2508 5026 8157 5763 635 7147 3630 3943 1369 4196 4891 6141 5242 3750 5019 1469 5341 1127 1929 6950 3549 8598 6153 3061 8341 6375 3981 519 8110 8632 6506 9967 1574 7511 8708 7741 8033 2296 737 544 8178 50 8898 1543 2517 6463 2991 7536 6871 4770 4332 5013 8429 9910 1238...

output:

0

result:

ok single line: '0'

Test #23:

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

input:

6246 6
1801 8630 9452 6739 3298 1906 4810 7510 2106 6913 5676 4 8668 115 4104 446 1141 9608 8745 52 3291 7084 9830 2640 7350 7796 715 4102 79 3680 474 5076 9931 8670 9828 6810 5534 2994 9546 9519 8084 1081 9898 1701 391 4357 9125 1430 3010 474 7919 6739 9672 3424 2860 5890 1382 4257 3142 8058 1525 7...

output:

0

result:

ok single line: '0'

Test #24:

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

input:

242 141
7684 1693 3750 5972 41 8027 6242 857 2343 9082 8935 9109 5521 7373 1235 4135 9903 3508 4451 2823 2420 4665 678 7130 8985 258 3476 1446 8870 7852 9189 1097 9906 3365 1478 6614 5045 6716 2857 8394 8588 5077 7619 184 3639 4786 4612 3003 938 8033 6862 9701 5681 1997 5059 470 7079 4572 2773 1912 ...

output:

188670

result:

ok single line: '188670'

Test #25:

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

input:

336 12
7083 7975 4741 632 5327 497 5456 4439 8578 1880 4235 3073 9574 7767 6703 8771 2438 7948 2246 3766 6083 3821 1923 2386 109 5366 8153 3216 761 4928 1343 394 6132 5391 2924 1894 4806 5736 6458 6306 8071 8907 9773 3912 305 6651 7548 8026 9219 6495 3503 5492 4286 7026 6100 7939 5717 1010 8306 1403...

output:

0

result:

ok single line: '0'

Test #26:

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

input:

17336 3
4353 9220 3491 5474 1404 1193 2976 1719 9121 1012 9011 8973 7579 901 3637 9945 5523 8085 8676 5342 9370 6909 7366 646 9408 7510 7861 6414 1200 3281 552 7176 4692 3911 6985 2139 8778 7221 9470 5809 1571 7006 4811 9863 5002 9113 6610 6875 1815 1697 5697 9526 4014 3129 2639 5462 5656 4763 5320 ...

output:

0

result:

ok single line: '0'

Test #27:

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

input:

9 5785
8037 6684 5960 6815 8961 9998 991 4053 5574
5919 3264 9391 8848 2637 303 9725 2125 2264 5086
7145 5761 6276 8571 3336 147 1982 5844 4578 6989
6333 2541 1741 6411 9557 3506 7833 4723 2548 9022
4368 4693 4781 2407 809 6652 6455 2053 5489 8493
7554 5348 5532 6625 7694 8768 9325 4561 6075 6428
95...

output:

9923

result:

ok single line: '9923'

Test #28:

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

input:

2961 13
2415 7966 9114 7272 3804 1913 635 993 507 8587 63 7595 1164 2495 1469 2247 3039 3210 3331 8241 7884 491 1587 1920 9892 8756 4228 4082 1551 7397 1210 3982 1520 7010 6680 454 6188 4629 3540 1715 2371 2518 6379 680 5586 6828 8401 2261 6494 6469 335 1689 4594 7776 8151 7829 749 7205 1477 8386 11...

output:

0

result:

ok single line: '0'

Test #29:

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

input:

3 14079
3811 5638 5619
3128 8075 5020 9479
1077 6077 7629 3220
8022 5581 4730 142
3042 2030 4230 8279
5407 3864 6208 431
8188 5854 6498 6571
8353 7497 8495 83
617 4060 3806 9723
32 931 9587 9009
711 5322 7760 2425
5253 5364 4111 1834
5803 7393 7882 8226
5444 6888 2883 624
3645 403 5920 4033
1697 187...

output:

87193

result:

ok single line: '87193'

Test #30:

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

input:

108 124
4114 145 4216 3619 9606 4623 61 3382 7672 2373 6538 9191 686 8564 7680 8009 8209 254 9831 4849 8042 3593 2886 4216 3108 5720 297 638 1022 8129 4877 5218 8026 157 1916 841 1595 4450 2355 6525 9117 8839 4291 8366 4662 493 6990 4343 9256 240 5781 8073 2910 831 9476 1435 9155 4560 9522 9854 5231...

output:

0

result:

ok single line: '0'

Test #31:

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

input:

1 61959
954
6810 7428
2822 7018
1196 7708
2095 8223
3970 9838
6275 428
2089 5552
1870 5153
1034 4512
5658 8719
2180 8982
8772 7944
6142 4631
9296 3424
5955 1838
8834 6931
1849 4853
3911 690
5016 5716
3903 2186
3095 1034
1603 4990
3394 2269
8626 2659
3679 6222
3739 9909
4390 8265
2674 8400
7589 3691
...

output:

9220410

result:

ok single line: '9220410'

Test #32:

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

input:

878 84
8206 1292 8369 4095 702 9492 7322 8835 5018 6416 9134 1424 1359 8010 2603 4404 4038 2367 5865 2715 6539 6784 4547 6616 1117 5346 8658 3169 4272 403 5350 8094 9808 8762 1617 3528 7882 6739 8184 8488 7958 8410 8209 7951 7659 828 8049 2341 1281 9091 2718 6161 1544 5868 192 9493 7263 2723 9241 10...

output:

0

result:

ok single line: '0'

Test #33:

score: 0
Accepted
time: 6ms
memory: 3852kb

input:

8680 10
7487 8135 3102 730 1099 1975 1866 1870 2101 2101 8658 4328 5667 9964 8657 7787 8187 7366 3014 4936 1288 5077 2264 923 5503 4305 4428 5304 5775 2377 4018 4906 4110 8801 8580 6525 157 7374 3898 931 2599 3364 7299 2151 3426 3980 5505 3980 5496 6549 3028 2575 2118 7723 6889 8161 2951 8542 2904 3...

output:

0

result:

ok single line: '0'

Test #34:

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

input:

13403 1
970 8538 2551 2659 1809 7356 968 4536 988 8613 224 6515 3449 3058 8730 6436 8978 3493 9697 1127 7264 1821 3831 3420 9738 8766 6291 2482 9571 922 639 3886 194 1371 305 6852 1298 8230 9648 244 9906 4668 6303 2890 3842 4500 6767 7903 3162 1072 9341 7196 1664 892 2911 1017 2722 215 6560 4396 759...

output:

0

result:

ok single line: '0'

Test #35:

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

input:

3117 27
4530 8773 7399 8943 1954 1128 7689 1545 6603 4165 9169 5407 3520 2689 9125 3740 3829 2092 9620 6565 2315 7572 6791 8368 1902 5257 5633 3807 8135 7797 4690 2769 3957 813 3410 5882 4575 733 4817 5164 4632 784 5166 1328 660 1650 539 7091 7740 764 4018 9750 9355 5241 4225 1374 7890 9718 4484 866...

output:

0

result:

ok single line: '0'

Test #36:

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

input:

3 4565
8644 7127 6487
364 636 146 9538
760 361 316 3301
255 116 62 5106
735 622 59 2374
95 668 801 3805
740 292 62 6084
420 119 40 1089
469 584 381 2325
748 267 209 4238
714 717 785 1366
600 836 358 3088
458 296 740 249
480 826 656 2130
185 318 200 7580
639 364 6 9747
96 833 242 3
535 703 393 2680
6...

output:

840900

result:

ok single line: '840900'

Test #37:

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

input:

3 880
924 3276 442
175 253 501 413
307 3 567 8487
227 383 392 5689
56 686 484 2112
199 82 610 5344
607 352 641 7269
102 591 648 1022
541 406 266 2897
41 685 215 8852
751 401 416 202
8 65 239 9790
108 566 503 9038
67 498 401 207
495 469 584 2484
759 81 283 7173
237 88 482 9444
568 80 93 2596
132 208 ...

output:

102704

result:

ok single line: '102704'