Search found 15 matches

by teni_teni
Fri Apr 08, 2005 2:06 pm
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 13697

It seems that some trees have 1000 or more nodes in the input of the Judge.
So, you should enlarge the size of the arrays, s[1000] and sum[100].
by teni_teni
Mon Mar 28, 2005 10:45 am
Forum: Volume 1 (100-199)
Topic: 143 - Orchard Trees
Replies: 90
Views: 12385

Code: Select all

71.67 88.3 45.02 49.09 98.49 0.1  ;;line 10
My output:

Code: Select all

1701
by teni_teni
Sun Mar 06, 2005 1:12 pm
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 13697

doddi, you maybe misunderstand the problem.

xbeanx's output is correct, since there is only one root-to-leaf path, 77 + 1.

another input for your help:

Code: Select all

77 (77(1()())())
77 (77  (1 () ())  (0 () ()) )
77 (77 () ())
my output:

Code: Select all

no
yes
yes
by teni_teni
Sun Feb 27, 2005 7:45 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 38089

Comment out these two lines, or you'll get 'compile error'. #include "stdafx.h" getchar(); There is no description about the maximum number of commands. int n,onum,a[100],b[100],op[100],temp[30]; The size, 100, is too small. If not enough, runtime error will occur. These, s1[4] and s2[4], cause strc...
by teni_teni
Sun Feb 27, 2005 5:38 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 34823

Your output is right. But try this, another different cases: 10 8 9 8 6 0 9 7 5 3 13 7 8 7 1 5 7 1 0 11 8 5 1 2 12 12 7 11 12 10 7 10 8 12 5 3 8 10 6 1 0 3 8 1 10 My output: CBG 38 CBG 30 CBG 33 CGB 46 GBC 26 I should have tested these cases first rather than those rare cases that I presented before...
by teni_teni
Sat Feb 26, 2005 9:20 pm
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 34823

The problem says: The input consists of a series of lines with each line containing 9 integers. Your program can not handle multiple inputs. while (true) { for(i=0;i<9;i++) { cin>>data[0][i]; if (cin.eof()) return 0; } ..... } And, The total number of bottles will never exceed 2^31. 2^31 = 214748364...
by teni_teni
Tue Feb 22, 2005 1:10 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 38089

i seem not to understand this problem correctly.
Hope this helps:
http://online-judge.uva.es/board/viewto ... hlight=101
by teni_teni
Thu Feb 17, 2005 10:06 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 162
Views: 15772

Code: Select all

 l = 1; r = 1000000000;
if (n>12) r = (int)pow(10,101.0/n);
r = 10^9;

Code: Select all

n=11 ==> 10^(11 * 9) = 10 ^ 99
n=12 ==> 10^(12 * 9) = 10 ^ 108                   <=!!!!!!!
n=13 ==> pow(10,101.0/n)^13 = 58780160^13 < 10^101
temp's size is ok? is this a small thing?
by teni_teni
Thu Feb 17, 2005 6:44 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 162
Views: 15772

I'm sorry. That was a quite silly question. I have done like this: while (true) { // <= !!! x = (l + r) / 2; if (P == power( x, N )) break; if (P > power( x, N )) l = x; // should use x + 1 else r = x; // should use x - 1 } note that this is not actual program but mere concept. I know that this will...
by teni_teni
Wed Feb 16, 2005 11:39 am
Forum: Volume 1 (100-199)
Topic: 113 - Power of Cryptography
Replies: 162
Views: 15772

Code: Select all

temp[0] = 1;
temp[1] = 1; 
what's this? eleven?
by teni_teni
Wed Feb 16, 2005 11:06 am
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 13697

Code: Select all

#define MAX 100
How about increasing this value to, say, 1000 or more.
by teni_teni
Sun Feb 13, 2005 9:46 am
Forum: Volume 1 (100-199)
Topic: 118 - Mutant Flatworld Explorers
Replies: 68
Views: 9129

Maybe you already got AC...
If not, try this:

Code: Select all

1 1
0 0 N
LF
by teni_teni
Sun Feb 13, 2005 7:34 am
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 13697

Though I don't look into your code, try this input:

Code: Select all

3
(1
  (1 (1 ()()) ())
  (2 ()       ())
)

3
(1
  (1 (2 ()()) ())
  (2 ()       ())
)
by teni_teni
Sun Feb 06, 2005 6:37 am
Forum: Volume 1 (100-199)
Topic: 120 - Stacks of Flapjacks
Replies: 118
Views: 13174

Test the following input:

Code: Select all

4 4 1
My output:

Code: Select all

4 4 1
1 0
And you'd better not use "\b" in printf to cancel the outputting of the last white space.
Because, when redirecting your output to a file, the file has '^H' (=0x08) characters which are the cause of WA.
by teni_teni
Sat Feb 05, 2005 2:57 pm
Forum: Volume 1 (100-199)
Topic: 120 - Stacks of Flapjacks
Replies: 118
Views: 13174

Re: Please answer me this question about #120.

The correct interpretation is,
2. The biggest at position 1, the second biggest at position 2, the third biggest at position 3 .... the smallest on the top.

Go to advanced search