Search found 100 matches

by DJWS
Thu May 29, 2008 7:42 pm
Forum: Volume 4 (400-499)
Topic: 488 - Triangle Wave
Replies: 270
Views: 31155

Re: 488 TLE

Those cin and cout are slow function. Remove them and use printf and scanf. In this problem, you can replace "endl" with "\n" and get reasonable runtime. "endl" push a character "\n" into I/O buffer and flush the buffer immediately. Frequent flushing will take a lot of time, especially with massive...
by DJWS
Thu May 29, 2008 7:06 pm
Forum: Volume 106 (10600-10699)
Topic: 10673 - Play with Floor and Ceil
Replies: 11
Views: 6708

You can simply separate this problem into two cases and discuss each of them: "k divides x" and "k does not divide x." BTW, you can also think about the modular. Modular is somehow related to the floor and the ceil function. This problem can be solved by very simple formula instead of the extended E...
by DJWS
Thu May 29, 2008 11:15 am
Forum: Volume 101 (10100-10199)
Topic: 10135 - Herding Frosh
Replies: 33
Views: 12846

My algorithm is just wrapping all points in angular sequence, and try to enumerate all possible starting positions.
The code is judged as WA. I wonder if it has any mistakes.

Code: Select all

Cut After AC.
by DJWS
Sun Apr 13, 2008 9:08 am
Forum: Volume 9 (900-999)
Topic: 976 - Bridge Building
Replies: 4
Views: 4336

Re: 976 - Bridge Building

Does the input data contain such a case that the two terrain are twisted?

Code: Select all

####################
..######............
....##....#########.
.....##........####.
.....#######....####
.........##.....####
..######.......#####
####################
by DJWS
Tue Jan 29, 2008 5:30 pm
Forum: Volume 104 (10400-10499)
Topic: 10445 - Make Polygon
Replies: 35
Views: 14563

Test cases that some are collected from other threads and some are generated by me. :) 5 0 0 10 0 15 5 0 20 -15 5 5 -10 0 -10 2 0 1 10 2 10 0 5 10 0 10 2 0 1 -10 2 -10 0 13 0 7 7 0 14 8 3 15 2 9 3 11 4 12 6 11 8 9 9 8 7 6 5 5 3 5 3 0 0 10 0 0 10 4 0 0 10 0 10 10 0 10 6 0 0 1 0 2 0 2 2 1 2 0 2 6 0 0 ...
by DJWS
Wed Jan 09, 2008 6:07 pm
Forum: Volume 6 (600-699)
Topic: 675 - Convex Hull of the Polygon
Replies: 12
Views: 5528

I have noticed that this problem is not allowed for judgement in the old system. I think that the data sets for judging haven't been prepared yet. In the new system, you can got accepted even if your program prints nothing.
by DJWS
Wed Jan 09, 2008 5:45 pm
Forum: Volume 6 (600-699)
Topic: 624 - CD
Replies: 77
Views: 33426

This problem has a special correction program. It's ok to output any correct solution. (At this time, the new site does not show the information about the special judgement.)
by DJWS
Wed Jan 09, 2008 12:04 pm
Forum: Volume 6 (600-699)
Topic: 675 - Convex Hull of the Polygon
Replies: 12
Views: 5528

I just got accepted. I also think this problem is not so hard, as you said. For the input, there is only 1 polygon. The vertex number do not exceed 100. The coordinates are all integers. For the output, the sequence of convex hull's vertices can be either clockwise or counter-clockwise. Anyone is ac...
by DJWS
Fri Jan 04, 2008 2:06 pm
Forum: Volume 8 (800-899)
Topic: 848 - Fmt
Replies: 16
Views: 12093

Re: ???

Spaces need to be reserved, except the specific eliminations by rules. aaa _____aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaa bbbbb______________________________________________________________________ bbbbb ccccc__________________________________________________________...
by DJWS
Fri Nov 02, 2007 4:38 pm
Forum: Bugs and suggestions
Topic: Flags of the problems with multiple solutions
Replies: 1
Views: 1529

Flags of the problems with multiple solutions

Dear administrators,
I suggest something like ImageImage can be added to the new system.

And specially, thank you for your efforts on the new system. :)
by DJWS
Tue Oct 30, 2007 8:18 am
Forum: Algorithms
Topic: Need expert's view for geometry algos.
Replies: 23
Views: 9414

thanks mf and DP, I also found some Line Segment Intersection problems. I would like to share with you. Detect if two line segments intersect: 866 (lack of complicated cases) 10902 273 10256 (detect if two convex hulls interesct) 191 (detect if segment intersects with rectangle) Distance between two...
by DJWS
Mon Oct 29, 2007 3:11 pm
Forum: Algorithms
Topic: Need expert's view for geometry algos.
Replies: 23
Views: 9414

Hi everybody, I have a question about Line Segment Intersection : how to determine efficiently whether two segments intersect, when some endpoints of these two segments are colinear? Assume we don't need to find definite intersection point. More one question: how to find the intersection point with ...
by DJWS
Mon May 21, 2007 5:29 am
Forum: Bugs and suggestions
Topic: 10418 input description
Replies: 3
Views: 2856

10418 input description

m and n are mismatched. Each test case begins with a line containing 4 integers m, n, k, t ... The following n lines each contains m integers ... and the first sample input is 3 4 6 2 5 ----------------> (m, n, k, t) 1 1 1 5 4 1 4 5 3 3 1 2 1 2 6 1 3 2 1 3 6 1 4 3 1 3 2 6 1 3 5 ------------> (m line...
by DJWS
Fri Mar 30, 2007 10:02 am
Forum: Volume 106 (10600-10699)
Topic: 10679 - I Love Strings!!
Replies: 101
Views: 48638

I generate some test data although I haven't solved this problem.
The output should be all 'y'.
5
aaa
6
a
aa
aaa
a
aa
aaa
abc
6
a
b
c
ab
bc
abc
abcabab
6
aba
abc
bab
bca
cab
abab
aaabbb
6
ab
aabb
aaabbb
aabbb
abbb
bb
abbabba
6
ab
ba
abb
bba
abba
bbabb
by DJWS
Sun Mar 25, 2007 1:58 pm
Forum: Volume 2 (200-299)
Topic: 250 - Pattern Matching Prelims
Replies: 15
Views: 8176

I change variables' type from double to long double. And also calculate the difference from right to left, from bottom to top. My code is written in C++. It works well. :D

Go to advanced search