The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22057   Accepted: 8521   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19718   Accepted: 7583   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286   Accepted: 8603   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 15136   Accepted: 5660   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
//题目:http://poj.org/problem?id=2965//题意:电冰箱有16个把手,每个把手两种状态(开‘-’或关‘+’),只有在所有把手都打开时,门才开,输入数据是个4*4的矩阵,因此考虑用位表示.可以改变任意一个把手的位置,但同时改变其所在的行和列.求最小步骤.//耗时 800MS1 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<queue> using…
http://poj.org/problem?id=2965 这个题的话,一开始也不会做,旁边的人说用BFS,后来去网上看了众大神的思路,瞬间觉得用BFS挺简单易:因为要让一个“+”变为“-”,只要将加号所在的位置(i,j)的行和列上的7个元素全部改变一次,这样的话(i,j)这个点将会变化7次,而 i 行上和 j 列另外六个元素将会变化4次,剩下的那些会变化2次,显而易见的是,一个位置上若翻转偶数次相当于没翻转,所以,只要记录下奇数次的翻转进行相加就可以了. #include<cstdio>…
题目地址:http://poj.org/problem?id=2965 /* 题意:4*4的矩形,改变任意点,把所有'+'变成'-',,每一次同行同列的都会反转,求最小步数,并打印方案 DFS:把'+'记为1, '-'记为0 1. 从(1, 1)走到(4, 4),每一点DFS两次(改点反转或不反转):used记录反转的位置 详细解释:http://poj.org/showmessage?message_id=346723 2. 比较巧妙的解法:抓住'+'位置反转,'-'位置相对不反转的特点,从状…
  The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 15176   Accepted: 5672   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 17450   Accepted: 6600   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
2965 he Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19995   Accepted: 7695   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to op…