L1-019 誰先倒 分數 15

Frodnx發表於2024-07-31

還是注意讀題,同輸不喝酒

// 10'38"
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int jia, yi;
    cin >> jia >> yi;
    int n;
    cin >> n;
    int j1 = 0, y1 = 0;
    for(int i = 1; i <= n; ++ i)
    {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        if(a + c == b && a + c != d) ++ j1;
        else if(a + c == d && a + c != b) ++ y1;
        if(jia < j1)
        {
            cout << "A";
            cout << endl << y1;
            return 0;
        }
        if(yi < y1)
        {
            cout << "B";
            cout << endl << j1;
            return 0;
        }
    }
    return 0;
}

相關文章