/ SeriousOJ /

Record Detail

System Error


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 System Error foo: malloc.c:2617: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. 2ms 568.0 KiB

Code

#include<bits/stdc++.h>
#define ll    long long int
#define yes   "YES"
#define no    "NO"
#define nl    "\n"
using namespace std;

void solve()
{
    int n;
    cin>>n;
    vector<int>a(n);
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    int ans=1;
    for(int i=2;i<=n;i++){
        if(a[i]!=a[i-1])
            ans++;
    }
    if(ans==n)
        cout<<yes<<nl;
    else
        cout<<no<<nl;

}

int main()
{
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}


Information

Submit By
Type
Submission
Problem
P1055 Array Permutation
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-10 15:16:41
Judged At
2024-05-14 21:52:54
Judged By
Score
0
Total Time
2ms
Peak Memory
568.0 KiB