I - Infinite Improbability Drive
http://codeforces.com/gym/241750/problem/I
不断构造,先填n-1个0,然后能放1就放1,最后这个序列的长度就是(1<<n)+n-1,也就是每添加1位就要匹配出来一个。

 #include<iostream>
#include<cstdio>
#include<queue>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<set>
#include<map>
#include<stack>
#include<cstring>
#define inf 2147483647
#define ls rt<<1
#define rs rt<<1|1
#define lson ls,nl,mid,l,r
#define rson rs,mid+1,nr,l,r
#define N 100010
#define For(i,a,b) for(int i=a;i<=b;i++)
#define p(a) putchar(a)
#define g() getchar() using namespace std;
int n;
int a[];
bool vis[];
int ans,t,fin; void in(int &x){
int y=;
char c=g();x=;
while(c<''||c>''){
if(c=='-')y=-;
c=g();
}
while(c<=''&&c>=''){
x=(x<<)+(x<<)+c-'';c=g();
}
x*=y;
}
void o(int x){
if(x<){
p('-');
x=-x;
}
if(x>)o(x/);
p(x%+'');
}
int main(){
freopen("infinite.in","r",stdin);
freopen("infinite.out","w",stdout);
in(n);
fin=(<<n)+n-;
a[n]=;
vis[]=;
For(i,n+,fin){
a[i]=;
t=;
ans=;
for(int j=i;j>=i-n+;j--){
ans+=t*a[j];
t<<=;
}
if(vis[ans]){
vis[ans-]=;
a[i]=;
}
else
vis[ans]=;
}
For(i,,fin)
o(a[i]);
return ; }

I - Infinite Improbability Drive的更多相关文章

  1. AHCI: Failed to attach drive to Port1 (VERR_GENERAL_FAILURE).

    在mac操作系统下,安装VirtualBoxVm虚拟机,虚拟机里面安装wind7操作系统.在启动虚拟机的时候报错:AHCI: Failed to attach drive to Port1 (VERR ...

  2. vmware安装win7提示No CD-ROM drive to use:GCDROM not loaded

    今天安装win7 64位的操作系统到vmware虚拟机,以为一切事如此的简单,因为自己以前经常拿vmware来装系统,结果确出现下面莫名其妙的错误: 提示说没有CD-ROM,可是我明明在vmware的 ...

  3. Ignite 配置更新Oracle JDBC Drive

           如果使用Oracle 12C 作为Ignite 的Repository的话,在Repository Createion Wizard的配置过程中,会出现ORA-28040:No matc ...

  4. 网盘的选择,百度网盘、google drive 还是 Dropbox

    我是国内用户,需要越过Chinawall 我使用的是一枝红杏,用着还行 如果要买,结账时输入'laod80' 一枝红杏官网:官网地址 Dropbox: 稳定,速度快 Dropbox官网:链接 操作十分 ...

  5. UEFI Bootable USB Flash Drive - Create in Windows(WIN7 WIN8)

    How to Create a Bootable UEFI USB Flash Drive for Installing Windows 7, Windows 8, or Windows 8.1 In ...

  6. Create a SQL Server Database on a network shared drive

    (原文地址:http://blogs.msdn.com/b/varund/archive/2010/09/02/create-a-sql-server-database-on-a-network-sh ...

  7. Infinite loop when using cookieless session ID on Azure

    If you use cookieless session ID and deploy them on Azure, you might get infinite loop when you quer ...

  8. 【转】Expire Google Drive Files 让Google Docs云盘共享连接在指定时间后自动失效

    最近在清理Google Docs中之前共享过的文件链接,发现Google Docs多人协作共享过的链接会一直存在,在实际操作中较不灵活.正好订阅的RSS推送了Pseric写的这篇文章 - Expire ...

  9. vs2010 A selected drive is no longer valid

    visual studio 2010重新安装添加组件,报A selected drive is no longer valid错误. 这个是由于已经安装了sp1,此时需要将sp1卸载掉,然后就可以安装 ...

随机推荐

  1. 1.6分布式通讯协议-WebService

    RPC 包含的要素(webservice) 协议层:tcp/ip 应用层: http协议 SOAP: http+xml 分布式通信框架-webservice分析 什么是webservice webse ...

  2. Qt快速入门第三版下载

    找了半天才找到一个靠谱的: http://www.ddooo.com/softdown/111665.htm

  3. word20170107当地交通 Local transportation有用的词和句子

    有用的词: transportation: 交通 airport express: 机场快线 shuttle bus: 班车 taxi/cab: 出租车 meter: 打表 limousine:专车. ...

  4. 论文学习笔记--无缺陷样本产品表面缺陷检测 A Surface Defect Detection Method Based on Positive Samples

    文章下载地址:A Surface Defect Detection Method Based on Positive Samples 第一部分  论文中文翻译 摘要:基于机器视觉的表面缺陷检测和分类可 ...

  5. Java基础11-List;Set;Map

    作业解析: remove(int index); //删除指定位置的元素 List list = new ArrayList(); list.add("s1"); list.add ...

  6. 关于COOKIE在本地可以正常写入发布后不能写入浏览器的问题

    看了一下cookie的属性设置如下: HTTP Cookie       设置了secure ,   该cookie只能在HTTPS通道下被写入浏览器. HTTPS Cookie     设置了sec ...

  7. gradle.properties使用

    设置属性 COMPILE_SDK_VERSION = 26 BUILD_TOOLS_VERSION = 26.0.0 MIN_SDK_VERSION = 19 TARGET_SDK_VERSION = ...

  8. flutter 登录后跳转到根路由

    flutter 登录以后  会有返回箭头显示 因为  路由的切换导致不是路由的第一个页面,解决办法清空路由. Navigator.of(context).pushAndRemoveUntil( new ...

  9. IntelliJ IDEA使用SVN检出项目到本地工作空间

  10. Django—第三方引用

    索引 一.富文本编辑器 1.1 在Admin中使用 1.2 自定义使用 1.3 显示 二.全文检索 2.1 创建引擎及索引 2.2 使用 三.发送邮件 一.富文本编辑器 借助富文本编辑器,网站的编辑人 ...