You are not logged in. Please login at www.codechef.com to post your questions!

×

# INTEST: Getting rte

 1 My code is : main(void) { unsigned long int n,div,out=0; long long num; int i; scanf("%lu%lu",&n,&div); for(i=0;i

 2 In C language you need to have a return 0 when exiting from main. http://www.codechef.com/wiki/faq#Why_do_I_get_an_NZEC answered 24 Mar '12, 02:35 4★gultus ♦ 1.5k●1●13●25 accept rate: 51% Thanks, it worked this time. But the time of execution was 5.55sec while some other solutions worked in .48sec So can you help me to optimize the solution... Thanks a lot. (24 Mar '12, 17:49)
 1 your out is declared as an unsigned long, but you print it as an int. moreover, it seems, regarding the problem statement, that storing num in a long long is not really necessary. an unsigned long should be enough. please tell us if it solves your problem :) answered 24 Mar '12, 01:55 3.4k●2●19●55 accept rate: 20% The problem persists, I corrected the points mentioned by you but still it shows Runtime Error. (24 Mar '12, 02:16)
 0 Your code is optimized except for long long for num. People whose execution is lesser, they optimize the I/O. ie they use block reading and their processing so that less I/O is performed. Generally without I/O optimized code passes in codechef, I/O optimization only reduces the execution time. answered 28 Mar '12, 10:59 41●3 accept rate: 33%
 toggle preview community wiki:
Preview

### Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• link:[text](http://url.com/ "title")
• 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:

×2,718
×55
×49

question asked: 24 Mar '12, 00:57

question was seen: 1,917 times

last updated: 10 Jul '12, 12:30