Finite Encyclopedia of Integer Sequences

题目描述
In Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of lengths between 1 and N (inclusive) consisting of integers between 1 and K (inclusive) are listed.
Let the total number of sequences listed in FEIS be X. Among those sequences, find the (X⁄2)-th (rounded up to the nearest integer) lexicographically smallest one.

Constraints
1≤N,K≤3×105
N and K are integers.

 

输入
Input is given from Standard Input in the following format:
K N

 

输出
Print the (X⁄2)-th (rounded up to the nearest integer) lexicographically smallest sequence listed in FEIS, with spaces in between, where X is the total number of sequences listed in FEIS.

 

样例输入
3 2

 

样例输出
2 1 

 

提示

There are 12 sequences listed in FEIS: (1),(1,1),(1,2),(1,3),(2),(2,1),(2,2),(2,3),(3),(3,1),(3,2),(3,3). The (12⁄2=6)-th lexicographically smallest one among them is (2,1).

需要找出规律

当k为偶数时,输出k/2,k, k...共n项

当k为奇数时,算了,上官方的吧,我也写不出来了...

然后我也编了一组数据,从(1,3,3)倒着带入程序就好理解le

.....(1,1,1)   (1,1,2)  (1,1,3)(1,2,1)(1,2,2)  (1,2,3)  (1,3,1)  (1,3,2)  (1,3,3)

#include<bits/stdc++.h>
using namespace std;
const int m = 1e5;
typedef long long ll;
ll a[3*m+5];
int main()
{
    int k,n;
    cin>>k>>n;
    if(k%2==0)
    {
        cout<<k/2<<" ";
        for(int i = 2; i <= n; i++)
        cout<<k<<" ";
    }
    else
    {
        for(int i = 1; i <= n; i++)
        a[i] = (k+1)/2;
        int len = n;
        for(int i = 1; i <=  n/2; i++)  //模拟 ,模拟次数找规律 
        {
            if(a[len] == 1)    len--;
            else
            {
                for(int j = len+1; j <= n; j++)
                a[j] = k;  
                a[len]--;
                len = n; 
            }
        }
        for(int i = 1; i <= len; i++)
        cout<<a[i]<<" ";
    }
    return 0;
}

好吧,终于写完了,hhhhaaa,有错误望指出Ooooooo

 

转载于:https://www.cnblogs.com/lwsh123k/p/9419087.html

有限创新速率(finite-rate-of-innovation)是指在一定时间内创新的速率有限。这个概念最早由Mathe Zibulevsky等人提出,并应用于信号处理中的稀疏表示算法。 在稀疏表示算法中,通常假设信号是以某些基向量的线性组合表示的,而稀疏表示算法的目标就是通过选择尽量少的基向量来近似原始信号。然而,如果信号的创新速率较高,即信号中出现的细节和特征的变化较快,那么传统的稀疏表示算法可能无法精确地捕捉到信号中的全部信息。 有限创新速率的概念是为了解决这个问题。它假设信号在一段时间内的变化相对较慢,并且引入了一种慢变化模型,即假设信号的创新速率是有限的。在这种情况下,可以通过在信号的表示中引入一些先验知识和约束条件,来提高稀疏表示的准确性。这些约束条件可以是基于信号本身的性质,也可以是来自外部领域知识的先验信息。 有限创新速率的概念在稀疏表示算法中被广泛应用,并且在信号处理和图像处理等领域取得了很好的效果。它提供了一种有效的方法来处理变化较快的信号,提高信号表示的精度和稳定性。同时,由于引入了先验知识和约束条件,这种方法也可以有效地减少所需的计算量和存储空间,提高算法的效率和实用性。 有限创新速率的概念在现代科学和工程中具有一定的重要性,它为我们理解和处理快速变化的信号提供了有益的思路和方法。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值