Submission #75069498


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using pii = pair<int,int>;
#define endl '\n'

void solveA () {
 int l, r;
 cin >> l >> r;
 cout << r - l + 1 << endl;
}

void solveB () {
  int n, m;
  cin >> n >> m;
  unordered_map<int, int> ump;
  for (int i = 0, x; i < n; i ++) {
    cin >> x;
    ump[x] ++;
  }
  bool ok = 1;
  for (auto&[x, y] : ump) {
    if (y > 1) {
      cout << "No" << endl;
      ok = 0;
      break;
    } 
  }
  if (ok) cout << "Yes" << endl;
    if ((int)ump.size() == m) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
}

void solveC () {
  int n, m;
  cin >> n >> m;
  auto G = vector(n + 1, vector<int> ());
  for (int i = 0; i < m; i ++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
  }
  vector<int> vis(n + 1);
  vis[1] = 1;
  auto dfs = [&] (auto&& self, int u) -> void {
    for (auto& v : G[u]) {
      if (vis[v]) continue;
      vis[v] = 1;
      self(self, v);
    }
  };
  dfs(dfs, 1);
  cout << accumulate(vis.begin(), vis.end(), 0) << endl;
}

int main () {
  cin.tie(0)->sync_with_stdio(0);
  solveB();
}

Submission Info

Submission Time
Task B - Mapping
User PureMilk
Language C++23 (GCC 15.2.0)
Score 200
Code Size 1177 Byte
Status AC
Exec Time 1 ms
Memory 3636 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 19
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_1_00.txt, 01_random_1_01.txt, 01_random_1_02.txt, 02_random_2_00.txt, 02_random_2_01.txt, 02_random_2_02.txt, 03_random_3_00.txt, 03_random_3_01.txt, 03_random_3_02.txt, 04_random_4_00.txt, 04_random_4_01.txt, 04_random_4_02.txt, 04_random_4_03.txt, 04_random_4_04.txt, 04_random_4_05.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3636 KiB
00_sample_01.txt AC 1 ms 3608 KiB
00_sample_02.txt AC 1 ms 3556 KiB
00_sample_03.txt AC 1 ms 3396 KiB
01_random_1_00.txt AC 1 ms 3608 KiB
01_random_1_01.txt AC 1 ms 3548 KiB
01_random_1_02.txt AC 1 ms 3628 KiB
02_random_2_00.txt AC 1 ms 3480 KiB
02_random_2_01.txt AC 1 ms 3356 KiB
02_random_2_02.txt AC 1 ms 3540 KiB
03_random_3_00.txt AC 1 ms 3552 KiB
03_random_3_01.txt AC 1 ms 3596 KiB
03_random_3_02.txt AC 1 ms 3588 KiB
04_random_4_00.txt AC 1 ms 3584 KiB
04_random_4_01.txt AC 1 ms 3584 KiB
04_random_4_02.txt AC 1 ms 3524 KiB
04_random_4_03.txt AC 1 ms 3528 KiB
04_random_4_04.txt AC 1 ms 3584 KiB
04_random_4_05.txt AC 1 ms 3468 KiB