From 27fdb57d617035349a720cd4cd29954138c0c3fc Mon Sep 17 00:00:00 2001 From: Baoshuo Ren Date: Sat, 26 Feb 2022 20:07:01 +0800 Subject: [PATCH] B - Pasta https://atcoder.jp/contests/abc241/submissions/29668362 --- AtCoder/ABC241/B/B.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 AtCoder/ABC241/B/B.cpp diff --git a/AtCoder/ABC241/B/B.cpp b/AtCoder/ABC241/B/B.cpp new file mode 100644 index 00000000..d65580e9 --- /dev/null +++ b/AtCoder/ABC241/B/B.cpp @@ -0,0 +1,29 @@ +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int n, m; +std::map a; + +int main() { + std::ios::sync_with_stdio(false); + cin >> n >> m; + for (int i = 1; i <= n; i++) { + int x; + cin >> x; + a[x]++; + } + for (int i = 1; i <= m; i++) { + int x; + cin >> x; + if (!a[x]--) { + cout << "No" << endl; + return 0; + } + } + cout << "Yes" << endl; + return 0; +}