- 博客(35)
- 资源 (2)
- 收藏
- 关注
原创 【设计模式】面向对象基础---温故知新
什么是设计模式?设计模式(Design pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性。设计模式的分类有哪些?创建型模式:抽象了对象实例化的过程,用来帮助创建对象的实例。Abstract Factory(工厂模式),Builder(构建者模式又叫生成器模式),Factory Metho...
2020-02-29 18:08:55 314
原创 【计算机组成原理】计算机系统概述
计算机性能指标吞吐量:表征一台计算机在某一时间间隔内能够处理的信 息量,单位是字节/秒(B/S)。响应时间:表征从输入有效到系统产生响应之间的时间度 量,用时间单位来度量,例如微秒(10-6S)、纳秒(10-9S)。利用率:表示在给定的时间间隔内,系统被实际使用的时 间所占的比率,一般用百分比表示。处理机字长:指处理机运算器中一次能够完成二进制数运算的位数。当前处理机的字...
2020-02-29 17:06:15 684
原创 miller_rabin素数判定+Pollard-rho素因子分解
一、miller_rabin素数判定miller_rabin是一种素性测试算法,用来判断一个大数是否是一个质数。miller_rabin是一种随机算法,它有一定概率出错,设测试次数为s,那么出错的概率是 4^(−s)算法的理论基础:Fermat定理:若a是任意正整数(1≤ a≤ n−1),n是奇素数,则 a^(n-1) ≡ 1 mod n。如果n是一个奇素数,将n−1表示成2^s*r 的...
2020-02-22 17:57:50 462
原创 2020年2月19日训练日记
这两天没怎么做题,也做不太出来,cf上一场没打,太晚了,上次好不容易把分打回来一点,但是离1600还差得远呢,感觉还挺迷茫的,不知道改咋学了,数论感觉也学的一塌糊涂,寒假就这么过去了,哎,好好干吧。...
2020-02-20 09:39:41 308
原创 2020年2月16日训练日记
最近打了好几场cf,感觉打的都不怎么样,还没把分刷回来。但是也解出了一些新的思想。好多时候自己知道思路但是自己实现起来就各种错误,看别人的代码就好简单。还是自己太菜了,最近的话主要是再看题,看思路。数论好多题都感觉好难,不好想,数量级太大,老是想不到怎么优化。看了别人的思路会收获很多,感觉很巧妙。...
2020-02-16 23:11:53 210
原创 Codeforces Round #620 (Div. 2):Shortest and Longest LIS
DiscriptionGildong recently learned how to find the longest increasing subsequence (LIS) in O(nlogn) time for a sequence of length n. He wants to test himself if he can implement it correctly, but he...
2020-02-16 22:30:37 202
原创 Codeforces Round #620 (Div. 2):Air Conditioner
DiscriptionGildong owns a bulgogi restaurant. The restaurant has a lot of customers, so many of them like to make a reservation before visiting it.Gildong tries so hard to satisfy the customers that...
2020-02-16 21:59:21 800
原创 Codeforces Round #620 (Div. 2):B. Longest Palindrome
DiscriptionReturning back to problem solving, Gildong is now studying about palindromes. He learned that a palindrome is a string that is the same as its reverse. For example, strings “pop”, “noon”, ...
2020-02-16 21:26:24 648
原创 Codeforces Round #620 (Div. 2):A. Two Rabbits
DiscriptionBeing tired of participating in too many Codeforces rounds, Gildong decided to take some rest in a park. He sat down on a bench, and soon he found two rabbits hopping around. One of the ra...
2020-02-16 20:42:38 286
原创 字典树判断是否为前缀编码
前缀编码:如果一个编码不是另一个编码的前缀,则为前缀编码。给定几个字符串,判断是否是前缀编码。直接字符串匹配。模板#include<bits/stdc++.h>using namespace std;#define maxn 100005 int ch[maxn][15];int val[maxn];int sz;char str[20];int num[ma...
2020-02-16 18:31:24 1793
原创 Codeforces Round #619 (Div. 2):C. Ayoub's function
DiscriptionAyoub thinks that he is a very smart person, so he created a function f(s), where s is a binary string (a string which contains only symbols “0” and “1”). The function f(s) is equal to the...
2020-02-14 15:35:23 170
原创 Codeforces Round #619 (Div. 2):B. Motarack's Birthday
DiscriptionDark is going to attend Motarack’s birthday. Dark decided that the gift he is going to give to Motarack is an array a of n non-negative integers.Dark created that array 1000 years ago, so...
2020-02-14 15:20:58 339
原创 Codeforces Round #619 (Div. 2):A. Three Strings
DiscriptionYou are given three strings a, b and c of the same length n. The strings consist of lowercase English letters only. The i-th letter of a is ai, the i-th letter of b is bi, the i-th letter ...
2020-02-14 14:47:30 299
原创 Codeforces Round #618 (Div. 2):C. Anu Has a Function
DiscriptionAnu has created her own function f: f(x,y)=(x|y)−y where | denotes the bitwise OR operation. For example, f(11,6)=(11|6)−6=15−6=9. It can be proved that for any nonnegative numbers x and y...
2020-02-13 20:39:31 256
原创 Educational Codeforces Round 82 (Rated for Div. 2):D. Fill The Bag
DiscriptionYou have a bag of size n. Also you have m boxes. The size of i-th box is ai, where each ai is an integer non-negative power of two.You can divide boxes into two parts of equal size. Your ...
2020-02-13 20:25:38 186
原创 Educational Codeforces Round 82 (Rated for Div. 2):C. Perfect Keyboard
DiscriptionPolycarp wants to assemble his own keyboard. Layouts with multiple rows are too complicated for him — his keyboard will consist of only one row, where all 26 lowercase Latin letters will b...
2020-02-13 18:09:28 167
原创 Educational Codeforces Round 82 (Rated for Div. 2):B. National Project
DiscriptionYour company was appointed to lay new asphalt on the highway of length nn. You know that every day you can either repair one unit of the highway (lay new asphalt over one unit of the highw...
2020-02-13 15:44:01 287
原创 Educational Codeforces Round 82 (Rated for Div. 2):A. Erasing Zeroes
DiscriptionYou are given a string ss. Each character is either 0 or 1.You want all 1’s in the string to form a contiguous subsegment. For example, if the string is 0, 1, 00111 or 01111100, then all 1...
2020-02-13 15:11:04 163
原创 2020年2月12 日训练日记
最近主要还是看题想题,感觉这些题有些难,想不太到,还是知识点用的不太熟练,看了一些资料感觉莫比乌斯反演呵杜教筛的原理差不多懂了,就是不知道怎么应用,原理推导都能看懂,但是一应用还是一头雾水。今晚本来想打cf的,结果不知道为啥电脑突然进不去cf了,主站分站都试了,都不行,气死我了。感觉好像是我电脑的毛病,最近一直感觉电脑不太好,明明没开几个网页和软件散热声音就特别大,可能哪个地方不太好了,等着疫情过...
2020-02-12 23:53:05 253
原创 poj2800 Joseph's Problem
DiscriptionJoseph likes taking part in programming contests. His favorite problem is, of course, Joseph’s problem.It is stated as follows.There are n persons numbered from 0 to n - 1 standing in a ...
2020-02-11 22:58:06 157
原创 UVA - 1404 Prime k-tuple【筛素数】
discription{p1, . . . , pk : p1 < p2 < . . . < pk} is called a prime k-tuple of distance s if p1, p2, . . . , pk are consecutiveprime numbers and pk − p1 = s. For example, with k = 4, s = 8...
2020-02-11 21:02:11 231
原创 2020年2月9日训练日记
这两天心态炸了,看一道题一道不会,看一道一道不会。脑子里过好几个方法,最后细想都成了暴力。然后因为做不出来题,我就看了一些题解的资料,也看了一些题,感觉数论的世界,我见识的还是太少,就很多公式定理我都不知道,是在看了那几道题才知道的。今晚上打了一场cf,div2,然后A开始想复杂了,WA了一发。然后死在了C上,改了好久也没改出来,感觉要掉分掉惨了,我太难了,明天补题。...
2020-02-10 00:47:02 286
原创 Uva 10061 进制问题【公式推导】
DiscriptionGiven a decimal integer number you will have to find out how many trailing zeros will be there in itsfactorial in a given number system and also you will have to find how many digits will...
2020-02-08 22:45:53 266 2
原创 三角函数公式
一、三角函数定义式sinA=a/csinA=a/c sinA=a/ccosA=b/c cosA=b/ccosA=b/ctanA=a/btanA=a/btanA=a/bcotA=b/acotA=b/acotA=b/asecA=c/bsecA=c/bsecA=c/bcscA=c/acscA=c/acscA=c/a二、同角三角函数基本关系1.倒数关系tanAcotA=1tanAcot...
2020-02-08 21:19:32 808
原创 POJ 2689【筛法求素数+区间筛素数】
DiscriptionThe branch of mathematics called number theory is about properties of numbers. One of the areas thathas captured the interest of number theoreticians for thousands of years is the questio...
2020-02-08 20:49:51 180
原创 Stirling公式【求解N!的位数】
一、定义斯特林公式(Stirling’s approximation)是一条用来取n的阶乘的近似值的数学公式。一般来说,当n很大的时候,n阶乘的计算量十分大,所以斯特林公式十分好用,而且,即使在n很小的时候,斯特林公式的取值已经十分准确。Stirling公式.:n!≈sqrt(2∗pi∗n)∗[(n/e)n]n!≈sqrt(2*pi*n)*[(n/e)^n]n!≈sqrt(2∗pi∗n)∗[...
2020-02-07 23:29:49 419
原创 2020年2月5日训练日记
这两天的话也是做题、做题、做题,有时候会遇到一些新的没见过的知识点,然后就去补相关的一些知识点。好久好久都没出门了,终于知道不出门能把人逼疯那种感受了。昨晚打了一场cf,结果c没做出来,掉了四分。补题的时候才知道原来pair可以直接做map的下标,就这么错过了这道题。最近感觉自己脑子特别慢,看一道题感觉要好久才能看出来是什么题,读题也是老是读不懂题。有些知识点看了好多遍都看不懂,该去看题了。...
2020-02-05 22:52:22 303
原创 Codeforces Round #617 (Div. 3):C. Yet Another Walking Robot
DiscriptionThere is a robot on a coordinate plane. Initially, the robot is located at the point (0,0). Its path is described as a string s of length n consisting of characters ‘L’, ‘R’, ‘U’, ‘D’.Eac...
2020-02-05 20:50:03 184
原创 POJ - 1320:Street Numbers【佩尔方程】
DriscriptionA computer programmer lives in a street with houses numbered consecutively (from 1) down one sideof the street. Every evening she walks her dog by leaving her house and randomly turning ...
2020-02-04 18:26:04 215
原创 佩尔方程
佩尔方程,是一种不定二次方程。Pell方程,古希腊和印度的数学家对此类方程的研究做了最早的贡献,由费马首先进行了深入研究,拉格朗日给出了解决方案,但后此类方程来却被欧拉误记为佩尔提出,并写入他的著作中。后人多称佩尔方程。
2020-02-03 21:58:59 1541
原创 2020年2月2日训练日记
最近的话就主要是做题做题,感觉好多题都还是不会啊,太难了,上个专题感觉又做不动了,又开始做新的专题,这个专题感觉还好一点,比上一个专题简单,好多推规律或者化简公式什么的就能做出来。今晚本来想打cf来着,前两天报名了比赛有几场忘记打,然后今晚题一直没刷出来,也没打成,明天补补题吧。...
2020-02-03 00:57:23 350
转载 UVA10090 Marbles【扩展的欧几里得】
DiscriptionI have some (say, n) marbles (small glass balls) and I am going to buy some boxes to store them. Theboxes are of two types:T ype 1: each box costs c1 Taka and can hold exactly n1 marbles...
2020-02-02 18:07:57 198
原创 ceil函数和floor函数
一、ceil函数1.头文件<cmath>2.作用:对小数向上取整,得到的不一定就是整数,因为他的返回值类型是double,有可能就是个小数,但是后边的小数部分全部是0;3. 格式:x=ceil(n);eg:ceil(3.4)=4;二、floor函数1.头文件<cmath>2.作用:对小数向下取整,得到的不一定就是整数,因为他的返回值类型是double,有可能就...
2020-02-02 17:30:45 1738
原创 UVA - 10951 Polynomial GCD 【最大公共多项式】
DisctiptionGiven a decimal integer number you will have to find out how many trailing zeros will be there in itsfactorial in a given number system and also you will have to find how many digits will...
2020-02-02 16:50:44 238
原创 求最大公共多项式
定义1 若h(x)既是f(x)的因式,又是g(x)的因式,则称h(x)是f(x)与g(x)的公因式。 因,c|f(x),c|g(x),并且c!=0,所以任意两个多项式都有公因式。定义2设d(x)是f(x)与g(x)的一个公因式,如果对于f(x)与g(x)的 任一个公因式h(x),都有h(x)|d(x)则称d(x)是f(x)与g(x)的一个最大公因式。定理如果d(x)是f(x)与g(x)的...
2020-02-02 16:22:59 735
Java Web图书管理系统源代码
2020-10-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人