/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 3ms 328.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int t; cin>>t;
  while(t--){
  ll n; cin>>n;
  vector<ll>s(n);
  vector<ll>v;
  for(int i=0;i<n;i++){
    cin>>s[i];
  }
  sort(s.begin(),s.end());
  for(int i=1;i<=n;i++){
    v.push_back(i);
  }
  if(s==v) 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:37:28
Judged At
2024-11-11 03:34:02
Judged By
Score
100
Total Time
3ms
Peak Memory
328.0 KiB