E
E
Elnur Tazhimbetov2018-02-07 21:55:35
Java
Elnur Tazhimbetov, 2018-02-07 21:55:35

How to create all sorts of triangles up to N?

for example sides i,j,k; need i^j^k==0 && i+j>k && ij, fast solution, not O(n^3)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Movchan, 2018-02-07
@Alexander1705

If i^j^k==0, then k = i^j. Accordingly, it is enough to enumerate two parameters, which gives O (n ^ 2).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question