题目链接

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. Tuning 13 Using oracle blocks Efficiently

    推进使用自动管理 automatic segment 1 个 Blocks = 2的幂次方倍 tablespace 像一块地 segment 像一个房子 extents 向一个装砖头的框 blocks ...

  2. Dump 分析法

    云更新目前能够收集32位客户机系统(XP和win7 32位)产生的蓝屏DMP文件到服务端DUMP文件夹,我们可以通过分析蓝屏曰志来确定到底是什么导致了客户机蓝屏. 一.WinDbg是什么?它能做什么? ...

  3. Window对应的类为java.awt.Windows, 它可独立于其他Container而存在

    Window对应的类为java.awt.Windows, 它可独立于其他Container而存在,它有两个子类, Frame和Dialog, Frame是具有标题(title)和可伸缩的角(resiz ...

  4. mysql分表技术

    一般来说,当我们的数据库的数据超过了100w记录的时候就应该考虑分表或者分区了,这次我来详细说说分表的一些方法. 目前我所知道的方法都是MYISAM的,INNODB如何做分表并且保留事务和外键,我还不 ...

  5. Docker for window 无法共享磁盘

    Docker for window 无法共享主机磁盘,环境如下: 操作系统: windown10 Docker version 18.09.0, build 4d60db4 症状如下: 如图,点击ap ...

  6. select循环读取数据

    <select id="srType" name="srType" value="test"> <c:forEach va ...

  7. java.lang.IllegalArgumentException: Failed to decrypt.

    加密失败. 附加信息: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Co ...

  8. 关于修改react的启动端口

    在package.json文件里面,加一个port端口号就ok了

  9. Vulkan Tutorial 06 逻辑设备与队列

    操作系统:Windows8.1 显卡:Nivida GTX965M 开发工具:Visual Studio 2017 Introduction 在选择要使用的物理设备之后,我们需要设置一个逻辑设备用于交 ...

  10. JAVA源码之JDK(三)——String、StringBuffer、StrinBuilder

    Java中,除了8种基本类型,最长用的应该就是String类了.那么我们来看看JDK中的源码是怎么建造String.StringBuffer.StrinBuilder一系列类的. java.lang. ...