## Search found 70 matches

Mon Oct 17, 2005 2:39 am
Forum: Volume 109 (10900-10999)
Topic: 10926 - How Many Dependencies?
Replies: 33
Views: 14293
I am not use DFS to make topological sorting. I only use DFS to count the value for every vertex. So if there are N vertex my program will call N DFS Function to count the value for every vertex, but I am not count the same vertex twice. I mark every vertex that I used in my DFS function. After I co...
Sat Oct 15, 2005 9:27 am
Forum: Volume 4 (400-499)
Topic: 494 - Kindergarten Counting Game
Replies: 119
Views: 22059
Try This Case :

input :
7 is a prime number.
hello world.
timo12345timo

output :
4
2
2

A ``word'' is defined as a consecutive sequence of letters (upper and/or lower case). Only letters -> 'a'-'z' and 'A'-'Z'.

I hope you will get AC.
Sat Oct 15, 2005 9:17 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32224
Hi HASAN_AI 4 336 34 -> this sequence is an A-sequence because we can arrange this sequence become 4 34 336 that satisfying 1 ≤ a1 < a2 < a3 and every ak of the sequence is not the sum of two or more distinct earlier terms of the sequence. So if the input : 2 2 1 You should output : Case #1: 2 1 Thi...
Sat Oct 15, 2005 8:42 am
Forum: Volume 2 (200-299)
Topic: 294 - Divisors
Replies: 91
Views: 23757
Suppose N is an integer that we want to know how many divisors that it has. I see that your algo is : j=N; c=0; loop from j decrease to 1 if N mod j then c=c+1; you should not use the above method because it too slow for this problem. I will give you a little hint. if N=8 then c=4 there are 4 intege...
Sat Oct 15, 2005 7:48 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32224
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 the sequence. So if the sequence have two or more equal value, the sequence is not A-sequence. Case #7: 975 35...
Sat Oct 15, 2005 3:07 am
Forum: Volume 109 (10900-10999)
Topic: 10925 - Krakovia
Replies: 50
Views: 21643
Here is the output from my accepted program. Bill #1 costs 56270: each friend should pay 56270 Bill #2 costs 59532: each friend should pay 7441 Bill #3 costs 570262: each friend should pay 142565 Bill #4 costs 789806: each friend should pay 46459 Bill #5 costs 735264: each friend should pay 73526 Bi...
Sat Oct 15, 2005 3:05 am
Forum: Volume 109 (10900-10999)
Topic: 10925 - Krakovia
Replies: 50
Views: 21643
You can try this case : 1 1 56270 1 8 59532 11 4 46174 39274 57939 53253 62523 46232 49934 64389 60970 42991 46583 16 17 39008 59470 53737 39200 42326 40011 43117 53067 48817 47243 48956 50353 45630 62386 54306 62179 14 10 51959 49936 56012 41518 58226 60565 53840 46328 61011 50654 47690 48301 65452...
Fri Oct 14, 2005 4:10 am
Forum: Volume 109 (10900-10999)
Topic: 10926 - How Many Dependencies?
Replies: 33
Views: 14293
I only use DFS to get accepted from this problem.
Fri Oct 14, 2005 4:07 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32224
Here is the output from my accepted code Case #1: 4 336 34 This is an A-sequence. Case #2: 218 537 196 701 950 275 445 109 699 565 42 166 This is not an A-sequence. Case #3: 686 765 828 960 220 427 953 840 924 811 452 605 662 600 550 721 114 407 122 672 475 492 565 345 869 This is not an A-sequence....
Fri Oct 14, 2005 4:03 am
Forum: Volume 109 (10900-10999)
Topic: 10930 - A-Sequence
Replies: 102
Views: 32224
Try This Input : 3 4 336 34 12 218 537 196 701 950 275 445 109 699 565 42 166 25 686 765 828 960 220 427 953 840 924 811 452 605 662 600 550 721 114 407 122 672 475 492 565 345 869 10 180 424 695 164 539 646 624 4 788 269 15 387 377 582 604 280 171 806 295 334 409 241 414 55 495 984 3 410 70 74 9 97...