HDU 6608 题意:给以你一个质数,求小于它的最大质数的阶乘。 分析:Miller-Rabin快速判断素性,找到这个最大素数。此外,加上威尔逊定理推式子就好了。威尔逊定理描述的内容是对于一个正素数p: ? \((k-1)!modk$\)= k-1$ 有了这个定理,我们就可以很容易得到小于k最大素 ...
分类:
其他好文 时间:
2020-07-29 00:42:21
阅读次数:
80
#pragma warning (disable : 4996) #include<iostream> #include<algorithm> //#include<unordered_map> #include<fstream> #include<iomanip> #include<string> ...
分类:
其他好文 时间:
2020-07-29 00:41:30
阅读次数:
78
Princess CJB has lived almost her entire life in the isolated town of Ertona, where CJB uses her unique ability to recognize where crystals of materia ...
分类:
其他好文 时间:
2020-07-28 22:14:42
阅读次数:
73
HDU - 1114 题目翻译: 在acm能够做任何事情之前, 必须编制预算并获得必要的财政支持。这一行动的主要收入来自IBM。这个想法其实很简单,每当一些会员有一点小钱时,他就会把所有的硬币都扔到小猪存钱罐里。这个过程是不可逆转的, 除非打破猪,否则硬币不能拿出来。过了足够长的时间, 存钱罐里应该 ...
分类:
其他好文 时间:
2020-07-28 22:08:26
阅读次数:
76
HDU - 4734 题目大致意思:我们定义十进制数x的权值为f(x) = a(n)*2^(n-1)+a(n-1)*2(n-2)+...a(2)*2+a(1)*1,a(i)表示十进制数x中第i位的数字。 题目给出a,b,求出0~b有多少个不大于f(a)的数。 这个f(x)计算就和数位计算是一样的,就 ...
分类:
其他好文 时间:
2020-07-28 22:05:32
阅读次数:
69
#ifndef MY_BIGN_H#define MY_BIGN_H 1#pragma GCC system_header#include<cstring>#include<algorithm>#include<iostream>using std::max;using std::istream;u ...
分类:
其他好文 时间:
2020-07-28 16:52:02
阅读次数:
67
使用文档 # -*- coding:utf-8 -*- #! python2 import shutil a=0 readDir = r"D:\pycharm-project\my-project\test\thefile2018-11-27.sh" writeDir = r"D:\pycharm- ...
分类:
其他好文 时间:
2020-07-28 14:00:53
阅读次数:
62
yield 是产出的意思,就是返回一个值,这一点有点像return,但是不会结束函数的执行。那它什么时候继续执行呢?等待下一次迭代器被调用时候返回上次中断的地方, 利用这个特性可以实现range函数: def my_range(max_num): i = 0 while i < max_num: y ...
分类:
其他好文 时间:
2020-07-27 23:43:11
阅读次数:
103
前言 SQL作为Web开发是永远离开不的一个话题,天天写SQL,可是你知道一个SQL是如何执行的吗? select name from user where id = 1; 上面是一个简单的查询语句,交给数据库去执行,然后返回name。看起来很简单,可是内部的执行过程却很多人都不知道。 今天就把My ...
分类:
数据库 时间:
2020-07-27 13:47:56
阅读次数:
130
Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? InputThe first line of input contains N, the number ...
分类:
其他好文 时间:
2020-07-27 09:42:59
阅读次数:
80