/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 764.0 KiB
#2 Accepted 2ms 320.0 KiB

Code

// BISMILLAH

#include "bits/stdc++.h"

#define fastIO std::ios::sync_with_stdio(0);std::cin.tie(0)
#define ll long long int
#define flush fflush(stdout)
// #define int ll

using pii = std::pair<int,int>;

const int MOD = 1000000007;
// const int MOD = 998244353;
const int mxN = 500005, inf = 1000000005;

signed main() {
	// fastIO;
	int testCases=1;
	scanf("%lld",&testCases);
	// std::cin >> testCases;
	
	for (int T = 1; T <= testCases; T++) {
        int N;
        scanf("%d", &N);
        bool a[101] = {0};
        for (int i = 0, x; i < N; i++) {
            scanf("%d", &x);
            a[x] = 1;
        }
        bool ok = 1;
        for (int i = 1; i <= N; i++) {
            if (a[i] == 0) {
                ok = 0;
                break;
            }
        }
        printf("%s\n", ok ? "YES" : "NO");
    }
	
	return 0;
}

/*

*/

Information

Submit By
Type
Submission
Problem
P1055 Array Permutation
Language
C++17 (G++ 13.2.0)
Submit At
2024-05-07 08:23:29
Judged At
2024-10-03 13:46:44
Judged By
Score
100
Total Time
2ms
Peak Memory
764.0 KiB