Submission #53841032


Source Code Expand

#include <bits/stdc++.h>
#include <atcoder/all>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using namespace atcoder;
namespace mp = boost::multiprecision;

using ll = long long;
using ull = unsigned long long;
using pll = pair<ll,ll>;
using bint = mp::cpp_int;

int main()
{
  ll N, M;
  cin >> N >> M;
  vector<pll> A;
  vector<pll> B;
  vector<pll> C;
  for(ll i = 0;i < N;i++)
  {
    ll a;
    ll s = 0;
    cin >> a;
    C.push_back(make_pair(a, s));
  }
  for(ll i = 0;i < M;i++)
  {
    ll b;
    ll s = 1;
    cin >> b;
    C.push_back(make_pair(b, s));
  }
  sort(C.begin(), C.end());

  bool f = false;
  bool ans = false;
  for(ll i = 0;i < N+M;i++)
  {
    if(C[i].second==0)
    {
      if(f == true)
      {
        ans = true;
        break;
      }
      f = true;
    }
    else
    {
      f = false;
    }
  }
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}

Submission Info

Submission Time
Task B - Piano 2
User n0dasalt
Language C++ 20 (gcc 12.2)
Score 200
Code Size 960 Byte
Status AC
Exec Time 1 ms
Memory 3704 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 20
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt, 02_handmade_07.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3396 KiB
00_sample_02.txt AC 1 ms 3508 KiB
00_sample_03.txt AC 1 ms 3608 KiB
01_random_01.txt AC 1 ms 3512 KiB
01_random_02.txt AC 1 ms 3616 KiB
01_random_03.txt AC 1 ms 3704 KiB
01_random_04.txt AC 1 ms 3512 KiB
01_random_05.txt AC 1 ms 3540 KiB
01_random_06.txt AC 1 ms 3552 KiB
01_random_07.txt AC 1 ms 3624 KiB
01_random_08.txt AC 1 ms 3556 KiB
01_random_09.txt AC 1 ms 3484 KiB
01_random_10.txt AC 1 ms 3516 KiB
02_handmade_01.txt AC 1 ms 3556 KiB
02_handmade_02.txt AC 1 ms 3488 KiB
02_handmade_03.txt AC 1 ms 3516 KiB
02_handmade_04.txt AC 1 ms 3500 KiB
02_handmade_05.txt AC 1 ms 3616 KiB
02_handmade_06.txt AC 1 ms 3584 KiB
02_handmade_07.txt AC 1 ms 3512 KiB