BluteForce
# Problem Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to their start times. Example 1:Given intervals [1,3],[6,9…
Problem Write a function to generate the generalized abbreviations of a word. Example: Given word = "word", return the following list (order does not matter): ["word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d", "1or1", "w…
problem An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one black region. Pixels are connected horizontally and vertically. Given the location (…
問題 arc035.contest.atcoder.jp note ペナルティの小さい順にソートして小さい順にペナルティをうけていけばよい。 コード
Problem arc049.contest.atcoder.jp Note 想定解のやり方と違うみたい。 nこの頂点から最も遠い2組の点が最小になるようにすればよいわけで、ある2点に対して、その2点間の間にあってそれぞれの点と距離が等しくなる任意の点との距離は、 (a.c * b.c) / (a…
問題 abc009.contest.atcoder.jp note 文字列操作を貪欲にするだけなのだが、とても手こずった。 一番左に条件を満たす限り、一番小さい文字を持ってくるようにすればよい。
問題 abc024.contest.atcoder.jp メモ 貪欲にやれば良いだけ