--- tags: FD Training --- # 2020暑期培訓小考(一) 複雜度題 ### 1. ```cpp for(int i=0;i<n;i+=5){ for(int j=i;j;j>>=2); } ``` ### 2. ```cpp vector<int> a(n); for(int i=0;i<n;i++) a.erase(a.begin()); ``` ### 3. ```cpp map<int,int> dp; for(int i=0;i<(1<<n);i++){ for(int j=0;j<(1<<n);j++){ if((i&j)==k) dp[i]+=dp[j]; } } ``` ### 4. ```cpp int a[n]; set<int> s; for(int i=1;i<n;i<<=1){ s.insert(lower_bound(a,a+n,i)-a); } ``` ### 5. ```cpp int a[n]; for(int i=0;<=n;i+=3){ for(int j=0;j*j<i;j+=2){ sort(a+j,a+n); } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up