void tinhphi() {
phi[1] = 1;
for (int i=2; i<MAXN; i++){
if (!phi[i]){
phi[i] = i-1;
for (int j = (i<<1); j<MAXN; j+=i){
if (!phi[j])
phi[j] = j;
phi[j] = (phi[j]/i)*(i-1);
}
}
}
}
// MAXN=1e6+5
Hiển thị các bài đăng có nhãn tinh_phi. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn tinh_phi. Hiển thị tất cả bài đăng
Thứ Sáu, 12 tháng 4, 2019
Đăng ký:
Bài đăng (Atom)
Bài G - Educatioal Round 62
Đề bài: Bạn được cho 1 đồ thị vô hướng đặc biệt. Nó bao gồm $2n$ đỉnh được đánh số từ 1 đến 2n. Dưới đây là một số đặc tính của đồ thị: + ...
-
Hamiltonian Path is a path in a directed or undirected graph that visits each vertex exactly once. The problem to check whether a graph (di...
-
An array is a sequential collection of elements of same data type and stores data elements in a continuous memory location. The elements of...
-
A multi-dimensional array is an array of arrays. 2-dimensional arrays are the most commonly used. They are used to store data in a tabula...