Submission #1023849

# Submission time Handle Problem Language Result Execution time Memory
1023849 2024-07-15T07:50:36 Z vjudge1 Wombats (IOI13_wombats) C++17
Compilation error
0 ms 0 KB
#include "wombats.h"
#include<bits/stdc++.h>
using namespace std;
int tmp[200][200],SSZZ;
int opt[201][201];
struct matrix{
    int V[200][200];
    void friend operator *=(matrix &a,matrix &b){
        memcpy(tmp,a.V,sizeof tmp);
        for(int i=0;i<SSZZ;i++)
            for(int j=0;j<SSZZ;j++)
                a.V[i][j]=1e9;
        for(int i=0;i<SSZZ;i++)
            opt[SSZZ][i]=SSZZ;
        for(int i=SSZZ;i--;) {
            for(int k=0;k<=opt[i+1][0];k++)
                if(a.V[i][0]>tmp[i][k]+b.V[k][0])
                    a.V[i][0]=tmp[i][k]+b.V[k][0],opt[i][0]=k;
            for(int j=1;j<SSZZ;j++)
                for(int k=opt[i][j-1];k<=opt[i+1][j];k++)
                    if(a.V[i][j]>tmp[i][k]+b.V[k][j])
                        a.V[i][j]=tmp[i][k]+b.V[k][j],opt[i][j]=k;
        }
    }
    void reset(){
        for(int i=0;i<200;i++)
            memset(V[i],15,sizeof V[i]),V[i][i]=0;
    }
} mygod[51],finalstuff;
int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
void recalcblok(int blok){
    mygod[blok].reset();
    int end=min(row-1,SZ*blok+SZ);
    for(int r=SZ*blok+1;r<=end;r++){
        for(int i=0;i<col;i++) {
            for(int j=0;j<col;j++)
                mygod[blok].V[i][j]+=dn[r-1][j];
            for(int j=0;++j<col;)
                mygod[blok].V[i][j]=min(mygod[blok].V[i][j],
                        mygod[blok].V[i][j-1]+lr[r][j-1]);
            for(int j=col;--j;)
                mygod[blok].V[i][j-1]=min(mygod[blok].V[i][j-1],
                            mygod[blok].V[i][j]+lr[r][j-1]);
        }
    }
}
void redofinale(){
    int pref[200];
    pref[0]=0;
    for(int i=1;i<200;i++)
        pref[i]=pref[i-1]+lr[0][i-1];
    for(int i=0;i<col;i++) for(int j=0;j<col;j++)
        finalstuff.V[i][j]=abs(pref[i]-pref[j]);
    for(int i=0;i<=blocknum;i++)
        finalstuff*=mygod[i];
}
void init(int R, int C, int H[5000][200], int V[5000][200]) {
    SSZZ=C;
    for(int i=0;i<5000;i++)
        memcpy(lr[i],H[i],sizeof lr[i]),
        memcpy(dn[i],V[i],sizeof dn[i]);
    row=R;col=C;
    blocknum=(R-2)/SZ;
    for(int i=0;i<=blocknum;i++)
        recalcblok(i);
    redofinale();
}
void changeH(int P, int Q, int W) {
    lr[P][Q]=W;
    if(P)recalcblok(P/SZ),redofinale();
}

void changeV(int P, int Q, int W) {
    memset(ans,-1,sizeof ans);
    dn[P][Q]=W;
    recalcblok(P/SZ),redofinale();
}
int escape(int V1, int V2) {
    return finalstuff.V[V1][V2];
}
#include "wombats.h"
#include<bits/stdc++.h>
using namespace std;
int tmp[200][200],SSZZ;
int opt[201][201];
struct matrix{
    int V[200][200];
    void friend operator *=(matrix &a,matrix &b){
        memcpy(tmp,a.V,sizeof tmp);
        for(int i=0;i<SSZZ;i++)
            for(int j=0;j<SSZZ;j++)
                a.V[i][j]=1e9;
        for(int i=0;i<SSZZ;i++)
            opt[SSZZ][i]=SSZZ;
        for(int i=SSZZ;i--;) {
            for(int k=0;k<=opt[i+1][0];k++)
                if(a.V[i][0]>tmp[i][k]+b.V[k][0])
                    a.V[i][0]=tmp[i][k]+b.V[k][0],opt[i][0]=k;
            for(int j=1;j<SSZZ;j++)
                for(int k=opt[i][j-1];k<=opt[i+1][j];k++)
                    if(a.V[i][j]>tmp[i][k]+b.V[k][j])
                        a.V[i][j]=tmp[i][k]+b.V[k][j],opt[i][j]=k;
        }
    }
    void reset(){
        for(int i=0;i<200;i++)
            memset(V[i],15,sizeof V[i]),V[i][i]=0;
    }
} mygod[51],finalstuff;
int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
void recalcblok(int blok){
    mygod[blok].reset();
    int end=min(row-1,SZ*blok+SZ);
    for(int r=SZ*blok+1;r<=end;r++){
        for(int i=0;i<col;i++) {
            for(int j=0;j<col;j++)
                mygod[blok].V[i][j]+=dn[r-1][j];
            for(int j=0;++j<col;)
                mygod[blok].V[i][j]=min(mygod[blok].V[i][j],
                        mygod[blok].V[i][j-1]+lr[r][j-1]);
            for(int j=col;--j;)
                mygod[blok].V[i][j-1]=min(mygod[blok].V[i][j-1],
                            mygod[blok].V[i][j]+lr[r][j-1]);
        }
    }
}
void redofinale(){
    int pref[200];
    pref[0]=0;
    for(int i=1;i<200;i++)
        pref[i]=pref[i-1]+lr[0][i-1];
    for(int i=0;i<col;i++) for(int j=0;j<col;j++)
        finalstuff.V[i][j]=abs(pref[i]-pref[j]);
    for(int i=0;i<=blocknum;i++)
        finalstuff*=mygod[i];
}
void init(int R, int C, int H[5000][200], int V[5000][200]) {
    SSZZ=C;
    for(int i=0;i<5000;i++)
        memcpy(lr[i],H[i],sizeof lr[i]),
        memcpy(dn[i],V[i],sizeof dn[i]);
    row=R;col=C;
    blocknum=(R-2)/SZ;
    for(int i=0;i<=blocknum;i++)
        recalcblok(i);
    redofinale();
}
void changeH(int P, int Q, int W) {
    lr[P][Q]=W;
    if(P)recalcblok(P/SZ),redofinale();
}

void changeV(int P, int Q, int W) {
    memset(ans,-1,sizeof ans);
    dn[P][Q]=W;
    recalcblok(P/SZ),redofinale();
}
int escape(int V1, int V2) {
    return finalstuff.V[V1][V2];
}
#include "wombats.h"
#include<bits/stdc++.h>
using namespace std;
int tmp[200][200],SSZZ;
int opt[201][201];
struct matrix{
    int V[200][200];
    void friend operator *=(matrix &a,matrix &b){
        memcpy(tmp,a.V,sizeof tmp);
        for(int i=0;i<SSZZ;i++)
            for(int j=0;j<SSZZ;j++)
                a.V[i][j]=1e9;
        for(int i=0;i<SSZZ;i++)
            opt[SSZZ][i]=SSZZ;
        for(int i=SSZZ;i--;) {
            for(int k=0;k<=opt[i+1][0];k++)
                if(a.V[i][0]>tmp[i][k]+b.V[k][0])
                    a.V[i][0]=tmp[i][k]+b.V[k][0],opt[i][0]=k;
            for(int j=1;j<SSZZ;j++)
                for(int k=opt[i][j-1];k<=opt[i+1][j];k++)
                    if(a.V[i][j]>tmp[i][k]+b.V[k][j])
                        a.V[i][j]=tmp[i][k]+b.V[k][j],opt[i][j]=k;
        }
    }
    void reset(){
        for(int i=0;i<200;i++)
            memset(V[i],15,sizeof V[i]),V[i][i]=0;
    }
} mygod[51],finalstuff;
int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
void recalcblok(int blok){
    mygod[blok].reset();
    int end=min(row-1,SZ*blok+SZ);
    for(int r=SZ*blok+1;r<=end;r++){
        for(int i=0;i<col;i++) {
            for(int j=0;j<col;j++)
                mygod[blok].V[i][j]+=dn[r-1][j];
            for(int j=0;++j<col;)
                mygod[blok].V[i][j]=min(mygod[blok].V[i][j],
                        mygod[blok].V[i][j-1]+lr[r][j-1]);
            for(int j=col;--j;)
                mygod[blok].V[i][j-1]=min(mygod[blok].V[i][j-1],
                            mygod[blok].V[i][j]+lr[r][j-1]);
        }
    }
}
void redofinale(){
    int pref[200];
    pref[0]=0;
    for(int i=1;i<200;i++)
        pref[i]=pref[i-1]+lr[0][i-1];
    for(int i=0;i<col;i++) for(int j=0;j<col;j++)
        finalstuff.V[i][j]=abs(pref[i]-pref[j]);
    for(int i=0;i<=blocknum;i++)
        finalstuff*=mygod[i];
}
void init(int R, int C, int H[5000][200], int V[5000][200]) {
    SSZZ=C;
    for(int i=0;i<5000;i++)
        memcpy(lr[i],H[i],sizeof lr[i]),
        memcpy(dn[i],V[i],sizeof dn[i]);
    row=R;col=C;
    blocknum=(R-2)/SZ;
    for(int i=0;i<=blocknum;i++)
        recalcblok(i);
    redofinale();
}
void changeH(int P, int Q, int W) {
    lr[P][Q]=W;
    if(P)recalcblok(P/SZ),redofinale();
}

void changeV(int P, int Q, int W) {
    memset(ans,-1,sizeof ans);
    dn[P][Q]=W;
    recalcblok(P/SZ),redofinale();
}
int escape(int V1, int V2) {
    return finalstuff.V[V1][V2];
}
#include "wombats.h"
#include<bits/stdc++.h>
using namespace std;
int tmp[200][200],SSZZ;
int opt[201][201];
struct matrix{
    int V[200][200];
    void friend operator *=(matrix &a,matrix &b){
        memcpy(tmp,a.V,sizeof tmp);
        for(int i=0;i<SSZZ;i++)
            for(int j=0;j<SSZZ;j++)
                a.V[i][j]=1e9;
        for(int i=0;i<SSZZ;i++)
            opt[SSZZ][i]=SSZZ;
        for(int i=SSZZ;i--;) {
            for(int k=0;k<=opt[i+1][0];k++)
                if(a.V[i][0]>tmp[i][k]+b.V[k][0])
                    a.V[i][0]=tmp[i][k]+b.V[k][0],opt[i][0]=k;
            for(int j=1;j<SSZZ;j++)
                for(int k=opt[i][j-1];k<=opt[i+1][j];k++)
                    if(a.V[i][j]>tmp[i][k]+b.V[k][j])
                        a.V[i][j]=tmp[i][k]+b.V[k][j],opt[i][j]=k;
        }
    }
    void reset(){
        for(int i=0;i<200;i++)
            memset(V[i],15,sizeof V[i]),V[i][i]=0;
    }
} mygod[51],finalstuff;
int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
void recalcblok(int blok){
    mygod[blok].reset();
    int end=min(row-1,SZ*blok+SZ);
    for(int r=SZ*blok+1;r<=end;r++){
        for(int i=0;i<col;i++) {
            for(int j=0;j<col;j++)
                mygod[blok].V[i][j]+=dn[r-1][j];
            for(int j=0;++j<col;)
                mygod[blok].V[i][j]=min(mygod[blok].V[i][j],
                        mygod[blok].V[i][j-1]+lr[r][j-1]);
            for(int j=col;--j;)
                mygod[blok].V[i][j-1]=min(mygod[blok].V[i][j-1],
                            mygod[blok].V[i][j]+lr[r][j-1]);
        }
    }
}
void redofinale(){
    int pref[200];
    pref[0]=0;
    for(int i=1;i<200;i++)
        pref[i]=pref[i-1]+lr[0][i-1];
    for(int i=0;i<col;i++) for(int j=0;j<col;j++)
        finalstuff.V[i][j]=abs(pref[i]-pref[j]);
    for(int i=0;i<=blocknum;i++)
        finalstuff*=mygod[i];
}
void init(int R, int C, int H[5000][200], int V[5000][200]) {
    SSZZ=C;
    for(int i=0;i<5000;i++)
        memcpy(lr[i],H[i],sizeof lr[i]),
        memcpy(dn[i],V[i],sizeof dn[i]);
    row=R;col=C;
    blocknum=(R-2)/SZ;
    for(int i=0;i<=blocknum;i++)
        recalcblok(i);
    redofinale();
}
void changeH(int P, int Q, int W) {
    lr[P][Q]=W;
    if(P)recalcblok(P/SZ),redofinale();
}

void changeV(int P, int Q, int W) {
    memset(ans,-1,sizeof ans);
    dn[P][Q]=W;
    recalcblok(P/SZ),redofinale();
}
int escape(int V1, int V2) {
    return finalstuff.V[V1][V2];
}

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;
      |      ^~~
wombats.cpp:84:5: error: redefinition of 'int tmp [200][200]'
   84 | int tmp[200][200],SSZZ;
      |     ^~~
wombats.cpp:4:5: note: 'int tmp [200][200]' previously declared here
    4 | int tmp[200][200],SSZZ;
      |     ^~~
wombats.cpp:84:19: error: redefinition of 'int SSZZ'
   84 | int tmp[200][200],SSZZ;
      |                   ^~~~
wombats.cpp:4:19: note: 'int SSZZ' previously declared here
    4 | int tmp[200][200],SSZZ;
      |                   ^~~~
wombats.cpp:85:5: error: redefinition of 'int opt [201][201]'
   85 | int opt[201][201];
      |     ^~~
wombats.cpp:5:5: note: 'int opt [201][201]' previously declared here
    5 | int opt[201][201];
      |     ^~~
wombats.cpp:86:8: error: redefinition of 'struct matrix'
   86 | struct matrix{
      |        ^~~~~~
wombats.cpp:6:8: note: previous definition of 'struct matrix'
    6 | struct matrix{
      |        ^~~~~~
wombats.cpp:109:3: error: conflicting declaration 'int mygod [51]'
  109 | } mygod[51],finalstuff;
      |   ^~~~~
wombats.cpp:29:3: note: previous declaration as 'matrix mygod [51]'
   29 | } mygod[51],finalstuff;
      |   ^~~~~
wombats.cpp:109:13: error: conflicting declaration 'int finalstuff'
  109 | } mygod[51],finalstuff;
      |             ^~~~~~~~~~
wombats.cpp:29:13: note: previous declaration as 'matrix finalstuff'
   29 | } mygod[51],finalstuff;
      |             ^~~~~~~~~~
wombats.cpp:110:5: error: redefinition of 'int ans [200][200]'
  110 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |     ^~~
wombats.cpp:30:5: note: 'int ans [200][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |     ^~~
wombats.cpp:110:19: error: redefinition of 'int lr [5000][200]'
  110 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                   ^~
wombats.cpp:30:19: note: 'int lr [5000][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                   ^~
wombats.cpp:110:33: error: redefinition of 'int dn [5000][200]'
  110 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                 ^~
wombats.cpp:30:33: note: 'int dn [5000][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                 ^~
wombats.cpp:110:47: error: redefinition of 'int col'
  110 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                               ^~~
wombats.cpp:30:47: note: 'int col' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                               ^~~
wombats.cpp:110:51: error: redefinition of 'int row'
  110 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                   ^~~
wombats.cpp:30:51: note: 'int row' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                   ^~~
wombats.cpp:110:55: error: redefinition of 'int SZ'
  110 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                       ^~
wombats.cpp:30:55: note: 'int SZ' previously defined here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                       ^~
wombats.cpp:110:62: error: redefinition of 'int blocknum'
  110 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                              ^~~~~~~~
wombats.cpp:30:62: note: 'int blocknum' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                              ^~~~~~~~
wombats.cpp:111:6: error: redefinition of 'void recalcblok(int)'
  111 | void recalcblok(int blok){
      |      ^~~~~~~~~~
wombats.cpp:31:6: note: 'void recalcblok(int)' previously defined here
   31 | void recalcblok(int blok){
      |      ^~~~~~~~~~
wombats.cpp:127:6: error: redefinition of 'void redofinale()'
  127 | void redofinale(){
      |      ^~~~~~~~~~
wombats.cpp:47:6: note: 'void redofinale()' previously defined here
   47 | void redofinale(){
      |      ^~~~~~~~~~
wombats.cpp:137:6: error: redefinition of 'void init(int, int, int (*)[200], int (*)[200])'
  137 | void init(int R, int C, int H[5000][200], int V[5000][200]) {
      |      ^~~~
wombats.cpp:57:6: note: 'void init(int, int, int (*)[200], int (*)[200])' previously defined here
   57 | void init(int R, int C, int H[5000][200], int V[5000][200]) {
      |      ^~~~
wombats.cpp:148:6: error: redefinition of 'void changeH(int, int, int)'
  148 | void changeH(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:68:6: note: 'void changeH(int, int, int)' previously defined here
   68 | void changeH(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:153:6: error: redefinition of 'void changeV(int, int, int)'
  153 | void changeV(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:73:6: note: 'void changeV(int, int, int)' previously defined here
   73 | void changeV(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:158:5: error: redefinition of 'int escape(int, int)'
  158 | int escape(int V1, int V2) {
      |     ^~~~~~
wombats.cpp:78:5: note: 'int escape(int, int)' previously defined here
   78 | int escape(int V1, int V2) {
      |     ^~~~~~
wombats.cpp:164:5: error: redefinition of 'int tmp [200][200]'
  164 | int tmp[200][200],SSZZ;
      |     ^~~
wombats.cpp:4:5: note: 'int tmp [200][200]' previously declared here
    4 | int tmp[200][200],SSZZ;
      |     ^~~
wombats.cpp:164:19: error: redefinition of 'int SSZZ'
  164 | int tmp[200][200],SSZZ;
      |                   ^~~~
wombats.cpp:4:19: note: 'int SSZZ' previously declared here
    4 | int tmp[200][200],SSZZ;
      |                   ^~~~
wombats.cpp:165:5: error: redefinition of 'int opt [201][201]'
  165 | int opt[201][201];
      |     ^~~
wombats.cpp:5:5: note: 'int opt [201][201]' previously declared here
    5 | int opt[201][201];
      |     ^~~
wombats.cpp:166:8: error: redefinition of 'struct matrix'
  166 | struct matrix{
      |        ^~~~~~
wombats.cpp:6:8: note: previous definition of 'struct matrix'
    6 | struct matrix{
      |        ^~~~~~
wombats.cpp:189:3: error: conflicting declaration 'int mygod [51]'
  189 | } mygod[51],finalstuff;
      |   ^~~~~
wombats.cpp:29:3: note: previous declaration as 'matrix mygod [51]'
   29 | } mygod[51],finalstuff;
      |   ^~~~~
wombats.cpp:189:13: error: conflicting declaration 'int finalstuff'
  189 | } mygod[51],finalstuff;
      |             ^~~~~~~~~~
wombats.cpp:29:13: note: previous declaration as 'matrix finalstuff'
   29 | } mygod[51],finalstuff;
      |             ^~~~~~~~~~
wombats.cpp:190:5: error: redefinition of 'int ans [200][200]'
  190 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |     ^~~
wombats.cpp:30:5: note: 'int ans [200][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |     ^~~
wombats.cpp:190:19: error: redefinition of 'int lr [5000][200]'
  190 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                   ^~
wombats.cpp:30:19: note: 'int lr [5000][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                   ^~
wombats.cpp:190:33: error: redefinition of 'int dn [5000][200]'
  190 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                 ^~
wombats.cpp:30:33: note: 'int dn [5000][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                 ^~
wombats.cpp:190:47: error: redefinition of 'int col'
  190 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                               ^~~
wombats.cpp:30:47: note: 'int col' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                               ^~~
wombats.cpp:190:51: error: redefinition of 'int row'
  190 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                   ^~~
wombats.cpp:30:51: note: 'int row' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                   ^~~
wombats.cpp:190:55: error: redefinition of 'int SZ'
  190 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                       ^~
wombats.cpp:30:55: note: 'int SZ' previously defined here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                       ^~
wombats.cpp:190:62: error: redefinition of 'int blocknum'
  190 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                              ^~~~~~~~
wombats.cpp:30:62: note: 'int blocknum' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                              ^~~~~~~~
wombats.cpp:191:6: error: redefinition of 'void recalcblok(int)'
  191 | void recalcblok(int blok){
      |      ^~~~~~~~~~
wombats.cpp:31:6: note: 'void recalcblok(int)' previously defined here
   31 | void recalcblok(int blok){
      |      ^~~~~~~~~~
wombats.cpp:207:6: error: redefinition of 'void redofinale()'
  207 | void redofinale(){
      |      ^~~~~~~~~~
wombats.cpp:47:6: note: 'void redofinale()' previously defined here
   47 | void redofinale(){
      |      ^~~~~~~~~~
wombats.cpp:217:6: error: redefinition of 'void init(int, int, int (*)[200], int (*)[200])'
  217 | void init(int R, int C, int H[5000][200], int V[5000][200]) {
      |      ^~~~
wombats.cpp:57:6: note: 'void init(int, int, int (*)[200], int (*)[200])' previously defined here
   57 | void init(int R, int C, int H[5000][200], int V[5000][200]) {
      |      ^~~~
wombats.cpp:228:6: error: redefinition of 'void changeH(int, int, int)'
  228 | void changeH(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:68:6: note: 'void changeH(int, int, int)' previously defined here
   68 | void changeH(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:233:6: error: redefinition of 'void changeV(int, int, int)'
  233 | void changeV(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:73:6: note: 'void changeV(int, int, int)' previously defined here
   73 | void changeV(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:238:5: error: redefinition of 'int escape(int, int)'
  238 | int escape(int V1, int V2) {
      |     ^~~~~~
wombats.cpp:78:5: note: 'int escape(int, int)' previously defined here
   78 | int escape(int V1, int V2) {
      |     ^~~~~~
wombats.cpp:244:5: error: redefinition of 'int tmp [200][200]'
  244 | int tmp[200][200],SSZZ;
      |     ^~~
wombats.cpp:4:5: note: 'int tmp [200][200]' previously declared here
    4 | int tmp[200][200],SSZZ;
      |     ^~~
wombats.cpp:244:19: error: redefinition of 'int SSZZ'
  244 | int tmp[200][200],SSZZ;
      |                   ^~~~
wombats.cpp:4:19: note: 'int SSZZ' previously declared here
    4 | int tmp[200][200],SSZZ;
      |                   ^~~~
wombats.cpp:245:5: error: redefinition of 'int opt [201][201]'
  245 | int opt[201][201];
      |     ^~~
wombats.cpp:5:5: note: 'int opt [201][201]' previously declared here
    5 | int opt[201][201];
      |     ^~~
wombats.cpp:246:8: error: redefinition of 'struct matrix'
  246 | struct matrix{
      |        ^~~~~~
wombats.cpp:6:8: note: previous definition of 'struct matrix'
    6 | struct matrix{
      |        ^~~~~~
wombats.cpp:269:3: error: conflicting declaration 'int mygod [51]'
  269 | } mygod[51],finalstuff;
      |   ^~~~~
wombats.cpp:29:3: note: previous declaration as 'matrix mygod [51]'
   29 | } mygod[51],finalstuff;
      |   ^~~~~
wombats.cpp:269:13: error: conflicting declaration 'int finalstuff'
  269 | } mygod[51],finalstuff;
      |             ^~~~~~~~~~
wombats.cpp:29:13: note: previous declaration as 'matrix finalstuff'
   29 | } mygod[51],finalstuff;
      |             ^~~~~~~~~~
wombats.cpp:270:5: error: redefinition of 'int ans [200][200]'
  270 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |     ^~~
wombats.cpp:30:5: note: 'int ans [200][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |     ^~~
wombats.cpp:270:19: error: redefinition of 'int lr [5000][200]'
  270 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                   ^~
wombats.cpp:30:19: note: 'int lr [5000][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                   ^~
wombats.cpp:270:33: error: redefinition of 'int dn [5000][200]'
  270 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                 ^~
wombats.cpp:30:33: note: 'int dn [5000][200]' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                 ^~
wombats.cpp:270:47: error: redefinition of 'int col'
  270 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                               ^~~
wombats.cpp:30:47: note: 'int col' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                               ^~~
wombats.cpp:270:51: error: redefinition of 'int row'
  270 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                   ^~~
wombats.cpp:30:51: note: 'int row' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                   ^~~
wombats.cpp:270:55: error: redefinition of 'int SZ'
  270 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                       ^~
wombats.cpp:30:55: note: 'int SZ' previously defined here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                       ^~
wombats.cpp:270:62: error: redefinition of 'int blocknum'
  270 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                              ^~~~~~~~
wombats.cpp:30:62: note: 'int blocknum' previously declared here
   30 | int ans[200][200],lr[5000][200],dn[5000][200],col,row,SZ=210,blocknum;
      |                                                              ^~~~~~~~
wombats.cpp:271:6: error: redefinition of 'void recalcblok(int)'
  271 | void recalcblok(int blok){
      |      ^~~~~~~~~~
wombats.cpp:31:6: note: 'void recalcblok(int)' previously defined here
   31 | void recalcblok(int blok){
      |      ^~~~~~~~~~
wombats.cpp:287:6: error: redefinition of 'void redofinale()'
  287 | void redofinale(){
      |      ^~~~~~~~~~
wombats.cpp:47:6: note: 'void redofinale()' previously defined here
   47 | void redofinale(){
      |      ^~~~~~~~~~
wombats.cpp:297:6: error: redefinition of 'void init(int, int, int (*)[200], int (*)[200])'
  297 | void init(int R, int C, int H[5000][200], int V[5000][200]) {
      |      ^~~~
wombats.cpp:57:6: note: 'void init(int, int, int (*)[200], int (*)[200])' previously defined here
   57 | void init(int R, int C, int H[5000][200], int V[5000][200]) {
      |      ^~~~
wombats.cpp:308:6: error: redefinition of 'void changeH(int, int, int)'
  308 | void changeH(int P, int Q, int W) {
      |      ^~~~~~~
wombats.cpp:68:6: note: 'void changeH(int, int, int)' previously defined here
   68 | void changeH(int P, int