×

# how can these solutions pass time limit and codechef do u really check how much plagarism is there in long challenge ..

 -1 https://www.codechef.com/viewsolution/17785493 https://www.codechef.com/viewsolution/17665036 https://www.codechef.com/viewsolution/17815955 https://www.codechef.com/viewsolution/17627180 just take array size 100000 and fill each value by a particular number like 259 and there are a lot others .. asked 12 Mar, 17:39 75●6 accept rate: 0%

 1 time complexity is actually $O(N\log{MAX})$, where MAX is maximum number in the array. Refer to this explanation TIME COMPLEXITY EXPLANATION. Upvote it if you find it helpful I need karma points to contribute to the community (I don't have any now) answered 13 Mar, 13:24 474●10 accept rate: 16%
 1 The complexity may seem O(n^2) but is actually around O(nlogn) since whatever input you try, the maximum number of total votes would be around nlogn. Try to come up with a test case that would give TLE on these codes and you'll realize why it's true. The reason why you're getting runtime error on ideone is because you're printing 10^5 integers which is more than the allowed output size on ideone. Try it on an offline compiler or just comment out the final print statements and it would work. answered 13 Mar, 01:17 1.9k●2●17 accept rate: 17% if u remove the if statement there are 2 simple for loops with with each one running and the difference bw i and j is just two everytime why isn't this loop is simple for(ll i=0;i
 0 Whats your point all the solution that u have linked above seems right and the time limit is generally 1 sec you assume u can do 10^8 operation per sec so 10^6 is fine. And about the plagiarism issue all the solutions are checked for plagiarism after contest. answered 12 Mar, 17:50 84●4 accept rate: 0% n can be as large as 100000 in the loop  for( i=0; i<(n); i++) { if(i+1 < n) { c[i]+=1; c[i+1]+=1; } for( j=i+2; j
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×668
×208
×3

question was seen: 610 times

last updated: 13 Mar, 13:26