본문 바로가기 메뉴 바로가기

MathTrauma

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

MathTrauma

검색하기 폼
  • 분류 전체보기 (128)
    • Mathematics (11)
      • Number Theory (5)
      • Real Analysis - 단편 (4)
      • Latex (1)
      • Inequality (1)
    • DS\Algo (84)
      • Dynamic Programming (16)
      • Tree (5)
      • Segment Tree (11)
      • 최단 경로 (5)
      • Mathematics (5)
      • Binary Search (1)
    • Programming Language (27)
      • Shell Programming (9)
      • Python3 and Ruby (3)
      • JavaScript [초급 -완결] (12)
      • C++ (3)
    • Computer 일반 (6)
      • Blender (1)
      • Jupyter Lab (1)
      • VIM (3)
      • Mac (1)
  • 방명록

boj 1083 (1)
BOJ 1083 소트

문제 링크 : https://www.acmicpc.net/problem/1083 1083번: 소트 크기가 N인 배열 A가 있다. 배열에 있는 모든 수는 서로 다르다. 이 배열을 소트할 때, 연속된 두 개의 원소만 교환할 수 있다. 그리고, 교환은 많아봐야 S번 할 수 있다. 이때, 소트한 결과가 사전 www.acmicpc.net 가장 앞자리부터 가능한한 큰 수로 교환하고, 교환 횟수가 남아있다면 그 다음 자리로 가서 이를 반복한다. 알고리즘은 더 설명할 게 없고, 아래 코드에서 algorithm 라이브러리에 있는 rotate 함수를 설명하면 충분할 듯하다. rotate( arr+start , arr+p , arr+end ); arr 이 배열인 경우 [ start , end ) 에 존재하는 원소들을 p 에..

DS\Algo 2022. 11. 11. 07:37
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • lazy propagation
  • JavaScript
  • C++ big number
  • shell
  • Shell Programming
  • BOJ
  • 세그먼트 트리
  • 다익스트라
  • script
  • stack
  • number theory
  • dynamic programming
  • Aho-Corasick
  • python3
  • Dijkstra
  • math font
  • 백준
  • Reference
  • persistent segment tree
  • nearest common ancestor
  • bash
  • javascript array
  • RUBY
  • segment tree
  • bash script
  • map
  • fenwick tree
  • max flow
  • Vim
  • 정수론
more
«   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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바