最新 最热

数论-快速幂、矩阵快速幂

文章目录快速幂矩阵快速幂例题HDU-2817HDU-3117快速幂----image.pngint fastpow(int a, int n) { int res = 1; while (n) { if (n & 1) //末位为1 res ...

2020-09-15
1

填坑-回溯-预习 之 素数大总结

B - 素数判定 HDU - 2012 对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=x<y<=50),判定该表达式的值是否都为素数。

2020-09-11
1

一起了解大名鼎鼎的“图灵机”

1936年,英国数学家阿兰・麦席森・图灵(1912―-1954年)提出了一种抽象的计算模型——图灵机( Turing machine)。图灵机,又称图灵计算机,即将人们使用纸笔进行数学运算的过程进行抽象,由一个虚拟的机器替代人类进行数学运算...

2020-08-14
0

设计模式之享元模式

Use sharing to support large numbers of similar objects efficiently.

2020-08-10
0

PAT1047 Student List for Course (25分)避免运行超时(内存溢出)

Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student...

2020-07-14
0

PAT 1033 To Fill or Not to Fill (25分) 贪心思想

With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on...

2020-07-14
1

PAT 1007 Maximum Subsequence Sum (25分) 最大连续子序列和

Given a sequence of K integers { N​1​​ , N​2​​ , ..., N​K​​ }. A continuous subsequence is defined to be { Ni​​ , N​i+1​​ , ..., N​j​​ } where 1≤i≤j≤K. The Maxi......

2020-07-14
0

PAT 1018 Public Bike Management (30分) Dijstra + DFS

There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and...

2020-07-14
1

【HDU 1021】Fibonacci Again(找规律)

There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). 输入n,若F(n)能被3整除,输出yes,否则no

2020-06-02
1

【HDU 5399】Too Simple

Rhason Cheung had a simple problem, and asked Teacher Mai for help. But Teacher Mai thought this problem was too simple, sometimes naive. So she ask you for h...

2020-06-02
1