/ SeriousOJ /

Record Detail

Accepted


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

Code

#include <iostream>
using namespace std;

//SAYED AL MAMUN_LU

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int samp[n];
        for(int i = 0; i<n; i++)
        {
            cin>>samp[i];
        }
        
        int flag = 0;
        
        for(int i = 0; i<n - 1; i++)
        {
            for(int j = i + 1; j<n; j++)
            {
              if(samp[i] == samp[j])
              {
                  flag = 1;
                  break;
              }
              else 
              {
                  flag = 0;
              }
            }
            
            if(flag == 1)
            {
                break;
            }
        }
        
        if(flag == 0)
        {
            cout<<"YES"<<endl;
        }
        else 
        {
            cout<<"NO"<<endl;
        }
        
        
    }
}

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 17:18:23
Judged At
2024-11-11 03:32:21
Judged By
Score
100
Total Time
3ms
Peak Memory
548.0 KiB