반응형

파이썬 45

[리트코드 (LeetCode)] Kth Largest Element in an Array (Python)

Kth Largest Element in an Array https://leetcode.com/explore/interview/card/top-interview-questions-medium/110/sorting-and-searching/800/ 분류: Top Interview Questions - Medium - Sorting and Searching Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for y..

[리트코드 (LeetCode)] Merge Two Sorted Lists: Linked List (Python)

Merge Two Sorted List https://leetcode.com/explore/featured/card/top-interview-questions-easy/93/linked-list/771/ 분류: Top Interview Questions - Easy - Linked List Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com 문제 두 개의 ..

[리트코드 (LeetCode)] Missing Number (Python)

Missing Number https://leetcode.com/explore/featured/card/top-interview-questions-easy/99/others/722/ 분류: Top Interview Questions - Easy - Others Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com 문제 주어진 배열 nums는 [0, n] 범위..

[리트코드 (LeetCode)] Valid Parentheses (Python)

Valid Parentheses https://leetcode.com/explore/featured/card/top-interview-questions-easy/99/others/721/ 분류: Top Interview Questions - Easy - Others Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com 문제 주어진 문자열 s는 문자 ‘(’, ..

[리트코드 (LeetCode)] Pascal's Triangle (Python)

Pascal’s Triangle https://leetcode.com/explore/featured/card/top-interview-questions-easy/99/others/601/ 분류: Top Interview Questions - Easy - Others Explore - LeetCode LeetCode Explore is the best place for everyone to start practicing and learning on LeetCode. No matter if you are a beginner or a master, there are always new topics waiting for you to explore. leetcode.com 문제 주어진 정수 numRow에 대해 파..

[백준] 14889: 스타트와 링크 (Python)

14889: 스타트와 링크 https://lemon27.tistory.com/22 [백준] 1748: 수 이어 쓰기 1 (Python) 1748: 수 이어 쓰기 1 https://www.acmicpc.net/problem/1748 1748번: 수 이어 쓰기 1 첫째 줄에 N(1 ≤ N ≤ 100,000,000)이 주어진다. www.acmicpc.net 문제 1부터 N까지의 수를 이어서 쓰면 다음과 같이 새로운.. lemon27.tistory.com 문제 오늘은 스타트링크에 다니는 사람들이 모여서 축구를 해보려고 한다. 축구는 평일 오후에 하고 의무 참석도 아니다. 축구를 하기 위해 모인 사람은 총 N명이고 신기하게도 N은 짝수이다. 이제 N/2명으로 이루어진 스타트 팀과 링크 팀으로 사람들을 나눠야 한다..

[백준] 1748: 수 이어 쓰기 1 (Python)

1748: 수 이어 쓰기 1 https://www.acmicpc.net/problem/1748 1748번: 수 이어 쓰기 1 첫째 줄에 N(1 ≤ N ≤ 100,000,000)이 주어진다. www.acmicpc.net 문제 1부터 N까지의 수를 이어서 쓰면 다음과 같이 새로운 하나의 수를 얻을 수 있다. 1234567891011121314151617181920212223... 이렇게 만들어진 새로운 수는 몇 자리 수일까? 이 수의 자릿수를 구하는 프로그램을 작성하시오. 입력 첫째 줄에 N(1 ≤ N ≤ 100,000,000)이 주어진다. 출력 첫째 줄에 새로운 수의 자릿수를 출력한다. 풀이 n의 범위가 딱 1억까지이므로 브루트 포스를 아슬아슬하게 사용할 수 있을 것 같았다. 그래서 1부터 n까지의 수를 ..

[백준] 1476: 날짜 계산 (Python)

1476: 날짜 계산 문제 준규가 사는 나라는 우리가 사용하는 연도와 다른 방식을 이용한다. 준규가 사는 나라에서는 수 3개를 이용해서 연도를 나타낸다. 각각의 수는 지구, 태양, 그리고 달을 나타낸다. 지구를 나타내는 수를 E, 태양을 나타내는 수를 S, 달을 나타내는 수를 M이라고 했을 때, 이 세 수는 서로 다른 범위를 가진다. (1 ≤ E ≤ 15, 1 ≤ S ≤ 28, 1 ≤ M ≤ 19) 우리가 알고있는 1년은 준규가 살고있는 나라에서는 1 1 1로 나타낼 수 있다. 1년이 지날 때마다, 세 수는 모두 1씩 증가한다. 만약, 어떤 수가 범위를 넘어가는 경우에는 1이 된다. 예를 들어, 15년은 15 15 15로 나타낼 수 있다. 하지만, 1년이 지나서 16년이 되면 16 16 16이 아니라 1..

[백준] 1932: 정수 삼각형

1932: 정수 삼각형 https://www.acmicpc.net/problem/1932 1932번: 정수 삼각형 첫째 줄에 삼각형의 크기 n(1 ≤ n ≤ 500)이 주어지고, 둘째 줄부터 n+1번째 줄까지 정수 삼각형이 주어진다. www.acmicpc.net 문제 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 위 그림은 크기가 5인 정수 삼각형의 한 모습이다. 맨 위층 7부터 시작해서 아래에 있는 수 중 하나를 선택하여 아래층으로 내려올 때, 이제까지 선택된 수의 합이 최대가 되는 경로를 구하는 프로그램을 작성하라. 아래층에 있는 수는 현재 층에서 선택된 수의 대각선 왼쪽 또는 대각선 오른쪽에 있는 것 중에서만 선택할 수 있다. 삼각형의 크기는 1 이상 500 이하이다. 삼각형을 이루고 있는 ..

반응형