上一页 1 2 3 4 5 6 7 8 ··· 17 下一页
摘要: 题目链接:https://www.luogu.com.cn/problem/P3379 方法一:暴力求公共祖先 1.向上标记法(重点了解26-44行) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, m, s; 4 const in 阅读全文
posted @ 2022-04-19 15:57 TFLSNOI 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P3865 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e5+10; 4 int n, m; 5 int a[maxn], f[max 阅读全文
posted @ 2022-04-18 15:44 TFLSNOI 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://vjudge.net/problem/POJ-3368#author=ljc1113 1 #include<cstdio> 2 #include<cmath> 3 #include<algorithm> 4 using namespace std; 5 const int 阅读全文
posted @ 2022-04-15 18:12 TFLSNOI 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P2880 1 #include<cstdio> 2 #include<cmath> 3 #include<algorithm> 4 using namespace std; 5 const int maxn=5e4+10; 阅读全文
posted @ 2022-04-15 15:22 TFLSNOI 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://www.luogu.com.cn/problem/P3916 链式前向星详细教程:https://www.bilibili.com/video/BV13r4y1X7a4/?spm_id_from=333.788 1 #include<bits/stdc++.h> 2 con 阅读全文
posted @ 2022-04-14 19:03 TFLSNOI 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 线段树的节点类型 1 const int maxn = 1e5; 2 typedef struct Node { 3 int left; //节点所维护区间的左边界 4 int right; //节点所维护区间的右边界 5 int data; //节点的数据 6 int lazy; //节点的懒惰标 阅读全文
posted @ 2022-04-12 17:29 TFLSNOI 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 题目连接:https://ac.nowcoder.com/acm/problem/214618 1 #include<bits/stdc++.h> 2 using namespace std; 3 int t; 4 int n, q; 5 int a[100010]; 6 int x; 7 int 阅读全文
posted @ 2022-03-24 11:39 TFLSNOI 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<cmath> 3 #include<cstring> 4 using namespace std; 5 6 //最大公约数 (辗转相除循环法) 7 int gcd(int a, int b) 8 { 9 while(b) 10 { 11 阅读全文
posted @ 2022-03-23 17:18 TFLSNOI 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://ac.nowcoder.com/acm/problem/208337 对于 其实是二进制的不进位运算, 因此有公式。该公式表示 二进制位上均为 1 的相加会进位。那么 其中需要满足 且 与 二进制位上不能有相同的,否则输出-1. 1 #include<bits/stdc++ 阅读全文
posted @ 2022-03-20 18:13 TFLSNOI 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://ac.nowcoder.com/acm/problem/205085 1 #include<bits/stdc++.h> 2 using namespace std; 3 int t; 4 int n, a; 5 int ans; 6 int main() 7 { 8 ci 阅读全文
posted @ 2022-03-20 17:44 TFLSNOI 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://ac.nowcoder.com/acm/problem/23483 1 #include<bits/stdc++.h> 2 using namespace std; 3 long long a[5000010]; 4 int n; 5 bool cmp(long long 阅读全文
posted @ 2022-03-20 17:15 TFLSNOI 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.luogu.com.cn/problem/P1469 异或运算 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n; 4 int a; 5 int ans=0; 6 int main() 7 { 8 cin 阅读全文
posted @ 2022-03-20 16:12 TFLSNOI 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://ac.nowcoder.com/acm/problem/21882 1 #include<bits/stdc++.h> 2 using namespace std; 3 int t; 4 long long n; 5 int main() 6 { 7 cin>>t; 8 w 阅读全文
posted @ 2022-03-15 09:54 TFLSNOI 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://ac.nowcoder.com/acm/problem/218048 方法一:数组 1 #include<bits/stdc++.h> 2 using namespace std; 3 int a, b; 4 long long aa, bb; 5 int ejza[20] 阅读全文
posted @ 2022-03-12 22:13 TFLSNOI 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1970 洛谷地址:https://www.luogu.com.cn/problem/P2670 本题的难点,1、是字符及字符串的出入输出 2、四个方向的遍历 方法一:有BUG #include< 阅读全文
posted @ 2022-02-27 22:41 TFLSNOI 阅读(128) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 17 下一页