Ultra-Fast Mathematician

简介: Ultra-Fast Mathematician

文章目录

一、Ultra-Fast Mathematician

总结


一、Ultra-Fast Mathematician

本题链接:Ultra-Fast Mathematician


题目:

A. Ultra-Fast Mathematician

time limit per test2 seconds

memory limit per test256 megabytes

nputstandard input

outputstandard output

Shapur was an extremely gifted student. He was great at everything including Combinatorics, Algebra, Number Theory, Geometry, Calculus, etc. He was not only smart but extraordinarily fast! He could manage to sum 1018 numbers in a single second.


One day in 230 AD Shapur was trying to find out if any one can possibly do calculations faster than him. As a result he made a very great contest and asked every one to come and take part.


In his contest he gave the contestants many different pairs of numbers. Each number is made from digits 0 or 1. The contestants should write a new number corresponding to the given pair of numbers. The rule is simple: The i-th digit of the answer is 1 if and only if the i-th digit of the two given numbers differ. In the other case the i-th digit of the answer is 0.


Shapur made many numbers and first tried his own speed. He saw that he can perform these operations on numbers of length ∞ (length of a number is number of digits in it) in a glance! He always gives correct answers so he expects the contestants to give correct answers, too. He is a good fellow so he won’t give anyone very big numbers and he always gives one person numbers of same length.


Now you are going to take part in Shapur’s contest. See if you are faster and more accurate.


Input

There are two lines in each input. Each of them contains a single number. It is guaranteed that the numbers are made from 0 and 1 only and that their length is same. The numbers may start with 0. The length of each number doesn’t exceed 100.


Output

Write one line — the corresponding answer. Do not omit the leading 0s.


Examples

input

1010100

0100101

output

1110001

input

000

111

output

111

input

1110

1010

output

0100

input

01110

01100

output

00010

本博客给出本题截图

题意:输入两个数,如果对应位置上分别是01的话,输出1,否则为0

AC代码

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string a, b;
    cin >> a >> b;
    for (int i = 0; i < a.size(); i ++ )
        if (a[i] + b[i] == '1' + '0')
            cout << 1;
        else cout << 0;
    return 0;
}

总结

其实就是二进制异或运算


目录
相关文章
|
2月前
|
算法 数据挖掘 数据库
文献解读-Pathogenic variants carrier screening in New Brunswick: Acadians reveal high carrier frequency for multiple genetic disorders
研究首次对新不伦瑞克省阿卡迪亚人进行致病变异携带者筛查,发现某些基因变异频率显著高于一般欧洲人群,表明存在创始人效应。这突出了对阿卡迪亚人进行更全面遗传筛查的必要性。
40 12
|
6月前
|
算法 数据挖掘
文献解读-Consistency and reproducibility of large panel next-generation sequencing: Multi-laboratory assessment of somatic mutation detection on reference materials with mismatch repair and proofreading deficiency
Consistency and reproducibility of large panel next-generation sequencing: Multi-laboratory assessment of somatic mutation detection on reference materials with mismatch repair and proofreading deficiency,大panel二代测序的一致性和重复性:对具有错配修复和校对缺陷的参考物质进行体细胞突变检测的多实验室评估
52 6
文献解读-Consistency and reproducibility of large panel next-generation sequencing: Multi-laboratory assessment of somatic mutation detection on reference materials with mismatch repair and proofreading deficiency
|
数据挖掘
MUSIED: A Benchmark for Event Detection from Multi-Source Heterogeneous Informal Texts 论文解读
事件检测(ED)从非结构化文本中识别和分类事件触发词,作为信息抽取的基本任务。尽管在过去几年中取得了显著进展
93 0
|
机器学习/深度学习 自然语言处理 计算机视觉
【计算机视觉】MDETR - Modulated Detection for End-to-End Multi-Modal Understanding
对于图像模型,MDETR采用的是一个CNN backbone来提取视觉特征,然后加上二维的位置编码;对于语言模态,作者采用了一个预训练好的Transformer语言模型来生成与输入值相同大小的hidden state。然后作者采用了一个模态相关的Linear Projection将图像和文本特征映射到一个共享的embedding空间。 接着,将图像embedding和语言embedding进行concat,生成一个样本的图像和文本特征序列。这个序列特征首先被送入到一个Cross Encoder进行处理,后面的步骤就和DETR一样,设置Object Query用于预测目标框。
|
机器学习/深度学习 算法 图形学
Deep learning based multi-scale channel compression feature surface defect detection system
简述:首先应用背景分割和模板匹配技术来定义覆盖目标工件的ROI区域。提取的感兴趣区域被均匀地裁剪成若干个图像块,每个块被送到基于CNN的模型,以分类杂乱背景中不同大小的表面缺陷。最后,对空间上相邻且具有相同类别标签的图像块进行合并,以生成各种表面缺陷的识别图。
181 0
|
自然语言处理
Reading the Manual: Event Extraction as Definition Comprehension, EMNLP 2020
Reading the Manual: Event Extraction as Definition Comprehension, EMNLP 2020
112 0
Reading the Manual: Event Extraction as Definition Comprehension, EMNLP 2020
《Towards A Fault-Tolerant Speaker Verification System A Regularization Approach To Reduce The Condition Number》电子版地址
Towards A Fault-Tolerant Speaker Verification System: A Regularization Approach To Reduce The Condition Number
96 0
《Towards A Fault-Tolerant Speaker Verification System A Regularization Approach To Reduce The Condition Number》电子版地址
|
Java
HDU - 2018 Multi-University Training Contest 1 - 1001: Maximum Multiple
HDU - 2018 Multi-University Training Contest 1 - 1001: Maximum Multiple
109 0
成功解决FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `ar
成功解决FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `ar
|
语音技术 机器学习/深度学习 开发者
语音顶会Interspeech 论文解读|Towards A Fault-tolerant Speaker Verification System: A Regularization Approach To Reduce The Condition Number
Interspeech是世界上规模最大,最全面的顶级语音领域会议,本文为Siqi Zheng, Gang Liu, Hongbin Suo, Yun Lei的入选论文
语音顶会Interspeech 论文解读|Towards A Fault-tolerant Speaker Verification System: A Regularization Approach To Reduce The Condition Number