본문 바로가기

분류 전체보기590

[C/C++] 프로젝트 오일러 #93 Arithmetic Expressions(백트래킹) 프로젝트 오일러 문제 #93, Arithmetic Expressions는 네 개의 숫자를 이용해 가능한 모든 정수 값을 만들고, 그 중 가장 긴 연속된 정수 집합을 찾는 문제입니다. 이 문제의 목표는 네 개의 서로 다른 숫자를 선택한 후, 사칙연산과 괄호를 자유롭게 조합하여 만들 수 있는 모든 가능한 정수를 계산하는 것입니다. 예를 들어, 주어진 숫자가 1, 2, 3, 4라면, 이 네 숫자를 사용해 다양한 수식을 만들어내고, 그 수식을 통해 결과로 얻을 수 있는 모든 정수를 구하게 됩니다.문제의 규칙은 다음과 같습니다.1. 네 개의 숫자는 모두 서로 달라야 합니다.2. 각 숫자는 한 번만 사용할 수 있습니다.3. 사칙연산(+, -, *, /)과 괄호를 사용하여 가능한 많은 정수를 만들어냅니다.4. 음수나.. 2024. 11. 14.
[C/C++] 프로젝트 오일러 #92 Square Digit Chains(동적계획법) Project Euler 문제 92번은 숫자의 반복적인 변환 과정을 다룹니다. 기본적으로, 하나의 숫자를 각 자릿수로 나눈 뒤 각각의 자릿수를 제곱하여 더하는 과정을 반복하는데, 모든 숫자는 결국 1이나 89로 수렴하게 됩니다. 이 문제에서 중요한 점은 어떤 숫자들이 89로 도달하게 되는지 찾는 것입니다.예를 들어 숫자 44로 시작한다고 가정해봅시다. 4의 제곱은 16이므로, 44의 자릿수인 4와 4를 각각 제곱하면 16과 16이 되어 합계는 32입니다. 32를 다시 같은 방식으로 계산해보면 3²과 2²의 합인 13이 됩니다. 이어서 13을 1²과 3²로 계산하여 10을 얻고, 마지막으로 1²과 0²의 합을 통해 1에 도달하게 됩니다. 따라서 44는 최종적으로 1에 수렴하는 수라는 결론에 도달합니다.다른.. 2024. 11. 13.
A close-up portrait of a beautiful young woman Positive Prompt:“A close-up portrait of a beautiful young woman with detailed, ethereal features, standing in an ornate setting with golden decorative elements surrounding her. She has long, flowing hair adorned with delicate accessories, and her skin glows softly in the warm light of a sunset. Her eyes are vibrant and expressive, reflecting a sense of mystery and grace. Her jewelry is finely de.. 2024. 11. 13.
A young woman standing confidently in front of a large, futuristic humanoid mech Positive Prompt:“A young woman standing confidently in front of a large, futuristic humanoid mech in an open urban environment under a bright sky. She has long, flowing hair and wears a stylish outfit with mechanical leg enhancements, showing a blend of human and robotic aesthetics. The mech behind her is detailed, with realistic textures, metal parts, and a powerful, protective stance. The scen.. 2024. 11. 13.
[txt2img] A young woman sitting in a dimly lit room Positive Prompt:“A young woman sitting in a dimly lit room filled with old books and mystical items, with a vintage candle casting a warm, soft glow. She is engrossed in a magical book with glowing runes floating from the pages, illuminating her face in a serene, enchanted expression. Her long, wavy hair falls gracefully over her shoulders, and a curious cat watches her from the background. The .. 2024. 11. 13.
[C/C++] 백준 #3079 입국심사(이분탐색) 백준 온라인 저지 #3079 문제인 “입국심사” 문제는 다음과 같습니다.문제 개요• N개의 입국심사대가 있으며, 각 심사대마다 사람을 심사하는 데 걸리는 시간이 다릅니다.• M명의 사람이 입국심사를 받으려고 기다리고 있습니다.• 모든 사람이 입국심사를 마치는 데 걸리는 최소 시간을 구하는 문제입니다.입력1. 첫째 줄에 N(심사대의 개수)와 M(심사를 받아야 할 사람 수)이 주어집니다.2. 둘째 줄부터 N개의 줄에 각 심사대에서 한 명을 심사하는 데 걸리는 시간이 주어집니다.출력• 모든 사람이 입국심사를 마치는 데 걸리는 최소 시간을 출력합니다.해결 방법• 이분 탐색을 활용하여 최소 시간을 구하는 것이 핵심입니다.• 특정 시간을 기준으로 모든 사람이 심사를 받을 수 있는지 판단하며, 조건을 만족하는 최소 .. 2024. 11. 12.
728x90