checker for task 57

Back to General discussions forum

frankie_pants     2024-07-30 01:11:03

Checker for task #57 is driving me crazy! Seems to be incosistent in whether it requires 12dp or 13dp for each irrational number. Help!!

qwerty     2024-07-30 04:36:31

I solved the task and I do not even know what your "12dp or 13dp" means.

The problem may be much simpler than you think (I guess you are trying some complex academic algorithm, but you better just read the statement).

Rodion (admin)     2024-07-30 05:46:05
User avatar

Perhaps it is about "decimal places" or some other name for number of digits?

But seems qwerty is right, there should be no such issue. Checker uses comparison with about 1e-7 tolerance... So if 4000+ people have solved the problem already, probably the checker is less or more all right :)

frankie_pants     2024-07-30 10:35:23

You must have fixed something with the checker because I just tried it again with the same code and it worked! (or else some other weird miracle). thanks.

Rodion (admin)     2024-07-31 06:17:29
User avatar

No, haven't touched anything :) perhaps weird miracle or some subtlety in the logic of your code which makes it fail on some data sets. I'm not specialist in C# but this if (lol.ToString().Length > 5 make me suspicious. I understand the idea but can't at once say whether it may fail somewhere... Perhaps I shall try testing it later.

Generally it may be easier when you have some issue of such kind, to include example of your answer and expected one (both could be copied from the task attempt page) so we can compare visually...

qwerty     2024-07-31 12:54:28

Yeah, frankie_pants, it is very hard to say what happened without examples. I submitted your code ten times in a row, and the checker was happy all the time, so I cannot understand why it is driving you crazy...

qwerty     2024-07-31 12:59:07

but this if (lol.ToString().Length > 5 make me suspicious.

No, this cannot be a problem. See, this condition triggers ToString("n12"), which is an useless line and do not affect anything. Because it is not affect anything, the condition does not affect anything as well. Am I correct?

Please login and solve 5 problems to be able to post at forum