会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
勿忘安己
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
下一页
2019年1月13日
发财兔1A
摘要: 题目描述 给定一个长度为n的正整数序列a[i],计算出有多少个i<j的数对,a[i]+a[j]为二的次幂,也就是说存在一个正整数x满足a[i]+a[j]==2^x。 输入 第一行一个整数n。第二行n个整数,其中第i个整数为a[i]。 输出 一行一个整数表示数对的数量。 样例输入 复制样例数据 样例输
阅读全文
posted @ 2019-01-13 19:17 勿忘安己
阅读(183)
评论(0)
推荐(0)
2018年12月25日
字典树模板及解析(基于数组)
摘要: //这里找后m个字符串分别是前面n个字符串的多少的前缀#include<bits/stdc++.h>using namespace std;const int maxn =1e6+5;int tree[maxn][30];int sum[maxn];int tot;void insert_(char
阅读全文
posted @ 2018-12-25 17:33 勿忘安己
阅读(318)
评论(0)
推荐(0)
2018年10月6日
diji
摘要: #include using namespace std; #define maxn 100005 struct Edge { int v,w,next; } edge[maxn]; int head[maxn]; int cnt; int n,m; void addedge(int u,int v,int w) { edge[cnt].v=v; edge[cnt].w...
阅读全文
posted @ 2018-10-06 10:43 勿忘安己
阅读(229)
评论(0)
推荐(0)
2018年9月12日
逆序对模板
摘要: #include #include #include #include #include #include using namespace std; const int N=550005; int n,a[N],c[N]; long long ans; void ready() { cin>>n; for(int i=1;i>a[i]; } inline void msort(int l...
阅读全文
posted @ 2018-09-12 22:18 勿忘安己
阅读(120)
评论(0)
推荐(0)
2018年8月25日
沙盘游戏(2017绍兴市第十五届少儿信息学竞赛复赛试题)
摘要: 沙盘游戏 Ivy是如此地喜欢编程,以至于在面对游戏时也是如此。在沙盘游戏中有一个巨大的方形沙盘(长方形或者正方形),该沙盘被分隔成边长为1的小方格,每个小方格内有一个整数。沙盘玩家需要在沙盘中圈出一个方形(长方形或者正方形都可以)的区域(必须沿着小方格的边界划线,不能穿过小方格的内部),目标是争取被
阅读全文
posted @ 2018-08-25 10:49 勿忘安己
阅读(1371)
评论(0)
推荐(0)
2018年8月19日
读入挂(整型)
摘要: inline int read(){ int x = 0,f = 1; char c = getchar(); while ((c '9') && c != EOF) { if (c == '-') f = -1; c = getchar(); } while ((c ='0') && c != EOF) {...
阅读全文
posted @ 2018-08-19 09:34 勿忘安己
阅读(161)
评论(0)
推荐(0)
2018年8月10日
求和VII
摘要: master对树上的求和非常感兴趣。他生成了一棵有根树,并且希望多次询问这棵树上一段路径上所有节点深度的k次方和,而且每次的k可能是不同的。此处节点深度的定义是这个节点到根的路径上的边数。他把这个问题交给了pupil,但pupil并不会这么复杂的操作,你能帮他解决吗 输入 第一行包含一个正整数n,表
阅读全文
posted @ 2018-08-10 16:56 勿忘安己
阅读(252)
评论(0)
推荐(0)
2018年8月8日
竞赛头文件及基础函数(较完备)
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF 0x3f3f3f3f #define FAST_IO ios::sync_with_stdio(false) const ...
阅读全文
posted @ 2018-08-08 17:03 勿忘安己
阅读(137)
评论(0)
推荐(0)
2018年8月7日
BSGS(模板)
摘要: 用于解决A=g^a mod P中计算a
阅读全文
posted @ 2018-08-07 20:43 勿忘安己
阅读(118)
评论(0)
推荐(0)
2018年8月3日
KMP(模板)
摘要: 字符串匹配;返回第一个匹配的首字母位置;
阅读全文
posted @ 2018-08-03 11:07 勿忘安己
阅读(91)
评论(0)
推荐(0)
上一页
1
2
3
4
下一页
公告