if you are solving it in java avoid TLE use TreeMap, the search is O(nlog2n) but when you end of append all the directory it is sorted, in other hand using hashmap hashset, and other tecniques, cause a TLE.
and of course use a buffer to print, don't print directly because the output is very large.
Search found 9 matches
- Sat Jul 31, 2010 6:08 am
- Forum: Volume 7 (700-799)
- Topic: 755 - 487--3279
- Replies: 115
- Views: 47879
- Fri Jul 30, 2010 1:12 am
- Forum: Volume 7 (700-799)
- Topic: 753 - A Plug for UNIX
- Replies: 20
- Views: 15831
Re: 753 - A Plug for UNIX
Ok, here are some test cases for this problem.
Input
10
4
A
B
C
D
6
a 0
b 1
c 2
d 3
e 4
f 5
9
0 A
0 D
1 A
1 B
2 B
2 C
3 C
4 A
5 A
4
A
B
C
D
5
laptop B
phone C
pager B
clock B
comb X
3
B X
X A
X D
5
A
B
C
D
E
5
a 0
b 1
c 2
d 3
e 4
9
0 A
0 D
1 A
1 B
2 B
2 C
2 E
3 C
4 B
5
A
B
C
D
E
6
a C
b C
c ...
Input
10
4
A
B
C
D
6
a 0
b 1
c 2
d 3
e 4
f 5
9
0 A
0 D
1 A
1 B
2 B
2 C
3 C
4 A
5 A
4
A
B
C
D
5
laptop B
phone C
pager B
clock B
comb X
3
B X
X A
X D
5
A
B
C
D
E
5
a 0
b 1
c 2
d 3
e 4
9
0 A
0 D
1 A
1 B
2 B
2 C
2 E
3 C
4 B
5
A
B
C
D
E
6
a C
b C
c ...
- Sun Jul 25, 2010 7:41 pm
- Forum: Bugs and suggestions
- Topic: km long judge queue (IV.)
- Replies: 4
- Views: 3177
Re: km long judge queue (IV.)
Hi, sorry to be the bearer of bad news, but again in judge queue, thanks for your attention.
- Thu Jul 22, 2010 7:40 pm
- Forum: Bugs and suggestions
- Topic: km long judge queue (IV.)
- Replies: 4
- Views: 3177
judge queue
Again in Judge Queue.
- Tue Jul 20, 2010 9:33 pm
- Forum: Bugs and suggestions
- Topic: 670 - The dog task bad format input
- Replies: 0
- Views: 2238
670 - The dog task bad format input
the test case have a mistake according the definition.
The first line of each dataset contains two integers N and M, separated by a space ( ). The second line contains N pairs of integers , separated by spaces. The third line contains M pairs of integers , separated by spaces.
so if you try to ...
The first line of each dataset contains two integers N and M, separated by a space ( ). The second line contains N pairs of integers , separated by spaces. The third line contains M pairs of integers , separated by spaces.
so if you try to ...
- Tue Jun 15, 2010 11:55 pm
- Forum: Volume 2 (200-299)
- Topic: 253 - Cube painting
- Replies: 28
- Views: 17449
253 - easy solution
I dont now every body want to rotate the cube.
it is a easy way to solve it, a very easy way.
we have a cube, that is a great facilitator, for the problem.
only see a ordinary cubic dice, the sum of your oposites sides is always seven, so if you are constructing one, and randomly generate the ...
it is a easy way to solve it, a very easy way.
we have a cube, that is a great facilitator, for the problem.
only see a ordinary cubic dice, the sum of your oposites sides is always seven, so if you are constructing one, and randomly generate the ...
- Wed Jan 16, 2008 4:26 am
- Forum: Volume 8 (800-899)
- Topic: 848 - Fmt
- Replies: 16
- Views: 14336
- Mon Jan 14, 2008 5:40 am
- Forum: Bugs and suggestions
- Topic: the problem ghost
- Replies: 1
- Views: 1542
the problem ghost
:-? I had a problem with my Browser, and occur a problem during the shipment, after this appeared a sign that mentions that the ID of the problem was incorrect, but the judge runs him, and even but, the judge takes it as a TLE, with time 0.000 and without any name for the problem.
so at this moment ...
so at this moment ...
- Fri Dec 29, 2006 3:51 pm
- Forum: Volume 3 (300-399)
- Topic: 343 - What Base Is This?
- Replies: 72
- Views: 28386
343
thank's for all.