Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
// #include<boost/multiprecision/cpp_int.hpp>
#define fl(i, a, n) for (int i = a; i <= n; i++)
#define pb push_back
#define pob pop_back
#define int long long int
#define ff first
#define ss second
#define pi 3.1415926535898
#define vi vector<int>
#define mi map<int, int>
#define umi unordered_map<int, int>
#define endl "\n"
#define w(x)                                                                   \
  int x;                                                                       \
  cin >> x;                                                                    \
  while (x--)
#define db(x) cout << (#x) << " " << (x) << "\n";
#define ios                                                                    \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
using namespace std;
// using namespace boost::multiprecision;
int mod = 1000000007;
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
}
bool ispalindrome(string s) {
  for (int i = 0; i <= s.length() / 2; i++) {
    if (s[i] != s[s.length() - 1 - i]) {
      return 0;
    }
  }
  return 1;
}
class cust {
public:
  int t;
  int l;
  int h;
};
int32_t main() {

  ios c_p_c();
  // w(t)
  {
    int n;
    cin >> n;
    vi v(n);
    mi mp;
    fl(i, 0, n - 1) {
      cin >> v[i];
      mp[v[i]]++;
    }
    if (mp.size() == n) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
// #include<boost/multiprecision/cpp_int.hpp>
#define fl(i, a, n) for (int i = a; i <= n; i++)
#define pb push_back
#define pob pop_back
#define int long long int
#define ff first
#define ss second
#define pi 3.1415926535898
#define vi vector<int>
#define mi map<int, int>
#define umi unordered_map<int, int>
#define endl "\n"
#define w(x)                                                                   \
  int x;                                                                       \
  cin >> x;                                                                    \
  while (x--)
#define db(x) cout << (#x) << " " << (x) << "\n";
#define ios                                                                    \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(NULL);                                                               \
  cout.tie(NULL);
using namespace std;
// using namespace boost::multiprecision;
int mod = 1000000007;
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
}
bool ispalindrome(string s) {
  for (int i = 0; i <= s.length() / 2; i++) {
    if (s[i] != s[s.length() - 1 - i]) {
      return 0;
    }
  }
  return 1;
}
class cust {
public:
  int t;
  int l;
  int h;
};
int32_t main() {

  ios
  // c_p_c();
  // w(t)
  {
    int n;
    cin >> n;
    vi v(n);
    mi mp;
    fl(i, 0, n - 1) {
      cin >> v[i];
      mp[v[i]]++;
    }
    if (mp.size() == n) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }

  return 0;
}