2024年8月12日
摘要: 1 面积最大的三角形 https://vjudge.net/contest/647024#problem/A 凸包 https://www.cnblogs.com/aiguona/p/7232243.html 代码 #include<bits/stdc++.h> using namespace st 阅读全文
posted @ 2024-08-12 21:17 Hoshino1 阅读(34) 评论(0) 推荐(0)
摘要: 1 洛谷练习 1)路径之谜 代码(未调 #include <bits/stdc++.h> using namespace std; int n; const int maxn = 25; int maxa[maxn]; int maxb[maxn]; int nowa[maxn]; int nowb 阅读全文
posted @ 2024-08-12 17:01 Hoshino1 阅读(13) 评论(0) 推荐(0)
  2024年8月7日
摘要: 1 并查集 1) 模板 板子 #include<bits/stdc++.h> using namespace std; void init() { for(int i=0; i<n; i++) pre[i]=i; } int find(int a) { if(pre[a]==a) //又写成单等了 阅读全文
posted @ 2024-08-07 09:38 Hoshino1 阅读(13) 评论(0) 推荐(0)
  2024年7月31日
摘要: 1 vj6补题 https://vjudge.net/contest/643996#overview 1) 几个点会被几个圆覆盖问题 重点 如何优化算法到1s: 不是遍历每个圆的每个点,我们移动圆心上下左右r。但这是个正方形区域,所以我们要判断距离是否超出圆的区域,然后标记每一个点 思路: 对于每个 阅读全文
posted @ 2024-07-31 10:12 Hoshino1 阅读(13) 评论(0) 推荐(0)
  2024年7月30日
摘要: 1 vj团队5补题(上午) https://vjudge.net/contest/643995 题解 2 cf r950(下午+晚上) https://vjudge.net/contest/643996#google_vignette 1)2最大公约数非递减序列 https://www.luogu. 阅读全文
posted @ 2024-07-30 16:16 Hoshino1 阅读(8) 评论(0) 推荐(0)
  2024年7月29日
摘要: 洛谷题单(上午) https://www.luogu.com.cn/training/9349 字符串读入 getline(cin,a); //读入一行包括空格 for(int i=0;i<a.size();i++) { if(a[i]!=' '&&a[i]!='\n') ans++; } 打表和a 阅读全文
posted @ 2024-07-29 09:24 Hoshino1 阅读(12) 评论(0) 推荐(0)
  2024年7月27日
摘要: vj4补题 线段树+multiset(buhui) 原文链接:https://blog.csdn.net/m0_64158084/article/details/127790615 补充)set和mutiset 一个自动去重,一个不去重。 字典树/map 题目:给你一个N x N的矩阵,矩阵由小写字 阅读全文
posted @ 2024-07-27 09:21 Hoshino1 阅读(22) 评论(0) 推荐(0)
  2024年7月25日
摘要: 1. vj团队赛3补题(上午 vj题解 https://blog.nowcoder.net/n/33590b62f85540cba97c55026be98480 https://www.cnblogs.com/ch-hui/p/12767416.html 代码板子 #include<bits/std 阅读全文
posted @ 2024-07-25 21:51 Hoshino1 阅读(11) 评论(0) 推荐(0)
摘要: 算法竞赛(差分)(上午) 初始化 #include <algorithm> int arr[100]; std::fill(arr, arr + 100, 0); //比memset更高效 int arr[100] = {}; // 所有元素都初始化为 0 栈溢出 为局部变量每次运行时都在运行栈中分 阅读全文
posted @ 2024-07-25 18:48 Hoshino1 阅读(19) 评论(0) 推荐(0)
  2024年7月24日
摘要: 算法竞赛(二分) (上午) 图论+二分 P1462 //邻接表实现无边权 vector<int> g[maxn]; g[x]push_back(y); g[y]push_back(x); //边权实现 #include <vector> using namespace std; const int 阅读全文
posted @ 2024-07-24 09:34 Hoshino1 阅读(13) 评论(0) 推荐(0)