ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1363. Halftones

ugly algo:
Posted by Shen Yang 27 Feb 2017 07:26
first using Heuristic search,  a[x][y]<255-a[x][y] first search 0, else first serach 255,

times>1e5  break;

if ok==false  using random search,  if(rand()%2==0) first search 0 else first search 1,

if you use rand()%2==1 first search 0 it will tle...