제출 #1219112

#제출 시각아이디문제언어결과실행 시간메모리
1219112theiuliusCoins (IOI17_coins)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "coins.h" using namespace std; #define int long long #define ff first #define ss second #define pb push_back int t; const int N = 1e6 + 6; std::vector<int> coin_flips(std::vector<int> b, int c) { std::vector<int> flips; for (int i = 0; i <= 6; i++){ if (((1 << i) & c) != b[i]){ flips.pb(i); } } while (flips.size() < 8){ flips.pb(7); } return flips; } int find_coin(std::vector<int> b) { int num = 0; for (int i = 0; i <= 6; i++){ num += (1 << i) * b[i]; } return num; } main(){ /*ifstream cin(".in"); ofstream cout(".out");*/ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); }

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

coins.cpp:35:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   35 | main(){
      | ^~~~
/usr/bin/ld: /tmp/ccp6fubg.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc8EQOav.o:coins.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccp6fubg.o: in function `main':
grader.cpp:(.text.startup+0x3e2): undefined reference to `coin_flips(std::vector<int, std::allocator<int> >, int)'
/usr/bin/ld: grader.cpp:(.text.startup+0xb8a): undefined reference to `find_coin(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status