摘要: 题目链接:http://poj.org/problem?id=1753 题目概述:有4*4的正方形,每个格子要么是黑色,要么是白色,当把一个格子的颜色改变(黑->白或者白->黑)时,其周围上下左右(如果存在的话)的格子的颜色也被反转,问至少反转几个格子可以使4*4的正方形变为纯白或者纯黑? 阅读全文
posted @ 2016-05-08 20:42 Hutonm 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 1 #include"iostream" 2 using namespace std; 3 int kuaisuqiumo(int a,int b,int c){ 4 int ans = 1; 5 a = a % c; 6 while(b>0){ 7 if(b % 2 == 1) 8 ans = (ans * a) ... 阅读全文
posted @ 2016-05-08 20:41 Hutonm 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=115 阅读全文
posted @ 2016-05-08 20:38 Hutonm 阅读(273) 评论(0) 推荐(0) 编辑