Good Bye 2019 A. Card Game

第一次五分钟过了cf A

https://codeforces.com/contest/1270/problem/A

思路:谁拿到最大的牌即赢

官方:

 

 #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N= 105 ;
int a[N],b[N];
int main(){
    int T;
    ios::sync_with_stdio(false);cin.tie(0);
    cin>>T;
    while(T--){
        int n,k1,k2,flag=0;
        cin>>n>>k1>>k2;
        for(int i=0;i<k1;i++)
        {cin>>a[i];
        if(a[i]==n)flag=1;
        }
        for(int i=0;i<k2;i++)cin>>b[i];
        if(flag)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
        
    }
    return 0;
    
}
原文地址:https://www.cnblogs.com/wyh447154317/p/12164268.html