poj
陆历川在江湖
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
展开
-
poj 1163 DP
今天翻师妹的博客,看到几篇不错的文章就打算转载一下,这是一道DP题,我自己先去做了一遍,虽然和她的思想有些出入,但还是AC了,看完文章还是有收益的传送门 : http://blog.csdn.net/qq_37672099/article/details/76577045自己的代码从上向下依次DP#include#include#include#includeusing转载 2017-08-05 10:03:14 · 168 阅读 · 0 评论 -
poj1061 模线性方程
模板题首先 x + k*m ≡ y + k* n (mod L) 转化成 k(m - n) ≡ y - x(mod L)套模板得到最小的解,但是要求是正的最小解,进行取模L#include<iostream>#include<cstdio>using namespace std;#define LL long longinline LL exgcd(LL a, ...原创 2018-02-20 15:45:19 · 340 阅读 · 1 评论 -
poj 2115
模线性方程需要注意的是mod 是间距也就是 ax+by =c , 其中的 b/gcd(a,b)模板题不需要多说#include<iostream>#include<cstdio>using namespace std;#define LL long longinline LL exgcd(LL a, LL b, LL &x, LL &y){///...原创 2018-02-20 18:01:04 · 201 阅读 · 0 评论