We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Looks like I've got super fast computer: 2.7 Ghz, Pentium 5, single core. Here is the result for calculation of all 2.6 * 10 ** 6 cases:
// 2.6 * 10 ** 6 test... ** operator is "in a power of"
long timeStart = System.currentTimeMillis();
for (int n = 0; n++ < 100000;)
for (int k = 0; k++ < 26;)
dortmundDilemma(n, k);
long timeStop = System.currentTimeMillis();
System.out.println("elapsedMills = " + (timeStop - timeStart));
Output:
elapsedMills = 402
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Dortmund Dilemma
You are viewing a single comment's thread. Return to all comments →
Looks like I've got super fast computer: 2.7 Ghz, Pentium 5, single core. Here is the result for calculation of all 2.6 * 10 ** 6 cases: // 2.6 * 10 ** 6 test... ** operator is "in a power of" long timeStart = System.currentTimeMillis(); for (int n = 0; n++ < 100000;) for (int k = 0; k++ < 26;) dortmundDilemma(n, k); long timeStop = System.currentTimeMillis(); System.out.println("elapsedMills = " + (timeStop - timeStart)); Output: elapsedMills = 402