Search found 17 matches

by Tariq Shahriar
Sat Apr 07, 2007 11:01 am
Forum: General
Topic: Plz give me some problems
Replies: 3
Views: 1946

This is not a topic of Volume I. So you should submit this type of topics in Algorithm section. ...and if you want classified problems list, then go to: ShyGypsy / Igor’s Tools and use "Search query:" text box at top-left of the page. This is a rich site for ACM solver. you can use other useful fea...
by Tariq Shahriar
Tue Feb 13, 2007 1:47 pm
Forum: Volume 101 (10100-10199)
Topic: 10141 - Request for Proposal
Replies: 44
Views: 14881

However, there has another problem in your code. Initialize max_rep and min_cost by an out-of-range value for every case.
by Tariq Shahriar
Tue Feb 13, 2007 1:08 pm
Forum: Volume 101 (10100-10199)
Topic: 10141 - Request for Proposal
Replies: 44
Views: 14881

Problem mentioned: a line naming the proposal (up to 80 characters terminated by end of line). so the proposal name may contain white spaces. But your code is- for(i=1;i<=p;i++){ scanf("%s%lf%d",&proposal[i],&cost[i],&met_req[i]); so use gets(). You can optimize for(i=1;i<=p;i++){ scanf("%lf%d", cos...
by Tariq Shahriar
Thu Nov 16, 2006 12:34 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 21543

Rushow, you forgot the terms & conditions of the problem only one operation ( Flip ) is available and that is you can exchange two adjacent terms but your algorithm didn't perform like this. think about second sample input- 2 3 1 in your algo, first interchange occurs between 2 and 1, but 2 and 1 is...
by Tariq Shahriar
Tue Oct 17, 2006 11:13 am
Forum: Volume 104 (10400-10499)
Topic: 10424 - Love Calculator
Replies: 137
Views: 37275

Perhaps, problem is in your calcu() function
problem description wrote:make the sum of these numbers until it comes in one digit
so

Code: Select all

while(d>10)
    d=add(d); 
is wrong. beacuse, if d=10 then the loop will stop.

you may change the loop condition by this way-

Code: Select all

while(d>=10)
    d=add(d); 
or,

Code: Select all

while(d>9) 
    d=add(d); 
by Tariq Shahriar
Sun Oct 15, 2006 9:58 am
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 38498

the problem description mentioned Numbers will be at most 200 characters long. and also the number may contain leading zeroes. 03425 3455 i solved by this way- input in a string normally we add two number right to left. here add left to right. as a result this add reversely. the number may contain l...
by Tariq Shahriar
Sun Oct 15, 2006 9:01 am
Forum: Volume 5 (500-599)
Topic: 541 - Error Correction
Replies: 27
Views: 11295

the mistake is
int i,j,n,m,er=0,row,col,ec=0;
you need to initialize er,ec for every input set.
so place the initialization here.

Code: Select all

while(scanf("%d",&n)) 
   { 
      if(n==0) 
         break; 
      er=ec=0;
     .........
Be careful about initialization error.
by Tariq Shahriar
Wed Oct 11, 2006 9:08 am
Forum: Volume 111 (11100-11199)
Topic: 11113 - Continuous Fractions
Replies: 16
Views: 11588

Sohel vai (Bengali word), Thanks for your kind information.
But, is my continuous fraction output of the input correct? Will you post your output?
by Tariq Shahriar
Wed Oct 11, 2006 9:07 am
Forum: Volume 111 (11100-11199)
Topic: 11111 - Generalized Matrioshkas
Replies: 19
Views: 10402

Obviously

Code: Select all

:-) Matrioshka!
(from my ac code)
by Tariq Shahriar
Wed Oct 11, 2006 8:31 am
Forum: Volume 111 (11100-11199)
Topic: 11111 - Generalized Matrioshkas
Replies: 19
Views: 10402

Thanks Wei-Ming Chen.
my code would fail in your this test case -3 -1 -1 1 1 3 for improper checking.

Now ac in 244 millisec.
by Tariq Shahriar
Wed Oct 11, 2006 5:31 am
Forum: Volume 111 (11100-11199)
Topic: 11113 - Continuous Fractions
Replies: 16
Views: 11588

Wow! though this is a big mistake, but not all. the highest input is less than 10^20 i.e 99,999,999,999,999,999,999 [20 digit]. but unsigned long long can hold only (2^64)-1=18446744073709551615 [20 digit]. but less than the 81553255926290448384 from the highest input. so, if the input is 9999999999...
by Tariq Shahriar
Tue Oct 10, 2006 3:53 am
Forum: Volume 111 (11100-11199)
Topic: 11111 - Generalized Matrioshkas
Replies: 19
Views: 10402

and my code fell on these -10 -5 3 -10 -5 -3 3 5 10 11 Wei-Ming Chen, i can understand the problem of your code. you think the line of input as stack. when a positive number(let x) is inputed, then check that- if(stack_size!=0 && top_of_stack == x ) pop the top num; else print "try again". My progr...
by Tariq Shahriar
Tue Oct 10, 2006 3:43 am
Forum: Volume 111 (11100-11199)
Topic: 11113 - Continuous Fractions
Replies: 16
Views: 11588

11113 - Continuous Fractions

For this problem, I used
by Tariq Shahriar
Mon Oct 09, 2006 12:24 pm
Forum: Volume 111 (11100-11199)
Topic: 11111 - Generalized Matrioshkas
Replies: 19
Views: 10402

To clear more , consider the following input: -10 -8 8 -5 5 10 this is a invalid input; -8 8 -5 5 is surrounded by -10 10 and 8+5=13 sized box cannot be allocated in a 10 sized box. but above input can be validated in this way- -10 -8 -5 5 8 10 Now it is possible. because, if the 5 sized box is plac...
by Tariq Shahriar
Sat Oct 07, 2006 12:19 pm
Forum: Volume 101 (10100-10199)
Topic: 10141 - Request for Proposal
Replies: 44
Views: 14881

Oh ho! what a great mistake.

I forgot to store the highest proposal's price in low_price.

that's the wrong. Sorry.

Now AC (Air Conditioning).

Go to advanced search