/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 1ms 532.0 KiB
#3 Wrong Answer 42ms 580.0 KiB

Code

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


#define int long long

void iusearchbtw () {
        int n; cin >> n;
        vector<int> a(n + 1), b(n + 1);
        for (int i = 1; i <= n; i++) cin >> a[i];
        for (int i = 1; i <= n; i++) cin >> b[i];
        
        sort(a.begin() + 1, a.end());
        sort(b.begin() + 1, b.end());
        bool ok1 = 1, ok2 = 1;
        for (int i = 1; i <= n; i++) {
                ok1 &= (a[i] > b[i]);
                ok2 &= (a[i] < b[i]);
        }
        cout << (n == 1 || ok1 || ok2 ? "Yes\n" : "No\n");
}






signed main () {
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        int tt = 1;	
        cin >> tt;
	while (tt --> 0) iusearchbtw();
}

Information

Submit By
Type
Submission
Problem
P1193 C. Roy and Peak Array
Contest
Brain Booster #10
Language
C++17 (G++ 13.2.0)
Submit At
2025-06-13 15:51:04
Judged At
2025-06-13 15:51:04
Judged By
Score
0
Total Time
42ms
Peak Memory
580.0 KiB