#include <iostream>
#include <algorithm>
using namespace std; const int maxn = 1e5 + ;
int a[maxn]; int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n;
string s;
cin >> s;
int sum = ;
bool l = true;
int i;
for(i = n-;i >= ;i -= ){
sum += *i+;
if(l){
if(s[i] == ''){
a[i] = ;
}
else
a[i] = ;
if(s[i-] == ''){
a[i-] = ;
}
else a[i-] = ;
l = false;
}
else{
if(s[i] == ''){
a[i] = ;
}
else
a[i] = ;
if(s[i-] == ''){
a[i-] = ;
}
else a[i-] = ;
l = true;
}
}
if(i == ){
sum += ;
if(l){
if(s[] == ''){
a[] = ;
}
else
a[] = ;
}
else{
if(s[] == ''){
a[] = ;
}
else
a[] = ;
}
} if(sum%){
cout << - << endl;
continue;
}
else{
for(int j = ;j < n;j++){
cout << a[j] ;
}
cout << endl;
} }
return ;
}

ZOJ 4033 CONTINUE...?(The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple)的更多相关文章

  1. 2018浙江省赛(ACM) The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple

    我是铁牌选手 这次比赛非常得爆炸,可以说体验极差,是这辈子自己最脑残的事情之一. 天时,地利,人和一样没有,而且自己早早地就想好了甩锅的套路. 按理说不开K就不会这么惨了啊,而且自己也是毒,不知道段错 ...

  2. The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple - L Doki Doki Literature Club

    Doki Doki Literature Club Time Limit: 1 Second      Memory Limit: 65536 KB Doki Doki Literature Club ...

  3. The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple - J CONTINUE...?

    CONTINUE...? Time Limit: 1 Second      Memory Limit: 65536 KB      Special Judge DreamGrid has  clas ...

  4. The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple -A Peak

    Peak Time Limit: 1 Second      Memory Limit: 65536 KB A sequence of  integers  is called a peak, if ...

  5. The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple - M Lucky 7

    Lucky 7 Time Limit: 1 Second      Memory Limit: 65536 KB BaoBao has just found a positive integer se ...

  6. The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple - B King of Karaoke

    King of Karaoke Time Limit: 1 Second      Memory Limit: 65536 KB It's Karaoke time! DreamGrid is per ...

  7. ZOJ 3962 E.Seven Segment Display / The 14th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple E.数位dp

    Seven Segment Display Time Limit: 1 Second      Memory Limit: 65536 KB A seven segment display, or s ...

  8. The 16th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple (Mirror)

    B题 思路 因为 \[ x=\sum\limits_{k=1}^{n}ka_k\\ y=\sum\limits_{k=1}^{n}ka_{k}^{2} \] 我们设交换前和交换后的这两个等式的值设为\ ...

  9. The 14th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple - F 贪心+二分

    Heap Partition Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge A sequence S = { ...

随机推荐

  1. 【C语言天天练(十九)】restrict关键词

    引言:在内核的系统调用函数里,常常遇到函数的參数使用restrict限定词限定的情况,以下就对该关键词做个总结. 1.restrict关键词是C99特性才加入的,因此在编译使用含有该限定词的程序时,一 ...

  2. 【LeetCode】Search in Rotated Sorted Array II(转)

    原文链接 http://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/ http://blog.csdn.net/linhuan ...

  3. Shell脚本学习指南笔记

    Shell脚本学习指南 作者:Danbo 2015-8-3 脚本编程语言与编译型语言的差异 许多中型.大型的程序都是用编译型语言写的,例如:C.C+.Java等.这类程序只要从源代码(Source C ...

  4. 绝对定位(absolute)

    绝对定位(absolute),作用是将被赋予此定位方法的对象从文档流中拖出,使用left,right,top, bottom等属性相对于其最接近的一个最有定位设置的父级对象进行绝对定位,如果对象的父级 ...

  5. 人生苦短之Python多线程

    #encoding=utf-8 import threading import time ''' python多线程并不是真正意义上的多线程,通常我们所说的多线程是多个线程同时执行某功能,而在pyth ...

  6. JavaSE基础练习IO,字符串,循环

    import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.F ...

  7. hadoop学习之旅2

    集群搭建文档1.0版本 1. 集群规划 所有需要用到的软件: 链接:http://pan.baidu.com/s/1jIlAz2Y 密码:kyxl 2.0 系统安装 2.1 主机名配置 vi /etc ...

  8. laravel基础课程---1、laravel安装及基础介绍(laravel如何安装)

    laravel基础课程---1.laravel安装及基础介绍(laravel如何安装) 一.总结 一句话总结: [修改composer镜像地址].[明确laravel的安装要求].[安装指定版本的la ...

  9. 关于Spring Security的笔记

    1.web.xml配置文件 加载Spring Security,将DelegatingFilterProxy配置在DispatcherServlet之前. <filter> <fil ...

  10. Java丨时间判断谁前谁后

    直奔主题: String date_str1 = "2016-06-02 23:03:123"; String date_str2 = "2016-06-03 03:03 ...