AC代码:

#include<bits/stdc++.h>
using namespace std;
int main() {
//freopen("in.txt", "r", stdin);
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int t; cin >> t;
while (t--) {
string s, a = ""; cin >> s;
for (auto p : s)
a += "01";
if (s.find('0') == string::npos || s.find('1') == string::npos)
cout << s << endl;
else cout << a << endl;
}
}

Problem 1342B - Binary Period (思维)的更多相关文章

  1. 2019牛客多校第三场B Crazy Binary String 思维

    Crazy Binary String 思维 题意 给出01串,给出定义:一个串里面0和1的个数相同,求 满足定义的最长子序列和子串 分析 子序列好求,就是0 1个数,字串需要思考一下.实在没有思路可 ...

  2. [LeetCode&Python] Problem 257. Binary Tree Paths

    Given a binary tree, return all root-to-leaf paths. Note: A leaf is a node with no children. Example ...

  3. [LeetCode&Python] Problem 107. Binary Tree Level Order Traversal II

    Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left ...

  4. [LeetCode&Python] Problem 401. Binary Watch

    A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom ...

  5. [LeetCode&Python] Problem 563. Binary Tree Tilt

    Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the ab ...

  6. [LeetCode&Python] Problem 693. Binary Number with Alternating Bits

    Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will a ...

  7. [LeetCode&Python] Problem 868. Binary Gap

    Given a positive integer N, find and return the longest distance between two consecutive 1's in the ...

  8. FZU - 2214 Knapsack problem 01背包逆思维

    Knapsack problem Given a set of n items, each with a weight w[i] and a value v[i], determine a way t ...

  9. codeforces 807 D. Dynamic Problem Scoring(贪心+思维)

    题目链接:http://codeforces.com/contest/807/problem/D 题意:对于动态计分的 Codeforces Round ,已知每题的 score 是根据 Round ...

  10. HDU - 6242 Geometry Problem (几何,思维,随机)

    Geometry Problem HDU - 6242 Alice is interesting in computation geometry problem recently. She found ...

随机推荐

  1. 🔥🔥Java开发者的Python快速进修指南:面向对象基础

    当我深入学习了面向对象编程之后,我首先感受到的是代码编写的自由度大幅提升.不同于Java中严格的结构和约束,Python在面向对象的实现中展现出更加灵活和自由的特性.它使用了一些独特的关键字,如sel ...

  2. c#实现一个简单的管理系统报错System.Data.SqlClient.SqlException”类型的未经处理的异常在 System.Data.dll 中发生【已解决】

    很简单就是把连接数据库语句改成(local)或者"127.0.0.1" 如下 public SqlConnection connect() { string str = @&quo ...

  3. 2020ICPC上海 C题(数位dp, 记忆化搜索)

    先复习了下之前做的数位DP又做了道新题才看的这道题,对我来说还是一种新类型,涉及到非线性计算,之前做的都是形如 \(dp[x]-dp[y]\)这样的只用处理一个上限做下差即可.一开始想分别枚举 \(x ...

  4. v-for和指令

    . v-for 起遍历作用. 注意点: 1.遍历的里面第一个值是定义的元素的值,第二个值是值的名称,第三个值为下标 2.:key是v-blind:key的简写,是代码中的唯一标识,一般用id来定义 v ...

  5. linux 上安装kapacitor

    转载请注明出处: 1.通过安装包安装 1.使用以下命令下载安装包: wget https://dl.influxdata.com/kapacitor/releases/kapacitor_1.6.3- ...

  6. 基于一维卷积神经网络模型的AI量化智能选股策略

    这是早前BigQuant专题研究:基于卷积神经网络CNN的深度学习因子选股模型.卷积神经网络(Convolutional Neural Network, CNN),是计算机视觉研究和应用领域中最具影响 ...

  7. Selenium等待元素出现

    https://www.selenium.dev/documentation/webdriver/waits/ 有时候我们需要等待网页上的元素出现后才能操作.selenium中可以使用以下几种方法等大 ...

  8. Bert-vits2-2.3-Final,Bert-vits2最终版一键整合包(复刻生化危机艾达王)

    近日,Bert-vits2发布了最新的版本2.3-final,意为最终版,修复了一些已知的bug,添加基于 WavLM 的 Discriminator(来源于 StyleTTS2),令人意外的是,因情 ...

  9. idea2020.1.3汉化包报错问题

    已解决:idea2020.1.3汉化包报错问题 问题描述:插件市场提供的版本不对.不兼容,所以需要手动下载安装 这里附上文件 https://wwsi.lanzouq.com/b03czdtwf 密码 ...

  10. MinIO客户端之ping

    MinIO提供了一个命令行程序mc用于协助用户完成日常的维护.管理类工作. 官方资料 mc ping 检查指定的MinIO节点的服务是否可用. 不带参数,命令如下: ./mc ping local1 ...