E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
ans
hdu 3294 Girls' research
b:a;}intmain(){inti,id,mx,max,n,j,
ans
,m;while(scanf("%s
lihaogegehuting
·
2020-08-24 22:47
HDU
poj
manacher
manacher
HDOJ 4512 - 吉哥系列故事——完美队形I
include#include#include#include#definelllonglong#defineoo1000000000usingnamespacestd;inth[205],n,dp[205],
ans
kk303
·
2020-08-24 22:26
动态规划
洛谷P1379_八数码游戏
0,1,0,-1};intdc[4]={-1,0,1,0};intbfs();boolcanmoveto(intu,intdir);intmoveto(intu,intdir);intmain(){intn,
ans
CoderCat.
·
2020-08-24 22:31
搜索
poj 1816
wa了几次,错在了判重上*j*jjjj应该是4但是由于*的存在,find递归是我的结果
ans
队列中应该有两个是4;所以输出时判断一下是否与前一个一样;#include#include#include#include
iwillsucceed555
·
2020-08-24 22:59
acm---字符串
UVa512 Spreadsheet Tracking
第一种,无脑模拟#include#include#definemaxd100#defineBIG10000intr,c,n,d[maxd][maxd],d2[maxd][maxd],
ans
[maxd][
virtu41
·
2020-08-24 22:44
算法竞赛入门经典第二版
c语言
算法
CodeFoeces-864B
;intmain(){intl;strings;setst;cin>>l>>s;intans=0;for(inti=0;i='a'&&s[i]<='z'){st.insert(s[i]);}else{
ans
ss5smi
·
2020-08-24 22:03
SCL--二分与lower_bound / upper_bound
lower_bound:intl=1,r=n,
ans
;while(l
ans=l;upper_bound
dingdi3021
·
2020-08-24 21:41
线段树套线段树 -转自CSDN博客nash142857 -POJ2155
#include#includeboolseg[4010][4010];intn,m,T,
ans
;voidudy(inti,intl,intr,intj,inty1,inty2){if(l==y1&&r
cnyali
·
2020-08-24 21:19
算法分享
程序代码
树形DP poj1741
,问两个点之间的dist(u,v)#include#include#include#includeusingnamespacestd;constintmaxn=1e5+10,inf=1e9;intk,
ans
as604412059
·
2020-08-24 21:45
树形dp
HDU 2825 Wireless Password (AC自动机 + 状压dp)
题意:给你m(m#include#include#includeusingnamespacestd;constintmod=20090717;voidadd(int&
ans
,intx){
ans
+=x;if
aozil_yang
·
2020-08-24 21:44
DP
HDU
AC自动机
字符串-字符串哈希-入门-bzoj2084
#include#definerep(i,l,r)for(inti=(l);i=(l);i--)usingnamespacestd;intn,
ans
TengWan_Alunl
·
2020-08-24 21:59
字符串-字符串哈希
树套树之线段树套线段树(POJ2155 Matrix)
开始时,A[i,j]均为0(1#includeboolg[4010][4010];intn,m,T,
ans
;voidupdate_y(inti,intl,intr,intj,inty1,inty2)
Sunshine_cfbsl
·
2020-08-24 21:26
树套树
树
POJ
kuangbin专题十七 HDU3065 AC自动机
题解:AC模板题,这道模板题在里面加个数组
ans
表示病毒的数量就可以了。
Start_to_crazy
·
2020-08-24 21:54
AC自动机
P1164 小A点菜(两种解法dfs+剪枝/dp)
voiddfs(intmoney,intindex){if(money==mon){
ans
++;return
Spidy_harker
·
2020-08-24 21:53
dfs
动态规划(dp)
Gym 102152 problem K Subarrays OR
以当遍历到a[i]时,得到[1,i-1],[2,i-1],[3,i-1]……的值,并分别与a[i]取或插入答案数组
ans
中。
S atur
·
2020-08-24 21:21
比赛&训练
【[HNOI2002]彩票】
刚开始想用动态规划,但是这是实数于是泡汤,最后看数据不是很大,于是采用搜索加上剪枝代码#include#include#include#includeusingnamespacestd;intn,m,
ans
Shikita
·
2020-08-24 21:50
洛谷博客
哈希函数--字符串哈希--hdu1800 Flying to the Mars
,下列hash函数的效率平均为0.67-0.69,3000/7003=0.43,hash值数组开得稍大比较合适//2.7003看起来像素数,适合取余intcnt[N],hashnum[N];intn,
ans
Falling~
·
2020-08-24 21:17
数论
BZOJ 1224 HNOI2002 彩票 DFS
左右所以考虑加剪枝上下界剪枝如果当前的情况下剩余的数最大都无法到达目标或最小都无法小于目标则剪枝#include#include#include#include#include#defineM60#defineEPS1e-10usingnamespacestd;intn,m,
ans
PoPoQQQ
·
2020-08-24 21:11
BZOJ
DFS
UVA - 512 Spreadsheet Tracking
include#include#definemaxd100#defineBIG10000usingnamespacestd;intr,c,n,d[maxd][maxd],d2[maxd][maxd],
ans
MrFox_
·
2020-08-24 21:05
【模板】字符串哈希
constintmaxn=1e6+10;constintbase=131;chars1[maxn],s2[maxn];unsignedlonglongpower[maxn],tot,h[maxn],l1,l2,
ans
K1385170
·
2020-08-24 21:21
hdu1496
当a、b、c、d符号相同的时候,
ans
=0;其余的时候,把正的放一边、负的挪到另一边,然后分别堆情况(注意堆出同一个数可能有不同的方法),如果两边都能堆出同一个数,那么:
ans
+=con1[i]*con2
Ice_Crazy
·
2020-08-24 21:16
各种水
|poj 2752|KMP|Seek the Name, Seek the Fame
includeusingnamespacestd;#definems(i,j)memset(i,j,sizeofi);constintMAXN=400000+5;chars[MAXN];intf[MAXN],n,
ans
NotFound1
·
2020-08-24 21:00
Poj/Hdu
字符串
-
KMP
[Codeforces17E]Palisection
题意求一个字符串的所有有交集的回文子串有多少对题解直接做貌似是做不了的,考虑到正难则反我们设回文串的总数是sumsum⇒
ans
=(sum2)−⇒
ans
=(sum2)−没有交集的回文串对数考虑怎么算没有交集的回文串对数我们考虑答案可以是
Kelin__
·
2020-08-24 21:48
回文自动机
HDU3868 HASH+随机增量
我们发现如果这个点能够与原集合中另外两点构成新的最近的三个点的话,那么另外的两个点与这个新加入的点的距离一定不超过r/2,证明如下:假设当前新加入点为C,且C与之前集合中的点A和B构成了新的最近的三个点,如下图所示,不妨设|AC|>=
ans
AcCry
·
2020-08-24 21:09
计算几何
解题报告
算法思想
pair
insert
算法
struct
null
c
SCU - 4438 Censor (哈希-字符串)
题目链接题意:给出一个word字符串和一个page字符串,要求不断重复把p中所有w串删去.输出最终结果(eg:w=abcp=aaabcbc=>
ans
=a)题解:经典字符串哈希题目.
Fushicho_XF
·
2020-08-24 21:20
哈希
Gym 102501 F Icebergs —— 贪心
那么我们枚举答案的位置,那么
ans
优先
天翼之城*
·
2020-08-24 21:59
想法
贪心
Luogu P1164 小A点菜
原题传送门#includeusingnamespacestd;intans[105][10005];//
ans
[i][j]表示在第i道菜之前花完j元的方法数,在main外已初始化为0intprice[105
_sophon
·
2020-08-24 21:46
Luogu
动规
HDU - 2072 单词数 trie树(非指针版) 统计不同单词数 || set
asdfasdf#include#include#include#includeusingnamespacestd;constintmaxn=1e6+10;inttr[100010][30];inttot,
ans
柒月 流火
·
2020-08-24 21:45
数据结构-----Trie树
STL
HDU4569-Special equations-小优化简单题
intkase=0;intfa;longlonga[10];longlongsov(longlongx,longlongmod){longlongans=a[n];for(inti=n;i>=1;i--){
ans
lyc1635566ty
·
2020-08-24 21:29
简单数学题
hdu3294 Girls' research(manacher)
#include#include#defineN200010charop[1],str[N],s[N=1&&i+p[i]
ans
)
ans
=p[i]-1,ansl=(i-p[i]+2)/2-1;if(i+p
Icefox_zhx
·
2020-08-24 20:58
其他oj
manacher
G - 前m大的数 HDU - 1280(水题)
include#include#include#include#includevoidfre(){system("clear"),freopen("A.txt","r",stdin);freopen("
Ans
.txt
做一只大熊猫
·
2020-08-24 20:12
#Hash
USACO Slowing down
SlowingdownJDOJ传送门DescriptionEverydayeachofFarmerJohn'sN(1usingnamespacestd;intn,c[100001],p[100001],
ans
anhaoti3785
·
2020-08-24 19:50
UVa.1587
不爽这题就是判断给出的六个面能否组成长方体1.判断能否两两对称2.判断对称的三个面中能否组成长方体(正方体也可以)以上#include#include#include#include//usingnamespacestd;char*
ans
郑斯道
·
2020-08-24 18:21
树状数组求逆序对
)表示[1,t]之间的数的个数在for循环新输入一个数的时候,逆序对的数量应该增加“比新加入的数大的数”的数量(前面插入的数的下标肯定比现在的小)如已经插入了431,现在插入2,那么逆序对应该增加2即
ans
这有点难啊
·
2020-08-24 17:59
树状数组
欧拉图
includeusingnamespacestd;constintmaxn=1e3+7;intv,e,top;intans[maxn*7];intmp[maxn][maxn];voiddfs(intx)//递归可走的边{
ans
>>777>>豆芽
·
2020-08-24 17:43
基础
jichu
AtCoder Context ABC 173 D - Chat in a Circle
i号玩家(1=n:breakans+=arr[i]endIndex+=1ifendIndex>=n:breakans+=arr[i]print(
ans
)calculate(N,AR
伟大不DIAO
·
2020-08-24 17:16
python3
中位数问题
题意:给定一个N个数的数组cat[i],并用这个数组生成一个新数组
ans
[i]。新数组定义为对于任意的i,j且i!
Tony_Y_a_n_g
·
2020-08-24 17:37
2017.8.8搜索课总结
2.如果当前体积+最大体积
ans
weixin_30823227
·
2020-08-24 17:56
uva 1368 - DNA Consensus String
includeconstintmaxn=1100;intA[maxn];intC[maxn];intG[maxn];intT[maxn];charans[maxn];intans_;intm,n;voidjudge(intpos){
ans
GejinZ
·
2020-08-24 16:32
算法竞赛题解
acm-icpc竞赛时光记
CodeChef March Challenge 2015
我有一种酷炫的计算方式:t=1/2时,
ans
=各个男生离各自最终位置的距离和。CountSubstring
loriex
·
2020-08-24 16:47
比赛
花店橱窗布置详解
如果Iusingnamespacestd;intf,v,a[1005][1005],dp[1005][1005],
ans
[1005][1005];voidprint(intx,inty){if(an
我要AK_IOI
·
2020-08-24 16:20
DP
动态规划
算法作业——集装箱装载问题(回溯)
vectorans;intbestw;intr;voiddfs(intcur,intnow,intrest,vector&res){if(rest+nown){if(now>bestw){bestw=now;
ans
sunmaoxiang
·
2020-08-24 16:14
CCF认证-20200602-稀疏向量
includeusingnamespacestd;usinggg=longlong;intmain(){ios::sync_with_stdio(false);cin.tie(0);ggni,ai,bi,xi,yi,
ans
日沉云起
·
2020-08-24 16:31
CCF
宗教信仰(并查集)
你的学校有n名学生(0#includeconstintmaxn=50005;intfa[maxn],
ans
,m,n,a,b,tot=1;boolflag[maxn];voidmakeSet(intn)/
密码锁
·
2020-08-24 15:22
并查集
leetcode 526. 优美的排列
problems/beautiful-arrangement/submissions/题目描述假设有从1到N的N个整数,如果从这N个数字中成功构造出一个数组,使得数组的第i位(1int:vis=[0]*(N+1)
ans
万古星空悬皓月
·
2020-08-24 15:33
刷题
UVA-10935 Throwing cards away I 【队列+模拟】
#include#includeusingnamespacestd;intmain(){intn;while(scanf("%d",&n)&&n){queueq,
ans
;for(inti=1;i1){
ans
.push
北里五井
·
2020-08-24 15:59
刷题
CodeForces-740A (分类)
http://codeforces.com/problemset/problem/740/A题意:给定n,a,b,c分别表示:目前已经买了n本书书的价格:a元可买1本书,b元可买2本书,c元可买3本书求
ans
旷野虽远
·
2020-08-24 15:42
codeforces
Codeforces #664(Div.2) A~C
,b>0)(变色两次(>0偶次)后,所有数字的奇偶没有变,没有意义变色三次(>1奇次)后,得到的数字的奇偶与变一次相同,没意义)B题C题c1|c2…cn=A,则,对任意的i(1~n),ci|A=A枚举
ans
雷德梅恩
·
2020-08-24 15:19
Codeforces
树状数组-并查集
intlowbit(intx){returnx&(-x);}voidupdate(intx,inty){while(x0){
ans
+=c[x];x-=lowbit(x);}returnans;}给你一个初始全为
krispper
·
2020-08-24 14:48
hdu5273(区间逆序对的个数)
解答方法就是先算出
ans
[0][1...N-1]的结果,然后根据再来算
ans
[i][i+1...N-1](0#include#include#include#include#include#includeusingnamespacestd
MarchOrHome
·
2020-08-24 14:09
Algorithm
上一页
61
62
63
64
65
66
67
68
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他