prithivMLmods/Coder-Stat huggingface dataset:
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(0)
int main() {
  SPEED;
  int n, count = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++)
    cin >> a[i];
  for (int j = 0; j < n; j++)
    for (int k = j + 1; k < n; k++)
      if (a[j] == a[k]) {
        count = 1;
        break;
      }
  if (count == 1)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(0)
int main() {
  SPEED;
  int n, count = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++)
    cin >> a[i];
  sort(a, a + n);
  for (int j = 0; j < n - 1; j++)
    if (a[j] == a[j + 1]) {
      count = 1;
      break;
    }
  if (count == 1)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  int judge = 0;
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (ll i = 0; i < n - 1; i++) {
    for (ll j = i + 1; j < n; j++) {
      if (a[i] == a[j]) {
        judge = 1;
        break;
      }
    }
  }
  if (judge == 0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  int judge = 0;
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1]) {
      judge = 1;
      break;
    }
  }
  if (judge == 0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const char *solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &i : a)
    cin >> i;
  sort(a.begin(), a.end());
  for (int i = 1; i < a.size(); i++)
    if (a[i] == a[i - 1])
      return "NO";
}
int main() { cout << solve() << endl; }

Fixed submission:
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const char *solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &i : a)
    cin >> i;
  sort(a.begin(), a.end());
  for (int i = 1; i < a.size(); i++)
    if (a[i] == a[i - 1])
      return "NO";
  return "YES";
}
int main() { cout << solve() << endl; }
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<bool> vec(100000001);
  bool ans = true;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (vec.at(x) == false)
      vec.at(x) = true;
    else
      ans = false;
  }
  if (ans == true)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<bool> vec(1000000001);
  bool ans = true;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (vec.at(x) == false)
      vec.at(x) = true;
    else
      ans = false;
  }
  if (ans == true)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  unsigned int n;
  vector<unsigned long long> a;

  cin >> n;
  a.resize(n);

  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i] == a[j] && i != j) {
        cout << "NO";
        return 0;
      }
    }
  }

  cout << "YES";
  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  unsigned int n;
  vector<unsigned long long> a;

  cin >> n;
  a.resize(n);

  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  sort(a.begin(), a.end());

  for (int i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1]) {
      cout << "NO";
      return 0;
    }
  }

  cout << "YES";
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(n) begin(n), end(n)
using namespace std;
using ll = long long;

int main() {
  int n;
  string ans = "YES";
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  rep(i, n - 1) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] == a[j])
        ans = "NO";
    }
  }
  cout << ans << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(n) begin(n), end(n)
using namespace std;
using ll = long long;

int main() {
  int n;
  string ans = "YES";
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  sort(a.begin(), a.end());
  rep(i, n - 1) if (a[i] == a[i + 1]) ans = "NO";
  cout << ans << endl;
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      if (a[i] == a[j]) {
        ans = 1;
        break;
      }
    }
  }
  if (ans == 1) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  sort(a, a + n);
  for (long long i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1]) {
      ans = 1;
      break;
    }
  }
  if (ans == 1) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main(void) {
  // Your code here!
  long long N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  for (int i = 0; i < N - 1; i++) {
    for (int j = i + 1; j < N; j++) {
      if (A[i] == A[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main(void) {
  // Your code here!
  long long N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  for (int i = 0; i < N - 1; i++) {
    if (A[i] == A[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
// #include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int lo;
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define inf (lo)1e9
#define mod (lo)1e9 + 7
lo k, a, b, c, n;
string s1, s2, s3;
queue<pair<lo, lo>> q;
priority_queue<lo> pq;
map<lo, lo> mp1;
vector<lo> v[100005];
lo oyuncu;
set<lo> stt;
lo a1[100005];
int main() {
  // freopen("gir.gir","r",stdin);
  // freopen("cik.cik","w",stdout);
  cin >> n;
  for (lo i = 0; i < n; i++) {
    cin >> a1[i];
    mp1[a1[i]]++;
  }
  for (lo i = 0; i < n; i++) {
    if (mp1[a1[i]] > 1) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}

Fixed submission:
// #include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int lo;
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define inf (lo)1e9
#define mod (lo)1e9 + 7
lo k, a, b, c, n;
string s1, s2, s3;
queue<pair<lo, lo>> q;
priority_queue<lo> pq;
map<lo, lo> mp1;
vector<lo> v[100005];
lo oyuncu;
set<lo> stt;
lo a1[500005];
int main() {
  // freopen("gir.gir","r",stdin);
  // freopen("cik.cik","w",stdout);
  cin >> n;
  for (lo i = 0; i < n; i++) {
    cin >> a1[i];
    mp1[a1[i]]++;
  }
  for (lo i = 0; i < n; i++) {
    if (mp1[a1[i]] > 1) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

#define mod 1e9 + 7;
#define INF 1e9 + 9;
#define ps(x, y) fixed << setprecision(y) << x
#define PI 3.14159265358979323846264338327950 L
typedef long long ll;
typedef unsigned long long ull;
int main() {
  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
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";

  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

#define mod 1e9 + 7;
#define INF 1e9 + 9;
#define ps(x, y) fixed << setprecision(y) << x
#define PI 3.14159265358979323846264338327950 L
typedef long long ll;
typedef unsigned long long ull;
int main() {
  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
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";

  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  bool ans = true;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (A.at(i) == A.at(j) && i != j) {
        ans = false;
        break;
      }
    }
  }
  if (ans) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  bool ans = true;
  sort(A.begin(), A.end());
  for (int i = 0; i < N - 1; i++) {
    if (A.at(i) == A.at(i + 1)) {
      ans = false;
      break;
    }
  }
  if (ans) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[1000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (a[i] == a[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[210000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (a[i] == a[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int const INF = 1001001001;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin >> n;

  vi a(n);
  rep(i, n) cin >> a[i];

  rep(i, n - 1) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] == a[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }

  cout << "YES" << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int const INF = 1001001001;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin >> n;

  vi a(n);
  rep(i, n) cin >> a[i];

  map<int, int> mp;

  rep(i, n) mp[a[i]]++;

  for (auto x : mp) {
    if (x.second >= 2) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;

  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
using P = pair<string, int>;
using ll = long long;

int main() {
  ll n;
  cin >> n;
  vector<int> v(n);
  rep(i, n) { cin >> v.at(i); }
  sort(v.begin(), v.end());
  bool ok = true;
  for (int i = 0; i < n; i++) {
    if (v.at(i) == v.at(i + 1)) {
      ok = false;
      break;
    }
  }
  if (ok) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
using P = pair<string, int>;
using ll = long long;

int main() {
  ll n;
  cin >> n;
  vector<int> v(n);
  rep(i, n) { cin >> v.at(i); }
  sort(v.begin(), v.end());
  bool ok = true;
  for (int i = 0; i < n - 1; i++) {
    if (v.at(i) == v.at(i + 1)) {
      ok = false;
      break;
    }
  }
  if (ok) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <stack>
#include <string>
using namespace std;
const int N = 1e4 + 5;
int n;
int a[N];
bool flag = false;
int main() {
  int j = 1;
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i + 1]) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
}


Fixed submission:
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <stack>
#include <string>
using namespace std;
const int N = 1e8 + 5;
int n;
int a[N];
bool flag = false;
int main() {
  int j = 1;
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i + 1]) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }

  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (x[i] == x[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }

  sort(x, x + n);
  for (int i = 0; i < n - 1; i++) {
    if (x[i + 1] == x[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  // 100要素の配列で初期化
  int n;
  cin >> n;
  vector<int> vec(n);
  string a = "YES";
  // 100個の入力を受け取る
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (vec.at(i) == vec.at(j))
        a = "NO";
    }
  }
  cout << a << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  // 100要素の配列で初期化
  int n;
  cin >> n;
  vector<int> vec(n);
  string a = "YES";
  // 100個の入力を受け取る
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  for (int i = 1; i < n; i++) {
    if (vec.at(i) == vec.at(i - 1))
      a = "NO";
  }
  cout << a << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  bool ans = true;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a.at(i) == a.at(j)) {
        ans = false;
      }
    }
  }
  if (ans) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  bool ans = true;
  sort(a.begin(), a.end());
  for (int i = 0; i < n - 1; i++) {
    if (a.at(i) == a.at(i + 1)) {
      ans = false;
    }
  }
  if (ans) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
  long n;
  cin >> n;
  vector<long> a(n);
  bool IsNotUnique = false;

  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] == a[j]) {
        IsNotUnique = true;
        break;
      }
    }
    if (IsNotUnique)
      break;
  }

  if (IsNotUnique)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
  long n;
  cin >> n;
  vector<long> a(n);
  bool IsNotUnique = false;

  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  sort(a.begin(), a.end()); // ソート

  a.erase(unique(a.begin(), a.end()), a.end()); // 重複を削除

  if (a.size() != n) {
    IsNotUnique = true;
  }

  if (IsNotUnique)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;

  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;

  vector<int> a(n);
  rep(i, n) { cin >> a.at(i); }
  sort(a.begin(), a.end());

  bool sta = false;
  for (int i = 0; i < n; i++) {
    if (a.at(i) == a.at(i + 1)) {
      cout << "NO" << endl;
      sta = true;
      break;
    }
  }

  if (!sta) {
    cout << "YES" << endl;
  }

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;

  vector<int> a(n);
  rep(i, n) { cin >> a.at(i); }
  sort(a.begin(), a.end());

  bool sta = false;
  for (int i = 0; i < n - 1; i++) {
    if (a.at(i) == a.at(i + 1)) {
      cout << "NO" << endl;
      sta = true;
      break;
    }
  }

  if (!sta) {
    cout << "YES" << endl;
  }

  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = 1; i <= (int)(n); i++)
#define dunk(n) cout << n << endl
#define all(a) (a).begin(), (a).end()
typedef pair<int, int> P;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<ll> num(n);
  rep(i, n) cin >> num[i];
  sort(all(num));
  rrep(i, n) {
    if (num[i - 1] == num[i]) {
      dunk("NO");
      return 0;
    }
  }
  dunk("YES");
  return 0;
}

Fixed submission:
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = 1; i < (int)(n); i++)
#define dunk(n) cout << n << endl
#define all(a) (a).begin(), (a).end()
typedef pair<int, int> P;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<ll> num(n);
  rep(i, n) cin >> num[i];
  sort(all(num));
  rrep(i, n) {
    if (num[i - 1] == num[i]) {
      dunk("NO");
      return 0;
    }
  }
  dunk("YES");
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  bool result = true;
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    for (int j = 0; j < i; j++) {
      if (a.at(i) == a.at(j)) {
        result = false;
        break;
      }
    }
  }
  if (result) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  bool result = true;
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n - 1; i++) {
    if (a.at(i) == a.at(i + 1)) {
      result = false;
      break;
    }
  }
  if (result) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int inf = 0x3f3f3f3f;
bool ok;
char ch;
void read(int &x) {
  for (ok = 0, ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-')
      ok = 1;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  if (ok)
    x = -x;
}
void write(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9)
    write(x / 10);
  putchar(x % 10 + '0');
  return;
}

int s[200005];
int main() {
  int n;
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    if (s[a]) {
      cout << "NO";
      return 0;
    }
    s[a] = 1;
  }
  cout << "YES";
  return 0;
}

Fixed submission:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int inf = 0x3f3f3f3f;
bool ok;
char ch;
void read(int &x) {
  for (ok = 0, ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-')
      ok = 1;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  if (ok)
    x = -x;
}
void write(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9)
    write(x / 10);
  putchar(x % 10 + '0');
  return;
}

unordered_map<int, int> s;
int main() {
  int n;
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    if (s[a]) {
      cout << "NO";
      return 0;
    }
    s[a] = 1;
  }
  cout << "YES";
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

// #define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)                                                             \
  sort(v.begin(), v.end());                                                    \
  reverse(v.begin(), v.end())

#define cout(n) cout << fixed << setprecision(n)

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T> inline void chmax(T &a, T b) { a = std::max(a, b); }
template <class T> inline void chmin(T &a, T b) { a = std::min(a, b); }

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll n;
  cin >> n;

  vector<ll> a(n);
  rep(i, n) { cin >> a[i]; }

  rep(i, n) {
    FOR(j, i + 1, n) {
      if (a[i] == a[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

// #define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)                                                             \
  sort(v.begin(), v.end());                                                    \
  reverse(v.begin(), v.end())

#define cout(n) cout << fixed << setprecision(n)

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T> inline void chmax(T &a, T b) { a = std::max(a, b); }
template <class T> inline void chmin(T &a, T b) { a = std::min(a, b); }

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll n;
  cin >> n;

  vector<ll> a(n);
  rep(i, n) { cin >> a[i]; }

  map<ll, ll> m;

  rep(i, n) { m[a[i]]++; }
  FORm(it, m) {
    if (it->second > 1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  long long n;
  scanf("%lld", &n);
  long long arr[n];
  for (long long i = 0; i < n; i++)
    scanf("%lld", &arr[i]);
  for (long long i = 0; i < n; i++)
    for (long long j = i + 1; j < n; j++)
      if (arr[i] == arr[j]) {
        cout << "NO\n";
        return 0;
      }
  cout << "YES\n";
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  scanf("%d", &n);
  int arr[n];
  for (int i = 0; i < n; i++)
    scanf("%d", &arr[i]);
  sort(arr, arr + n);
  for (int i = 0; i < n - 1; i++)
    if (arr[i] == arr[i + 1]) {
      cout << "NO\n";
      return 0;
    }
  cout << "YES\n";
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  long long int a = 0, b = 0, x = 0;
  long long int n = 0, ans = 0, count = 0;
  string s, t, u;
  vector<long long int> z;
  vector<long long int>::iterator position;
  bool q = false;
  cin >> n;
  for (int i = 0; i < s.size(); i++) {
    cin >> a;
    z.push_back(a);
  }
  sort(z.begin(), z.end());
  for (int i = 0; i < n - 1; i++) {
    if (z.at(i) == z.at(i + 1)) {
      cout << "NO" << endl;
      break;
    } else if (i == n - 2)
      cout << "YES" << endl;
  }
  cout << endl;
}

Fixed submission:
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  long long int a = 0, b = 0, x = 0;
  long long int n = 0, ans = 0, count = 0;
  string s, t, u;
  vector<long long int> z;
  vector<long long int>::iterator position;
  bool q = false;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    z.push_back(a);
  }
  sort(z.begin(), z.end());
  for (int i = 0; i < n - 1; i++) {
    if (z.at(i) == z.at(i + 1)) {
      cout << "NO" << endl;
      break;
    } else if (i == n - 2)
      cout << "YES" << endl;
  }
  cout << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
long n, a[200000];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    for (int j = i - 1; j >= 0; --j) {
      if (a[i] == a[j]) {
        cout << "NO" << '\n';
        return 0;
      }
    }
  }
  cout << "YES" << '\n';
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
long n, a[200000];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 1; i < n; ++i) {
    if (a[i] == a[i - 1]) {
      cout << "NO" << '\n';
      return 0;
    }
  }
  cout << "YES" << '\n';
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  bool ans = false;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (A.at(i) == A.at(j)) {
        ans = true;
        break;
      }
    }
    if (ans) {
      break;
    }
  }
  if (ans) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  bool ans = false;
  sort(A.begin(), A.end());
  for (int i = 0; i < N - 1; i++) {
    if (A.at(i) == A.at(i + 1)) {
      ans = true;
      break;
    }
  }
  if (ans) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (i == j)
        continue;
      if (a.at(i) == a.at(j)) {
        cout << "NO" << endl;
        exit(0);
      }
    }
  }
  cout << "YES" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < N - 1; i++) {
    if (a.at(i) == a.at(i + 1)) {
      cout << "NO" << endl;
      exit(0);
    }
  }
  cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  int S[200100];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
    for (int j = 0; j < i; j++) {
      if (S[i] == S[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  int S[200100];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  sort(S, S + N);
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == S[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
bool a[2000000];
int main() {
  int N, b;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> b;
    if (a[b] == false) {
      a[b] = true;
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
bool a[2000000000];
int main() {
  int N, b;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> b;
    if (a[b] == false) {
      a[b] = true;
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  bool judge = true;
  for (int i = 0; i < n; i++)
    cin >> arr.at(i);
  for (int i = 0; i < n; i++) {
    for (int j = (i + 1); j < n; j++) {
      if (arr.at(i) == arr.at(j)) {
        judge = false;
        break;
      }
    }
    if (!judge) {
      break;
    }
  }

  if (judge)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  bool judge = true;
  for (int i = 0; i < n; i++)
    cin >> arr.at(i);
  sort(arr.begin(), arr.end());
  for (int i = 1; i < n; i++) {
    if (arr.at(i) == arr.at(i - 1)) {
      judge = false;
      break;
    }
  }

  if (judge)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  rep(i, n) { cin >> arr.at(i); }
  vector<bool> jud(200001);
  rep(i, n) {
    if (jud.at(arr.at(i))) {
      cout << "NO" << endl;
      return 0;
    } else {
      jud.at(arr.at(i)) = true;
    }
  }
  cout << "YES" << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  rep(i, n) { cin >> arr.at(i); }
  vector<bool> jud(1e9);
  rep(i, n) {
    if (jud.at(arr.at(i))) {
      cout << "NO" << endl;
      return 0;
    } else {
      jud.at(arr.at(i)) = true;
    }
  }
  cout << "YES" << endl;
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define int long long

bool vis[200006];
bool flag = 1;
signed main() {

  int n;
  cin >> n;

  for (int i = 1; i <= n; i++) {
    int b;
    cin >> b;
    if (vis[b])
      flag = 0;
    vis[b] = 1;
    // if(a==b)flag = 0;
    // a = b;
  }

  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define int long long

map<int, bool> vis;
bool flag = 1;
signed main() {

  int n;
  cin >> n;

  for (int i = 1; i <= n; i++) {
    int b;
    cin >> b;
    if (vis[b])
      flag = 0;
    vis[b] = 1;
    // if(a==b)flag = 0;
    // a = b;
  }

  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
ll ar[200007], a, b, test, sum, t, x = 0, p, q, y, i, j, k = 0, l, cnt;
ll br[200007];
string s, s1, s2;

int main() {
  ll test;
  cin >> a;
  for (i = 1; i <= a; i++) {
    cin >> ar[i];
    br[ar[i]]++;
  }
  for (i = 1; i <= a; i++)
    if (br[ar[i]] > 1) {
      cout << "NO";
      return 0;
    }
  cout << "YES" << endl;
}


Fixed submission:
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
ll ar[200007], a, b, test, sum, t, x = 0, p, q, y, i, j, k = 0, l, cnt;
map<ll, ll> br;
string s, s1, s2;

int main() {
  ll test;
  cin >> a;
  for (i = 1; i <= a; i++) {
    cin >> ar[i];
    br[ar[i]]++;
  }
  for (i = 1; i <= a; i++)
    if (br[ar[i]] > 1) {
      cout << "NO";
      return 0;
    }
  cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

void printVector(vector<int> vec) {
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] << endl;
  }
}

int main() {
  int N;
  cin >> N;
  vector<int> vec;
  for (int i = 0; i < N; i++) {
    int A;
    cin >> A;
    vec.push_back(A);
  }
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (vec[i] == vec[j]) {
        cout << "NO" << endl;
        return EXIT_SUCCESS;
      }
    }
  }
  cout << "YES" << endl;
  return EXIT_SUCCESS;
}

Fixed submission:
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

void printVector(vector<int> vec) {
  for (int i = 0; i < vec.size(); i++) {
    cout << vec[i] << endl;
  }
}

int main() {
  int N;
  cin >> N;
  vector<int> vec;
  for (int i = 0; i < N; i++) {
    int A;
    cin >> A;
    vec.push_back(A);
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < N - 1; i++) {
    if (vec[i] == vec[i + 1]) {
      cout << "NO" << endl;
      return EXIT_SUCCESS;
    }
  }
  cout << "YES" << endl;
  return EXIT_SUCCESS;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
struct Fast {
  Fast() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} fast;

long long mod = 1000000007;

int main() {
  long long N;
  cin >> N;
  vector<long long> A;
  for (long long i; i < N; i++) {
    cin >> A[i];
  }
  map<long, long> uss;
  for (long long i; i < N; i++) {
    uss[(A[i])]++;
  }
  for (long long i; i < N; i++) {
    if (uss[(A[i])] >= 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}


Fixed submission:
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
struct Fast {
  Fast() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} fast;

long long mod = 1000000007;

int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (long long i; i < N; i++) {
    cin >> A[i];
  }
  map<long, long> uss;
  for (long long i; i < N; i++) {
    uss[(A[i])]++;
  }
  for (long long i; i < N; i++) {
    if (uss[(A[i])] >= 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main(void) {
  long long int n = 0;

  cin >> n;
  vector<long long int> a(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int k = 0; k < i; k++) {
      if (a[k] == a[i]) {
        cout << "NO\n";
        return 0;
      }
    }
  }

  cout << "YES\n";

  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main(void) {
  long long int n = 0;

  cin >> n;
  vector<long long int> a(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  sort(a.begin(), a.end());

  for (int i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1]) {
      cout << "NO\n";
      return 0;
    }
  }

  cout << "YES\n";

  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<bool> B(200050, true);
  bool ans = true;
  rep(i, N) {
    cin >> A.at(i);
    if (B.at(A.at(i))) {
      B.at(A.at(i)) = false;
    } else {
      ans = false;
    }
  }
  cout << (ans ? "YES" : "NO") << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<bool> B(1000000050, true);
  bool ans = true;
  rep(i, N) {
    cin >> A.at(i);
    if (B.at(A.at(i))) {
      B.at(A.at(i)) = false;
    } else {
      ans = false;
    }
  }
  cout << (ans ? "YES" : "NO") << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j && vec.at(i) == vec.at(j)) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < n - 1; i++) {
    if (vec.at(i) == vec.at(i + 1)) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, C = 1;
  cin >> N;
  vector<long> A(N);
  for (int i = 0; i < N; i++)
    cin >> A.at(i);

  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (A.at(i) == A.at(j))
        C = 0;
    }
  }
  if (C == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, C = 1;
  cin >> N;
  vector<long> A(N);
  for (int i = 0; i < N; i++)
    cin >> A.at(i);

  sort(A.begin(), A.end());

  for (int i = 0; i < N - 1; i++) {
    if (A.at(i) == A.at(i + 1))
      C = 0;
  }
  if (C == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
Problem p02779 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  int ex = 0;
  for (int i = 0; i < N - 1; i++) {
    for (int j = i + 1; j < N; j++) {
      if (A.at(i) == A.at(j)) {
        ex++;
        break;
      }
    }
  }
  if (ex > 0) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  sort(A.begin(), A.end());
  A.erase(unique(A.begin(), A.end()), A.end());
  if (A.size() < N) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int LMS(int n, int k) {
  if (n == 1)
    return 1;
  else
    /* The position returned by josephus(n - 1, k) is adjusted because the
    recursive call josephus(n - 1, k) considers the original position
    k%n + 1 as position 1 */
    return (LMS(n - 1, k) + k - 1) % n + 1;
}
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  int t = 1;
  // cin >> t;
  while (t--) {
    int n;
    cin >> n;
    set<int> s;
    int a;
    for (int i = 0; i < n; ++i) {
      cin >> a;
      s.insert(a);
    }
    if (s.size() == n)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int LMS(int n, int k) {
  if (n == 1)
    return 1;
  else
    /* The position returned by josephus(n - 1, k) is adjusted because the
    recursive call josephus(n - 1, k) considers the original position
    k%n + 1 as position 1 */
    return (LMS(n - 1, k) + k - 1) % n + 1;
}
int main() {

  int t = 1;
  // cin >> t;
  while (t--) {
    int n;
    cin >> n;
    set<int> s;
    int a;
    for (int i = 0; i < n; ++i) {
      cin >> a;
      s.insert(a);
    }
    if (s.size() == n)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Memory Limit Exceeded):
// clang-format off
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i,n) for(ll i=n-1; i>=0; --i)
#define rrep1(i,n) for(ll i=n; i>0; --i)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define SORT_DESC(x) sort(all(x), greater<>())
#define pb push_back
#define mp make_pair
#define coutl cout<<fixed<<setprecision(10)
#define ANS(ans) cout<<ans<<endl;
const ll LINF = (1LL << 62) - 1;
const int INF = (1 << 30) - 1;
template<class T>bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a, const T &b){if (b<a){a=b;return 1;}return 0;}
const string YES = "YES";
const string NO = "NO";
// clang-format on

void solve(long long N, std::vector<long long> A) {
  vector<bool> a(1e10);
  rep(i, N) {
    if (a[A[i]]) {
      ANS(NO);
      return;
    }
    a[A[i]] = true;
  }
  ANS(YES);
}

// clang-format off
int main() {
  long long N;
  scanf("%lld",&N);
  std::vector<long long> A(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&A[i]);
  }
  solve(N, std::move(A));
  return 0;
}


Fixed submission:
// clang-format off
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i,n) for(ll i=n-1; i>=0; --i)
#define rrep1(i,n) for(ll i=n; i>0; --i)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define SORT_DESC(x) sort(all(x), greater<>())
#define pb push_back
#define mp make_pair
#define coutl cout<<fixed<<setprecision(10)
#define ANS(ans) cout<<ans<<endl;
const ll LINF = (1LL << 62) - 1;
const int INF = (1 << 30) - 1;
template<class T>bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a, const T &b){if (b<a){a=b;return 1;}return 0;}
const string YES = "YES";
const string NO = "NO";
// clang-format on

void solve(long long N, std::vector<long long> A) {
  vector<bool> a(INF);
  rep(i, N) {
    if (a[A[i]]) {
      ANS(NO);
      return;
    }
    a[A[i]] = true;
  }
  ANS(YES);
}

// clang-format off
int main() {
  long long N;
  scanf("%lld",&N);
  std::vector<long long> A(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&A[i]);
  }
  solve(N, std::move(A));
  return 0;
}
Problem p02779 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
  int n, i, j;
  int a[100005], flag = 0;
  cin >> n;
  for (i = 0; i < n; i++)
    cin >> a[i];
  sort(a, a + n);
  for (i = 1; i < n; i++) {
    if (a[i] == a[i - 1]) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "NO";
  else
    cout << "YES";
}

Fixed submission:
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main() {
  int n, i, j;
  long long a[200005], flag = 0;
  cin >> n;
  for (i = 0; i < n; i++)
    cin >> a[i];
  sort(a, a + n);
  for (i = 1; i < n; i++) {
    if (a[i] == a[i - 1]) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "NO";
  else
    cout << "YES";
}