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 = { ...
随机推荐
- 无法启动FTP站点,服务目前停止
在本地搭建了一个FTP服务器(windows搭建FTP服务器实战),再启动的时候提示错误: 错误提示信息: 根据提示可以查出问题原因:FTP服务没有开启 启动服务,再次重启站点服务.一切OK. 亲测好 ...
- java中Integer在JDK1.6和JDK1.7中的区别
运行下面这段代码: System.out.println(Integer.valueOf("127")==Integer.valueOf("127")); Sy ...
- AndroidPageObjectTest_TimeOutManagement.java
以下代码使用ApiDemos-debug.apk进行测试 //这个脚本用于演示PageFactory的功能:设置timeout时间. package com.saucelabs.appium; imp ...
- BestCoder Round #92 1001 Skip the Class —— 字典树 or map容器
题目链接:http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=748&pid=1001 题解: 1.trie树 关 ...
- 追求代码质量: 用 AOP 进行防御性编程
原文出处: IBM中国 开发人员测试的主要缺点是:绝大部分测试都是在理想的场景中进行的.在这些情况下并不会出现缺陷 —— 能导致出现问题的往往是那些边界情况. 什么是边界情况呢?比方说,把 null ...
- Facebook图片存储系统Haystack——存小文件,本质上是将多个小文件合并为一个大文件来降低io次数,meta data里存偏移量
转自:http://yanyiwu.com/work/2015/01/04/Haystack.html 一篇14页的论文Facebook-Haystack, 看完之后我的印象里就四句话: 因为[传统文 ...
- World Finals 2017 (水题题解)
看大佬做2017-WF,我这种菜鸡,只能刷刷水题,勉强维持生活. 赛后补补水题. 题目pdf链接,中文的,tls翻译的,链接在这里 个人喜欢在vjudge上面刷题. E Need for Speed ...
- hdu-5738 Eureka(组合计数+极角排序)
题目链接: Eureka Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Pr ...
- 「DP」区间dp
区间dp? 状态设计为描述一段区间的dp. eg:f[i][j]表示从 i 到 j 这个区间上的最优值.
- android开发中怎么通过Log函数输出当前行号和当前函数名
public class Debug { public static int line(Exception e) { StackTraceElement[] trace = e.getStackTra ...