본문 바로가기
  • Let's study

분류 전체보기104

백준 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.
[C++] 백준 3765: Celebrity jeopardy 문제 https://www.acmicpc.net/problem/3765 3765번: Celebrity jeopardy It’s hard to construct a problem that’s so easy that everyone will get it, yet still difficult enough to be worthy of some respect. Usually, we err on one side or the other. How simple can a problem really be? Here, as in Celebrity Jepoardy, questions www.acmicpc.net 해결방법 getline으로 입력값이 없을 때까지 입력받고 그대로 출력하면 된다. 코드 #include #includ.. 2023. 5. 7.
[C++] 백준 21638: SMS from MCHS 문제 https://www.acmicpc.net/problem/21638 21638번: SMS from MCHS The first line of input contains two integers $t_1$ and $v_1$ --- the temperature and the wind speed for today ($-50 \le t_1 \le 50$; $0 \le v_1 \le 20$). The second line contains two integers $t_2$ and $v_2$ --- the temperature and the wind speed for tomo www.acmicpc.net 해결방법 오늘과 내일의 온도와 풍속을 비교하여 적절한 조건마다 올바른 문장을 출력해주면 된다. 코드 #inclu.. 2023. 5. 6.