제출 #246343

#제출 시각아이디문제언어결과실행 시간메모리
246343kostia244길고양이 (JOI20_stray)C++17
컴파일 에러
0 ms0 KiB
#include "Catherine.h" #include <bits/stdc++.h> #define pb push_back using namespace std; namespace kate { int A, B, gg = 0, lst = -2; string cur, god = "110100110100"; int decide(vector<int> c) { if(c[0] + c[1] == 0) { gg = 1; return -1; } if(lst == -2 && c[0]+c[1] == 1) { gg = 1; return lst = c[1]; } if(c[0] + c[1] + (lst != -2) > 2) { gg = 1; if(c[0] == 0) return -1; if(c[1] == 0) return -1; if(c[0] == 1) return lst = 0; if(c[1] == 1) return lst = 1; exit(-1); } if(c[0] + c[1] == 2) { if(c[0]) { cur.pb('0'+c[1]); cur.pb('0'); return lst = 0; } cur += "11"; return lst = 1; } if(gg) return lst = c[1]; cur.pb('0'+c[1]); if(cur.size() == 5) { gg = 1; //cout << " " << gg << "Yay\n"; if(god.find(cur) != string::npos) return -1; } return lst = c[1]; } } // namespace void Init(int A, int B) { kate::A = A; kate::B = B; } int Move(std::vector<int> y) { //cout << y[0] << " " << y[1] << " go "; int t = kate::decide(y); //cout <<kate::cur << " " << t << endl; return t; }
#include "Catherine.h" #include <bits/stdc++.h> #define pb push_back using namespace std; namespace kate { int A, B, gg = 0, lst = -2; string cur, god = "110100110100"; int decide(vector<int> c) { if(c[0] + c[1] == 0) { gg = 1; return -1; } if(lst == -2 && c[0]+c[1] == 1) { gg = 1; return lst = c[1]; } if(c[0] + c[1] + (lst != -2) > 2) { gg = 1; if(c[0] == 0) return -1; if(c[1] == 0) return -1; if(c[0] == 1) return lst = 0; if(c[1] == 1) return lst = 1; exit(-1); } if(c[0] + c[1] == 2) { if(c[0]) { cur.pb('0'+c[1]); cur.pb('0'); return lst = 0; } cur += "11"; return lst = 1; } if(gg) return lst = c[1]; cur.pb('0'+c[1]); if(cur.size() == 5) { gg = 1; //cout << " " << gg << "Yay\n"; if(god.find(cur) != string::npos) return -1; } return lst = c[1]; } } // namespace void Init(int A, int B) { kate::A = A; kate::B = B; } int Move(std::vector<int> y) { //cout << y[0] << " " << y[1] << " go "; int t = kate::decide(y); //cout <<kate::cur << " " << t << endl; return t; }

컴파일 시 표준 에러 (stderr) 메시지

/tmp/cc7DCUtv.o: In function `main':
grader_anthony.cpp:(.text.startup+0x175): 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