제출 #116706

#제출 시각아이디문제언어결과실행 시간메모리
116706faustaadpCoins (IOI17_coins)C++17
0 / 100
12 ms1468 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); //flips.clear(); if(flips.empty()) { flips.clear(); 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:43: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...