Submission #657560

# Submission time Handle Problem Language Result Execution time Memory
657560 2022-11-10T08:41:59 Z coding_snorlax Catfish Farm (IOI22_fish) C++17
0 / 100
45 ms 8176 KB
#include "fish.h"
#include<bits/stdc++.h>
using namespace std;
int Graph[302][10]={{0}};
long long int dp[10][10]={{0}};
long long int tmp[10][10]={{0}};
long long int Count(int n,int m,int column){
    long long int answer=0;
    for(int i=n;i<=m;i++){
        answer+=Graph[column][i];
    }
    return answer;
}
void check(){
    cout<<endl;
    for(int i=0;i<9;i++){
        for(int j=0;j<9;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(int i=0;i<M;i++){
        Graph[x[i]][y[i]]=w[i];
    }
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            dp[i][j]=Count(i,j,0);
        }
    }
    //check();
    for(int Time=1;Time<N-1;Time++){
        for(int j=0;j<10;j++){
            for(int k=0;k<10;k++){
                for(int i=0;i<10;i++){
                    tmp[j][k]=max(tmp[j][k],dp[i][j]+Count(j,max(k,i),Time));
                }
            }
        }
        for(int j=0;j<10;j++){
            for(int k=0;k<10;k++){
                dp[j][k]=tmp[j][k];
                tmp[j][k]=0;
            }
        }
        //check();
    }
    long long int Final=0;
    for(int j=0;j<10;j++){
        for(int k=0;k<10;k++){
            dp[j][k]+=Count(k,j,N-1);
            Final=max(Final,dp[j][k]);
        }
    }
    //check();
    return Final;
}
# Verdict Execution time Memory Grader output
1 Runtime error 22 ms 4208 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 45 ms 8176 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 308 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 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 -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 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 -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 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 -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 308 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 22 ms 4208 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -