摘要:
将博客搬至CSDN 阅读全文
摘要:
直接找规律就可以打表 开始是2,+2后,变成4,开方变成2,等级为2, 2/2 = 1 然后2 + 17 2 = 36,开方后变成6 等级为3, 6/3 = 2 然后6 + 46 3 = 144,开方后变成12 等级为4 12/4 = 3 然后12 + 97 4 = 400 开方后变成20 等级为5 阅读全文
摘要:
水题,每次截取长度为26的字符串,然后直接进行修改就可以 然而本弱渣昨天wa看很久 include using namespace std; int n,c; int ans[30]; int main() { string s; cin s; int tt=0; int n=s.size(); i 阅读全文
摘要:
#include using namespace std; int n,c; int a[1000000]; int main() { cin>>n>>c; if(n==1) { cout>a[i]; } for(int i=0;i 阅读全文
摘要:
枚举每一条边 将树分为两部分 分别dfs求出树的直径 从一点开始最长路加次长路为树的直径 #include<iostream> #include<vector>#include<algorithm>using namespace std;vector<int> G[100000];int n,s;i 阅读全文
摘要:
#include<iostream>#include<vector>#include<algorithm>using namespace std;struct edge{ int to,cost;};vector<edge> G[10000];int main(){ int v,e; while(c 阅读全文
摘要:
题意:让你构造一个序列,使得序列异或和最大,序列为n 的全排列 ,序列和计算方式为 SUM = a[1] ^ 0 + a[2] ^ 1 + a[3] ^ 2 + .......a[n] ^ n 感想 :之前没做过有关位运算的题,对这一块很陌生,两个数异或以后,如果二进制每一位都为1,那么一定最大,找 阅读全文
摘要:
题意:给n个数 m次操作 操作方式为 count 统计区间里的幸运数字都多少个 add给区间里每个数都加上一个值 网上的大牛都是用树状数组写的 线段树也可以解决 只是有点悬 刚学线段树 借此加强知识储备和代码能力 线段树单点更新 谢谢各位指教 #include<iostream> #include< 阅读全文