tozangezan's diary

勝手にソースコードをコピペして利用しないでください。

2014-02-17から1日間の記事一覧

PKU 2886 Who Gets the Most Candies?

PKU

削除のある配列のi番目をlogでわかるようにする。 Segment Treeの典型。IOI2012のpracticeでも本番でもこんなの書いた覚えがある。 #include<stdio.h> #include<algorithm> using namespace std; char str[500010][16]; int c[500010]; int v[500010]; int segtree[1048576]; voi</algorithm></stdio.h>…

PKU 3301 Texas Trip

PKU

点が与えられるのでそれらを含む最小の正方形は?二分探索して角度をがんばって決める。まじめに考えるのが面倒だし制約が小さかったので大量に区間を追加して楽した。 二分探索の回数が足りなくて(30回)誤差死した #include<stdio.h> #include<algorithm> #include<math.h> #include<complex> usi</complex></math.h></algorithm></stdio.h>…

PKU 3016 K-Monotonic

PKU

単調増加列用と単調現象列用にすこしずらした配列を持ってあとは典型的なやつ。 あとはまとめて計算してオーダーを落とすタイプのDP。 #include<stdio.h> #include<algorithm> using namespace std; int c[1500]; // use in increasion int d[1500]; // use in decreasion int C[</algorithm></stdio.h>…

XIV Open Cup named after E.V. Pankratiev. GP of Udmurtia.

(正しい名称がわからないのでタイトル丸コピペしました。)JAPLJさん, rng_58さんと参加。6完8位でした。二人ともプロ過ぎて怖い。 自分が解いた問題だけ貼っておきますJ: やるだけ。というより英語を読むだけ。ただし英語が読めず嵌る。りんごさんに英語を読…