|  | 
|  | 
| вернуться в форум | Why this problem has so high complexity estimation? It is very easy problem, i think complexity estimation 192 is overestimation.Very simple search was accepted:
 
 static bool Solve(IEnumerable<Tuple<int, int>> limitations, int[] proposedOrder)
 {
 foreach (Tuple<int, int> limitation in limitations)
 {
 int less = limitation.Item1;
 int greater = limitation.Item2;
 if (less == greater)
 return false; // wrong rule
 
 foreach (int currentSubj in proposedOrder)
 {
 if (currentSubj == greater)
 return false; // first is greater, so rule is contradicted
 if (currentSubj == less)
 break; // first is smaller, so rule is satisfied, go to next one
 }
 }
 return true; // all rules was satisfied
 }
Re: Why this problem has so high complexity estimation? 1. Some time ago ML for it was 1MB. Try to solve within this limitation.2. Average difficulty of a problem on Timus is ~1300, so 192 means that it is very simple problem (~15% of average difficulty), how did you get it is overestimation?
 | 
 | 
|