• 2024-11-09CF803E Roma and Poker 差分约束
    CF803ERomaandPoker记W为\(1\),L为\(-1\),D为\(0\),前\(i\)个字符的和为\(dis_i\)。则有:当第\(i\)位为W时:\[dis_i-dis_{i-1}=1\]可以推出:\[\begin{cases}dis_i-dis_{i-1}\le1\\dis_i-dis_{i-1}\ge1\\\end{cases}\]转为差分约束形式:\[\begin{ca
  • 2024-11-09CF803E Roma and Poker 差分约束
    CF803ERomaandPoker记W为\(1\),L为\(-1\),D为\(0\),前\(i\)个字符的和为\(dis_i\)。则有:当第\(i\)位为W时:\[dis_i-dis_{i-1}=1\]可以推出:\[\begin{cases}dis_i-dis_{i-1}\le1\\dis_i-dis_{i-1}\ge1\\\end{cases}\]转为差分约束形式:\[\begin{ca