POJ 1222 EXTENDED LIGHTS OUT(反转)】的更多相关文章

POJ 1222 EXTENDED LIGHTS OUT 今天真是完美的一天,这是我在poj上的100A,留个纪念,马上就要期中考试了,可能后面几周刷题就没这么快了,不管怎样,为下一个200A奋斗, 这个题是大白上的牛翻转颜色的题(P153)的弱化版,典型的开关问题; /* * Created: 2016年04月05日 22时28分26秒 星期二 * Author: Akrusher * */ #include <cstdio> #include <cstdlib> #includ…
EXTENDED LIGHTS OUT Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12616   Accepted: 8002 Description In an extended version of the game Lights Out, is a puzzle with 5 rows of 6 buttons each (the actual puzzle has 5 rows of 5 buttons ea…
EXTENDED LIGHTS OUT Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 10835   Accepted: 6929 Description In an extended version of the game Lights Out, is a puzzle with 5 rows of 6 buttons each (the actual puzzle has 5 rows of 5 buttons ea…
题目大意:给你一个5*6的格子,每个格子中有灯(亮着1,暗着0),每次你可以把一个暗的点亮(或者亮的熄灭)然后它上下左右的灯也会跟着变化.最后让你把所有的灯熄灭,问你应该改变哪些灯. 首先我们可以发现,如果我们对一个灯操作2次,等于啥也没干,所以呢,每个点只有可能有两种状态,操作或不操作. 但是每个点的状态不只和自己有关,还与它周围的四个点有关,是吧? 所以相当于对于每个点解一个方程: 之前的状态  XOR  自己变没变  XOR  周围的四个点变没变  = 目标状态  (暗着) 稍稍变动一下,…
题意:5*6的格子,你翻一个地方,那么这个地方和上下左右的格子都会翻面,要求把所有为1的格子翻成0,输出一个5*6的矩阵,把要翻的赋值1,不翻的0,每个格子只翻1次 思路:poj 1222 高斯消元详解 代码: #include<queue> #include<cstring> #include<set> #include<map> #include<stack> #include<cmath> #include<vector&…
http://poj.org/problem?id=1222 题意:给一个确定的5*6放入矩阵.每一个格子都有一个开关和一盏灯,0表示灯没亮,1表示灯亮着.让你输出一个5*6的矩阵ans[i][j],ans[i][j] = 1表示按下开关,ans[i][j] = 0表示不按开关,使最后全部的灯都熄灭. 思路:与http://acm.hdu.edu.cn/showproblem.php?pid=1882类似.在这里找到一种方案输出就可以.但有一个疑惑不解.最后ans[ ][ ]输出的时候每一行里要…
Description In an extended version of the game Lights Out, is a puzzle with 5 rows of 6 buttons each (the actual puzzle has 5 rows of 5 buttons each). Each button has a light. When a button is pressed, that button and each of its (up to four) neighbo…
1.链接地址: http://bailian.openjudge.cn/practice/2811 http://poj.org/problem?id=1222 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 有一个由按钮组成的矩阵,其中每行有6个按钮,共5行.每个按钮的位置上有一盏灯.当按下一个按钮后,该按钮以及周围位置(上边.下边.左 边.右边)的灯都会改变一次.即,如果灯原来是点亮的,就会被熄灭:如果灯原来是熄灭的,则会被点亮.在矩阵角上的按钮改变3盏灯的状态:在…
[题目链接] http://poj.org/problem?id=1222 [题目大意] 给出一个6*5的矩阵,由0和1构成,要求将其全部变成0,每个格子和周围的四个格子联动,就是说,如果一个格子变了数字,周围四格都会发生变化,变化即做一次与1的异或运算,输出每个格子的操作次数. [题解] 高斯消元练手题,对于每个格子的最终情况列一个方程,一共三十个方程三十个未知数,用高斯消元求解即可. [代码] #include <cstdio> #include <algorithm> #in…
Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8417   Accepted: 5441 Description In an extended version of the game Lights Out, is a puzzle with 5 rows of 6 buttons each (the actual puzzle has 5 rows of 5 buttons each). Each button has…