Search found 498 matches

by shamim
Sat Mar 31, 2007 11:13 am
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 76886

Code: Select all

while(scanf("%d",&num)) 
change the above line to

Code: Select all

while(scanf("%d",&num) == 1) 
by shamim
Thu Mar 29, 2007 11:40 am
Forum: Volume 6 (600-699)
Topic: 623 - 500!
Replies: 187
Views: 42827

Your code is difficult to follow, but it seems that you are not preprocessing the results. You must generate the factorials before taking any input.
by shamim
Sat Mar 24, 2007 10:57 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 21636

without giving any space and new line as the sample output indicates
not including space is ok, but why don't you print new lines. In every problem, there is at least one new line after every case of output.
by shamim
Sat Mar 24, 2007 10:54 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 55599

You are not considering carry forwarded.

try the case:

input
999
989

output
3
by shamim
Tue Mar 20, 2007 12:12 pm
Forum: Volume 3 (300-399)
Topic: 392 - Polynomial Showdown
Replies: 93
Views: 17573

I did not run your code, but check for extra spaces at the end of a line.
by shamim
Mon Mar 19, 2007 1:30 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 44666

You have to set top=0 before each case.
This correction will give you wrong answer.
by shamim
Sat Mar 10, 2007 12:10 pm
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 45202

There is a lot of data in the input file.
So you could speed up the input/output process.
Usually, people use fread and fwrite to speed up I/O.
by shamim
Thu Mar 08, 2007 2:30 pm
Forum: Off topic (General chit-chat)
Topic: Problem
Replies: 7
Views: 17196

well, uva never bans anyone for making a lot of submissions.
Perhaps, at the time the site was down and now its back.
by shamim
Mon Feb 19, 2007 12:34 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 176881

You could use precalculation and memoization.
That is, precalculate all the values first. Now, when finding the cycle length for 32 you need to find that of 16. So, there is no need to calculate the cycle length of 16 twice.
by shamim
Sun Feb 18, 2007 12:15 pm
Forum: Volume 110 (11000-11099)
Topic: 11011 - Numerical Methods! A Satire
Replies: 11
Views: 6270

Jan wrote: Students with good results become teachers most of the time. And it is obviously true that 'Exception is rare'.
Sounds like a vicious cycle :(
by shamim
Wed Feb 14, 2007 11:31 am
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 55599

Disable smilie tags when posting codes.
by shamim
Sun Feb 11, 2007 11:52 am
Forum: Volume 110 (11000-11099)
Topic: 11011 - Numerical Methods! A Satire
Replies: 11
Views: 6270

Any idea, how such people end up being the Dean of Faculty?
by shamim
Sat Feb 10, 2007 1:37 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 55599

Code: Select all

while(1) 
{ 
gets(num1); 
gets(num2);
Your program will never stop taking inputs even when the end of file is reached.

Change it to:

Code: Select all

while ( gets(num1) != NULL )
gets(num2);
by shamim
Wed Feb 07, 2007 11:22 am
Forum: Volume 1 (100-199)
Topic: 123 - Searching Quickly
Replies: 55
Views: 4670

The online judge should send you an email explaining the reason for compile error. Please check the mails.
If you don't receive any mail with each submission, you have the option disabled. So edit your accounts' profile so that you receive the mails.
by shamim
Tue Feb 06, 2007 1:10 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 21636

change this line

Code: Select all

short Matrix[ 101 ][ 101 ][ 101 ][ 101 ] = { 0, }; 
to

Code: Select all

short Matrix[ 101 ][ 101 ][ 101 ][ 101 ] ; 
But it will get MLE now.

Go to advanced search