Submission #1073271

# Submission time Handle Problem Language Result Execution time Memory
1073271 2024-08-24T11:30:40 Z fv3 Catfish Farm (IOI22_fish) C++17
0 / 100
23 ms 8336 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;
    for (int i = 0; i < N; i++)
        res = max(res, ps[0][i] + ps[1][N-1] - ps[1][i]);

    return res;
}
# Verdict Execution time Memory Grader output
1 Runtime error 23 ms 8336 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 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 4 ms 3660 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 3660 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 23 ms 8336 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -