# study

# Codeforces #733 D

733D D. Kostya the Sculptor time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Kostya is a genial sculptor, he has an idea: to carve a marble sculpture in the shape of a sphere. Kostya has a friend Zahar who works at a career. Zahar knows about Kostya’s idea and wants to present him a rectangular parallelepiped of marble from which he can carve the sphere.

# Codeforces #719 C

719C C. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output

# Codeforces #721 C

721C C. Journey time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Recently Irina arrived to one of the most famous cities of Berland — the Berlatov city. There are n showplaces in the city, numbered from1 to n, and some of them are connected by one-directional roads. The roads in Berlatov are designed in a way such that there are nocyclic routes between showplaces.

# 使用scikit-learn进行KMeans文本聚类

K-Means 算法简介 中文名字叫做K-均值算法，算法的目的是将n个向量分别归属到K个中心点里面去。算法首先会随机选择K个中心向量，然后通过迭代计算以及重新选择K个中心向量，使得n个向量各自被分配到距离最近的K中心点，并且所有向量距离各自中心点的和最小。

# static in C/C++

在C和C++语言当中都有static关键字，C语言中的功能C++全部都有，除此之外static关键字在C++的类中还有一些其他的功能。

# Sorting in Python

Simple implementation of five common sorting algorithm in Python. Bubble Sort Python 12345678910111213

# POJ1006

POJ1006 Biorhythms Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 124772 Accepted: 39392 Description Some people believe that there are three cycles in a person’s life that start the day he or she is born. These three cycles are the physical, emotional, and intellectual cycles, and they have periods of lengths 23, 28, and 33 days, respectively. There is one peak in each period of a cycle. At the peak of a cycle, a person performs at his or her best in the corresponding field (physical, emotional or mental). For example, if it is the mental curve, thought processes will be sharper and concentration will be easier.

# POJ1458

POJ1458 Common Subsequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 44778 Accepted: 18346 Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, …, xm > another sequence Z = < z1, z2, …, zk > is a subsequence of X if there exists a strictly increasing sequence < i1, i2, …, ik > of indices of X such that for all j = 1,2,…,k, xij = zj. For example, Z = < a, b, f, c > is a subsequence of X = < a, b, c, f, b, c > with index sequence < 1, 2, 4, 6 >. Given two sequences X and Y the problem is to find the length of the maximum-length common subsequence of X and Y.

# Linux下获取一个程序运行时间和内存用量

思路 运行一个程序，然后fork出一个子进程来使用execl运行目标程序，然后使用wait4获取子进程所消耗的资源。 目标程序