// Author : RioTian// Time : 21/01/24#include<bits/stdc++.h>usingnamespacestd;typedeflonglongll;constintN =100; ll dp[N][2];boolopt[N]; string s;intmain(){// freopen("in.txt","r",stdin);ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);intn; cin >> n...
cout << dp[(1 << n) - 1][0] << '\n'; return 0; } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. F - Unbranched 官方题解:https://atcoder.jp/contests/abc180/editorial/250 这里做的有点懵,贴一下代码 这里使...
Editorialis released. →Reply SilverWing05 22 months ago,#| 0 Can anyone explain the DP soln for F? →Reply FiniteMoves 22 months ago,#^| 0 I did Greedy + bs →Reply FlyingElephant 22 months ago,#^| ←Rev.2→0 what you were looking for with bs? How do you retrive the max disco...
__builtin_popcount()用于计算一个 32 位无符号整数有多少个位为1 #include<bits/stdc++.h>usingnamespacestd;#definerep(i, n) for (int i = 0; i < (n); i++)usingll =longlong;constexprintMOD =1e9+7;longlongdp[2][17]; string s;intn, k, m, a, e;intmain(){ cin >> s >>...
I was looking at the submission of hitonanode, which seemed to more or less implement the algorithm described in the second editorial, the correctness of which I had tried to understand and prove. Eventually, to my great surprise, I constructed the case 6 1 2 0 3 1 2 0 2 2 1 3 3...
https://atcoder.jp/contests/abc231/editorial/3089 翻译一下它这个官方题解 记期望为 E(X) ,答案是 E(∏i=1n(Xi+Ai)) 由于n 个操作的对称性, n 次选了 n 个位置之后的期望等于将这 n 个位置重排成有序时的期望 n 个乘积项,每项要么取 Ai 要么取 Xi ,展开可得, E(∏i=1n(Xi+Ai))=∑n...
AtCoder Beginner Contest 189 Personal Editorial 第一次参加 AtCoder 的比赛,感觉还挺简单。 比赛链接:https://atcoder.jp/contests/abc189 A - Slot // Author : RioTian // Time : 21/01/23 #include <bits/stdc++.h> using namespace std;...
https://atcoder.jp/contests/abc385/editorial/11663 翻译一下他这个题解, 首先dp[i][k]表示只考虑(n-i,n-i+1,...,n-1,n)这些项时,L(p)-R(p)=k时的方案数, 考虑把n-i-1插进当前的序列里, (1)如果插到开头位置,L(p)加1,L(p)-R(p)整体加1 ...
AtCoder Grand Contest 007: D - Shik and Game (DP) 题目链接地址:https://agc007.contest.atcoder.jp/tasks/agc007_d Editorial D - Shik and Game Time limit : 2sec / Memory limit : 256MB Score : 1200 points Problem Statement Imagin......
why there isn't a editorial in English.. (T⌓T) → Reply SummerSky 16 months ago, # | 0 For problem E, I use dp[i][j][k][r][0/1] to denote the number of ways such that, i denotes that we have determined the first i digits(from high to low), and j denotes tha...