Search found 25 matches

by mrahman
Tue Jun 10, 2008 8:53 am
Forum: Volume 113 (11300-11399)
Topic: 11342 - Three-square
Replies: 14
Views: 6631

Re: 11342 - Three-square

hi!

can anyone tell me what is the meaning of "If there is more than one possible answer, print the one that comes first lexicographically" in this problem?
P.S. I have solved the problem before getting a wrong answer because I had diverted by the line.

Thanks in advance

[Sorry for my poor english]
by mrahman
Mon Jan 22, 2007 6:24 am
Forum: Volume 111 (11100-11199)
Topic: 11158 - Elegant Permuted Sum
Replies: 23
Views: 15014

Here is the greedy approah. First sort the array. Then try to construct the permutation array placing each pair(highest,lowest) of integer into a blank array. Place the highest and lowest number in the middle of the permutation array. Then place the second highest number neighbouring to the lowest n...
by mrahman
Wed Jan 17, 2007 4:02 am
Forum: Volume 111 (11100-11199)
Topic: 11120 - Very Funny Mr. Feynman
Replies: 11
Views: 3992

Hi mysword,

I have no Idea about any critical I/O about this problem.

Here is some sample I/O

Input:

Code: Select all

2
3
5
7
11
13
19
23
29
31
37
41
43
47
Output:

Code: Select all

2 149 9
3 77 0
5 129 4
7 127 8
11 180 4
13 3 5
17 466 6
19 49 4
23 36 9
29 50 8
31 158 3
37 19 9
41 51 8
43 13 0
47 79 9
Hope this will help.
by mrahman
Wed Oct 18, 2006 5:51 am
Forum: Volume 111 (11100-11199)
Topic: 11110 - Equidivisions
Replies: 33
Views: 18979

Hi slxst,

Try this

input #

Code: Select all

2
1 2 0 0
5
0 0 1 2 1 3 3 2 2 2
2 1 4 2 4 1 5 1 3 1 3
4 5 5 2 5 3 5 5 5 4
2 5 3 4 3 5 4 3 4 4
0
output #

Code: Select all

good
wrong
Hope it will help.
by mrahman
Mon Oct 16, 2006 8:02 am
Forum: Volume 111 (11100-11199)
Topic: 11120 - Very Funny Mr. Feynman
Replies: 11
Views: 3992

11120 - Very Funny Mr. Feynman

Hi,

I have solved the problem using Brute Force Method. At first I am trying to find out a Mathematical Solution or A formula but after spending hours of time I have failed. Is there any possiblity to have a mathematical Solution of this problem.

Thanks in advance

Sorry for my poor english.
by mrahman
Mon Oct 16, 2006 4:14 am
Forum: Volume 111 (11100-11199)
Topic: 11121 - Base -2
Replies: 23
Views: 14552

Hello Lame,

Think about Simply Binary number System

Code: Select all

           16  8  4  2  1        
   6 =            1  1  0

and negative 2 (-2) base System

           16  -8  4  -2  1
   6 =      1   1  0   1  0
good luck!!
by mrahman
Mon Oct 16, 2006 3:19 am
Forum: Volume 9 (900-999)
Topic: 928 - Eternal Truths
Replies: 11
Views: 5238

Thanks to little joey and Darko,

I just change my Queue size to 300000 and get AC. At first I didn't think about this amount of size.

Thank you anyway
by mrahman
Fri Oct 13, 2006 2:20 pm
Forum: ACM ICPC Archive Board
Topic: p2195 Counting Zeroes (dhaka regionals)
Replies: 25
Views: 11263

hi all

I also have solved the problem and timing at 5.855s. But I think the timing is poor. some author have timing less than 3s. What is the method if anyone can explain. Thanks in advance.

Sorry for my poor english
by mrahman
Fri Oct 13, 2006 1:44 pm
Forum: Volume 110 (11000-11099)
Topic: 11028 - Sum of Product
Replies: 24
Views: 12867

hi sakhassan your formula is wrong. There is two formula. One for Odd number, other for even number. The input 21 and 22 is invalid. here is the output for 2-20 Case #1: 1 Case #2: 1 Case #3: 3 Case #4: 8 Case #5: 21 Case #6: 43 Case #7: 69 Case #8: 102 Case #9: 145 Case #10: 197 Case #11: 261 Case ...
by mrahman
Fri Oct 13, 2006 1:25 pm
Forum: Volume 9 (900-999)
Topic: 928 - Eternal Truths
Replies: 11
Views: 5238

Hi little joey I have checked those already. But fail to get AC. Here is my search function #define SIZE 100001 #define INF 1000000000 int dr[]={1,0,-1,0}; int dc[]={0,1,0,-1}; int d[301][301][3],n,m,sx,sy,tx,ty,st,end; char grid[301][301]; typedef struct node { int x,y,cost,dir; }node; node Q[SIZE]...
by mrahman
Fri Oct 13, 2006 9:51 am
Forum: Volume 9 (900-999)
Topic: 928 - Eternal Truths
Replies: 11
Views: 5238

928 - Eternal Truths

I am getting WA several times using BFS with a distance array d[301][301][3]
Can anyone put some input/output.

Thanks in advance
by mrahman
Thu Oct 12, 2006 5:02 am
Forum: Volume 111 (11100-11199)
Topic: 11110 - Equidivisions
Replies: 33
Views: 18979

Hi, aniket, Your approach is good. But your Input taking method failed you to accept this code. Try to use gets() function instead of scanf() function and then parse the integer from the string. and you could simplify your code like #include<stdio.h> long mat[105][105],total_number,total[105],no_x[1...
by mrahman
Wed Oct 11, 2006 4:40 am
Forum: Volume 110 (11000-11099)
Topic: 11062 - Andy's Second Dictionary
Replies: 38
Views: 18404

I am getting Runtime Error at least 12 times and have no clue. Plz help me #include<stdio.h> #include<ctype.h> #include<string.h> #include<stdlib.h> char list[510][10001],cnt; char str[100001],temp[10001]; int sort_function(const void *a, const void *b) { return (strcmp((char *)a,(char *)b)); } int ...
by mrahman
Tue Oct 10, 2006 1:37 pm
Forum: Volume 110 (11000-11099)
Topic: 11093 - Just Finish it up
Replies: 14
Views: 8004

Thank you smilitude for your test input.

I solved it using kp's method. But why this is O(n). Can anyone explain. Is there anyother method to solve this problem?

Thanks in advance

Sorry for my poor english
by mrahman
Tue Oct 10, 2006 1:23 pm
Forum: Volume 110 (11000-11099)
Topic: 11094 - Continents
Replies: 43
Views: 19897

Dear SamuraiShaz, Why you do this if(L>100) W = L-1; else W = L+1; You don't have to determine water denoted character. If you really want to do so use digit in place of Letter. Becasue in problem statement Maps are given as M x N tables, filled with at most two different letters denoting land and w...

Go to advanced search