Question regarding copying code (plagiarsim?)

According to the 7th point of Codechef code of conduct, we can use codes which were publicly available before commencement of a contest after giving proper attribution.
So that means we can use common codes like Modular Exponentiation, etc from sites like Geeksforgeeks, stackoverflow after mentioning the source in comments?
@vijju123 @ssjgz

3 Likes

yes. pl mention source link on top of the code

is it fine if we mention in comments before that particular segment of code?

Also, you can use solutions written by other people’s in different problem / contest which is publicly available.

I think So, You have to mention it properly …
As an Example what I did…

"""
ModInverse and ModDivide Code Taken from GeeksforGeeks.com modular division
https://www.geeksforgeeks.org/modular-division/
"""

import math
def modInverse(b,m): 
	g = math.gcd(b, m)
	if (g != 1):
		return -1
	else:
		return(pow(b, m - 2, m))
def modDivide(a,b,m):
	a = a % m
	inv = modInverse(b,m)
	if(inv == -1):
		return(1)
	else:
		return((inv*a) % m)

My code

3 Likes

okay thanks, I was afraid it would be seen as plagiarism.
so plagiarism means that we can’t use any content available on the internet once the contest began?

a comment like the following works?
/*
the following code to do XYZ task has been taken from ABC (website name)
www.websitelink.com (website link)
*/

Yes … Also, I think they check Peer - Peer Sols. If they find a student doing plagiarism more than X% via MOS. Then only he/she will be penalised.

  • No bro! you can use any content available on the internet which is public and only thing you should not use is other people’s solution to the same contest problem (if accidently made public).
  • Any general content can be used from any sites if it’s public. Make sure to add a link in the top of your code which says this is the source from where I got this piece of code.
1 Like

No, he is actually right. If the content was put on internet during the contest, its NOT allowed to use it. Else cheaters will upload content somewhere during contest and use this third-party-code argument to escape.

3 Likes

Thanks for the clarification @vijju123

1 Like

I submitted the code and mentioned the topic and website name from which I took reference which is publicly available before the contest, but I failed to provide the ‘link’ of article/blog, So will it still go down as plagiarism ? as I wasn’t exactly aware of perfect attribute mentioning before today,

1 Like

No brother, You won’t get caught in most circumstances . and even if MOSS caught you , Codechef checks manually and they send email before punishing where you can explain/send them link you used in your code :slight_smile:

2 Likes

Thanks a lot for letting me know, I was worried ryt from the evening about that ugly little red plag mark, Thanks again :slightly_smiling_face:

2 Likes