This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
def solution(N, K) : | |
limit = 100001 # 최대로 주어지는 점 + 1 | |
time = [-1] * limit # 시간 저장을 위한 리스트 (방문 여부 확인을 위해 -1로 초기화) | |
time[N] = 0 # 시작은 0초 | |
d = [2, -1, 1] | |
q = deque() | |
q.append(N) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT MIN(DATETIME) AS 시간 | |
FROM ANIMAL_INS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text = input() | |
answer = '' | |
stack = [] # 연산자 관리용 | |
for t in text : | |
if t.isalpha() : | |
answer += t | |
else : | |
if t == '(' : | |
stack.append(t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L, R = input().split() | |
Llen, Rlen = len(L), len(R) | |
cnt = 0 | |
if Llen != Rlen : | |
print(cnt) | |
else : | |
for i in range(Llen) : | |
if L[i] != R[i] : | |
break | |
else : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// java/hello/hellospring/repository/MemoryMemberRepository.java | |
package hello.hellospring.repository; | |
import hello.hellospring.domain.Member; | |
import java.util.*; | |
public class MemoryMemberRepository implements MemberRepository { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// java/hello/hellospring/repository/MemberRepository.java | |
package hello.hellospring.repository; | |
import hello.hellospring.domain.Member; | |
import java.util.List; | |
import java.util.Optional; | |
public interface MemberRepository { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// java/hello/hellospring/domain/Member.java | |
package hello.hellospring.domain; | |
public class Member { | |
private Long id; // 시스템이 저장하는 ID | |
private String name; // 회원 이름 | |
// 단순하게 쉬운 예제로 하기 위해 getter, setter 사용 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// java/hello/hellospring/controller/HelloController.java | |
package hello.hellospring.controller; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.ui.Model; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
import org.springframework.web.bind.annotation.ResponseBody; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- resources/templats/hello-template.html --> | |
<html xmlns:th="http://www.thymeleaf.org"> | |
<body> | |
<p th:text="'hello ' + ${name}">hello! empty</p> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// java/hello/hellospring/controller/HelloController.java | |
package hello.hellospring.controller; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.ui.Model; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
// Controller 사용 시 @Controller라고 Annotation을 추가해야 함 |
NewerOlder