Submission #1073273

# Submission time Handle Problem Language Result Execution time Memory
1073273 2024-08-24T11:34:01 Z fv3 Catfish Farm (IOI22_fish) C++17
0 / 100
20 ms 8600 KB
#include "fish.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

ll max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) 
{
    vector<vector<ll>> ps(2, vector<ll>(N));

    for (int i = 0; i < N; i++)
    {
        ps[X[i]][Y[i]] = W[i];
    }
    ll suml = 0, sumr = 0;
    for (int i = 0; i < N; i++)
    {
        suml += ps[0][i];
        ps[0][i] = suml;
        sumr += ps[1][i];
        ps[1][i] = sumr;
    }

    ll res = 0;

    if (N > 2)
    {
        for (int i = 0; i < N; i++)
            res = max(res, ps[0][i] + ps[1][N-1] - ps[1][i]);
    }
    else
    {
        for (int i = 0; i < N; i++)
            res = max({res, ps[0][i], ps[1][i]});
    }

    return res;
}
# Verdict Execution time Memory Grader output
1 Runtime error 20 ms 8600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 3660 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 3660 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 20 ms 8600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -