1 爱吃老谈酸菜的DV

尚未进行身份认证

把ACM当做自己的事业。

等级
TA的排名 2w+

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

2020年2月19日训练日记

这两天没怎么做题,也做不太出来,cf上一场没打,太晚了,上次好不容易把分打回来一点,但是离1600还差得远呢,感觉还挺迷茫的,不知道改咋学了,数论感觉也学的一塌糊涂,寒假就这么过去了,哎,好好干吧。...

2020-02-20 09:39:41

2020年2月16日训练日记

最近打了好几场cf,感觉打的都不怎么样,还没把分刷回来。但是也解出了一些新的思想。好多时候自己知道思路但是自己实现起来就各种错误,看别人的代码就好简单。还是自己太菜了,最近的话主要是再看题,看思路。数论好多题都感觉好难,不好想,数量级太大,老是想不到怎么优化。看了别人的思路会收获很多,感觉很巧妙。...

2020-02-16 23:11:53

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

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

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

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

字典树判断是否为前缀编码

前缀编码:如果一个编码不是另一个编码的前缀,则为前缀编码。给定几个字符串,判断是否是前缀编码。直接字符串匹配。模板#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

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

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

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

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

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

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

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

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

2020年2月12 日训练日记

最近主要还是看题想题,感觉这些题有些难,想不太到,还是知识点用的不太熟练,看了一些资料感觉莫比乌斯反演呵杜教筛的原理差不多懂了,就是不知道怎么应用,原理推导都能看懂,但是一应用还是一头雾水。今晚本来想打cf的,结果不知道为啥电脑突然进不去cf了,主站分站都试了,都不行,气死我了。感觉好像是我电脑的毛病,最近一直感觉电脑不太好,明明没开几个网页和软件散热声音就特别大,可能哪个地方不太好了,等着疫情过...

2020-02-12 23:53:05

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

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

2020年2月9日训练日记

这两天心态炸了,看一道题一道不会,看一道一道不会。脑子里过好几个方法,最后细想都成了暴力。然后因为做不出来题,我就看了一些题解的资料,也看了一些题,感觉数论的世界,我见识的还是太少,就很多公式定理我都不知道,是在看了那几道题才知道的。今晚上打了一场cf,div2,然后A开始想复杂了,WA了一发。然后死在了C上,改了好久也没改出来,感觉要掉分掉惨了,我太难了,明天补题。...

2020-02-10 00:47:02

查看更多

勋章 我的勋章
  • 新人勋章
    新人勋章
    用户发布第一条blink获赞超过3个即可获得
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 1024勋章
    1024勋章
    #1024程序员节#活动勋章,当日发布原创博客即可获得
  • 勤写标兵Lv4
    勤写标兵Lv4
    授予每个自然周发布9篇以上(包括9篇)原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。