codeforce 补题 Good Bye 2019 A 水题(入门博弈)

超级简单的博弈
http://codeforces.com/contest/1270

Good Bye 2019 A 
#include <stdio.h>
#include <math.h>
#include <string.h>
int max(int a, int b)
{
    if(a >= b)
    {
        return a;
    }
    else
        return  b;
}
void solve() {
    int n, m;
    scanf("%d", &n);
    scanf("%d%d", &n, &m);
    int x;
    int a = 0, b = 0;
    while(n--) {
        scanf("%d", &x);
        a = max(a, x);
    }
    while(m--) {
        scanf("%d", &x);
        b = max(b, x);
    }
    if (a < b)
        printf("NO\n");
    else
        printf("YES\n");
}
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    
        solve();
    
    return  0;
}

发布了289 篇原创文章 · 获赞 112 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/king9666/article/details/103812855