Блог пользователя The__Knight

Автор The__Knight, история, 3 месяца назад, По-английски

After diving more and more into randomized algorithms(and teeny-weeny bit into the simulation of ray tracing) I have realised the unfathomable potential of Monte-Carlo methods (if used properly) . It can help break down extremely complex constructive algorithms into simple random sampling.

However, considering the time limit of 1-2 secs on most of the problems on CF and AtCoder it feels impossible to simulate Monte Carlo without facing a TLE or a WA (if the ans involves exact floating points).

Is there any way to implement a time bound randomised search and bypass the natural time based restrictions and is it feasible during official rounds?

To those who help, ありがとうございます in advance..

  • Проголосовать: нравится
  • -7
  • Проголосовать: не нравится

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

cf problems often require a globally optimal answer. monte carlo methods might get stuck in a local minimum

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Two icpc problems come to mind https://codeforces.me/contest/1773/problem/A https://codeforces.me/gym/104848/problem/D (Second one also has a deterministic solution). I suppose cf rounds also had problems where you can do something randomly a few times and you are basically guaranteed to succeed quickly enough, but I can't remember anything.

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Not monte-carlo but I remember a matroid intersection problem with low constraints that people managed to AC using simulated annealing.

»
3 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Yes, I remember this problem, which had a randomized solution: https://codeforces.me/contest/2149/problem/G

»
2 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

2074E - Empty Triangle

2246E - lce4113 and Security Game

Both these problems strictly require randomization, most problems that strictly require randomization are interactive

Plenty of problems also have an alternative or primary randomized solution