Submission #897443

# Submission time Handle Problem Language Result Execution time Memory
897443 2024-01-03T06:13:17 Z Sir_Ahmed_Imran Wombats (IOI13_wombats) C++17
Compilation error
0 ms 0 KB
                              ///~~~LOTA~~~///
#include "wombats.h"
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ff first
#define ss second
#define ll long long 
#define append push_back
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define N 10000000
int n,m;
int x[5000][200];
int y[5000][200];
int dp[5000][200][200];
void compute_dp(){
    for(int i=0;i<m;i++)
        for(int j=0;j<m;j++)
            dp[n-1][i][j]=abs(x[n-1][i]-x[n-1][j]);
    for(int i=n-2;i>=0;i--){
        for(int j=0;j<m;j++){
            for(int k=0;k<m;k++){
                dp[i][j][k]=1e9;
                for(int l=0;l<m;l++)
                    dp[i][j][k]=min(dp[i][j][k],
                    dp[i+1][l][k]+abs(x[i][j]-x[i][l])+y[i][l]);
            }
        }
    }
}
void init(int R, int C, int H[5000][200], int V[5000][200]){
    n=R; m=C;
    for(int i=0;i<n;i++)
        for(int j=0;j<m-1;j++)
            x[i][j+1]=x[i][j]+H[i][j];
    for(int i=0;i<n-1;i++)
        for(int j=0;j<n;j++)
            y[i][j]=V[i][j];
    compute_dp();
}
void changeV(int p,int q,int w){

}
void changeH(int p,int q,int w){
    
}
int escape(int p,int q){
    return dp[0][p][q];
}
int main(){
    return 0;
}

Compilation message

grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
   15 |  int res;
      |      ^~~
/usr/bin/ld: /tmp/cc8nS8R1.o: in function `main':
wombats.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccPUoOuZ.o:grader.c:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status