알고리즘 트레이닝/UVa

풀이 문제에 기술되어 있는 내용을 정확히 코드로 구현합니다. #include #include using namespace std; int main() { // your code goes here int R; while (cin >> R) { if (R == -1) { break; } cout > guesses; int Stroke = 0; while(guesses.length()>0) { char ch = guesses[0]; if ( solution.find(ch) == -1 ) { Stroke += 1; } else { solution.erase(remove(solution.begin(), solution.end(), ch), solution.end()); } guesses.erase(remove(g..
풀이 #include #include using namespace std; vector SubSet; vector Seq(6); int n; int fnSolve(int idx,/* 고려하는 SubSet Index */ int cnt /* 선택한 갯수 */) { if (idx > n) { return 0; } if (cnt == 6) { cout
풀이 #include #include using namespace std; // next_permutaion 을 사용하면 쉽게 풀이 가능 int main() { string str; while (cin >> str) { if (str[0] == '#') { break; } bool val = next_permutation(str.begin(), str.end()); if (val == false) { cout
풀이 #include using namespace std; FILE* stream; int main(void) { //freopen_s(&stream, "Text.txt", "r", stdin); int D, F, H; float U; // Double 사용하면 답이 달라짐 while (cin >> H >> U >> D >> F) { if (H == 0) { break; } float f = U * F / 100; // Double 사용하면 답이 달라짐 float i = 0; // Double 사용하면 답이 달라짐 int d = 1; while (true) { // Day i += U; if (U > 0) U -= f; // Leave if (i > H) { break; } //cout
#include using namespace std; // FILE* stream; int main(void) { // freopen_s(&stream, "Text.txt", "r", stdin); int T; cin >> T; for (int t = 0; t > N; for (int i = 0; i > s; if (s > max) { max = s; } } cout
풀이 #include using namespace std; #define MAX_W 13 int main(void) { int N, B, H, W; while (cin >> N >> B >> H >> W) { int cP = 987654321; for (int i = 0; i > P; for (int j = 0; j > w; if (w >= N && P*N
풀이 #include using namespace std; int main(void) { int t; cin >> t; for (int i = 0; i > a >> b; if (a == b) { cout
쓴웃음
'알고리즘 트레이닝/UVa' 카테고리의 글 목록