1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. const int maxn = 1e5 + ;
  6. int a[maxn];
  7.  
  8. int main(){
  9. int t;
  10. cin >> t;
  11. while(t--){
  12. int n;
  13. cin >> n;
  14. string s;
  15. cin >> s;
  16. int sum = ;
  17. bool l = true;
  18. int i;
  19. for(i = n-;i >= ;i -= ){
  20. sum += *i+;
  21. if(l){
  22. if(s[i] == ''){
  23. a[i] = ;
  24. }
  25. else
  26. a[i] = ;
  27. if(s[i-] == ''){
  28. a[i-] = ;
  29. }
  30. else a[i-] = ;
  31. l = false;
  32. }
  33. else{
  34. if(s[i] == ''){
  35. a[i] = ;
  36. }
  37. else
  38. a[i] = ;
  39. if(s[i-] == ''){
  40. a[i-] = ;
  41. }
  42. else a[i-] = ;
  43. l = true;
  44. }
  45. }
  46. if(i == ){
  47. sum += ;
  48. if(l){
  49. if(s[] == ''){
  50. a[] = ;
  51. }
  52. else
  53. a[] = ;
  54. }
  55. else{
  56. if(s[] == ''){
  57. a[] = ;
  58. }
  59. else
  60. a[] = ;
  61. }
  62. }
  63.  
  64. if(sum%){
  65. cout << - << endl;
  66. continue;
  67. }
  68. else{
  69. for(int j = ;j < n;j++){
  70. cout << a[j] ;
  71. }
  72. cout << endl;
  73. }
  74.  
  75. }
  76. return ;
  77. }

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. 设置开启telnet功能

    今天访问服务器的时候发现ip可以ping通,但是不能访问,就telnet一下端口吧,谁知系统逗我:

  2. Appnium安装-Mac平台

    Appium的安装-MAC平台   其实Appium的安装方式主要有两种: 1)自己安装配置nodejs的环境,然后通过npm进行appium的安装 2)直接下载官网提供的dmg进行安装,dmg里面已 ...

  3. poj3904 Sky Code —— 唯一分解定理 + 容斥原理 + 组合

    题目链接:http://poj.org/problem?id=3904 Sky Code Time Limit: 1000MS   Memory Limit: 65536K Total Submiss ...

  4. ansible-playbook初始化服务器

    hosts ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [test] 0.0.0.0 ansible_ssh_us ...

  5. wpf图片定点缩放

    去年犯小人,万事不顺,4月刚换工作,开始新工作 遇到一个小问题,需要读取图片,然后对图片进行定点缩放,很简答的逻辑,很简单的代码,但是,这尼玛我被wpf给坑了,这一坑就是三天 好了,很简单的一个UI ...

  6. cassandra 存储二进制data

    Blob type The Cassandra blob data type represents a constant hexadecimal number defined as 0[xX](hex ...

  7. tabbar

    1 tabbar不显示的问题: 命名在app.json中配置了tabbar但是不显示可能的问题: app.json中的pages中第一个路径没有在tabbar中设置 原因:app.json中配置的pa ...

  8. Beyond Compare 简体版+注册码

    Beyond Compare 3.3.4.14431 官方简体版+注册码 查阅全文 ›

  9. 【224】◀▶ IDL NetCDF 文件操作说明

    参考:I/O - NetCDF Routines —— NetCDF 操作函数 01   NCDF_OPEN 打开一个 NetCDF 文件. 02   NCDF_CLOSE 关闭一个 NetCDF 文 ...

  10. ubuntu删除g2o

    解决方法为:(1)删除/usr/local/include/g2o,指令为sudo rm -rf /usr/local/include/g2o:(2)删除/usr/local/lib下有关libg2o ...