728x90
반응형

프로그래밍 78

백준 10250번 문제(ACM 호텔) 파이썬(Python) 풀이 [로밍맨]

문제 링크https://www.acmicpc.net/problem/10250 이 문제는 상당히 쉬운 문제이면서도 함정(?)이 있는 문제입니다.다른 모든 층들에서는 주어진 n 에 대하여 h 로 나눈 뒤, 몫에다가 1을 더한 값이 방 번호가 되고, 나머지가 층이 되는데,가장 높은 층에 대해서는 몫이 방 번호가 되고, 나머지가 0이 될텐데, 이 경우에 h 값이 층이 됩니다.이러한 패턴을 파악하게 되면, 코드는 어렵지 않게 작성할 수가 있습니다.n 이 h 로 나누어 떨어지는 경우와 그렇지 않은 경우로 나누어서 풀면 간단하게 다음과 같이 풀립니다.123456789101112131415import sys def solve():    h, w, n = map(int, sys.stdin.readline().rstrip..

비전공자 무료로 혼자 코딩 공부하는 법(광고 X)

프로그래머가 꼭 컴퓨터 공학을 전공해야 하는 것은 아니지만,컴공과에서는 프로그래밍을 하기 위한 다양한 지식을 체계적으로 배우기 때문에비전공자도 전공자처럼 컴공 커리큘럼에 따라 공부를 한다면 전공자 비슷하게는 될 수 있을 것입니다.당연히 수업 이외의 부분에서도 배우는 것들도 있기 때문에 완벽하게 따라잡기는 어렵겠지만 말이죠. 제가 추천 드리는 방법은 다음과 같습니다.1) 훌륭한 대학에서 공개한 커리큘럼을 확인한다.2) 훌륭한 대학에서 공개한 강좌를 듣고 공부한다. 포항 공대 컴공과를 예로 들어볼게요.아래 링크를 가보시면 다양한 과목이 있는 것들을 알 수 있습니다.https://cse.postech.ac.kr/bachelors-degree/undergraduate-course/ 학부과정 – POSTECH 컴..

기타 2024.12.04

백준 25083번 문제(새싹) 파이썬(Python) 풀이 [로밍맨]

문제 링크 https://www.acmicpc.net/problem/25083 25083번: 새싹 아래 예제와 같이 새싹을 출력하시오. www.acmicpc.net 정답 코드는 아래와 같습니다. 1 2 3 4 5 6 print(" ,r\'\"7") print("r`-_ ,\' ,/") print(" \\. \". L_r\'") print(" `~\\/") print(" |") print(" |") cs 풀이는 아래 영상을 참고 바랍니다. https://www.youtube.com/watch?v=kbgfJrKQ7eU 저작권 라이선스: CC BY (출처만 표시하면 자유롭게 이용 가능)

[LeetCode] 26. Remove Duplicates from Sorted Array 파이썬(Python) 풀이

문제 링크 https://leetcode.com/problems/remove-duplicates-from-sorted-array Remove Duplicates from Sorted Array - LeetCode Can you solve this real interview question? Remove Duplicates from Sorted Array - Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place [https://en.wikipedia.org/wiki/In-place_algorithm] such that each unique element ap leetcode.com 투 포인터 문제라..

[LeetCode] 27. Remove Element 파이썬(Python) 풀이

문제 링크 https://leetcode.com/problems/remove-element Remove Element - LeetCode Can you solve this real interview question? Remove Element - Given an integer array nums and an integer val, remove all occurrences of val in nums in-place [https://en.wikipedia.org/wiki/In-place_algorithm]. The order of the elements may be changed. Then r leetcode.com element 간의 순서가 변경되어도 상관 없으니, 순차적으로 방문하면서 지워야 하는 ele..

[LeetCode] 88. Merge Sorted Array 파이썬(Python) 풀이

문제 링크 https://leetcode.com/problems/merge-sorted-array Merge Sorted Array - LeetCode Can you solve this real interview question? Merge Sorted Array - You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1 an leetcode.com merge sort 에서 가장 핵심이 되는 merge 함수의 in-place ..

백준 2588번 문제(곱셈) 파이썬(Python) 풀이 [로밍맨]

문제 링크 https://www.acmicpc.net/problem/2588 2588번: 곱셈 첫째 줄부터 넷째 줄까지 차례대로 (3), (4), (5), (6)에 들어갈 값을 출력한다. www.acmicpc.net 정답 코드는 아래와 같습니다. 1 2 3 4 5 6 7 8 9 10 a = int(input()) b = int(input()) b0 = b % 10 b1 = (b % 100) // 10 b2 = b // 100 print(a * b0) print(a * b1) print(a * b2) print(a * b) cs 풀이는 아래 영상을 참고 바랍니다. https://www.youtube.com/watch?v=c4E8gylCyC8 저작권 라이선스: CC BY (출처만 표시하면 자유롭게 이용 가능)

백준 10430번 문제(나머지) 파이썬(Python) 풀이 [로밍맨]

문제 링크 https://www.acmicpc.net/problem/10430 10430번: 나머지 첫째 줄에 A, B, C가 순서대로 주어진다. (2 ≤ A, B, C ≤ 10000) www.acmicpc.net 정답 코드는 아래와 같습니다. 1 2 3 4 5 6 7 import sys A, B, C = map(int, sys.stdin.readline().rstrip().split()) print((A+B)%C) print(((A%C) + (B%C))%C) print((A*B)%C) print(((A%C) * (B%C))%C) Colored by Color Scripter cs 동영상에서 말씀드린 참고하실 링크는 다음과 같습니다. https://roamingman.tistory.com/27 백준 25..

728x90
반응형