coder_new

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年5月3日

摘要: 枚举法参考点灯游戏枚举#include <iostream>using namespace std;void flip(int* a,int i){ a[i]=1-a[i]; if(i>3) a[i-4]=1-a[i-4]; if(i<12) a[i+4]=1-a[i+4]; if(i%4!=0) a[i-1]=1-a[i-1]; if((i+1)%4!=0) a[i+1]=1-a[i+1];}bool check(int* a){ int sum=0; for(int i=0;i<16;i++) { sum+=a[i]; }... 阅读全文
posted @ 2012-05-03 17:12 coder_new 阅读(229) 评论(0) 推荐(0) 编辑