Search found 70 matches

by Timo
Wed Mar 15, 2006 8:56 am
Forum: C
Topic: Please Help Me...
Replies: 1
Views: 2398

Please Help Me...

I have a code like this :

Code: Select all


#include <stdio.h>

int main()
{
  int x,y;
   
  x=4;
  y=x++ * ++x;
  x=4;
  printf("%d %d\n",y,  x++ * ++x);

  return 0;
}

I think the result will be :
25 25

but when I test :
25 24

please explain to me ?
by Timo
Fri Dec 09, 2005 8:55 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 50081

here is the output from rocky test case

Code: Select all

BCG 30
BGC 6050
CBG 50
CGB 1620
GBC 2140
GCB 2440
I hope you can get AC :D
by Timo
Tue Dec 06, 2005 2:44 am
Forum: Other words
Topic: Notice: Second Programming Contest of Newbies
Replies: 6
Views: 2366

22 o 23 dec would be ok. Remember a lot of people will be celebrating christmas
I agree with you trulo17.

:D
by Timo
Tue Dec 06, 2005 2:40 am
Forum: Volume 102 (10200-10299)
Topic: 10260 - Soundex
Replies: 30
Views: 10856

congratulations for you AC.

you can use gets() to read the data for improve your program speed.

:D
by Timo
Mon Dec 05, 2005 3:47 pm
Forum: Volume 102 (10200-10299)
Topic: 10260 - Soundex
Replies: 30
Views: 10856

try this input

Code: Select all

input

RAAR
RAMA

output

66
65
I hope you can get AC.
:D
by Timo
Mon Dec 05, 2005 1:15 pm
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 184370

Hi yogeshgo05, your code is little wrong. you must to set the value of k to zero when read a new input. your code is TLE because the first input can be greater than the second input. your code didn't handle that case so it loop forever. I have fixed your code and send it to judge and get AC. here is...
by Timo
Mon Dec 05, 2005 9:37 am
Forum: Algorithms
Topic: Repeating Decimal or Expanding Fraction
Replies: 3
Views: 1007

Hi Roby, I try to help you. The number in decimal is repeated if when you divide them with the divisor they have same remainders appear twice. I try explain you with sample input from problem 275. input : 3 7 output : .428571 The last 6 digits repeat forever. output '.' N 1. multiply 3 by 10 30 / 7 ...
by Timo
Sat Dec 03, 2005 7:59 am
Forum: Volume 5 (500-599)
Topic: 575 - Skew Binary
Replies: 18
Views: 3708

i have removed the strrev function. i replaced strrev(a) by len=strlen(a); for(i=0;i<len;i++) { a[len-i]=a[i]; } a[i]='\0'; also i have removed exit(0); and replaced it by return 0; since i had not included <process.h> in the code but still CE............. your strrev is wrong it shoule be len=strl...
by Timo
Fri Dec 02, 2005 4:34 am
Forum: Algorithms
Topic: The STL Library
Replies: 4
Views: 1652

You can learn from this site

http://www.josuttis.com/libbook/toc.html

see the STL algorithms.
I think all of them are needed in programming contest.

:D
by Timo
Fri Dec 02, 2005 2:56 am
Forum: Volume 3 (300-399)
Topic: 369 - Combinations
Replies: 101
Views: 17440

You don't need big integer to solve this problem. The problem says that : "You may assume that the final value of C will fit in a 32-bit Pascal LongInt or a C long." so a simple technique will pass this problem. input : 100 6 100! = ------------ (100-6)!*6! 100! = ------------ 94! * 6! 94! * 95 * 96...
by Timo
Thu Nov 17, 2005 12:59 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 46249

I think this problem can be solved easily if you use stack. - scan the string from left to right - if find '(' or '[' push them into your stack - if find ')' or ']' and the top of the stack is not they match then break from the looping the answer is "No". Otherwise pop from the stack - after you fin...
by Timo
Fri Oct 21, 2005 1:26 pm
Forum: Off topic (General chit-chat)
Topic: How old are you? Statistics.
Replies: 121
Views: 175837

Hi, I am Timotius from Bina Nusantara University.
I am 19 years old and started solving from Mei, 2005.
I have solved +260 problems.
by Timo
Mon Oct 17, 2005 10:15 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32237

Yesterday I got Accepted on this problem without sorting input sequence, so I can assume, that sorting isn't necessary. It implies, that every sequence in which order of elements after sorting is different from original order isn't A-Sequence. Best regards DM If you can get AC without sorting, I th...
by Timo
Mon Oct 17, 2005 2:59 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32237

Hi Fixxxer,

because both you and me can get AC with different output for the input :

2 2 1

so we can assume that there is no input like that (the input is invalid).

:D
by Timo
Mon Oct 17, 2005 2:52 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32237

Hi RONI_DU, 15 387 377 582 604 280 171 806 295 334 409 241 414 55 495 984 This is not an A-sequence. because the problem says that A-sequence is a sequence of positive integers ai satisfying 1 ≤ a1 < a2 < a3 < ... and every ak of the sequence is not the sum of two or more distinct earlier terms of t...

Go to advanced search