上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1388 方法一:普通模拟,结构体写法 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 阅读全文
posted @ 2021-01-08 11:25 TFLSNOI 阅读(478) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1389 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, m, a, b; 4 char c; 5 struct qq{ 6 int fa 阅读全文
posted @ 2021-01-07 19:06 TFLSNOI 阅读(378) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1385 1 #include<bits/stdc++.h> 2 using namespace std; 3 int fa[1005]; 4 vector<int> dr[1005];//记录每个人的敌人 阅读全文
posted @ 2021-01-06 10:17 TFLSNOI 阅读(703) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P1305 本题按照自己理解,如果N个字符串是乱序输入的话,需要先找根再从根先序遍历,便有如下代码: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n; 4 string 阅读全文
posted @ 2021-01-02 16:41 TFLSNOI 阅读(143) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P5076 模版题 1 #include<cstdio> 2 #include<set> 3 using namespace std; 4 multiset<int>ms; 5 int q, op, x; 6 int main() 7 阅读全文
posted @ 2020-12-31 15:14 TFLSNOI 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int MAXN=1024; 4 struct node{ 5 int val; // val:该节点储存的数值 6 int lch, rch; // lch: 左子树根节点编号,rch 阅读全文
posted @ 2020-12-22 17:51 TFLSNOI 阅读(182) 评论(0) 推荐(1) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1370 一:炸堆操作 1 #include<iostream> 2 #include<queue> 3 using namespace std; 4 priority_queue <int ,vector 阅读全文
posted @ 2020-12-17 16:39 TFLSNOI 阅读(685) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1369 写法一:手写优先队列 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int MAX_N=30005; 4 int h[MAX_ 阅读全文
posted @ 2020-12-16 10:36 TFLSNOI 阅读(562) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int Max_N; 4 5 //1.树的节点定义 6 struct node{ 7 char val;//结点值 8 int lch, rch;//左右儿子(指向结构体数组下标) 9 阅读全文
posted @ 2020-12-14 14:07 TFLSNOI 阅读(164) 评论(1) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1367 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, x; 4 int ans; 5 struct node{ 6 int data, 阅读全文
posted @ 2020-12-10 08:41 TFLSNOI 阅读(376) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1365 NOIP2004-pj组 方法一:笨办法建棵树--从上往下递归 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n; 4 string 阅读全文
posted @ 2020-12-09 20:20 TFLSNOI 阅读(485) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1340 写法一:结构体指针 1 #include<bits/stdc++.h> 2 using namespace std; 3 struct node {//树结点 4 char data;//存放值 阅读全文
posted @ 2020-12-06 16:47 TFLSNOI 阅读(760) 评论(0) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1337 1 #include<bits/stdc++.h> 2 using namespace std; 3 char s[100005]; 4 int tot=0;//编号 5 int trie[100 阅读全文
posted @ 2020-12-04 14:11 TFLSNOI 阅读(297) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/problem/213483 写法一:手写二分答案 1 //x<=ai+aj<=y; 2 //x-ai<=aj aj<=y-ai; 3 //a个数的排列方式对最后的答案不会产生影响,那么就可以对a个值排序枚举每个ai,二分处理答案 4 #inc 阅读全文
posted @ 2020-12-02 11:01 TFLSNOI 阅读(197) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/contest/8997/B 方法一: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int f[4][2]={{0,1},{-1,0},{0,-1},{1,0}}; 4 int n; 5 阅读全文
posted @ 2020-12-01 23:03 TFLSNOI 阅读(115) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页