摘要:
//Circle_queue 头文件名 #ifndef CIRCLE_QUEUE_H //就是头文件名(全大写后加个_H #define CIRCLE_QUEUE_H 代码 #endif 阅读全文
摘要:
P8599 [蓝桥杯 2013 省 B] 带分数 暴力,全排列 #include<bits/stdc++.h> using namespace std; int a[11]={0,1,2,3,4,5,6,7,8,9}; int m,ans; int tosum(int l,int r) { int 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; char a[1010],b[1010]; int ans; int key=0;//置为0表示关闭计数 int main() { scanf("%s",a); scanf("%s",b); for(int i 阅读全文
摘要:
P8647 [蓝桥杯 2017 省 AB] 分巧克力 暴力做法(60分) #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int a[N],b[N]; int n,k,sum; bool judge(int x) { 阅读全文
摘要:
^异或 相同为0,不同为1; ① ^1例如a^=1,开灯或者关灯,改变状态 ② 阅读全文
摘要:
L2-002 链表去重 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int f[N],n,m,p[N],q[N]; struct LAN { int z; int nz; }lan[N]; int main() { 阅读全文
摘要:
L2-003 月饼 #include<bits/stdc++.h> using namespace std; int n,need; struct Value { double a,b,v; }val[1010]; bool cmp(Value x,Value y) { return x.v>y.v 阅读全文
摘要:
L2-005 集合相似度 #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,m,t; set<int>s[51];//此题主要考虑用set来解决 cin>>n; for(int 阅读全文
摘要:
L2-008 最长对称子串 对给定的字符串,本题要求你输出最长对称子串的长度。例如,给定Is PAT&TAP symmetric?,最长对称子串为s PAT&TAP s,于是你应该输出11。 输入格式: 输入在一行中给出长度不超过1000的非空字符串。 输出格式: 在一行中输出最长对称子串的长度。 阅读全文
摘要:
L2-011 玩转二叉树 给定一棵二叉树的中序遍历和前序遍历,请你先将树做个镜面反转,再输出反转后的层序遍历的序列。所谓镜面反转,是指将所有非叶结点的左右孩子对换。这里假设键值都是互不相等的正整数。 输入格式:输入第一行给出一个正整数N(≤30),是二叉树中结点的个数。第二行给出其中序遍历序列。第三 阅读全文