Search found 72 matches

by sith
Mon Dec 03, 2012 7:30 am
Forum: Volume 12 (1200-1299)
Topic: 1205 - Color a Tree
Replies: 5
Views: 3699

Re: 1205 Color a tree

Hi, I got WA. For input 9 4 2 25 500 32 1 4 8 12 6 4 2 4 3 4 1 2 5 2 6 2 7 1 8 1 9 My solution returns 1306, but why for this case correct value 1304. Is there better sequence than 432187965? Here is my solution import java.io.*; import java.util.*; class Main { public static void main(String[] args...
by sith
Sat Nov 17, 2012 7:27 am
Forum: Volume 120 (12000-12099)
Topic: 12003 - Array Transformer
Replies: 2
Views: 1530

12003 - Array Transformer

Hi
I solved this problem with O(n). but got TLE

Is there any faster algorithm. Do we need some faster structure, some thing like tree or Cartesian tree? Am I w
by sith
Sat Nov 10, 2012 7:33 am
Forum: Volume 12 (1200-1299)
Topic: 1254 - Top 10
Replies: 4
Views: 2136

Re: 1254 - Top 10. Why TLE?

I've got AC.

But I think that this approach is not optimal. We make a lot of substring operations.
Suffix tree would be better, but my first implementation has O(n^2) to init the tree, I believe because of that I've got TLE
by sith
Wed Nov 07, 2012 7:53 am
Forum: Volume 12 (1200-1299)
Topic: 1254 - Top 10
Replies: 4
Views: 2136

1254 - Top 10

Hi

I am using prefix tree to solve this task, but got TLE,
(I am using java)

Is it not enough fast?

Code: Select all

AC
by sith
Wed Oct 31, 2012 8:59 am
Forum: Volume 110 (11000-11099)
Topic: 11034 - Ferry Loading IV
Replies: 15
Views: 6770

Re: 11034 - Ferry Loading IV

AC , Thanks
by sith
Sat Oct 27, 2012 7:41 pm
Forum: Volume 110 (11000-11099)
Topic: 11034 - Ferry Loading IV
Replies: 15
Views: 6770

Re: 11034 - Ferry Loading IV

Sorry, my mistake :)

Code: Select all

AC
by sith
Sun Oct 21, 2012 8:56 am
Forum: Volume 110 (11000-11099)
Topic: 11034 - Ferry Loading IV
Replies: 15
Views: 6770

Re: 11034 - Ferry Loading IV

Hi

I am getting WA, why?

here is my solution

Code: Select all

AC
by sith
Wed Sep 12, 2012 10:13 am
Forum: Volume 112 (11200-11299)
Topic: 11243 - Texas Trip
Replies: 18
Views: 8159

Re: 11243 - Texas Trip

Ok.


Lets back again to the this case

4
10 1
10 -1
-10 1
-10 -1

It is coordinates of rectangle

So the longest line length is 20 - so the minmum square will be 400, why correct result is 242?
by sith
Tue Sep 11, 2012 10:10 am
Forum: Volume 112 (11200-11299)
Topic: 11243 - Texas Trip
Replies: 18
Views: 8159

Re: 11243 - Texas Trip

But if we have to cover points by square, how can the first sample has answer 4 ?


4
-1 -1
1 -1
1 1
-1 1
by sith
Mon Sep 10, 2012 3:29 pm
Forum: Volume 112 (11200-11299)
Topic: 11243 - Texas Trip
Replies: 18
Views: 8159

Re: 11243 - Texas Trip

Hi

Can anybody explain correctness of problem sample input.

Why the square for this case is 242. I believe that it has to be 40. Where is my mistake?

4
10 1
10 -1
-10 1
-10 -1
by sith
Mon Sep 10, 2012 12:57 pm
Forum: Volume 123 (12300-12399)
Topic: 12390 - Distributing Ballot Boxes
Replies: 10
Views: 2834

Re: 12390 - Distributing Ballot Boxes - how to solve

Could you please provide this sample, here on by the private message
by sith
Fri Sep 07, 2012 10:00 am
Forum: Volume 123 (12300-12399)
Topic: 12390 - Distributing Ballot Boxes
Replies: 10
Views: 2834

Re: 12390 - Distributing Ballot Boxes - how to solve

I have no idea how it could be division by zero.

I can't think , what case may lead to this state.

Perhaps there is other reason of RE :(
by sith
Thu Sep 06, 2012 2:40 pm
Forum: Volume 123 (12300-12399)
Topic: 12390 - Distributing Ballot Boxes
Replies: 10
Views: 2834

Re: 12390 - Distributing Ballot Boxes - RUNTIME ERROR

Thanks, I have re-written my solution, but I get RE now. Why? import java.io.*; import java.util.Arrays; import java.util.StringTokenizer; class Main { public static void main(String[] args) { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter writer = new B...
by sith
Tue Sep 04, 2012 2:34 pm
Forum: Volume 123 (12300-12399)
Topic: 12390 - Distributing Ballot Boxes
Replies: 10
Views: 2834

12390 - Distributing Ballot Boxes

Hi

I solved this problem within priority queue. But is is too slowly.


I have trying a lot of different approaches but without any results.

I believe there is known algorithm, but I don't know which one?
by sith
Mon Sep 03, 2012 2:37 pm
Forum: Volume 123 (12300-12399)
Topic: 12390 - Distributing Ballot Boxes
Replies: 10
Views: 2834

Re: 12390 - Distributing Ballot Boxes - Time Limit Error

Solved ^)


I was using Scanner - It is too slow :)

Go to advanced search