0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 15:56:26 +00:00

D - Swap Hats

https://atcoder.jp/contests/abc244/submissions/30287032
This commit is contained in:
Baoshuo Ren 2022-03-20 20:28:03 +08:00
parent a9d2dced1e
commit fce4d5f914
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

19
AtCoder/ABC244/D/D.cpp Normal file
View File

@ -0,0 +1,19 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
int cnt;
char s1, s2, s3,
t1, t2, t3;
int main() {
std::ios::sync_with_stdio(false);
cin >> s1 >> s2 >> s3 >> t1 >> t2 >> t3;
if (s1 != t1) cnt++;
if (s2 != t2) cnt++;
if (s3 != t3) cnt++;
cout << (cnt == 0 || cnt == 3 ? "Yes" : "No") << endl;
return 0;
}