数论--中国剩余定理
文章平均质量分 66
二喵君
菜的不安详
展开
-
POJ2891【中国剩余定理】
原题:Elina is reading a book written by Rujia Liu, which introduces a strange way to express non-negative integers. The way is described as following:Choose k different positive integers a1, a2, …...原创 2019-01-14 18:54:30 · 177 阅读 · 0 评论 -
强势看懂--中国剩余定理--不互质--解题模板
先上大佬代码:#include<iostream>#include<stdio.h>using namespace std;long long exgcd(long long a,long long b,long long &x,long long &y){ if(b==0){ x=1,y=0; retur...原创 2018-08-09 17:12:27 · 783 阅读 · 0 评论 -
Biorhythms--题解
题目链接:http://poj.org/problem?id=1006难道只有我自己看不懂这道题吗?我始终没搞明白它和中国剩余定理有什么关系。。刚刚终于看明白了,比着题目一点一点扣字眼看明白了,还画出了一张神来之作--是的,简直完美(。) 题目大意:(要敲住重点) 从人生下来(遥远的起点,不用考虑),就有三个周期,T1=23,T2=28, T3=33,一个周期内有一天是...原创 2018-08-10 22:22:44 · 381 阅读 · 0 评论 -
基于题目的--中国剩余定理
x ≡ a1 (mod m1) x%m1 = a1 x ≡ a2 (mod m2) x%m2 = a2(S):x ≡ a3 (mod m3) -> x%m3 = a3 ... ... x ≡ an (mod mn) x%mn = an资料来源1:https://blog.csdn.net/...原创 2018-08-08 09:30:40 · 1115 阅读 · 0 评论 -
HDU 3336 Count the string【KMP】
题目:It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example:s:...原创 2019-02-28 15:35:21 · 150 阅读 · 0 评论