ZOJ 4033 CONTINUE...?(The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple)
#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)的更多相关文章
- 2018浙江省赛(ACM) The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple
我是铁牌选手 这次比赛非常得爆炸,可以说体验极差,是这辈子自己最脑残的事情之一. 天时,地利,人和一样没有,而且自己早早地就想好了甩锅的套路. 按理说不开K就不会这么惨了啊,而且自己也是毒,不知道段错 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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} \] 我们设交换前和交换后的这两个等式的值设为\ ...
- 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 = { ...
随机推荐
- Unable to start adb server: adb server version (32) doesn't match this client (39); killing...
关于Android studio 连接不上adb问题,有人说重启机器,有人说重启工具,也有人说adb kill-server.然后我都尝试过依然没有解决.通过各种查询.最终成功的解决!!! adb n ...
- Hadoop安全
kerberos-hadoop配置常见问题汇总 注意事项 常见问题如下(其中前面两点最多): 各目录属主组属性修改. 对于hadoop,需要改为yarn:hadoop/mapred:hdoop/hdf ...
- 如何修改sublime3注释的颜色
在用sublime text3编写Python2代码时总觉得注释颜色太浅了, 看起来吃力,于是就尝试去修改,和sublime text2不同, sublime text3的主题配置文件在Sublime ...
- Codeforces Round #138 (Div. 2) A. Parallelepiped
A. Parallelepiped time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- HDU1102 Constructing Roads —— 最小生成树
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1102 题解: 纯最小生成树,只是有些边已经确定了要加入生成树中,特殊处理一下这些边就可以了. krus ...
- 人生苦短之Python迭代器
迭代 在Python中,如果给定一个list或者touple,我们可以通过for循环来遍历,将值依次取出,这种遍历称为迭代. 在Python中是通过for...in..来进行遍历的,在Java中则是 ...
- vue 常用的表单验证,包括手机号码,固定电话和身份证...
<template> <div> <pl-content-box> <pl-page-nav :show-previous=true></pl-p ...
- springboot开启远程调试
远程调试maven设置 The run goal forks a process for the boot application. It is possible to specify jvm arg ...
- 指定网卡进行ping操作
windows系统下:ping -S 查看当前网卡情况 ipconfig 有两块网卡,ip分别为 192.168.12.83.192.168.1.126 使用不同网卡分别ping百度 网卡1: pi ...
- World CodeSprint 10
C: 题意: 给定一个长度为 $n$ 的序列 $a_i$,从 $a$ 序列中选出一个大小为 $k$ 的子序列使得子序列数字的 bitwise AND 值最大. 求问最大值是多少,并求出有多少个最大值 ...