はまやんはまやんはまやん

hamayanhamayan's blog

2019-07-20から1日間の記事一覧

Sequence Decomposing [AtCoder Beginner Contest 134 E]

https://atcoder.jp/contests/abc134/tasks/abc134_e 前提知識 2Dセグメントツリー、セグメントツリーにセグメントツリーを載せるテク ← 公式解法ではいらない 解説 https://atcoder.jp/contests/abc134/submissions/6479037 先頭から貪欲に増加列を作ってい…

Preparing Boxes [AtCoder Beginner Contest 134 D]

https://atcoder.jp/contests/abc134/tasks/abc134_d 解説 https://atcoder.jp/contests/abc134/submissions/6478841 B[i] := i番目の箱にボールが何個入っているかと定義しておこう。 まず、自明なところから考えていこう。 A[N]=B[N] これがまず分かるとこ…

Exception Handling [AtCoder Beginner Contest 134 C]

https://atcoder.jp/contests/abc134/tasks/abc134_c 前提知識 累積和 解説 https://atcoder.jp/contests/abc134/submissions/6478504 ある1要素以外の最大値を取りたいという要望には典型テクがある。 累積和を利用するのだが、先頭からと後尾からの2つを構…

Golden Apple [AtCoder Beginner Contest 134 B]

https://atcoder.jp/contests/abc134/tasks/abc134_b 解説 https://atcoder.jp/contests/abc134/submissions/6478072 監視員がカバーできる範囲は[i-D,i+D]なので、2D+1の範囲をカバーできる。 よって、len=2D+1とすると、N/Dの切り上げが必要な監視員の最少…

Dodecagon [AtCoder Beginner Contest 134 A]

https://atcoder.jp/contests/abc134/tasks/abc134_a 解説 https://atcoder.jp/contests/abc134/submissions/6477844 問題に書いてある計算式をそのまま実装しよう。 int R; //---------------------------------------------------------------------------…

XXE on JSON Endpoints

概要 JSONを渡すAPIに対して、XMLを渡すことができる場合がある その場合にXXEが行えてしまう JSONを渡すAPIに対してXMLが渡せる現象 Playing with Content-Type – XXE on JSON Endpointsのほぼ日本語訳。 例えば、 POST /netspi HTTP/1.1 Host: someserver.…

BNV [Google Capture The Flag 2019 (Quals)]

https://ctftime.org/task/8791 前提知識 XXE 問題 There is not much to see in this enterprise-ready™ web application. https://bnv.web.ctfcompetition.com/ Writeups https://www.youtube.com/watch?v=OqDxy-wm9to https://medium.com/hmif-itb/google…