"alloca" vs "placement new"

WHAT?!

For most time, we use malloc or new for memory allocation, which will get it on heap.

However, access memory on heap is not as effective as the memory on stack, because the heap is “free-floating region of memory”. To the contrary, memory on stack is managed by CPU …

more ...

GeoHash算法

GeoHash

Geohash is a latitude/longitude geocode system invented by Gustavo Niemeyer when writing the web service at geohash.org, and put into the public domain. It is a hierarchical spatial data structure which subdivides space into buckets of grid shape.

简单说,GeoHash是一个将经纬度信息编码成一个string的算法。从而便于储 …

more ...




匈牙利算法

概念

交错路

交错路:设P是图G的一条路,如果P的任意两条相邻的边一定是一条属于M而另一条不属于M,就称P是一条交错路。

通俗点来说,就是把一个图中的路径染成红黑两种。然后找出一条路,使这条路红黑 …

more ...

Codeforces 3C - Tic-tac-toe

啥?

Tic-tac-toe是我很久之前在CF上做的一道题。非常考细心的模拟题。

最近有同学和我讨论过类似的问题。于是拿出来重新做一遍。练练手。

原题做 …

more ...


自己动手搭建第三方的Codeforces CDN

啥?

校园网上CF那叫一个卡。

原因是什么呢? 因为codeforces大量的使用了ajax技术,所以引用了很多js/css文件,并且引用的位置位于页面之前。

这就造成了,我们在上CF的时候,其实页 …

more ...