전체 글

·💻 개발
@GetMappingpublic ResponseEntity> gets( @RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "10") int size) { Page responseDtos = postService.gets(page, size); return ResponseEntity.ok(responseDtos);}public Page gets(int page, int size) { PageRequest pageRequest = PageRequest.of(Math.max(0, page), size, Sort.Direction.DESC, "createdAt"); Page pagedP..
·🤯 문제풀이
https://www.acmicpc.net/problem/23246n = int(input())arr = []rank = []for _ in range(n): score = list(map(int, input().split())) m = score[1] * score[2] * score[3] s = sum(score[1:]) n = score[0] arr.append([m, s, n])rank = sorted(arr)for i in range(3): print(rank[i][2], end = ' ') 생각첫 번째 배열 칸에는 곱, 두 번째 배열 칸에는 합, 세 번째 배열 칸에는 등번호를 넣어주고 정렬하면 되는 문제
·🤯 문제풀이
https://www.acmicpc.net/problem/11650n = int(input())arr = []for _ in range(n): nums = list(map(int, input().split())) arr.append(nums)arr.sort()for num in arr: print(num[0], num[1]) 생각오름차순 정렬만 하면 되는 간단한 문제
·🤯 문제풀이
https://www.acmicpc.net/problem/10974n = int(input())arr = [i for i in range(1, n + 1)]check = [False] * nchoose = []def permutation(level): if level == n: print(*choose) return for i in range(n): if check[i] == True: continue choose.append(arr[i]) check[i] = True permutation(level + 1) check[i] = False choose.pop()permutation(0) 생각제목 그대로 순열 문제, 조합과 비슷한 방식으로 풀면 된..
·🤯 문제풀이
https://www.acmicpc.net/problem/1759l, c = map(int, input().split())arr = list(map(str, input().split()))arr.sort()choose = []check = ['a', 'e', 'i', 'o', 'u']def combination(index, level): if level == l: cnt, cnt2 = 0, 0 for ch in choose: if ch in check: cnt += 1 else: cnt2 += 1 if cnt >= 1 and cnt2 >= 2: print(''.join(choose)) return for i in range(..
·🤯 문제풀이
https://www.acmicpc.net/problem/6603n = 0choose = []def combination(lst, index, level): if level == 6: print(*choose) return for i in range(index, n): choose.append(lst[i]) combination(lst, i + 1, level + 1) choose.pop()while True: t = list(map(int, input().split())) if t[0] == 0: break n = t[0] arr = t[1:] combination(arr, 0, 0) choose.clear() print() 생각대충 k개의 숫자 중에..
·💻 개발
import lombok.Getter;import lombok.RequiredArgsConstructor;import org.springframework.http.HttpStatus;@RequiredArgsConstructor@Getterpublic enum ErrorCode { INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "S-001", "서버 에러가 발생했습니다."), VALIDATION_FAIL(HttpStatus.BAD_REQUEST, "S-002", "유효성 검사에 실패했습니다."), ; private final HttpStatus httpStatus; private final String code; priv..
·💻 개발
@EnableJpaAuditing@Configurationpublic class JpaAuditingConfig {}import jakarta.persistence.*;import lombok.Getter;import org.springframework.data.annotation.CreatedDate;import org.springframework.data.annotation.LastModifiedDate;import org.springframework.data.jpa.domain.support.AuditingEntityListener;import java.time.LocalDateTime;@Getter@EntityListeners(AuditingEntityListener.class)@MappedSup..
openmpy
기록장