308278: CF1492D. Genius's Gambit
Memory Limit:512 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Genius's Gambit
题意翻译
给定你三个整数 $a,b,k$ ,满足 $0\le a;1 \le b;k \le a + b \le 2\times10^5$。 请你构造出两个二进制形式的整数 $x,y$,满足 $x \ge y$,$x,y$ 的二进制形式由 $a$ 个 $0$,$b$ 个 $1$ 组成,并且 $x - y$ 得到的数在二进制下共有 $k$ 个 $1$。 如果存在合法构造,请输出 $\texttt{Yes}$ ,并输出合法的 $x,y$。 否则,请输出 $\texttt{No}$。题目描述
You are given three integers $ a $ , $ b $ , $ k $ . Find two binary integers $ x $ and $ y $ ( $ x \ge y $ ) such that 1. both $ x $ and $ y $ consist of $ a $ zeroes and $ b $ ones; 2. $ 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 \leq a $ ; $ 1 \leq b $ ; $ 0 \leq k \leq a + b \leq 2 \cdot 10^5 $ ) — 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