https://www.codingame.com/training/hard/big-bang-theory---sheldons-array-puzzle
Send your feedback or ask for help here!
Created by @RaulButuc,validated by @anon79996792.
If you have any issues, feel free to ping them.
https://www.codingame.com/training/hard/big-bang-theory---sheldons-array-puzzle
Send your feedback or ask for help here!
Created by @RaulButuc,validated by @anon79996792.
If you have any issues, feel free to ping them.
I removed a few extra whitespaces from the testcases, which make an input parsing like this one crash:
List<int> nums = Console.ReadLine().Split().Select(int.Parse).ToList();
.
Then I noticed an issue at testcase 6 (āMedium 1ā): according to the input specification we get n in the first line and n numbers in the following line.
However the mentioned testcase sets n to 150 and then only gives 100 numbers.
Furthermore Iām not happy with the stub, as it reads the 2nd line as a string, rather than a list of integers - which is why running the default code on test 6 wonāt even cause a crash.
Pinging @RaulButuc and @anon79996792, as the @CommunityBot told me to do so.
@eulerscheZahl This problem is plagiarism (with a few cosmetic changes) from HackerRank. All the initial testcases and author solution were plagiarism from there too. The author modified a few things in a hurry, in particular the testcases, when I mentioned that in the comments.
The people who validated that obviously did not solve it (copy-paste the solution, period) nor did any kind of reviewing work.
So there are indeed a few issues here, beyond those you mentionā¦
Niako: plagiarismā¦ so it is even worse than I though.
I also have issues with Test 6 (aka āMedium 1ā).
If I apply the fix suggested by eulerscheZahl, the official solution answers 569820 instead of 4023883. This is the answer of my own bot (which actually ignores n ).
Can you confirm that the correct answer is indeed 569820 before I fix this stuff?
edit: stuff fixed.
JBM: Donāt make it even worseā¦
Thanks for the info @Niako. I had the feeling that it might be copied from another website (well crafted puzzles that require more thinking than coding always make me a little suspicious). I should improve my google skills.
And thank you for @Stilgart for correcting this and many other contributions.
Edit: this also explains the weird modulo of 10ā·+7 instead of 10ā¹+7. While the latter is commonly used (easy to remember prime with a similar order of magnitude as MAX_INT), the number used here just feels random.
Of course, he did not even bother to pick a prime number when trying to hide the plagiarism after it was revealed. Funny thing is that the previous official solution (which simply was a plagiarism of the first C++ solution on HR with modified variable names) relied on computing modular inverses by x^(mod-2), which only works when mod is prime. Thus he had to plagiarize another solution (using the standard additive relation for binomial coefficients instead, avoiding modular inversion) to make it compatible with the new constraints (but I donāt even know if he realized that in some way or if he just was lucky when picking the other solution)ā¦
After making sure that the creator of the puzzle is legitimate, I checked the suspicious accounts which validated the contribution. Theyāre not related to the creator and I have deleted them.
About the puzzle, now that it is published, I have no easy way to put it back as āwaiting for moderationā. If moderators think it should get back to the moderation phase, we could all badly rate it and the moderation bot would quickly do the rest.
I donāt have a major issue concerning plagiarism. As long as:
I think it is acceptable and I trust the moderation team to discuss and agree together if the puzzle is worth being published on CG.
You should consider playing with https://chadok.info/codingame/ part 3.
It shall help you finding related accounts.
Heās talking about part 3, where you can see which user solved which problems in which programming language by entering the name of the user.
I see nothing in the HackerRank ToS that allows content re-use. Relevant sections:
You (ā¦) agree to all of the following (ā¦): a. The Content represents Your own original work and/or You have all necessary rights to disclose the Content.
Except as expressly authorized by Interviewstreet, You agree not to sell, license, distribute, copy, modify, publicly perform or display, transmit, publish, edit, adapt, create derivative works from, or otherwise make unauthorized use of the Materials.
Unless either one of those is the case:
then this is red-handed plagiarism and blatant copyright infringement.
Your quoted paragraphs are talking about different stuff. First one is about usersā content, the second is about Hacker Rank (HR) itself.
HR allows content reuse. In fact they donāt own usersā work but have a perpetual license:
Content that You own and post on or through HR belongs to You and You may use it in any way, except as prohibited by applicable law or regulations. By using HR, You are granting Us permission to use the Content as described in these Terms.
Grant a permission is different than owning that content. They state āyou ownā.
By using HR You are granting Us a nonĀexclusive, (ā¦) license to use (ā¦) Your Content. If You post Content on or through HR, You represent and warrant that You have the right to post the Content and to grant the above rights to Us.
Non exclusive license to use.
In short, HR ToS are irrelevant in that issue, their ToS are just there to cover their ābacksā from any copyright infringement on usersā content.
The important point is the original puzzleās license as you and Thibaud stated.
Even HR clean their hands on possible issues:
4 . We cannot and need not control all Content posted by Hackers on or through HR, and We do not guarantee the accuracy, integrity or quality of such Content
6 . You are solely responsible for Your Content and the consequences of posting or publishing it.(ā¦) You affirm, represent, and warrant that: (i) You own, or have the necessary licenses,
With all the new content creation I think CG should do the same, update their ToS to avoid copyright issues and delegate these responsabilities to content creators. HR does that in many terms (Content and Code of Conduct are pretty much about that)
Let me introduce by stating Iām not too knowledgeable about HR : I know about it, but I āamā not there. But I do know a thing or two about authorship and copyright.
Iām aware of that. I quoted the first part to highlight the user-submited content is presumed owned or licensed by its authors; the second one to underline HR extends license to use on nothing: neither their self-produced nor the user-submitted material.
I didnāt mean they donāt authorize re-use in the sense they forbid it, I meant they donāt authorize it as theyāre not in a position to since they donāt own it.
But then weāre back to my two: it is very possible that the alleged plagiarizer either authored that content, or totally legally licensed it from its author. It just seemed very unlikely to me.
I disagree. I recognize their contents are mostly superfluous as they donāt change the default situation valid in most countries about authorship and copyright. But at least:
Cookie-cutter. This needs context.
They have no problem with users submitting re-used contents, since this is the usersā responsibility. Theyāre certainly even very happy about it, since it gives them bigger ācontentā counts until somebody notices and complains. Kind of like CG, I suspect.
They certainly do not grant anyone the right re-use the content they host. Expressly forbidden by the ToS for the content they own, implicitly (but still expressly) not authorized (by them) for the content they merely host.
So despite your confrontational tone I agree with everything you wrote. (except the cookie-cutter, of course).
On CG, I recall seeing CC-BY-SA (2 or later boxes) in the earliest content submission forms, but indeed Iām not so sure theyāre still there. They mostly* respect it anyway, whether or not theyāre still explicit about it.
[*] for my content anyway. No promises for others.
As far as I know, the only competitive programming website to be clear about licenses is Kattis where each problems has an explicitly specified license ā mostly CC BY-SA it seems, which still requires Attribution (BY) and I think it would be good practice to ask for any contribution that is legally copied or strongly inspired to always explicitly mention the source. Iām pretty sure the content on any other site I know of should be considered copyrighted.
In fact 10^7 + 7 is worse than random-looking because it actually looks like it is prime.
Maybe the description can be updated with a warning: āBe careful: 10000007=941*10627 is not primeā
@Fluxor Yeah, but, wellā¦ This problem should have been deleted IMO (the statement, the testcases and the solution code were plagiarized, moreover the 3 reviewers who validated it have been banned, the author survived for some reason though). Period.