我也不清楚这是什么高级算法,欧拉筛是昨天有位大佬,半夜无意间告诉我的
欧拉筛:
主要的含义就是我把这个数的所有倍数都弄出来,然后下次循环的时候直接就可以跳过了
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
public class 求指数 {
public static ArrayList list = new Array
1.首先是这样写的:
import jieba
txt = open(D:/python程序/threekingdoms.txt,rt,encoding='utf-8').read()
words=jieba.lcut(txt)
counts={}
for word in words:
if len(word)==1:
continue
else:
counts[word]=counts.get(word,0)+1
items=list(counts.items(