제출 #642175

#제출 시각아이디문제언어결과실행 시간메모리
642175birthdaycake죄수들의 도전 (IOI22_prison)C++17
컴파일 에러
0 ms0 KiB
#include "prison.h" #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> #endif // C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <typeindex> #include <type_traits> #include <unordered_map> #include <unordered_set> #endif #define int long long #define endl '\n' #define boost ios_base::sync_with_stdio(false), cin.tie(NULL); using namespace std; // odd has , even doesnt // 0 check a // 1 , 2 check b for 0 vector<vector<int>> devise_strategy(int N) { vector<vector<int>>ans; vector<int>d; d.push_back(0); for(int i = 1; i <= N; i++) { if(i == 1){ d.push_back(-1); continue; } else if(i == N){ d.push_back(-2); continue; } if(i & (1 << (12))) d.push_back(1); else d.push_back(2); } ans.push_back(d); d.clear(); bool turn = 0; int cnt = 0; for(int j = 1; cnt < 12 || turn == 0; j+=2){ if(turn){ // check a cnt++; d.push_back(0); for(int i = 1; i <= N; i++){ if(i == 1) d.push_back(-1); else if(i == N) d.push_back(-2); else if(i & ((1 << cnt))) { d.push_back(j + 2); } else { d.push_back(j + 3); } } ans.push_back(d); d.clear(); d.push_back(0); for(int i = 1; i <= N; i++){ if(i == 1) d.push_back(-1); else if(i == N) d.push_back(-2); else if(i & ((1 << cnt))){ d.push_back(j + 2); } else { d.push_back(j + 3); } } ans.push_back(d); d.clear(); }else{ d.push_back(1); for(int i = 1; i <= N; i++){ if(i == 1) d.push_back(-2); else if(i == N) d.push_back(-1); else if(i & ((1 << cnt))) d.push_back(j + 2); else d.push_back(-2); } ans.push_back(d); d.clear(); d.push_back(1); for(int i = 1; i <= N; i++){ if(i == 1) d.push_back(-1); else if(i == N) d.push_back(-2); else if(i & ((1 << cnt))) d.push_back(-1); else d.push_back(j + 3); } ans.push_back(d); d.clear(); } turn = !turn; } return ans; }

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

/usr/bin/ld: /tmp/ccwAC0Gl.o: in function `main':
grader.cpp:(.text.startup+0x194): undefined reference to `devise_strategy(int)'
collect2: error: ld returned 1 exit status