/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 1ms 540.0 KiB
#3 Wrong Answer 21ms 772.0 KiB

Code

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

#define int long long
#define yes cout<<"Yes"<<'\n'
#define no cout<<"No"<<'\n'
#define nl cout<<"\n"

void solve() {
    int n; cin>>n;
    vector<int> a(n), b(n);
    for(int i=0; i<n; i++) cin>>a[i];
    for(int i=0; i<n; i++) cin>>b[i];

    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    if(n==1) yes;
    else if(a[n-1] < b[0]) yes;
    else if(b[n-1] < a[0]) yes;
    else no;
}

int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int t=1;
    cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}

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 16:40:02
Judged At
2025-06-13 16:40:02
Judged By
Score
0
Total Time
21ms
Peak Memory
772.0 KiB