Submission #915542

# Submission time Handle Problem Language Result Execution time Memory
915542 2024-01-24T06:50:20 Z Namkhing Catfish Farm (IOI22_fish) C++17
0 / 100
19 ms 5460 KB
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

const int Max = 1e5 + 1;
ll fish[Max], dp[Max][2];

ll max_weights(int N, int M, vi X, vi Y, vi W) {
    for (int i = 0; i < M; i++) {
        fish[X[i]] = W[i];
    }

    dp[0][0] = fish[0];

    for (int i = 1; i < N; i++) {
        dp[i][1] = max(dp[i-1][1], dp[i-1][0]);
        dp[i][0] = max(dp[i-1][0], dp[i-1][1] + fish[i]);
    }

    return max(dp[N-1][0], dp[N-1][1]);
}
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 5460 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 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 Correct 1 ms 2648 KB Output is correct
2 Correct 2 ms 1884 KB Output is correct
3 Incorrect 13 ms 4696 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '16359027219341'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Correct 2 ms 1884 KB Output is correct
3 Incorrect 13 ms 4696 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '16359027219341'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 5460 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453'
2 Halted 0 ms 0 KB -