摘要: 这不是内个哈夫曼编码嘛. #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cin.get(); while (m--) { string s; getline(cin, s); i 阅读全文
posted @ 2024-03-29 20:22 YuKiCheng 阅读(51) 评论(0) 推荐(0)
摘要: #include <bits/stdc++.h> using namespace std; int main() { int count =0,huoguo=0; int flag = 0;//第一次出现是第几条 string s; while (getline(cin, s) && s != ". 阅读全文
posted @ 2024-03-29 20:11 YuKiCheng 阅读(38) 评论(0) 推荐(0)
摘要: easy. #include <bits/stdc++.h> using namespace std; set<pair<int, int>> st; int maxv = 0; int main() { for(int i=1;i<=4;i++){ int t; cin >> t; st.inse 阅读全文
posted @ 2024-03-29 19:44 YuKiCheng 阅读(54) 评论(0) 推荐(0)
摘要: 这题没做出来,查了一些博客,下面是我比较能接受的一种写法。 读完题可以发现这是一个满二叉树,并且可以得到每场比赛失败者的信息(决赛是胜利者和失败者都可以得到) 对于一场比赛,它的胜利者要么是左孩子中的胜利者,要么是右孩子中的胜利者,那我们就可以先假设是左孩子的胜利者,如果不行就交换(是右孩子的胜利者 阅读全文
posted @ 2024-03-29 16:59 YuKiCheng 阅读(354) 评论(1) 推荐(1)
摘要: 喔,太久没敲代码了,有点生疏了。 baozang[i]=1:第i块岛屿有宝藏。 baozang[i]=0: 第i块岛屿没有宝藏。 #include <bits/stdc++.h> using namespace std; vector<vector<int>> area; int row, col; 阅读全文
posted @ 2024-03-29 11:10 YuKiCheng 阅读(162) 评论(0) 推荐(0)