답안 #657758

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
657758 2022-11-11T00:28:58 Z coding_snorlax 메기 농장 (IOI22_fish) C++17
0 / 100
47 ms 8104 KB
#include "fish.h"
#include<bits/stdc++.h>
using namespace std;
long long int Graph[400][12]={{0}};
long long int dp[12][12]={{0}};
long long int tmp[12][12]={{0}};
long long int Count(long long int n,long long int m,long long int column){
    long long int answer=0;
    for(long long int i=n;i<=m;i++){
        answer+=Graph[column][i];
    }
    return answer;
}
/*
void check(){
    cout<<endl;
    for(int i=0;i<12;i++){
        for(int j=0;j<12;j++){
            cout<<dp[i][j]<<" ";
        }
        cout<<endl;
    }
}
*/
long long int max_weights(int N,int M,vector<int> x,vector<int> y,vector<int> w){
    for(long long int i=0;i<M;i++){
        Graph[x[i]][y[i]+1]=w[i];
    }
    for(long long int i=0;i<12;i++){
        for(long long int j=0;j<12;j++){
            dp[i][j]=Count(i,j,0);
            tmp[i][j]=0;
        }
    }
    //check();
    for(long long int Time=1;Time<N-1;Time++){
        for(long long int j=0;j<12;j++){
            for(long long int k=0;k<12;k++){
                for(long long int i=0;i<12;i++){
                    tmp[j][k]=max(tmp[j][k],dp[i][j]+Count(j,max(k,i),Time));
                }
            }
        }
        for(long long int j=0;j<12;j++){
            for(long long int k=0;k<12;k++){
                dp[j][k]=tmp[j][k];
                tmp[j][k]=0;
            }
        }
        //check();
    }
    long long int Final=0;
    for(long long int j=0;j<12;j++){
        for(long long int k=0;k<12;k++){
            dp[j][k]+=Count(k,j,N-1);
            Final=max(Final,dp[j][k]);
        }
    }
    //check();
    return Final;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 22 ms 4248 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 47 ms 8104 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Incorrect 2 ms 212 KB 1st lines differ - on the 1st token, expected: '216624184325', found: '220242990393'
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Incorrect 2 ms 212 KB 1st lines differ - on the 1st token, expected: '216624184325', found: '220242990393'
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Incorrect 2 ms 212 KB 1st lines differ - on the 1st token, expected: '216624184325', found: '220242990393'
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 22 ms 4248 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -