Skip to content

Instantly share code, notes, and snippets.

@buyoh
Last active December 3, 2016 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buyoh/7a830a13664e1c316073329f73074d58 to your computer and use it in GitHub Desktop.
Save buyoh/7a830a13664e1c316073329f73074d58 to your computer and use it in GitHub Desktop.
セグメント木。要バグチェック。
/*
セグメント木
こちらのスライドを参照しながら作成
http://www.slideshare.net/iwiwi/ss-3578491
簡単なテストケースしか見ていないので、バグがあるかも
n個のクエリが与えられるので、高速に処理したい。
クエリはクエリタイプ・prm1・prm2から構成される。
クエリタイプ 0 => a[prm1]=prm2
1 => a[prm1..prm2] から最小の値を求める。
*/
/* (アカン) */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment