제출 #1237964

#제출 시각아이디문제언어결과실행 시간메모리
1237964ayathkCoins (IOI17_coins)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "coins.h" using namespace std; #define fi first #define se second #define all(a) a.begin(),a.end() #define pb push_back const int maxn = 2e5+1; vector <int> coin_flips(vector <int>& b, int c){ vector <int> d(1); if(c == 1){ if(b[0] == 0){ b[0] = 1; d[0] = 0; } } else{ if(b[0] == 1){ b[0] = 0; d[0] = 0; } } return d; } int find_coin(vector <int> b){ if(b[0] == 1){ return 1; } else{ return 0; } } /*static string run_test() { int c; cin >> c; vector<int> b(64); for (int i = 0; i < 8; i++) { string s; cin >> s; for (int j = 0; j < 8; j++) { b[i * 8 + j] = int(s[j] - '0'); } } vector<int> flips = coin_flips(b, c); if ((int)flips.size() == 0) { return "0 turn overs"; } for (int i = 0; i < (int)flips.size(); i++) { if (flips[i] < 0 || flips[i] > 63) { return "cell number out of range"; } b[flips[i]] = 1 - b[flips[i]]; } int coin = find_coin(b); if (coin != c) { return "wrong coin"; } return "ok"; } //signed main() { int tests; cin >> tests; for (int t = 1; t <= tests; t++) { string result = run_test(); cout << "test #" << t << ": " << result << endl; } return 0; } */

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

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