/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 324.0 KiB
#2 Wrong Answer 2ms 532.0 KiB

Code

#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define endl '\n'
#define Endl '\n'

using namespace std;

const int N = 2e5 + 5;
int tc, n, m, a[N];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); // cout.tie(0);
    cin >> tc;
    while (tc--) {
        set<int> st;
        cin >> n;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            st.insert(a[i]);
        }

        if (*st.begin() == 1 && *st.end() == n && st.size() == n) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }

    return 0;
}

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 15:04:58
Judged At
2024-10-03 13:53:02
Judged By
Score
0
Total Time
2ms
Peak Memory
532.0 KiB