博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
usaco PROB Checker Challenge 搜索
阅读量:7034 次
发布时间:2019-06-28

本文共 1185 字,大约阅读时间需要 3 分钟。

搜索的过程中用2进制保存状态,通过位运算判断可行性。

//#pragma comment(linker, "/STACK:1024000000,1024000000")#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair
pii;#define pb(a) push(a)#define INF 0x1f1f1f1f#define lson idx<<1,l,mid#define rson idx<<1|1,mid+1,r#define PI 3.1415926535898template
T min(const T& a,const T& b,const T& c) { return min(min(a,b),min(a,c));}template
T max(const T& a,const T& b,const T& c) { return max(max(a,b),max(a,c));}void debug() {#ifdef ONLINE_JUDGE#else freopen("d:\\in1.txt","r",stdin); freopen("d:\\out1.txt","w",stdout);#endif}int getch() { int ch; while((ch=getchar())!=EOF) { if(ch!=' '&&ch!='\n')return ch; } return EOF;}int res[3][20];int buf[20];int n;int num;int dfs(int k,int col,int dl,int dr){ if(k>n) { if(num<3) { memcpy(res[num],buf,sizeof(buf)); } num++; return 0; } for(int i=1;i<=n;i++) { if( !(col&(1<
View Code

 

转载于:https://www.cnblogs.com/BMan/p/3558262.html

你可能感兴趣的文章
读Xamarin文档记录
查看>>
Mysql Commands
查看>>
[转载]关于eclipse提示:"The superclass "javax.servlet.http.HttpServlet" was not found on the
查看>>
MOSS网站集的迁移
查看>>
嵌入式软件测试工具―Winams
查看>>
POJ 3111 K Best
查看>>
HDU 3480 Division
查看>>
python-凯撒密码
查看>>
Spring任务调度之Quartz集成
查看>>
5.如何使主机和虚拟机IP处于同一网段(内网渗透专用)
查看>>
Kali信息收集系列:(都是我以前的笔记整理了一下,就没加水印,习惯就好)...
查看>>
PL/SQL查询设计器
查看>>
jsonp是什么
查看>>
Unity加载模块深度解析(Shader)
查看>>
雷林鹏分享:MySQL 处理重复数据
查看>>
单元测试笔记
查看>>
【转】数据库范式(1NF 2NF 3NF BCNF)详解一
查看>>
如何用css将一个div设置为一个圆
查看>>
2016年未,腾讯,百度,华为,搜狗和滴滴面试题汇总
查看>>
C# AS与Is
查看>>