QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#208024#3611. Smoothie StandrlongRE 1ms3292kbC++14537b2023-10-09 03:40:492023-10-09 03:40:50

Judging History

This is the latest submission verdict.

  • [2023-10-09 03:40:50]
  • Judged
  • Verdict: RE
  • Time: 1ms
  • Memory: 3292kb
  • [2023-10-09 03:40:49]
  • Submitted

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;

    for(int i=1;i<=r;i++) {
        long long mx = 999999999999LL;
        for(int j=1;j<=k;j++) {
            int cost_j;
            cin >> cost_j;
            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: 1ms
memory: 3292kb

input:

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

output:

10

result:

ok single line: '10'

Test #2:

score: -100
Runtime Error

input:

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

output:


result: