## Search found 42 matches

Tue Jul 13, 2004 7:44 pm
Forum: Volume 100 (10000-10099)
Topic: 10069 - Distinct Subsequences
Replies: 26
Views: 11067

### 10069 Distinct Subsequences

it looked simple, but getting WA . is there any input with null string or any thing special?
Sat Jul 03, 2004 9:30 am
Forum: Algorithms
Topic: Aho/Corasick
Replies: 2
Views: 1512

### Aho/Corasick

can anyone give me a book name in which i can found the Aho/Corasick algorithm
Tue Jun 29, 2004 5:40 pm
Forum: Volume 106 (10600-10699)
Topic: 10680 - LCM
Replies: 38
Views: 12083
try to make a table. think in this way ---
if you know last digit of lcm(1...N) then you can aslo calculate last digit of lcm(1.....(N+1)).
Sat Apr 17, 2004 5:41 pm
Forum: Volume 101 (10100-10199)
Topic: 10171 - Meeting Prof. Miguel...
Replies: 68
Views: 23236
the output should be
2 B
because shahriar manzoor will go to B using cost 2
and Prof. Miguel will stay in B so he uses cost 0.

try this data

4
Y B A B 2
Y U B D 0
M B B C 3
M U B D 0
B B
output is
0 B D
Sat Apr 17, 2004 5:11 pm
Forum: Volume 101 (10100-10199)
Topic: 10152 - ShellSort
Replies: 33
Views: 8344
u can solve in o(n) time
Sat Dec 27, 2003 2:14 pm
Forum: Volume 105 (10500-10599)
Topic: 10594 - Data Flow
Replies: 40
Views: 25364
i think the sample i/o is ok. see 1st we find the shortest path (according to time). the shortest path time is 7 (per unit data) and the path is(1->2->4 or 1->3->4). here the link capacity is 100. so, we can send the whole data at the same time. so total time for 20 unit data is = 7*20=140 so it is ...
Sun Oct 05, 2003 9:13 am
Forum: Volume 105 (10500-10599)
Topic: 10557 - XYZZY
Replies: 31
Views: 14315
This process continues until she wins by entering the finish room
or dies by running out of energy (or quits in frustration).
did u consider the case in bold letter?
Sun Aug 31, 2003 8:21 pm
Forum: Algorithms
Topic: i am a new person pliiiiiz help :( :( :(
Replies: 8
Views: 2974
i can show u how sieve of eratosthenes works but not ur code. cause it looks very unusual. the sieve of eratosthenes is used to find all prime not exceeding a specified positive integer. let us take our limit is 100 take a bool type global array prime[limit+1] first set prime[1]=1 // 1 indicates com...
Tue Aug 19, 2003 5:56 pm
Forum: Volume 100 (10000-10099)
Topic: 10099 - The Tourist Guide
Replies: 91
Views: 27412
there are some errors in ur code [cpp] graph[x][y]=graph[y][x]=l; [/cpp] should be [cpp] graph[x][y]=graph[y][x]=l-1; //because the tourist will also go [/cpp] and u r doing [cpp] temp-- [/cpp] this is wrong. u should not do this u checked [cpp] if (temp%p!=0) sum++; [/cpp] i think it should be [cpp...
Sun Jun 15, 2003 7:13 pm
Forum: Volume 104 (10400-10499)
Topic: 10448 - Unique World
Replies: 8
Views: 3637
Sun Jun 15, 2003 5:54 pm
Forum: Volume 104 (10400-10499)
Topic: 10445 - Make Polygon
Replies: 35
Views: 14217
sorry for late reply its hard to understand ur procedure by watching the code only. it would be better if u say ur procedure. so i am describing how i have solved it: i calculated every angle of the polygon and find the maximum and minimum of them; first of all i determined the polygon is given in c...
Fri Jun 13, 2003 8:59 am
Forum: Volume 104 (10400-10499)
Topic: 10445 - Make Polygon
Replies: 35
Views: 14217
6
0 0
1 0
2 0
2 2
1 2
0 2

90.000000 180.000000

check this input and output. i think ur prog. gives
90.000000 90.000000

and one more thing, use pi = acos(-1) or pi=2*acos(0)
Fri Jun 13, 2003 6:10 am
Forum: Volume 104 (10400-10499)
Topic: 10445 - Make Polygon
Replies: 35
Views: 14217
if there are three point p p[i+1] p[i+2] in one line,
Should I ignore it or just count it as 180?

Just count it as 180 because In this problem you have to find the minimum and maximum angle of Picasso’s polygon. it does not matter the angle is 180 or not.
Wed Jun 11, 2003 5:06 pm
Forum: Volume 104 (10400-10499)
Topic: 10445 - Make Polygon
Replies: 35
Views: 14217
6
0 0
1 0
1 10
0 5
-1 10
-1 0

20
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
9 1
8 1
7 1
6 1
5 1
4 1
3 1
2 1
1 1
0 1

outputs are:

11.309932 337.380135
90.000000 180.000000

to lowai:
will the polygon be concave?
u read the problem statement carefully. then u will find it.
Tue Jun 10, 2003 6:51 pm
Forum: Volume 104 (10400-10499)
Topic: 10445 - Make Polygon
Replies: 35
Views: 14217
5
-1 0
1 0
1 10
0 5
-1 5

the output is:

11.309932 258.690068

i think it will help u . try to assign pi=acos(-1) or 2*acos(0). in this problem points may be given in clockwise or anticlockwise order. so u have to handle this case.