## Search found 11 matches

Wed Aug 30, 2006 8:27 pm
Forum: Volume 6 (600-699)
Topic: 615 - Is It A Tree?
Replies: 71
Views: 23788
You can also try:
0 0
-1 -1

it's a tree -
A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.
Wed Aug 30, 2006 8:22 pm
Forum: Volume 6 (600-699)
Topic: 615 - Is It A Tree?
Replies: 71
Views: 23788
Try this:
1 2 3 4 0 0
-1 -1
It's not a tree
Tue Aug 22, 2006 10:22 am
Forum: Volume 6 (600-699)
Topic: 621 - Secret Research
Replies: 45
Views: 19130
1) In cases where there is no match to any of the patterns
mentioned in the problem description DON'T print a blank line
2) Dont' print eoln at the end of output
Wed Apr 05, 2006 3:54 pm
Forum: Algorithms
Topic: Problem with sum of seqence
Replies: 5
Views: 1596
Thanks for your answers. I've finally solve this problem. I've created two arrays: bool wasadd[2 000 001] and int sums[2 000 001] It's "only" ;) 2 000 000 possible sums. I show my algorithm using example: Set: 2,3,4 Sum to find: 7 wassadd[2+1 000 000] = 1; sums[0] = 2; for members of set from 3 to 4...
Mon Apr 03, 2006 5:46 pm
Forum: Algorithms
Topic: Problem with sum of seqence
Replies: 5
Views: 1596

### Problem with sum of seqence

There is a set of N integers in range [-1000, 1000], N< 1000 I have to find if there is any subset which sum of elements is exactly S. S is an integer in range [-1 000 000, 1 000 000 ] Example: Set - {5, 10, 25, 50} S = 30 I can find a subset {5,25} - 5+25 = 30 Set - { -6,9,100,-45} S = -42 I can fi...
Sat Apr 01, 2006 6:36 pm
Forum: Volume 5 (500-599)
Topic: 530 - Binomial Showdown
Replies: 137
Views: 33832
1. C(n,k) = C(n,n-k)
2. My program memorizes C(n,k) for n and k < 1000
3. C(n,0) = 1;
C(n, n) = 1;
C(n,1) = n;
Thu Mar 30, 2006 10:23 pm
Forum: Volume 102 (10200-10299)
Topic: 10205 - Stack 'em Up
Replies: 60
Views: 23329

### 10205

http://acm.uva.es/p/v102/10205.html I have WA :( Please help or send test which my program fails. #include <cstdio> int tab[105][54], wyn[54], seq[800000], n, st; void printcard(int x) { int col, nr; x--; nr = x%13; col = x/13; if (nr<=8) printf("%d", nr+2); if (nr==9) printf("Jack"); if (nr==10) p...
Wed Mar 29, 2006 9:19 am
Forum: Volume 101 (10100-10199)
Topic: 10198 - Counting
Replies: 30
Views: 15142
You should create array for saving alredy computed numbers
Thu Mar 23, 2006 10:56 pm
Forum: Volume 101 (10100-10199)
Topic: 10182 - Bee Maja
Replies: 9
Views: 3218
In my opinion you shouldn't use fopen and fprintf function.
Mon Mar 20, 2006 8:57 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 41365
Thank you a lot
Sun Mar 19, 2006 8:40 pm
Forum: Volume 104 (10400-10499)
Topic: 10405 - Longest Common Subsequence
Replies: 103
Views: 29815
Thank you!