E - Decrease (Judge ver.) Time limit : 2sec / Memory limit : 256MB Score : 600 points Problem Statement We have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence until the largest…
每次将最大的数减到n以下,如此循环直到符合题意. 复杂度大概是n*n*log?(?). #include<cstdio> #include<iostream> #include<algorithm> using namespace std; int n; typedef long long ll; ll ans,a[60]; int main(){ scanf("%d",&n); for(int i=1;i<=n;++i){ cin&g…
从n个t变化到n个t-1,恰好要n步,并且其中每一步的max值都>=t,所以把50个49当成最终局面,从这里开始,根据输入的K计算初始局面即可. #include<cstdio> #include<iostream> using namespace std; typedef long long ll; ll K; int main(){ cin>>K; int n=50; printf("%d\n",n); ll a=K/(ll)n; ll b…