Skip to content

Existing resources

Introduction

  • Real values, N, a[i] <= 5, exactly one solution, error 1e-4, print the one solution
  • N <= 100 modulo P, say 0 or 1 or many solutions

Binary

  • number of XORS of subsets, N <= 5e5, a[i] <= 1e18
  • XOR maximization https://www.spoj.com/problems/XMAX/
  • Zero XOR Subset https://codeforces.com/contest/1101/problem/G
  • You are given a sequence of integers (N <= 10^5, a[i] <= 10^9) and there are two players. First Alice removes some numbers and then Bob removes some of the remaining numbers but can't remove everything. Then they play a NIM game, Alice starts. How many numbers at least should Alice remove in order to ensure the victory in NIM game later? This is a very simplified problem Magic Matches Game https://community.topcoder.com/stat?c=problem_statement&pm=11676 .
  • Same problem but every number has a price of removing b[i]. This time Alice pays for removing numbers and needs to minimize the total cost.

Binary Extra

complexityO(Q*log^3) with a segment tree

Random Walk general

Random Walk By One

ev[1] = x

ev[1] = ... * ev[2] + ... * ev[1] -> ev[2] = a * x + b

0.6 forward, else backward by 1

ev[1] = x ev[2] = 5 * x + 10 ...

ev[5] = p1 * ev[6] + p2 * ev[4] + p3 * ev[3] + const ev[6] = (p2 * ev[4] + p3 * ev[3] - ev[5]) / p1 + const why SUM can't be 0?

Maybe