제출 #116703

#제출 시각아이디문제언어결과실행 시간메모리
116703faustaadpCoins (IOI17_coins)C++17
0 / 100
13 ms1596 KiB
#include "coins.h" #include<bits/stdc++.h> typedef long long ll; #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; std::vector<int> coin_flips(std::vector<int> b, int c) { ll i; std::vector<int> flips; for(i=0;i<64;i++) if((b[i]==1&&i!=c)||(i==c&&b[i]==0)) flips.pb(i); if(flips.size()==0) for(i=0;i<64;i++) flips.pb(i); return flips; } int find_coin(std::vector<int> b) { ll i,sat=1; for(i=0;i<64;i++) if(b[i]==1) sat++; if(sat==1) { for(i=0;i<64;i++) if(b[i]==1) return i; } else { for(i=0;i<64;i++) if(b[i]==0) return i; } }

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

coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:39:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...