Search found 26 matches

by TimeString
Thu Jul 10, 2008 9:21 am
Forum: Volume 114 (11400-11499)
Topic: 11414 - Dream
Replies: 8
Views: 7302

11414 - Dream

can anybody explain the problem statement?
can more than one path lay on two points?
can one path connect a point itself?
by TimeString
Mon Jun 30, 2008 7:22 am
Forum: Volume 113 (11300-11399)
Topic: 11366 - Circle of Debt
Replies: 1
Views: 2385

Re: 11366 - Circle of Debt

If the judge data is the same as the original contest data, I think it is wrong: The forth case is: 1 5 0 1 0 0 0 0 0 0 1 1 1 2 10 0 0 5 0 0 5 This means that before the exchange Alice has 100, Bob has 100 and Cynthia has 25 crowns. Since Alice has to pay Bob 1 crown, and Bob has to pay Cynthia 5 c...
by TimeString
Mon May 19, 2008 4:14 pm
Forum: Volume 9 (900-999)
Topic: 930 - Polynomial Roots
Replies: 1
Views: 3397

930 - Polynomial Roots

i think each set of input of first line may contain a float number, not an integer number, i.e. the degree of polynomial may give like 3.0 .
i use scanf("%d") and get TLE, but use scanf("%s", word) and n = atoi(word) get AC.
by TimeString
Fri Jan 25, 2008 3:27 pm
Forum: Volume 101 (10100-10199)
Topic: 10187 - From Dusk Till Dawn
Replies: 50
Views: 24079

it is an unavailable input = =||

getting wrong answer a lot of times and finally ACCEPTED!!! i think it is a normal bfs problem but the starting time doesn't have a range, namely the starting time can be very large, more than 24, so after you read the starting time, you need to mod 24 , and then judge wheter it is <=6 or >=18. if s...
by TimeString
Sun Jan 13, 2008 8:33 am
Forum: Volume 113 (11300-11399)
Topic: 11321 - Sort! Sort!! and Sort!!!
Replies: 50
Views: 27194

the problem says the operation mod should exactly follow C language, so you needn't to determine whether a number is positive or negitive.

but when you have to determine a number is odd or not, use should carefully use mod operation, because a negative odd number mod 2 returns -1.
by TimeString
Sun Dec 30, 2007 8:14 am
Forum: Volume 112 (11200-11299)
Topic: 11285 - Exchange Rates
Replies: 6
Views: 3762

rio wrote:Send a code with commenting out below part.

Code: Select all

            if(t>dp[i])
               dp[i]=t;
            if(dp[j]>dp[i])
               dp[i]=dp[j]; 
You could guess why its getting TLE.
i still don't know why.
does it mean that it costs a lot of time to do float number comparison?
by TimeString
Fri Dec 28, 2007 4:04 pm
Forum: Volume 112 (11200-11299)
Topic: 11285 - Exchange Rates
Replies: 6
Views: 3762

rio wrote:You code has a bug. You didn't initialize erate[0], but using in
I sent a code which initialize erate[0] with 1e9 and it got WA in 0.060 s.
thanks a lot.
but i think the bug will lead to runtime error or wrong answer, not time limited exceed = =||
by TimeString
Fri Dec 28, 2007 2:50 pm
Forum: Volume 112 (11200-11299)
Topic: 11285 - Exchange Rates
Replies: 6
Views: 3762

#include <stdio.h> int main(){ int en; double erate[400]; int i,j; double dp[400]; while(scanf("%d",&en)==1 && en>0){ for(i=1;i<=en;i++) scanf("%lf",&erate[i]); dp[0]=1000.0; for(i=1;i<=en;i++){ dp[i]=0.0; for(j=0;j<i;j++){ static double t; t=dp[j]/erate[j]*0.97*...
by TimeString
Fri Dec 28, 2007 1:46 pm
Forum: Volume 112 (11200-11299)
Topic: 11285 - Exchange Rates
Replies: 6
Views: 3762

11285 - Exchange Rates

i use O(n^2) solution but seems it does not expected, i got TLE.
it's very strange because the limit of n is 365, so i just want to check do i really have to implement an O(n) solution?
by TimeString
Thu Dec 06, 2007 5:59 pm
Forum: Volume 113 (11300-11399)
Topic: 11305 - Chess on Planet X
Replies: 6
Views: 2372

"However its(queen's) powerful attack can be blocked with a Pawn, just like chess on Earth"

what does it means? can anybody explain? thanks ^^
by TimeString
Thu Dec 06, 2007 4:37 pm
Forum: Volume 113 (11300-11399)
Topic: 11321 - Sort! Sort!! and Sort!!!
Replies: 50
Views: 27194

long long int get WA ??

although i have accepted this problem, but i wonder what's the bug in my previous code. #include <stdio.h> #include <stdlib.h> long long int en,em; int mod(long long int n,long long int m){ if(n>0) return n%m; else return m-(-n)%m; } int cmp2(long long int a,long long int b){ if(a<b) return -1; else...
by TimeString
Sun Sep 02, 2007 11:27 am
Forum: Volume 112 (11200-11299)
Topic: 11201 - The problem of the crazy linguist
Replies: 21
Views: 12623

why is the output for "bubu" is "below" ? First thing we should consider is how many vaild words are there? The problem says the first letter is the same as the given word, second and fourth letter have 5 choices separatedly, and the third letter has 21 choices. So total possibl...
by TimeString
Thu Aug 09, 2007 4:37 am
Forum: Volume 111 (11100-11199)
Topic: 11110 - Equidivisions
Replies: 33
Views: 22526

Re: still get WA

If there is empty line do you automatically output "wrong" ?? Yeah, it should print "wrong". Here are some I/O. Hope it helps. Input: 1 2 1 1 2 1 1 1 2 2 1 1 1 2 2 1 2 2 1 1 1 2 1 2 3 1 1 1 2 1 3 2 1 2 2 2 3 3 1 1 1 2 1 3 2 1 2 2 2 3 3 1 1 1 2 2 1 3 3 3 2 2 3 3 1 1 1 2 1 3 1 1 1...
by TimeString
Mon Aug 06, 2007 12:58 pm
Forum: Volume 111 (11100-11199)
Topic: 11110 - Equidivisions
Replies: 33
Views: 22526

Finally, I get AC :D I use a lot of OLE and get some conclution: (In one case...) - A line may not contain exactly 2*N numbers, maybe less than it, maybe more than it. Moreover, it is possible that there are no numbers in this line!! So if you use C or C++, you'd better use gets(). - Although you do...
by TimeString
Mon Aug 06, 2007 8:41 am
Forum: Volume 112 (11200-11299)
Topic: 11256 - Repetitive Multiple
Replies: 15
Views: 8142

shakil wrote:Why WA???? i can not find any problem. Please help.....
Try this:

Code: Select all

3
117
121
126
Correct answer is:

Code: Select all

108108
110110
108108

Go to advanced search