본문 바로가기
  • Let's study

PS56

[C++] 백준 25784: Easy-to-Solve Expressions 문제 https://www.acmicpc.net/problem/25784 25784번: Easy-to-Solve Expressions When one looks at a set of numbers, one usually wonders if there is a relationship among them? This task is more manageable if there are only three numbers. Given three distinct positive integers, you are to determine how one can be computed using the othe www.acmicpc.net 해결방법 세 수를 배열에 넣어 정렬한 뒤, 첫번째 수와 두번째 수를 더하거나 곱한 게 세번.. 2023. 5. 13.
[C++] 백준 6887: Squares 문제 https://www.acmicpc.net/problem/6887 6887번: Squares Gigi likes to play with squares. She has a collection of equal-sized square tiles. Gigi wants to arrange some or all of her tiles on a table to form a solid square. What is the side length of the largest possible square that Gigi can build? For example, wh www.acmicpc.net 해결방법 입력받은 숫자를 sqrt 함수를 이용하여 제곱근을 구하고 앞에 (int)를 붙여 정수로 만들어 출력하면 된다. 코드 .. 2023. 5. 12.
백준 18698: The Walking Adam 문제 https://www.acmicpc.net/problem/18698 18698번: The Walking Adam Adam has just started learning how to walk (with some help from his brother Omar), and he falls down a lot. In order to balance himself, he raises his hands up in the air (that’s a true story), and once he puts his hands down, he falls. You are given a s www.acmicpc.net 해결방법 for문으로 입력받은 문자열을 하나씩 보면서 'D'이기 전까지 U의 개수를 세준다. 코드 #inclu.. 2023. 5. 11.
[C++] 백준 5300: Fill the Rowboats! 문제 https://www.acmicpc.net/problem/5300 5300번: Fill the Rowboats! The output will be the number of each pirate separated by spaces, with the word ”Go!” after every 6th pirate, and after the last pirate. www.acmicpc.net 해결방법 1. 1~n까지 숫자를 출력하되 6의 배수일 때마다 "Go!"를 출력한다. 2. n 출력 후 "Go!"를 출력해야 하는데 이 때 n이 6의 배수라면 for문에서의 "Go!" 출력과 중복되므로 출력하지 않는다. 코드 #include using namespace std; int main() { ios_base::s.. 2023. 5. 10.
[C++] 백준 5357: Dedupe 문제 https://www.acmicpc.net/problem/5357 5357번: Dedupe Redundancy in this world is pointless. Let’s get rid of all redundancy. For example AAABB is redundant. Why not just use AB? Given a string, remove all consecutive letters that are the same. www.acmicpc.net 해결방법 입력받은 문자열의 index 1부터 끝까지 확인하는데 i번째 문자가 i-1번째 문자와 같으면 i번째 문제를 삭제하고 i--를 해주고 for문이 다 끝나면 문자열을 출력해주면 된다. 코드 #include #include using name.. 2023. 5. 9.
[C++] 백준 11257: IT Passport Examination 문제 https://www.acmicpc.net/problem/11257 11257번: IT Passport Examination บรรทัดแรก เป็นจํานวนเต็ม N ระบุจํานวนผู้สอบ และ N บรรทัด ต่อมาเป็นข้อมูลของผู้เข้าสอบแต่ละค www.acmicpc.net 해결방법 전력 점수가 35 * 0.3 이상이고, 관리 점수가 25 * 0.3 이상이고, 기술 점수가 40 * 0.3 이상이고 전체 점수가 55 이상이면 PASS 아니면 FAIL을 출력한다. 코드 #include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, a, .. 2023. 5. 8.