/ SeriousOJ /

Record Detail

Accepted


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

Code

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

void ans();

int main() {
    int t; 
    cin >> t;
    while(t--) 
        ans();
    return 0;
}

void ans() {
    int n; 
    cin >> n;
    vector<int> arr(n);
    for(int i = 0; i < n; i++) 
        cin >> arr[i];
    sort(arr.begin(),arr.end());
    bool ok = false;
    for(int i = 0; i < n - 1; i++) {
        if(arr[i] == arr[i + 1]) {
            ok = true;
            break;
        }
    }
    if(!ok) 
        cout << "YES" << endl;
    else 
        cout << "NO" << endl;
}

Information

Submit By
Type
Submission
Problem
P1055 Array Permutation
Contest
Brain Booster #3
Language
C++17 (G++ 13.2.0)
Submit At
2024-05-06 16:19:48
Judged At
2024-10-03 13:50:31
Judged By
Score
100
Total Time
3ms
Peak Memory
324.0 KiB