-
POJ 1061 青蛙的约会 扩展欧几里得
扩展欧几里得模板套一下就A了,不过要注意刚好整除的时候,代码中有注释 #include iostream #include cstdio #include cstring #include cmath #include algorithm using namespace std;typedef long long ll;ll exgcd(ll a, ll b, ll x, ll y) { if (b == 0 ) { x = 1...
2018-06-17 23:43:25
-
扩展欧几里得算法
【转载】http://blog.csdn.net/qq_34494458/article/details/52637193 一:欧几里得算法(辗转相除法) 基本算法:设a=qb+r,其中a,b,q,r都是整数,则gcd(a,b)=gcd(b,r),即gcd(a,b)=gcd(b,a%b)。 证明: a可以表示成a = kb + r,则r = a mod b 假设d是a,b的一个公...
2018-06-17 23:43:25
-
C++ 之 基础回顾(一)
1 exe 程序 1.1 最小 cpp int main(){} // minimal cpp 思考一: 为什么最小程序没有return语句? 1.2 Hello #include iostream int main(){ std::cout " Hello!\n " ;} 思考二: \n 和std::endl 的区别是什么? 1.3 函数 #include iostream double Square( double x){ r...
2018-06-17 23:43:25 cms
-
如何在MFC界面开发中响应Button按钮的Down和Up事件
通过尝试有两种方案可以解决这个问题,第一种方案是通过PreTranslateMessage函数在调度消息之前对消息类型进行筛选,第二种方案是重载CButton类,在重载后的类CForTestButton中新增ON_WM_LBUTTONDOWN消息以及ON_WM_LBUTTONUP消息。 第一种方案 实现原理也挺简单,在消...
2018-06-17 23:43:19
-
nyoj-一笔画问题-欧拉图+联通判定
一笔画问题 时间限制: 3000ms | 内存限制: 65535KB 难度: 4 描述 zyc从小就比较喜欢玩一些小游戏,其中就包括画一笔画,他想请你帮他写一个程序,判断一个图是否能够用一笔画下来。 规定,所有的边都只能画一次,不能重复画。 输入 第一行只有一个正整数N(N=10)表示...
2018-06-17 23:43:23
-
Gym 101102D---Rectangles(单调栈)
题目链接 http://codeforces.com/gym/101102/problem/D problem description Given an R C grid with each cell containing an integer, find the number of subrectangles in this grid that contain only one distinct integer; this means every cell in a subrecta...
2018-06-17 23:43:15
-
HDU 1028(母函数)
Online Judge Online Exercise Online Teaching Online Contests Exercise Author F.A.Q Hand In Hand Online Acmers Forum |Discuss Statistical Charts Problem Archive Realtime Judge Status Authors Ranklist C/C++/Java Exams ACM Steps Go to Job Contest LiveC...
2018-06-17 23:43:20
-
2016弱校联盟十一专场10.3---Similarity of Subtrees
题目链接 https://acm.bnu.edu.cn/v3/problem_show.php?pid=52310 problem description Define the depth of a node in a rooted tree by applying the following rules recursively: The depth of a root node is 0. The depths of child nodes whose parents are wit...
2018-06-17 23:43:18
-
POJ 2115 C Looooops扩展欧几里得
题意不难理解,看了后就能得出下列式子: (A+C*x-B)mod(2^k)=0 即(C*x)mod(2^k)=(B-A)mod(2^k) 利用模线性方程(线性同余方程)即可求解 模板直达车 #include iostream #include cstdio #include cstring #include cmath #include algorithm using namespace std;typedef...
2018-06-17 23:43:15
-
Gym 100917J---Judgement(01背包+bitset)
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/output Statements The jury of Berland regional olympiad in informatics does not trust to contest management systems, so the Berland regional programming contest is judged...
2018-06-17 23:43:11
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash




