### 样例

#### 输入

2
4
1 2 3 4
4
1 3 2 4

#### 输出

Case #1: 4 6 4 1
Case #2: 4 5 2 0

### 代码

// Array_Division.cpp : Defines the entry point for the console application.

#include
#include
#include
#include
#define mod 1000000007
#define maxn 10010
#define maxm 229
using namespace std;
int f[maxn][maxm],a[maxn],n;
struct BT{
int t[maxn];
int sum(int p){int r=0;while(p)r+=t[p],r%=mod,p-=(p&-p);return r;}
}d[221];
int main(){
ios::sync_with_stdio(false);
int T;cin>>T;for (int i=1;i<=T;i++){
cout<<"Case #"<>n;
for (int i=1;i<=n;i++)
cin>>a[i];
for(int i=1;i<=n;i++){
f[i][1]=1;
if (i==1) continue;
for(int l=1;l<=min(maxm,n);l++){
int x=d[l].sum(a[i]-1);
if (!x) break;
f[i][l+1]=x%mod;
cout<
 
 Share 【百度之星 2018 资格赛】整数规划 / 题解 原题地址 [http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=820&… 07 Aug 2018 【学习笔记】线性基 原理 坑。 例题 P哥的桶 首先有一道很水的例题 [https://www.luogu.org/problemnew/show/T37302]… 04 Aug 2018 
 
 
 Zepto's © 2024 Data & privacy Contact → Published with Ghost • Theme Attila • System theme 
 $(document).ready(function () { var viewport =$(window); var post = $('.post-content'); // Responsive videos with fitVids post.fitVids(); // Format code blocks and add line numbers function codestyling() {$('pre code').each(function(i, e) { // Code highlight hljs.highlightElement(e); // No lines for plain text blocks if (!$(this).hasClass('language-text')) { var code =$(this); // Calculate amount of lines var lines = code.html().split(/\n(?!$)/g).length; var numbers = []; if (lines > 1) { lines++; } for (i = 1; i < lines; i++) { numbers += '<span class="line" aria-hidden="true">' + i + '</span>'; } code.parent().append('<div class="lines">' + numbers + '</div>'); } }); } codestyling(); // Reading progress bar on window top function readingProgress() { var postBottom = post.offset().top + post.height(); var viewportHeight = viewport.height(); var progress = 100 - (((postBottom - (viewport.scrollTop() + viewportHeight) + viewportHeight / 3) / (postBottom - viewportHeight + viewportHeight / 3)) * 100);$('.progress-bar').css('width', progress + '%'); (progress > 100) ? $('.progress-container').addClass('complete'):$('.progress-container').removeClass('complete'); } readingProgress(); // Trigger reading progress viewport.on({ 'scroll': function() { readingProgress(); }, 'resize': function() { readingProgress(); }, 'orientationchange': function() { readingProgress(); } }); });