Search found 146 matches

by hank
Mon Jul 07, 2003 6:23 am
Forum: C
Topic: about using "sscanf" :=)
Replies: 5
Views: 3705

Thanks a lot!!but what's the meaning of "%[^\0]"?
:P
by hank
Sun Jul 06, 2003 4:54 pm
Forum: C
Topic: about using "sscanf" :=)
Replies: 5
Views: 3705

about using "sscanf" :=)

[c]#include <stdio.h> #include <string.h> void main() { char arr[80]; int i,j,k; strcpy(arr,"1 2 3"); sscanf(arr,"%d",&i); sscanf(arr,"%d",&j); sscanf(arr,"%d",&k); printf("( %d %d %d )",i,j,k); }[/c] Can you tell me why "j != 2" and "k != 3" ? I want to convert the string "arr" to int ? How to modi...
by hank
Sun Jul 06, 2003 4:37 pm
Forum: C
Topic: Rounding methods
Replies: 6
Views: 2420

[cpp]while( ABS(x-9999.9)> 0.01 || ABS(y-9999.9)> 0.01 ) { /* carry on */ } /* end */[/cpp] Hi bery olivier! Can you tell me why you said it didn't work with 0.001? I used a funtion to check whether the two values are the same or not. [cpp] bool equal (double a,double b) { if (fabs(a-b)< 0.000000001...
by hank
Sat Jul 05, 2003 4:54 pm
Forum: Volume 3 (300-399)
Topic: 382 - Perfection
Replies: 95
Views: 19211

be careful "1 is DEFICIENT"
by hank
Sat Jul 05, 2003 4:49 pm
Forum: Volume 104 (10400-10499)
Topic: 10400 - Game Show Math
Replies: 32
Views: 17664

[c]if( res>32000 || res<-32000 ) return;
else if (used[n][res+32000] ) return;[/c]
by hank
Sat Jul 05, 2003 4:45 pm
Forum: Volume 4 (400-499)
Topic: 474 - Heads / Tails Probability
Replies: 50
Views: 10892

I have fixed it...Thanks a lot!! :D
by hank
Fri Jul 04, 2003 4:40 pm
Forum: C++
Topic: A very very small problem
Replies: 12
Views: 3794

[cpp]
while( x ){ // it works when x is true
...
}

//but why it can also work if cin doesn't return a boolean value?
while( cin>>x ){
...
}
[/cpp]
by hank
Fri Jul 04, 2003 4:02 pm
Forum: Volume 3 (300-399)
Topic: 301 - Transportation
Replies: 13
Views: 4886

hi,excuse me
What is B&B?
by hank
Mon Jun 30, 2003 10:27 am
Forum: Volume 4 (400-499)
Topic: 474 - Heads / Tails Probability
Replies: 50
Views: 10892

474 - Heads / Tails Probability

Hello !! I don't know why I always got WA. I have try all the possibilities for many cases.And it works. :oops: :oops: Here is my output 2^-1 = 5.000e-1 2^-2 = 2.500e-1 2^-3 = 1.250e-1 2^-4 = 6.250e-2 2^-5 = 3.125e-2 2^-6 = 1.563e-2 2^-7 = 7.813e-3 2^-8 = 3.906e-3 2^-16 = 1.526e-5 2^-17 = 7.629e-6 2...
by hank
Sun May 25, 2003 2:55 pm
Forum: C++
Topic: how to copy an array in&#12288;&#65315;
Replies: 2
Views: 1857

for example:
[cpp] int a[10],b[10];
.......
b=a; // copy a to b
[/cpp]
by hank
Sun May 25, 2003 7:27 am
Forum: Volume 103 (10300-10399)
Topic: 10364 - Square
Replies: 47
Views: 14867

try this:
8 1 2 3 4 5 6 7 8
10 21 14 13 11 9 6 4 3 2 1
output:
yes
yes

by the way...
I got accepted now,and I use backtracking.
But when I use the same method to solve Problem 307 "Sticks"
,I got TLE!!
(I guess problem307 must be solved by Knapsack...)
:P
by hank
Sun May 25, 2003 1:47 am
Forum: C++
Topic: A very very small problem
Replies: 12
Views: 3794

Is it correct?

[cpp]if( (cin>>i>>j>>k)==true ){

........
}[/cpp]
by hank
Thu May 22, 2003 4:06 pm
Forum: C++
Topic: A very very small problem
Replies: 12
Views: 3794

Code: Select all

( cin>>i>>j>>k )
What it may return when reaching the end of the file ?
Does it return "EOF" ?
by hank
Thu May 22, 2003 12:26 pm
Forum: Volume 3 (300-399)
Topic: 307 - Sticks
Replies: 56
Views: 17652

Hello Adrian Kuegel!!
What is your method to solve this problem?
Can you share your method with us?
by hank
Tue May 20, 2003 2:19 pm
Forum: Volume 3 (300-399)
Topic: 307 - Sticks
Replies: 56
Views: 17652

anupam wrote:i used dp but getting wa...
is there any tricky case????
The problem can be solved by DP? That's interesting!!
What's your method?

Go to advanced search