study

POJ3041

Written by  on August 14, 2018

POJ3041 Asteroids Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26141 Accepted: 14134 Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conveniently located at the lattice points of the grid.

[Read more...]

Codeforces #879C

Written by  on November 6, 2017

879C C. Short Program time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya learned a new programming language CALPAS. A program in this language always takes one non-negative integer and returns one non-negative integer as well.

[Read more...]

奇异值分解

Written by  on February 23, 2017

在自然语言处理或者机器学习相关应用时,通常首先要做的是将每一个样本转换成一个向量,然后将预处理过后的样本聚集在一起以矩阵计算的形式来对数据进行分析,然而很多时候都会碰到向量维度过高矩阵过大带来的计算复杂度太高问题,这个时候就要对样本数据集进行降维处理,也就是通常所说的主成分分析 (Principal components analysis,PCA),在尽可能保持原本数据集的特征的前提下降低数据集维度,简单的线性回归就是一种降维操作(将二维平面上的点用一维的线段来表示)。

[Read more...]

POJ1182

Written by  on December 13, 2016

POJ1182 食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 66244 Accepted: 19522 Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。

[Read more...]

Codeforces #733 D

Written by  on November 2, 2016

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.

[Read more...]

Codeforces #719 C

Written by  on October 26, 2016

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

[Read more...]

Codeforces #721 C

Written by  on October 11, 2016

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.

[Read more...]

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

Written by  on April 28, 2016

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

[Read more...]

static in C/C++

Written by  on March 2, 2016

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

[Read more...]

Sorting in Python

Written by  on February 28, 2016

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

[Read more...]