大一寒假训练:集训内容考试(三)【未完待续】

要我来说,这次的题真是太难了(/蒟蒻掩面而泣)

题目&题解:

A 熊熊对对碰 [33/166]

#include <bits/stdc++.h>
using namespace std;
struct xxx
{
    int x;
    int y;
    //因为用结构体做map键值,内部需要有排序规则
    friend bool operator<(const struct xxx &a, const struct xxx &b) 
    {
        if (a.x < b.x ||
            (a.x == b.x && a.y < b.y))
        {
            return true;
        }
        return false;
    }
};
map<xxx, int> mpr;
map<xxx, int>::iterator it;
int main()
{
    int n;
    scanf("%d", &n);
    while (n--)
    {
        int t1, t2, t3, t4;
        scanf("%d%d", &t1, &t2);
        t3 = -t1;
        t4 = -t2;
        if (mpr[{t3, t4}])
            mpr[{t3, t4}]++;
        else
            mpr[{t1, t2}]++;
    }
    int ans = 0;
    for (it = mpr.begin(); it != mpr.end(); it++)
    {
        int t = it->second;
        if (t % 2 == 0)
            ans += t;
    }
    printf("%d\n", ans);
    //system("pause");
    return 0;
}

B 秘籍 [20/117]


C jwGG的签到题 [16/98]


D jwMM的疯狂A-B [65/150]

#include <bits/stdc++.h>
using namespace std;
set<int> ssr1, ssr2;
set<int>::iterator it;
int n, m, x, f = 1;
int main()
{
    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++)
    {
        scanf("%d", &x);
        ssr1.insert(x);
    }
    for (int i = 1; i <= m; i++)
    {
        scanf("%d", &x);
        ssr2.insert(x);
    }
    for (it = ssr1.begin(); it != ssr1.end(); it++)
    {
        if (ssr2.find(*it) == ssr2.end())
        {
            printf("%d\n", *it);
            f = 0;
        }
    }
    if (f == 1)
        printf("So crazy!!!\n");
    //system("pause");
    return 0;
}

E 煊哥的难题 [2/26]


F jwGG与yzMM的字符串 [2/19]


(G题没链接就算了叭……)

H 库特放书 [3/38]


*2020/02/22

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值