题目链接

https://www.patest.cn/contests/gplt/L1-019

AC代码

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <cstdlib>
#include <ctype.h>
#include <numeric>
#include <sstream>
using namespace std;

typedef long long LL;
const double PI = 3.14159265358979323846264338327;
const double E = 2.718281828459;
const double eps = 1e-6;
const int MAXN = 0x3f3f3f3f;
const int MINN = 0xc0c0c0c0;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7;

int main()
{
    int arr[2] = {0};
    cin >> arr[0] >> arr[1];
    int q = arr[0], w = arr[1];
    int n;
    cin >> n;
    int a, b, c, d;
    int flag = 1;
    while (n--)
    {
        scanf("%d%d%d%d", &a, &b, &c, &d);
        if (flag)
        {
            if (a + c == b && a + c != d)
            {
                arr[0]--;
                if (arr[0] < 0)
                    flag = 0;
            }
            if (a + c == d && a + c != b)
            {
                arr[1]--;
                if (arr[1] < 0)
                    flag = 0;
            }
        }
        else
            continue;
    }
    if (arr[0] < 0)
        printf("A\n%d\n", w - arr[1]);
    else
        printf("B\n%d\n", q - arr[0]);
}

PAT 天梯赛 L1-019. 谁先倒 【水】的更多相关文章

  1. PAT 天梯赛 L1-036. A乘以B 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-036 AC代码 #include <iostream> #include <cstdio&g ...

  2. PAT 天梯赛 L1-018. 大笨钟 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-018 AC代码 #include <iostream> #include <cstdio&g ...

  3. PAT 天梯赛 L1-013. 计算阶乘和 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-013 AC代码 #include <iostream> #include <cstdio&g ...

  4. PAT 天梯赛 L1-026. I Love GPLT 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-026 AC代码 #include <iostream> #include <cstdio&g ...

  5. PAT 天梯赛 L1-037. A除以B 【水】

    题目链接 https://www.patest.cn/contests/gplt/L1-037 AC代码 #include <iostream> #include <cstdio&g ...

  6. PAT天梯赛 L1-049 天梯赛座位分配

    题目链接:点击打开链接 天梯赛每年有大量参赛队员,要保证同一所学校的所有队员都不能相邻,分配座位就成为一件比较麻烦的事情.为此我们制定如下策略:假设某赛场有 N 所学校参赛,第 i 所学校有 M[i] ...

  7. PAT天梯赛L3-007 天梯地图

    题目链接:点击打开链接 本题要求你实现一个天梯赛专属在线地图,队员输入自己学校所在地和赛场地点后,该地图应该推荐两条路线:一条是最快到达路线:一条是最短距离的路线.题目保证对任意的查询请求,地图上都至 ...

  8. PAT天梯赛练习题——L3-007. 天梯地图(多边权SPFA)

    L3-007. 天梯地图 时间限制 300 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 本题要求你实现一个天梯赛专属在线地图,队员输入自己学校 ...

  9. PTA 天梯赛 L1

    L1-002 打印沙漏 细节:就是在  (i>j&&i+j<r+1) 这个区间里才有空格,然后就是 for 循环   for(r=1; ;r+=2)  条件不满足之后还会再 ...

随机推荐

  1. 设置grid高度

    $("#jqxSalaryCalculation").jqxGrid({ height: $("#jqxTree").height() - 73 });

  2. c# @符号后面对 双引号转义

    本文讲述c#中如何转义双引号. c#中转义双引号",使用的转义字符仍然是\. string str = "\"www.itjsxx.com\""; 但 ...

  3. css3 html5画心

    以下内容不是原创 我是搬运工 1. <!DOCTYPE HTML><html> <head> <meta charset="UTF-8"/ ...

  4. poj 3084(最小割)

    题目链接:http://poj.org/problem?id=3084 思路:题目的意思是不让入侵者进入保护的房间,至少需要锁几道门.网络流建模:设一个超级源点,源点与有入侵者的房间相连,边容量为in ...

  5. JavaScript------日期和时间戳的相互转换

    var date = new Date(); 日期转时间戳 Number(date)或者date.getTime(); //只是转换成了纯数字的时间戳,例如:1498144203861需要转换才能使用 ...

  6. Python学习-一个简单的计时器

    在实际开发中,往往想要计算一段代码执行多长时间,以下我将该功能写入到一个函数里面,仅仅要在每一个函数前面调用该函数就可以,见以下代码: #------------------------------- ...

  7. Android开发:《Gradle Recipes for Android》阅读笔记(翻译)4.3——排除任务

    问题: 你想要在构建进程当中排除指定的任务. 解决方案: 可以使用-x排除单个任务.编辑task graph排除多个任务. 讨论: Gradle的构建进程包含了许多任务的执行顺序.他们中的大多数都依赖 ...

  8. python之range和xrange

    range 前面小节已经说明了,range([start,] stop[, step]),根据start与stop指定的范围以及step设定的步长,生成一个序列. 比如: 1 >>> ...

  9. 在Scrapy中使用IP池或用户代理更新版(python3)

    middlewares.py # -*- coding: utf-8 -*- # 导入随机模块 import random # 导入有关IP池有关的模块 from scrapy.downloaderm ...

  10. maven pom.xml常用标签 Exclusions plugins是什么意思

    Exclusions maven的依赖(dependencies)有传递性,为了解决兼容性问题,就用exclusions来排除造成兼容性问题的依赖. 写法如下: 加入项目A依赖项目B,项目B依赖项目C ...