Search found 49 matches

by suneast
Sat Apr 30, 2011 5:18 am
Forum: Volume 6 (600-699)
Topic: 676 - Horse Step Maze
Replies: 21
Views: 14194

Re: 676 - Horse Step Maze

* Wow, this problem is really my nightmare
*
* "If the number of steps is over 50000 print `more than 50000 steps'."
* at first, I miss this sentence and got a dozen of WA...
*
* I try to store the answer as ANSWER[size++]=(...)
* then I check size>50000, but it's quite wrong
* because the ...
by suneast
Fri Apr 22, 2011 5:23 pm
Forum: Volume 119 (11900-11999)
Topic: 11926 - Multitasking
Replies: 21
Views: 11020

Re: 11926 - Multitasking

Imti wrote: hi,
here is the output from my ac code

Code: Select all

CONFLICT
CONFLICT
hope I'm help to U...

p.s this problem is quite easy if you are brave enough to solve it using brute force~

happy coding~ :wink:
by suneast
Sat Apr 02, 2011 2:05 am
Forum: Bugs and suggestions
Topic: 10689 - Yet another Number Sequence
Replies: 0
Views: 1854

10689 - Yet another Number Sequence

Hi, Admin

I think my solution for this problem is WRONG but also got AC...
maybe the judge don't have the test case below, which I think is really necessary, and important


1
10 0 0 1

the correct output is

0

but my code output

10

because in my code, I have a silly mistake

if(n==0 ...
by suneast
Mon Feb 28, 2011 6:51 am
Forum: Volume 119 (11900-11999)
Topic: 11926 - Multitasking
Replies: 21
Views: 11020

Re: 11926 - Multitasking

I just maintained a boolean array of size 10^6 and for each task marked the corresponding indices. When there is any conflict, I just stopped altogether. With this approach, you will just need 10^6 comparisons - which is small enough to pass the time limit.

:oops: Oooooooops...
how silly I am ...
by suneast
Sun Feb 27, 2011 3:55 pm
Forum: Volume 119 (11900-11999)
Topic: 11926 - Multitasking
Replies: 21
Views: 11020

11926 - Multitasking

Oh, my god ! I need help...

this problem isn't seems hard ...
but in fact I can't figure out how to solve it excepted for brute force, which directly cause me getting TLE :o

I know

for any two ONE-TIME task, we can use O(n^2) brute force to check whether they are intersect with each other
for ...
by suneast
Sun Feb 27, 2011 3:46 pm
Forum: Volume 119 (11900-11999)
Topic: 11934 - Magic Formula
Replies: 6
Views: 4407

Re: 11934 - Magic Formula

what's wrong with this problem?? f (n) = a x 2 + b x + c .... here what should I think?? Is it b*x or 'x' is here for multiplication.If so....where is other variable?? Again..... test cases are also confusing. 3rd and 4th test case are same but answer is different. :-? Plz...help. I got WA. I didn ...
by suneast
Wed Feb 16, 2011 10:13 am
Forum: Volume 119 (11900-11999)
Topic: 11920 - 0 s, 1 s and ? Marks
Replies: 17
Views: 7938

Re: 11920

finally got AC with my previous mention method :D

my method is


* b-search and greedy
*
* if the digits before && after "?" is different, we can change the sequence to
* *0?1* -> *0?1* still don't know
* *0??1* -> *0101* ans>=1
* *0???1* -> *01001* ans>=2
* *0????1* -> *010101* ans>=1 ...
by suneast
Wed Feb 16, 2011 9:21 am
Forum: Volume 119 (11900-11999)
Topic: 11920 - 0 s, 1 s and ? Marks
Replies: 17
Views: 7938

Re: 11920

hi, all

after struggle for this problem a few days, I still keep getting WA... :-?

my method is quite simple

b-search the answer and greedy

merge '?' with the previous sequence, util I can't merge them , I try to merge '?' with the successive sequence.

any special test case?

I have try what ...
by suneast
Thu Feb 10, 2011 2:18 pm
Forum: Volume 119 (11900-11999)
Topic: 11910 - Closest Fractions
Replies: 8
Views: 4231

Re: 11910 - Closest Fractions


Hi, mpi


I think your data input is invalid. :(

because in the problem description :

Each case contains one number on a line, each with exactly ten digits.


but I will still print out the output from my accepted program


Input : 3.141592654
1 : 3.141592920 = 355 / 113
2 : 3.141630901 ...
by suneast
Thu Feb 10, 2011 11:28 am
Forum: Volume 119 (11900-11999)
Topic: 11920 - 0 s, 1 s and ? Marks
Replies: 17
Views: 7938

Re: 11920

Hi ,receme
Can u plz give me some hints on how 2 solve this problem using GREEDY method? :)

I can't figure out how to reduce the time complex using dynamic programming, in fact, I got TLE using DP :(

Maybe I have missed some important condition...

thx so much for you help :wink:
by suneast
Wed Feb 02, 2011 12:25 pm
Forum: Volume 119 (11900-11999)
Topic: 11910 - Closest Fractions
Replies: 8
Views: 4231

Re: 11910 - Closest Fractions

Oh, I’m so sorry zobayer…

Actually I mean that :
We should read the data using string format, to avoid float point precision error, then output what we have read. (I think this is the most important part in this problem :)

I do it like this:

double var;
char str[20];

scanf("%s",&str);
sscanf(str ...
by suneast
Sun Jan 30, 2011 5:58 am
Forum: Volume 119 (11900-11999)
Topic: 11910 - Closest Fractions
Replies: 8
Views: 4231

Re: 11910 - Closest Fractions

now , I got AC...
but still don't know why :o

I just change my reading to

Code: Select all

	scanf("%s",str);
	puts(str);
:D

happy coding~
by suneast
Sun Jan 30, 2011 5:45 am
Forum: Volume 119 (11900-11999)
Topic: 11910 - Closest Fractions
Replies: 8
Views: 4231

11910 - Closest Fractions

hi, all :

for this problem, seems quite easy at first sight... :wink:

but I keep getting WA during the contest and don't know why

any tricks ?

thx in advance :D
by suneast
Tue Jan 11, 2011 5:39 am
Forum: Volume 119 (11900-11999)
Topic: 11902 - Dominator
Replies: 20
Views: 14159

Re: 11902 - dominator

Finally got Ac :wink:

the graph can be disconnected actually :)

happy coding.... :D
by suneast
Tue Jan 11, 2011 5:33 am
Forum: Volume 119 (11900-11999)
Topic: 11902 - Dominator
Replies: 20
Views: 14159

Re: 11902

Hi, MRH :wink:

My code have passed your data post above, but I still keep getting WA... and don't know why

My algorithm is quite simple:
delete NODE_U from the graph
if I can't visit NODE_V from 0, then NODE_U is Dominator of NODE_V

and here's my main algorithm code


deleted... after got ac ...

Go to advanced search