0w1

Entries from 2016-02-24 to 1 day

CF 579D "Or" Game ( Ad hoc )

Problem - D - Codeforces We should notice that it is necessary to somehow maximize the largest number, so all the x should be multiplied on the same number, otherwise the most significant digit could be pushed even further. However we cann…

UVA 11626 Convex Hull ( 凸包模板 )

UVa Online Judge 不太懂告訴我們一個點是否在凸包上到底有何意義。。嘛反正也是無恥水過去。注意座標會過大要用ll。 #include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 5; typedef long long ll; struct Vector{ int x, y; Vector(){} Vector(int _x,</bits/stdc++.h>…

UVA 681 Convex Hull Finding ( 凸包模板 )

UVa Online Judge 沒有變化的單純求凸包。比較特別的要求是起點要印兩次,且必須是 y值最小的,若有多個相同則 x值最小的。這部分很容易解決,將點排序的時候照他要求排就行了。 碎念:以為每次後面都要吐出 -1,沒想到是測資與測資之間啊。。。 #include <bits/stdc++.h> u</bits/stdc++.h>…

UVA 1543 Telescope ( DP )

UVa Online Judge 題目要求圓內選擇 m個點時最大的 m多邊形面積。由於點是給逆時針排序的,所以省掉了做一次凸包的麻煩。以 dp[ i ][ j ][ k ]為 [ i, j ] 中選了 k個點( 包含 i 和 j )時的最大面積動態規劃下去就行了。 #include <bits/stdc++.h> using namespace std; con</bits/stdc++.h>…

CF 579E Weakness and Poorness ( Binary Search )

Problem - E - Codeforces We are to find x that will give minimum for max{ ABS( SUM( a[ k ] - x Ɐ i ≤ k ≤ j ) ) Ɐ 1 ≤ i ≤ j ≤ n }. Let us first remove absolute and get max{ max{ SUM( a[ k ] - x Ɐ i ≤ k ≤ j ) Ɐ 1 ≤ i ≤ j ≤ n }, max{ - SUM( a…

CF 629C Famil Door and Brackets ( DP )

dp( a, b ) = the number of combinations, having a characters of valid prefix bracket sequence, and the opening bracket - closing = b dp2( a, b ) = the number of combinations, having a characters of valid suffix bracket sequence, and the cl…

TTPC2015 pF - レシート ( 桁DP )

F: レシート - 東京工業大学プログラミングコンテスト2015 | AtCoder A(1≤A≤10^100)円の商品に対し、X円でそれを購入することができる。買い物の金額A、支払額X、お釣り(X−A)の3つの整数について10進数表記にしたとき、3つの数字が揃う桁の数を最大にしたい…