download:Node.js+Koa2 framework ecological combat – from zero simulation sina Weibo

This course is a pure practice project, developing a micro-blog system with complete basic functions from zero simulation (including registration, login, following and retrieving, micro-blog browsing, creation and reply, @ following and other functions), taking you to complete the comprehensive technical practice of the whole Koa2 framework ecology, including all kinds of middleware, MySQL database design, Finally, we’ll take you through the entire development process and summarize the best practices of Node.js from a technical perspective

Suitable for people who have node.js foundation but want to continue to improve their ability

#include

using namespace STD; #define int long long const int N=3e5+5; int n,a[N]; int cnt=1,flag,res=0; signed main(){ cin>>n; if(n==1) return printf(“0\n”),0; for(int i=1; i<=n; ++i) scanf(“%lld”,&a[i]); n=unique(a+1,a+1+n)-a-1,flag=a[2]-a[1]; for(int i=2; i

0); // printf(“%d\n”,cnt); for(; cnt>1; cnt>>=1,res++) if(cnt&1) cnt++,flag=0; return printf(“%lld\n”,res+(flag<0)),0; } Problem B you find that the two operations are completely equivalent to deleting (\ Max) or (\min) from two numbers, and then you can delete one of the last remaining numbers, (1), and then count at will.
;>

#include

using namespace std; #define int long long const int N=1e6+5; const int MOD=998244353; int n,a[N],res=0; int fac[N],ifac[N],ksm[N<<1]; int qpow(int x,int k){ int res=1; for(; k; k>>=1,x=x

x%MOD)

if(k&1) res=res

x%MOD;

return res;

}

int cal(int n,int m){

return fac[n+m]

ifac[n]%MOD

ifac[m]%MOD;

}

int f(int n,int m){

return cal(n,m)

ksm[n<<1]%MOD

ksm[m<<1]%MOD; } signed main(){ cin>>n,fac[0]=ifac[0]=ksm[0]=1; for(int i=1; i<=n; ++i) fac[i]=fac[i-1]

i%MOD; for(int i=1; i<=n; ++i) ifac[i]=qpow(fac[i],MOD-2); for(int i=2; i<=(n<<1); i+=2) ksm[i]=ksm[i-2]

(i-1)%MOD; for(int i=1; i<=n; ++i) scanf(“%lld”,&a[i]); for(int i=1; i<=n; ++i) if(a[i]) res+=f(i-1,n-i),res%=MOD; return printf(“%lld\n”,res),0; } Problem C is A heading discovery (a_i\le 100), which means that we can enumerate subsets of (A) (not directly, of course) and feel that we should start there.

We ponder the information asked. So what we want to know is what is the probability that we get all of the choices of phi (a) and end in phi (a). Finding subsets of enumeration (A) seemingly useless?

Can we try to figure out the probability of picking every subset of (A) that ends in (A), so that we can subtract the probability of randomly picking (A) that ends in (A).

So let’s think about how to calculate the latter, which is to end with an order of a, and then we’re left with the probability of randomly picking the first one times the probability of picking this one again.

We find that, for a (b_i), we can compare and randomly find the probability of choosing the convergence first when he is about a convergence:

[P(b_i,S)=\frac{b_i}{bi+\sum{i\in S}a_i} ]

Then, what we want to find is the probability that for each (b_i), he will choose the complete set (A) (p

I), then the final answer is (n+m-\sum

{i=1}^m p_i)

Let’s think about how to do that. And since we can figure out the probability of each of these converges, we can take the total probability minus the probability of each subset times the inclusion and exclusion coefficient and figure out the probability of the next choice.

And then there you go.

#include

using namespace STD; #define int long long const int N=105; const int MOD=998244353; int n,m,a[N],b[N]; int f[N

N],res=0; int ksm(int x,int k){ int res=1; for(; k; k>>=1,x=x

x%MOD)

if(k&1) res=res

x%MOD; return res; } signed main(){ cin>>n>>m,res=n+m; for(int i=1; i<=n; ++i) scanf(“%lld”,&a[i]); for(int i=1; i<=m; ++i) scanf(“%lld”,&b[i]); f[0]=1; for(int i=1; i<=n; ++i){ for(int j=N

N-1; j>=a[i]; –j) f[j]+=MOD-f[j-a[i]],f[j]%=MOD; } for(int i=1; i<=m; ++i){ for(int j=0; j

N; ++j) res+=MOD-f[j]

b[i]%MOD*ks