摘要:
测试点会出现-0这种,直接导致无法使用int类型接收编号,因为无从判断性别,因此只能用string类型。 并且需要使用sex来记录当前是男性还是女性,只有对方是异性的时候,亲密度才有意义。 #include <bits/stdc++.h> using namespace std; int p[101 阅读全文
posted @ 2024-03-19 18:20
YuKiCheng
阅读(45)
评论(0)
推荐(0)
摘要:
很容易就AC了但是真没get到这道题有啥用这个所谓的排名。 #include <bits/stdc++.h> using namespace std; struct node { string s; int zp; int rank; }s[10010]; bool cmp(node n1, nod 阅读全文
posted @ 2024-03-19 15:42
YuKiCheng
阅读(16)
评论(0)
推荐(0)
摘要:
第一眼想到BFS,一次就AC了haha。 我的思路是用level记录当前是多少层,然后到最后一层的时候,将这一层的元素放到set集合里面。 输出的时候注意末尾不要有空格。 #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using n 阅读全文
posted @ 2024-03-19 11:31
YuKiCheng
阅读(21)
评论(0)
推荐(0)
摘要:
如果一个城市未被炸毁,那如果他可达的其他城市也未被炸毁,说明方案不可行。 #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; #define ll long long vector<vector< 阅读全文
posted @ 2024-03-19 10:27
YuKiCheng
阅读(14)
评论(0)
推荐(0)
摘要:
注意merge的时候如果p1和p2相等及时返回否则死循环了,代码有问题而不是算法超时。 #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; #define ll long long int par 阅读全文
posted @ 2024-03-19 08:52
YuKiCheng
阅读(33)
评论(0)
推荐(0)