chibi专题

UVA12983 The Battle of Chibi

文章目录 R e s u l t Result Result H y p e r l i n k Hyperlink Hyperlink D e s c r i p t i o n Description Description S o l u t i o n Solution Solution C o d e Code Code R e s u l t Result R

The Battle of Chibi[树状数组+DP]

传送门 f[i][j] 表示1--i 选j个的情况  先离散化 , 然后开n个树状数组分别维护 f[][j]   #include<bits/stdc++.h>#define N 1005#define Mod 1000000007#define LL long longusing namespace std;int T,n,m,a[N],b[N];LL f[N][N],