QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#208027 | #3611. Smoothie Stand | rlong | WA | 21ms | 3668kb | C++14 | 575b | 2023-10-09 03:44:10 | 2023-10-09 03:44:10 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
long long k, r;
cin >> k >> r;
long long budget[k+5];
for(int i=1;i<=k;i++) cin >> budget[i];
long long ans = 0;
int cost_j;
for(int i=1;i<=r;i++) {
long long mx = 999999999999LL;
for(int j=1;j<=k;j++) {
cin >> cost_j;
if(cost_j == 0) mx = 0;
else mx = min(mx, budget[j] / cost_j);
}
long long rev = 0;
cin >> rev;
ans = max(ans, mx * rev);
}
cout << ans << endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3528kb
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: 0ms
memory: 3576kb
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: 3648kb
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: 21ms
memory: 3668kb
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: -100
Wrong Answer
time: 9ms
memory: 3528kb
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:
0
result:
wrong answer 1st lines differ - expected: '17432', found: '0'