摘要: #include <bits/stdc++.h>using namespace std;string s;stack<double>ac;bool op(char c){ if(c=='+'||c=='-'||c=='*'||c=='/'){ return 1; } else return 0;}i 阅读全文
posted @ 2020-02-29 14:31 lhl1020 阅读(547) 评论(1) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; #define maxn 40 int prime[maxn]; int visit[maxn]; void Prime(){//埃氏筛法 memset(visit,0,sizeof(visit)); //初始 阅读全文
posted @ 2019-12-07 13:00 lhl1020 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 大概解决问题:给定优先级关系,输出依次顺序 方法:先把最低级的放入vector,最后反向输出即可。 #include<bits/stdc++.h> using namespace std; const int MAXN=30030; bool vis[MAXN]; int in[MAXN]; int 阅读全文
posted @ 2019-11-17 13:40 lhl1020 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Have you ever heard of the word "six degrees of separation"? It is said that two individuals are connected by at most five others. Lee is wondering ab 阅读全文
posted @ 2019-11-16 13:37 lhl1020 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 统计区间数字个数 #include<bits/stdc++.h> using namespace std; #define CL(a,b) memset(a,b,sizeof(a))//简化代码 #define MAXN 100010 struct node { int l,r,s; } t[MAX 阅读全文
posted @ 2019-11-09 14:11 lhl1020 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 重点:理解next数组的含义,减少循环的时间。 阅读全文
posted @ 2019-10-04 13:27 lhl1020 阅读(299) 评论(0) 推荐(0) 编辑
摘要: An equal sum partition of a sequence of numbers is a grouping of the numbers (in the same order as the original sequence) in such a way that each grou 阅读全文
posted @ 2019-09-22 15:26 lhl1020 阅读(73) 评论(0) 推荐(0) 编辑
摘要: George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the origina 阅读全文
posted @ 2019-09-22 14:11 lhl1020 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Using each of the digits 1, 2, 3,...,D1 exactly once to form D1 digit numbers, how many are divisible by D2. 输入 The input data will contain multiple c 阅读全文
posted @ 2019-09-22 13:37 lhl1020 阅读(125) 评论(0) 推荐(0) 编辑