/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 332.0 KiB
#2 Accepted 4ms 348.0 KiB

Code

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

int32_t main () {
  int t = 1;
  cin >> t;
  while (t--) {
      int n, x, ok = 1;
      cin >> n;
      int a[n+1]{};
      for (int i = 0; i < n; i++) {
          cin >> x;
          a[x] = 1;
      }
      for (int i = 1; i <= n; i++) {
          if (!a[i]) ok = 0;
      }
      if (ok) cout << "YES\n";
      else cout << "NO\n";
  }
}

Information

Submit By
Type
Submission
Problem
P1055 Array Permutation
Contest
Brain Booster #3
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-06 15:05:32
Judged At
2024-11-11 03:35:16
Judged By
Score
100
Total Time
4ms
Peak Memory
348.0 KiB