본문 바로가기

C++349

[BOJ / C++] 26574번 : Copier 문제 Your copier broke down last week, and you need to copy a list of numbers for a class project due tomorrow! Luckily, you can use your computer to copy the numbers for you. Given a list of numbers, each on their own line, print out the number, a space, and then another copy of the number. 입력 The first line will contain a single integer n that indicates the number of numbers to follow, each on t.. 2022. 12. 20.
[BOJ / C++] 5341번 : Pyramids 문제 A pyramid of blocks is constructed by first building a base layer of n blocks and then adding n-1 blocks to the next layer. This process is repeated until the top layer only has one block. You must calculate the number of blocks needed to construct a pyramid given the size of the base. For example, a pyramid that has a base of size 4 will need a total of 10 blocks. 입력 The input will be a sequ.. 2022. 12. 17.
[BOJ / C++] 20254번 : Site Score 문제 Teams from variaous universities compete in ICPC regional contests for tickets to the ICPC World Finals. The number of tickets allocated to every regional contest may be different. The allocation method in our super region, Asia Pacific, is based on a parameter called site score. Site scores will only count teams and universities solving at least one problem, in the regional contest or its pr.. 2022. 12. 15.
[BOJ / C++] 18301번 : Rats 문제 쥐의 해 설날을 축하하기 위해, 더글라스는 그의 집에 사는 쥐의 수를 세어보기로 했습니다. 쥐는 워낙 잘 숨기 때문에, 그가 모든 쥐를 찾기란 불가능합니다. 그러나 새해 첫 날, 더글라스는 n1마리의 쥐를 잡고 놓아주기 전 그들의 귀에 표식을 남기는 데에 성공했습니다. 새해 둘째 날, 더글라스는 또 n2마리의 쥐를 잡았는데, 그중 n12마리가 첫 날에 이미 표식을 남겼던 쥐라는 걸 발견했습니다. 더글라스는 그의 집에 사는 쥐의 총 수를 추정하기 위해 당신에게 도움을 요청합니다. 통계학 교과서를 뒤져보고, 당신은 아래의 채프만 추정값 N을 사용하기로 제안합니다. N = ⌊(n1 + 1)(n2 + 1)/(n12 + 1) - 1⌋ ⌊x⌋는 x의 내림값, 즉, x 이하의 수 중 x와 가장 가까운 정수를 의.. 2022. 12. 12.