Algorithm/Math (100) 썸네일형 리스트형 (C++) - 백준(BOJ) 21185 : Some Sum https://www.acmicpc.net/problem/21185 21185번: Some Sum Output a single word. The word should be 'Even', 'Odd', or 'Either', according to the rules given earlier. www.acmicpc.net 정수론 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 등차가 1인 연속 정수 구간의 길이 n을 선언 후 입력받습니다. 📔 풀이과정 2가지 경우가 있습니다. 1. n이 홀수인 경우 : 연속 구간이 홀수라면 (짝수가 짝수개, 홀수가 홀수개), (짝수가 홀수개, 홀수가 짝수개) 두 경우이므로 누적합이 짝수 또는 홀수가 나오게 됩니다. 2. 짝수인 경우 : 어떤 구간을 선택해도 짝수가 짝수개, 홀수.. (C++) - 백준(BOJ) 18330 : Petrol https://www.acmicpc.net/problem/18330 18330번: Petrol The input consists of two lines. The first line contains an integer n (0 ⩽ n ⩽ 200), specifying the amount of petrol that will be used in the next month. The second line contains an integer k (0 ⩽ k ⩽ 360), showing the quota left in Mahya’s fuel www.acmicpc.net 간단한 산수문제였습니다. 📕 풀이방법 📔 입력 및 초기화 다음달에 쓸 예정인 리터수 usePlan, 이번달에 쓰고 남은 리터수 leftLiter를 선.. (C++) - 백준(BOJ) 18005 : Even or Odd? https://www.acmicpc.net/problem/18005 18005번: Even or Odd? Output 2 if the sum of any n consecutive integers in the range from 1 to 1018 must be even, 1 if the sum must be odd, or 0 if the sum could be either even or odd. www.acmicpc.net 정수론 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 등차가 1인 연속 정수 구간의 길이 n을 선언 후 입력받습니다. 📔 풀이과정 2가지 경우가 있습니다. 1. n이 홀수인 경우 : 연속 구간이 홀수라면 (짝수가 짝수개, 홀수가 홀수개), (짝수가 홀수개, 홀수가 짝수개) 두 경우이므로.. (C++) - 백준(BOJ) 16693 : Pizza Deal https://www.acmicpc.net/problem/16693 16693번: Pizza Deal There’s a pizza store which serves pizza in two sizes: either a pizza slice, with area A1 and price P1, or a circular pizza, with radius R1 and price P2. You want to maximize the amount of pizza you get per dollar. Should you pick the pizza slice or the www.acmicpc.net if문을 사용해보는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 피자 슬라이스 면적 a1, 피자 슬라이스 가격 p1, 피자 1.. (C++) - 백준(BOJ) 16648 : Accumulator Battery https://www.acmicpc.net/problem/16648 16648번: Accumulator Battery The only line of the input contains two integers t and p — time Anna needs to get from her home to the meeting place, in minutes, and the battery level of her phone at the moment of meeting, in percent (1 ≤ t ≤ 360; 1 ≤ p ≤ 99). www.acmicpc.net 방정식을 세우고 공식을 도출해 답을 출력하는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 미팅 장소에 도착까지 걸리는 t분, t분 지나 도착하니 100%에.. (C++) - 백준(BOJ) 16600 : Contemporary Art https://www.acmicpc.net/problem/16600 16600번: Contemporary Art At the Van Abbemuseum of modern and contemporary art in Eindhoven, we always look to present our muses in the most interesting way possible. Sometimes we have our work cut out for us. Today we are exploring whether we can modify one of our perfectly-square www.acmicpc.net 간단한 산수문제였습니다. 📕 풀이방법 📔 입력 및 초기화 정사각형의 넓이를 입력할 double형 변수 squar.. (C++) - 백준(BOJ) 15610 : Abbey Courtyard https://www.acmicpc.net/problem/15610 15610번: Abbey Courtyard Bath’s annual Christmas market runs from the 23rd of November 2017 until the 10th of December 2017. During this time, the market will occupy the entire square courtyard of Bath Abbey. To brighten things up at night, a single long strand of cheerful festi www.acmicpc.net sqrt함수를 사용해보는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 정사각형의 평방미터를 의미하는 변수 squar.. (C++) - 백준(BOJ) 13610 : Volta https://www.acmicpc.net/problem/13610 13610번: Volta No automobilismo é bastante comum que o líder de uma prova, em determinado momento, ultrapasse o último colocado. O líder, neste momento, está uma volta à frente do último colocado, que se torna, assim, um retardatário. Neste problema, dados os tem www.acmicpc.net 간단한 수식과 for문을 써보는 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 가장 빠른 운전자의 한 랩 완주 시간초인 x와 가장 느린 운전자의 .. 이전 1 ··· 3 4 5 6 7 8 9 ··· 13 다음