Anyone has additional testcases, or care to point to me some tricky interpretation of the problem?
Have matched all testcases here, and my code output for the last case agrees with El-Idioto.
Also for the following case:
abcabc-
#
#
The output should be
ab
bc
*
Correct?
Search found 11 matches
- Sat Jul 11, 2009 8:57 pm
- Forum: Volume 1 (100-199)
- Topic: 169 - Xenosemantics
- Replies: 18
- Views: 12334
- Mon Dec 10, 2007 6:01 pm
- Forum: Volume 1 (100-199)
- Topic: 150 - Double Time
- Replies: 18
- Views: 7876
Just be careful
Just got AC after three days struggle.
This problem takes extreme care, or maybe I am careless.
Check every boundary condition carefully, Feb 29, 1600, 1700, 2000 years, and when count from Dec 1899 to Jan 1900. Basically put some assert will help.
This problem takes extreme care, or maybe I am careless.
Check every boundary condition carefully, Feb 29, 1600, 1700, 2000 years, and when count from Dec 1899 to Jan 1900. Basically put some assert will help.
- Wed Dec 05, 2007 6:37 pm
- Forum: Volume 1 (100-199)
- Topic: 148 - Anagram checker
- Replies: 31
- Views: 7734
Clarification and TLE
First a clarification on the problem:
Each word can appear in the anagram at most once.
That is, given input
A
B
#
AA
#
there should be no output.
However, if the input is
A
A
B
#
AA
#
then the output should be
AA = A A
It is not clear from the problem statement whether a word can appear multiple ...
Each word can appear in the anagram at most once.
That is, given input
A
B
#
AA
#
there should be no output.
However, if the input is
A
A
B
#
AA
#
then the output should be
AA = A A
It is not clear from the problem statement whether a word can appear multiple ...
- Sat Dec 01, 2007 5:05 pm
- Forum: Volume 1 (100-199)
- Topic: 143 - Orchard Trees
- Replies: 90
- Views: 27100
Another speed up
For C++ users, someone told me that cin/cout are in general much slower, maybe 10x, than scanf/printf, so consider this if you still got TLE.
- Sat Dec 01, 2007 5:04 pm
- Forum: Volume 1 (100-199)
- Topic: 143 - Orchard Trees
- Replies: 90
- Views: 27100
TLE and WA
There are all too many TLE and WA complains about this problem.
For TLE, two improvements might be:
1. use a good polygon area computation routine, search mathworld.com for an idea
2. check points from minx to maxx only
I got several TLE because I forgot to cache triangle area values but did three ...
For TLE, two improvements might be:
1. use a good polygon area computation routine, search mathworld.com for an idea
2. check points from minx to maxx only
I got several TLE because I forgot to cache triangle area values but did three ...
- Tue Nov 20, 2007 5:21 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10157 - Expressions
- Replies: 23
- Views: 15410
bigint multiplication
I was unable to figure out the formula without multiplication. But I would like to confirm that the recurrence with O(n*d) multiplication still can get you to AC, but the trick is in integer multiplication.
I learned this from misof, who pointed out that you can use vector<int> to store large ...
I learned this from misof, who pointed out that you can use vector<int> to store large ...
- Tue Sep 20, 2005 9:46 am
- Forum: Volume 7 (700-799)
- Topic: 701 - The Archeologists' Dilemma
- Replies: 43
- Views: 35564
p701, solved but run in 2.531s
Since there a a number of peope get less than 0.010s to finish, there must be some better algorithm than bruth force on search exponent by
2n+1, 2n+2, ...
Will anyone please give a hint?
thanks
2n+1, 2n+2, ...
Will anyone please give a hint?
thanks
- Wed Aug 17, 2005 2:42 pm
- Forum: Volume 1 (100-199)
- Topic: 134 - Loglan-A Logical Language
- Replies: 45
- Views: 8858
Some fine points
1. There is BAD formed words, words that are NOT in the grammar. This is very unfortunate because the problem statement says "you can assume all words will be correctly formed". I checked this by an assertion which catches bad words.
2. There is NO upper case characters. So you don't have to worry ...
2. There is NO upper case characters. So you don't have to worry ...
- Fri Aug 12, 2005 9:29 am
- Forum: Volume 1 (100-199)
- Topic: 132 - Bumpy Objects
- Replies: 38
- Views: 10767
The WA output IS correct
Maniac's output is
Code:
UZJWU 13
YVTJTOOO 20
This is what should be output. Since the first polygon has point 1 point 2 and center form a triangle with 90deg, so segment(point 1, point 2) should be rejected as baseline. The same for the second polygon.
Also, about the format, I guess the magic ...
Code:
UZJWU 13
YVTJTOOO 20
This is what should be output. Since the first polygon has point 1 point 2 and center form a triangle with 90deg, so segment(point 1, point 2) should be rejected as baseline. The same for the second polygon.
Also, about the format, I guess the magic ...
- Sat Mar 19, 2005 11:21 am
- Forum: Volume 1 (100-199)
- Topic: 118 - Mutant Flatworld Explorers
- Replies: 68
- Views: 20555
possible error source
Here are some pitfalls I encounter for p118, seemingly trivial problem
1. What you code do if enum type var was assigned soemthing off bounds, e.g.
enum direction { S,N,E,W }; and enum direction dir = 5; what is dir+1 then?
2. is your buffer large enough? instructions are length 100 at most ...
1. What you code do if enum type var was assigned soemthing off bounds, e.g.
enum direction { S,N,E,W }; and enum direction dir = 5; what is dir+1 then?
2. is your buffer large enough? instructions are length 100 at most ...
- Sat Mar 19, 2005 11:19 am
- Forum: Volume 1 (100-199)
- Topic: 118 - Mutant Flatworld Explorers
- Replies: 68
- Views: 20555
output by my AC program
11 12 W
14 4 W
5 17 E
20 4 E LOST
10 2 S
7 9 N
0 20 W LOST
3 5 N
6 0 E
16 6 W
9 4 W
0 18 W
5 3 E
6 15 N
7 12 W
6 9 S
4 5 W
0 19 W LOST
10 6 S
20 10 S
0 18 W
19 4 S
3 1 N
3 6 S
13 12 S
9 4 E
11 9 E
5 14 S
7 14 N
1 19 E
19 1 E
4 8 E
20 12 E LOST
4 4 S
20 11 E LOST
12 13 S
5 1 W
16 16 E
13 15 N
17 12 E ...
14 4 W
5 17 E
20 4 E LOST
10 2 S
7 9 N
0 20 W LOST
3 5 N
6 0 E
16 6 W
9 4 W
0 18 W
5 3 E
6 15 N
7 12 W
6 9 S
4 5 W
0 19 W LOST
10 6 S
20 10 S
0 18 W
19 4 S
3 1 N
3 6 S
13 12 S
9 4 E
11 9 E
5 14 S
7 14 N
1 19 E
19 1 E
4 8 E
20 12 E LOST
4 4 S
20 11 E LOST
12 13 S
5 1 W
16 16 E
13 15 N
17 12 E ...