exgcd
ChengYuQi621
北京邮电大学人工智能学院
展开
-
P1082 同余方程
https://www.luogu.org/problemnew/show/P1082#include <cmath>#include <cstdio>#include <iostream>#include <algorithm>#define ll long long using namespace std;ll A,B,x,y,r...原创 2019-07-09 21:22:32 · 55 阅读 · 0 评论 -
P1516 青蛙的约会
https://www.luogu.org/problemnew/show/P1516#include <cmath>#include <cstdio>#include <iostream>#include <algorithm>#define ll long long using namespace std;ll x,y,m,n,l...原创 2019-07-09 21:23:34 · 102 阅读 · 0 评论 -
P2613 【模板】有理数取余
https://www.luogu.org/problemnew/show/P2613#include<bits/stdc++.h>#define IL inline#define RI register int#define mod 19260817long long a,b,ans;IL void read(long long &x){int f=1;x=0;...原创 2019-07-10 23:06:53 · 99 阅读 · 0 评论 -
P1762 偶数
https://www.luogu.org/problemnew/show/P1762打出杨辉三角形前若干行的奇偶分布情况,便会发现这是一个分形图形。这样就可以用递归解决问题。具体实现时可以直接计算,也可以先算总个数再减去奇数的数量(比较好算)。用扩展欧几里德或欧拉定理来解决除法取模问题,或是直接用高精计算,最后取模。#include<iostream>#include<c...原创 2019-07-10 23:07:55 · 131 阅读 · 0 评论 -
P1495 曹冲养猪
https://www.luogu.org/problem/P1495#include <algorithm>#include <iostream>#include <cstring>#include <cstdio>#include <cmath>#include <queue>#include <sta...原创 2019-08-20 17:26:09 · 117 阅读 · 0 评论