답안 #990069

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
990069 2024-05-29T12:57:24 Z cpdreamer 메기 농장 (IOI22_fish) C++17
14 / 100
1000 ms 2097152 KB
#include "fish.h"

#include <bits/stdc++.h>
using namespace std;
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y,std::vector<int> W) {
    vector<vector<long long>> vp(N, vector<long long>(N + 2));
    for (int i = 0; i < N; i++)
        vp[i].assign(N + 2, 0);
    for (int i = 0; i < M; i++)
        vp[X[i]][Y[i] + 1] += W[i];
    for (int i = 0; i < N; i++)
        for (int j = 1; j <= N; j++)
            vp[i][j] += vp[i][j - 1];
    long long dp[N][min(N,10)+2][min(N,10)+2];
    memset(dp,0,sizeof(dp));
    for (int i = 0; i <= min(N,10); i++) {
        for (int j = 0; j <= min(N,10); j++) {
            dp[0][i][j] = max(dp[0][i][j],vp[0][j] - vp[0][i]);
        }
    }
    for (int i = 1; i < N; i++) {
        for (int j = 0; j <=min(N,10); j++) {
            for (int g = 0; g <= min(N,10); g++) {
                for (int e = 0; e <=min(N,10); e++) {
                    dp[i][j][g]=max(dp[i][j][g],dp[i-1][e][j]+max(max(vp[i][e]-vp[i][j],0LL),max(vp[i][g]-vp[i][j],0LL)));
                }
            }
        }
    }
    long long  ans=0;
    for(int i=0;i<=min(N,10);i++){
        ans=max(ans,dp[N-1][i][0]);
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1110 ms 2097152 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 352 KB Output is correct
2 Runtime error 952 ms 2097152 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 797 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 352 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 352 KB Output is correct
6 Correct 0 ms 356 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 352 KB Output is correct
9 Correct 1 ms 604 KB Output is correct
10 Correct 2 ms 1376 KB Output is correct
11 Correct 1 ms 612 KB Output is correct
12 Correct 2 ms 1372 KB Output is correct
13 Correct 1 ms 352 KB Output is correct
14 Correct 2 ms 1380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 352 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 352 KB Output is correct
6 Correct 0 ms 356 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 352 KB Output is correct
9 Correct 1 ms 604 KB Output is correct
10 Correct 2 ms 1376 KB Output is correct
11 Correct 1 ms 612 KB Output is correct
12 Correct 2 ms 1372 KB Output is correct
13 Correct 1 ms 352 KB Output is correct
14 Correct 2 ms 1380 KB Output is correct
15 Incorrect 1 ms 1372 KB 1st lines differ - on the 1st token, expected: '299', found: '10'
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 352 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 352 KB Output is correct
6 Correct 0 ms 356 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 352 KB Output is correct
9 Correct 1 ms 604 KB Output is correct
10 Correct 2 ms 1376 KB Output is correct
11 Correct 1 ms 612 KB Output is correct
12 Correct 2 ms 1372 KB Output is correct
13 Correct 1 ms 352 KB Output is correct
14 Correct 2 ms 1380 KB Output is correct
15 Incorrect 1 ms 1372 KB 1st lines differ - on the 1st token, expected: '299', found: '10'
16 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 797 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1110 ms 2097152 KB Time limit exceeded
2 Halted 0 ms 0 KB -