要我来说,这次的题真是太难了(/蒟蒻掩面而泣)
题目&题解:
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