CF1492D.Genius's Gambit
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given three integers a , b , k .
Find two binary integers x and y ( x≥y ) such that
- both x and y consist of a zeroes and b ones;
- x−y (also written in binary form) has exactly k ones.
You are not allowed to use leading zeros for x and y .
输入格式
The only line contains three integers a , b , and k ( 0≤a ; 1≤b ; 0≤k≤a+b≤2⋅105 ) — the number of zeroes, ones, and the number of ones in the result.
输出格式
If it's possible to find two suitable integers, print "Yes" followed by x and y in base-2.
Otherwise print "No".
If there are multiple possible answers, print any of them.
输入输出样例
输入#1
4 2 3
输出#1
Yes 101000 100001
输入#2
3 2 1
输出#2
Yes 10100 10010
输入#3
3 2 5
输出#3
No
说明/提示
In the first example, x=1010002=25+23=4010 , y=1000012=25+20=3310 , 4010−3310=710=22+21+20=1112 . Hence x−y has 3 ones in base-2.
In the second example, x=101002=24+22=2010 , y=100102=24+21=18 , x−y=20−18=210=102 . This is precisely one 1.
In the third example, one may show, that it's impossible to find an answer.