백준 1107 리모컨 혼내주기
아이디어는 어렵지 않았는데, 모든 경우의 수를 문자열로 만드니 stoi 함수가 빈 문자열일 때 에러가 나서 고치는데 꽤나 고생했다. #include #define fastio ios::sync_with_stdio(0), cin.tie(0) using namespace std; string target; int n, answer; bool broken[10]; void input() { fastio; int numBroken, num; cin >> target >> numBroken; n = stoi(target); for(int i = 0; i > num; broken[num] = true; } } void d(string& num) { for(int i = ..
혼내주기
2021. 8. 1. 22:31