제출 #988666

#제출 시각아이디문제언어결과실행 시간메모리
988666ElenaBMCoins (IOI17_coins)C++17
컴파일 에러
0 ms0 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; vector<int>coin_flips(vector<int>b, int c){ vector<int>flips; int val = 0; for (int i = 0; i < 64; i++){ if (b[i]){ val^= i; } } flips.push_back(val^c); return flips; } vector find_coin(vector <int>b){ int val =0; for (int i =0; i < 64; i++){ if (b[i])val^= i; } return val; }

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

coins.cpp:17:8: error: deduced class type 'vector' in function return type
   17 | vector find_coin(vector <int>b){
      |        ^~~~~~~~~
In file included from /usr/include/c++/10/vector:67,
                 from coins.h:1,
                 from coins.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~