转载请注明出处:http://blog.csdn.net/a1dark 分析:如果想要将一个“+”翻转成“-”,那么必然会把对应的行和列上的所有点翻转一次.由于一个点翻偶数次就相当于不翻转.所以我需要统计“+”.然后将对应行和列的值+1.最后统计奇数值的个数.便是要翻转的点. #include<stdio.h> int mpt[5][5]; int main(){ char ch; for(int i=1;i<=4;i++){ for(int j=1;j<=4;j++){ scan…
[题目链接] http://poj.org/problem?id=2965 [算法] 位运算 [代码] #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> #include <cstdio> #includ…
题目链接:http://poj.org/problem?id=2965 The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Description The game "The Pilots Brothers: following the stripy elephant" has a quest where a player needs to open a refrigerator. Ther…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20304   Accepted: 7823   Special Judge Description The game "The Pilots Brothers: following the stripy elephant" has a quest where a player needs to o…
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…
题目地址: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: 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…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 16868   Accepted: 6393   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: 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: 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…