Submission #778513

# Submission time Handle Problem Language Result Execution time Memory
778513 2023-07-10T11:35:37 Z bachhoangxuan Stray Cat (JOI20_stray) C++17
Compilation error
0 ms 0 KB
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;

namespace {
    int A,B,p=-1;
    int up=0,st=0,num=0;
    int f[81];
}  // namespace

void Init(int A, int B) {
    ::A = A;
    ::B = B;
    for(int i=0;i<81;i++) f[i]=-2;
    f[39]=-1;f[43]=0;f[32]=-1;f[13]=1;
    f[16]=-1;f[31]=0;f[67]=-1;f[64]=1;

}

int Move(std::vector<int> y) {
    auto g = [&](int val,int x){
        p=(val==-1?p:val);
        if(val!=-1) assert((to_string(x),y[val]));
        return val;
    };
    if(A==2){
        int d=y[0]+y[1]+(st!=0);st++;
        if(up) return g(d>=3?(p^1):y[1],0);
        if(d==1) return up=true,g(st!=1?-1:y[1],1);
        if(d>2) return up=true,g(y[0]==0 || y[1]==0?-1:(y[1]+(p==1)>y[0]+(p==0)?0:1),2);
        num=num*3+y[1]+(p==1);
        if(st<=3) return g(!y[0],3);
        else return up=true,g(f[num],4);
    }
    else for(int i=0;i<3;i++) if(y[i] && !y[(i+2)%3]) return i;
    return -2;
}



    

Compilation message

/usr/bin/ld: /tmp/ccnWfD21.o: in function `main':
grader_anthony.cpp:(.text.startup+0x191): undefined reference to `Mark(int, int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccOPecAN.o: in function `main':
grader_catherine.cpp:(.text.startup+0x41c): undefined reference to `Init(int, int)'
/usr/bin/ld: grader_catherine.cpp:(.text.startup+0xcfa): undefined reference to `Move(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status