摘要: 关于string 学习笔记 在ACM竞赛中string是一个极其重要和用途广泛已封装的函数 转载自 https://blog.csdn.net/qq_37941471/article/details/82107077 1.声明一个C++字符串声明一个字符串变量很简单:string Str;这样我们就 阅读全文
posted @ 2020-10-15 10:48 Wh1te 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线, 这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2, 就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的路 阅读全文
posted @ 2020-10-14 16:48 Wh1te 阅读(65) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; typedef long long ll; ll a[100001]; ll b[100001]; int main() { int n, i; cin>>n; for(i=0; i<n; i++) cin>> 阅读全文
posted @ 2020-09-25 18:50 Wh1te 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; typedef long long ll; int a[100000]; int main() { int t; cin>>t; while(t--) { int n,x; int sum = 0; cin>> 阅读全文
posted @ 2020-09-17 16:07 Wh1te 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 枚举sum 2 -> 2*n 即可 #include<bits/stdc++.h> using namespace std; typedef long long ll; int a[100000]; int b[100000]; int main() { int t; cin>>t; while(t 阅读全文
posted @ 2020-09-15 14:21 Wh1te 阅读(156) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<algorithm> #include<cstring> #include<vector> #include<map> #include<cmath> #include<cstdio> #include<queue> typedef long 阅读全文
posted @ 2020-08-30 09:01 Wh1te 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 9:38am; 初步设想:线段树覆盖 从根节点开始 对已给区间进行染色 如果查询区间 有未被染色部分 则输出 -1 10:24am; 但我寻思着?咋统计最小个数? CTRL + A 10:40 灵光乍现 从查询的左节点依次开始往后覆盖,如果后面节点的长度 > 查询节点节点覆盖的最长 长度 那我ans 阅读全文
posted @ 2020-08-07 16:26 Wh1te 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 线段树本质为二叉搜索树 每个节点以结构体方式储存 (结构体需开4倍空间大小) 包含 { 区间左端点 l; 区间右端点 r; (需要维护的信息); } struct node { int l,r,val; }tree[maxn]; 基础思路为二分 在结构体储存中tree[i]中 子节点为 2*i 与 阅读全文
posted @ 2020-08-04 13:27 Wh1te 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 图论 (菜的扣jio 啥也不会) 题目分析: A 签到题 注意向上取整 题面 sy总是喜欢做一些非常没有意义的事情,比如和Mannix比赛短跑。 众所周知Mannix是短跑冠军,所以他准备先让sy跑一会儿,但是此时会发生一些比较尴尬的事情,比如装B失败输掉了比赛。sy想知道Mannix装多大的B才能 阅读全文
posted @ 2020-08-02 16:36 Wh1te 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 等我研究出来链式前向星的写法再回来更新,先贴看了其他博客的 (棋盘的长宽 为集合A 和 集合B) 为保证 车不相互打架 集合AB二分匹配 删除其中一条边 如果与标准的结果相同 则不是重要边,反之sum++; #include<iostream> #include<algorithm> #includ 阅读全文
posted @ 2020-08-01 13:52 Wh1te 阅读(89) 评论(0) 推荐(0) 编辑