文章分类 - CF题目合集
摘要:>>>不在x->y路径上的 mid point 的旁生点 >>>1. mid point == LCA -> siz[1]-siz[LCA->x]-siz[LCA->y] -> dep[x]==xep[y] >>>2. mp!=LCA ->先到LCA再计算 siz[mp]-siz[mp->x] (m
阅读全文
posted @ 2023-08-10 10:08
JMXZ
摘要:>>> /3 -> 遍历一遍就可以了 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd
阅读全文
posted @ 2023-08-09 23:19
JMXZ
摘要::::素都会根据元素的键值自动排序 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd p
阅读全文
posted @ 2023-08-05 11:08
JMXZ
摘要:>>>圆 不相交 》》》 可能在同一个 圆形 ——整形运算 快于 double —— 强制转换 ans=(double) int/int -> double or int 因为double也可以有整数 #include<cstdio> #include<cstring> #include<iostr
阅读全文
posted @ 2023-08-04 17:20
JMXZ
摘要:>>>迭代时,不要初始化 》》》想清楚再coding /* #include<bits/stdc++.h> using namespace std; const int X[]={1,0,-1,0}; const int Y[]={0,1,0,-1}; int n,m,a[1005][1005],f
阅读全文
posted @ 2023-07-25 08:09
JMXZ
摘要:坍塌只与 上面的有关 》》》数组多开+循环时检查 》》》运行时 闪退 基本就是 segment ERROR #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h
阅读全文
posted @ 2023-07-24 23:00
JMXZ
摘要:先想一想再做 ,用自己的话说一遍 //对 vector 不熟 g[][] #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long
阅读全文
posted @ 2023-07-23 18:27
JMXZ
摘要:#include<bits/stdc++.h> using namespace std; typedef long long ll; void tc(){ ll n; cin>>n; for(ll i=0;i<n;i++){ ll x; cin>>x; cout<<n+1-x<<' '; } cou
阅读全文
posted @ 2023-07-21 14:17
JMXZ
摘要:#include <iostream> #include <cstring> #include<bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int ca[N * 2], cb[N * 2],a[N<<1]; /* void g
阅读全文
posted @ 2023-07-19 17:50
JMXZ
摘要://已是回文 #include<bits/stdc++.h> #define int long long using namespace std; inline int read(){ int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){ if
阅读全文
posted @ 2023-07-18 22:15
JMXZ
摘要:画出队列 ->op1,op2操作的都是相同位置的数字 #include<iostream> #include<algorithm> #include<cmath> #include<cstdio> #include<cstring> #include<vector> using namespace
阅读全文
posted @ 2023-07-17 19:39
JMXZ
摘要:->把玩数据->分类讨论-> 段数+1==ans -》数组遍历时 不要 i+1 -》溢出 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define
阅读全文
posted @ 2023-07-16 07:40
JMXZ