본문 바로가기

Dev.baelanche

검색하기
Dev.baelanche
프로필사진 baelanche

  • 분류 전체보기 (273)
    • CS (0)
      • 선형대수 (0)
    • Data Structure & Algorithm (273)
      • PS 관련 이론 (0)
      • PS - JAVA (270)
      • PS - C++ (3)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
  • 부분합
  • 구현
  • 동적계획법
  • 구간합
  • 완전탐색
  • 문자열
  • 투포인터
  • 수학
  • 디스조인트-셋
  • BFS
  • disjoint-set
  • 분할정복
  • 힙
  • 우선순위큐
  • 슬라이딩윈도우
  • 탐색
  • 브루트포스
  • 스택
  • 알고리즘
  • 시뮬레이션
  • 그리디
  • 탐욕법
  • 큐
  • 유니온파인드
  • 백트래킹
  • 트리
  • 그래프
  • 이분탐색
  • 정렬
  • DFS
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록부분합 (1)

Dev.baelanche

[백준 16510] Predictable Queue

일반적인 배열이나 부분합 배열로 풀면 시간초과가 난다. 나는 부분합 배열을 이분탐색하는 방식으로 풀었다. 이것말고도 풀이가 많을것 같은데 푼 사람이 얼마없어서 다른 방법은 못 찾았다. public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int a[] = new int[n+1]; for(int i=0; i0) { int t = sc.nextInt(); int left = 1; int right = n; while(left t) right = mid-1; else left = mid+1; } System.o..

Data Structure & Algorithm/PS - JAVA 2019. 7. 2. 23:22
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바