제출 #333079

#제출 시각아이디문제언어결과실행 시간메모리
333079gouravkhungerCoins (IOI17_coins)C++14
컴파일 에러
0 ms0 KiB
#include "coins.h" std::vector<int> coin_flips(std::vector<int> b, int c) { std::vector <int> flips; for(int i=0;i<64;i++){ if(i!=c){ if(b[i]==b[c]) flips.push_back(i); } } if(flips.size()==0){ flips.push_back(c); flips.push_back(c); } return flips; } int find_coin(std::vector<int> b) { int temp; if(count(b.begin(),b.end(),1)>1) temp=0; else temp=1; for(int i=0;i<64;i++){ if(b[i]==temp) return(i); } }

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

coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:19:8: error: 'count' was not declared in this scope
   19 |     if(count(b.begin(),b.end(),1)>1) temp=0;
      |        ^~~~~
coins.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^