From 1ca38e37c8dbaa7e0b9f49bb134bc03f8355d92c Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Tue, 29 Jun 2021 19:09:48 +0800 Subject: [PATCH] =?UTF-8?q?P3742=20umi=E7=9A=84=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R52193557 --- Luogu/problem/P3742/P3742.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Luogu/problem/P3742/P3742.cpp diff --git a/Luogu/problem/P3742/P3742.cpp b/Luogu/problem/P3742/P3742.cpp new file mode 100644 index 00000000..ec33253e --- /dev/null +++ b/Luogu/problem/P3742/P3742.cpp @@ -0,0 +1,18 @@ +#include + +using namespace std; + +int main() { + int n; + string s1, s2, g; + cin >> n >> s1 >> s2; + for (int i = 0; i < n; i++) { + g.push_back(min(s1[i], s2[i])); + if (s1[i] < s2[i]) { + cout << -1 << endl; + return 0; + } + } + cout << g << endl; + return 0; +}