Submission #1031867

# Submission time Handle Problem Language Result Execution time Memory
1031867 2024-07-23T08:15:02 Z Mr_Husanboy Catfish Farm (IOI22_fish) C++17
6 / 100
57 ms 17848 KB
#include "fish.h"
#include <bits/stdc++.h>

using namespace std;

#define ff first
#define ss second
#define all(a) (a).begin(), (a).end()
#define ll long long

template<typename T>
int len(T &a){
    return a.size();
}

mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());


long long max_weights(int n, int m, std::vector<int> x, std::vector<int> y,
                      std::vector<int> w) {
    vector<vector<ll>> s(2, vector<ll>(n));
    for(int i = 0; i < m; i++){
        s[x[i]][y[i]] = w[i];
    }
    for(int j = 0; j < 2; j ++)
    for(int i = 1; i < n; i++) s[j][i] += s[j][i - 1];
    ll res = max(s[0][n - 1], s[1][n - 1]);
    if(n == 2) return res;

    for(int i = 0; i < n; i ++){
        //cout << s[0][i] + s[1][n - 1] - s[1][i] << endl;
        res = max(res, s[0][i] + s[1][n - 1] - s[1][i]);
    }
    return res;
}
# Verdict Execution time Memory Grader output
1 Correct 13 ms 4440 KB Output is correct
2 Correct 17 ms 4952 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 2 ms 2652 KB Output is correct
5 Runtime error 57 ms 17848 KB Execution killed with signal 11
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 28 ms 6192 KB Output is correct
3 Correct 38 ms 10832 KB Output is correct
4 Correct 15 ms 5720 KB Output is correct
5 Correct 18 ms 6748 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 2648 KB Output is correct
11 Correct 1 ms 2652 KB Output is correct
12 Correct 15 ms 5744 KB Output is correct
13 Correct 18 ms 6740 KB Output is correct
14 Correct 15 ms 5876 KB Output is correct
15 Correct 17 ms 6368 KB Output is correct
16 Correct 15 ms 5724 KB Output is correct
17 Correct 16 ms 6484 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2652 KB Output is correct
2 Runtime error 2 ms 3656 KB Execution killed with signal 11
3 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 Correct 1 ms 2652 KB Output is correct
2 Runtime error 2 ms 3656 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 13 ms 4440 KB Output is correct
2 Correct 17 ms 4952 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 2 ms 2652 KB Output is correct
5 Runtime error 57 ms 17848 KB Execution killed with signal 11
6 Halted 0 ms 0 KB -