답안 #912758

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
912758 2024-01-19T20:57:57 Z amirhoseinfar1385 길고양이 (JOI20_stray) C++17
컴파일 오류
0 ms 0 KB
#include "Catherine.h"
#include<bits/stdc++.h>
using namespace std;

namespace {
  int a,b,peydashod=0,last=-1;
  vector<int>tofy;
}

void Init(int A, int B) {
  a=A;
  b=B;
}

int Move(std::vector<int> y) {
  if(a>=3){
    vector<int>tof;
    for(int i=0;i<(int)y.size();i++){
      if(y[i]!=0){
        tof.push_back(i);
      }
    }
    if((int)tof.size()==0){
      return -1;
    }
    if((int)tof.size()==1){
      return tof[0];
    }
    if(tof[0]==0&&tof[1]==1){
      return 0;
    }
    if(tof[0]==0&&tof[1]==2){
      return 2;
    }
    if(tof[0]==1&&tof[1]==2){
      return 1;
    }
  }
  if(y[0]>1){
    last=1;
    peydashod=1;
    return 1;
  }
  if(y[1]>1){
    last=0;
    peydashod=1;
    return 0;
  }
  if(peydashod==1){
    last^=1;
    return last;
  }
  if(last!=-1){
    if(y[0]==0&&y[1]==0){
      peydashod=1;
      return -1;
    }
    last^=1;
    tofy.push_back(last);
    int z=-1;
    if(z==-1){
      return last;
    }
    if(z==0){
      last^=1;
      peydashod=1;
      return -1;
    }
    peydashod=1;
    return last;
  }
  else{
    y[last]++;
    if(y[0]>1){
      last=1;
      peydashod=1;
     return 1;
    } 
    if(y[1]>1){
      last=0;
      peydashod=1;
      return 0;
    }
    return last;
  }
}



    

Compilation message

/usr/bin/ld: /tmp/cc8hX7Ck.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/ccN03ab6.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