915 - Stack of Cylinders

All about problems in Volume 9. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
User avatar
Abednego
A great helper
Posts: 281
Joined: Tue Sep 10, 2002 5:14 am
Location: Mountain View, CA, USA
Contact:

915 - Stack of Cylinders

Post by Abednego » Thu Nov 02, 2006 12:40 am

The problem description is ambiguous. Why is the path not (2, 3, 6, 7)? It seems that if cylinder 7 were big enough, it would be part of the path. What is the precise definition of the "continous path" and the "path tail"?
If only I had as much free time as I did in college...

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Thu Nov 02, 2006 1:09 am

See the picture in the problem. Imagine that some circles are packed in a rectangle. Suppose you need length 'x' to pack all the circles. To be more precise suppose you have to place all the circles between two vertical lines. 'x' is the minimum required length between the vertical lines. Now the circles that cant be removed (otherwise the value of 'x' will decrease) are the elemets of the continuous path. Path Head means the first circle that should be taken, and Path Trail means the last circle that should be taken.

2, 3, 6, 7 is not the answer because if you remove 7, it has no effect to 'x'. But if you remove 2, 3 or 6; 'x' will decrease.

Hope you understand.
Ami ekhono shopno dekhi...
HomePage

yiuyuho
A great helper
Posts: 325
Joined: Thu Feb 21, 2002 2:00 am
Location: United States
Contact:

Post by yiuyuho » Fri Jun 29, 2007 7:48 am

It is ensured that each cylinder can touch no more than one cylinder at its left and no more than one cylinder at its right.

What cylinders is it refering to? 3 is touching 4 and 6 on the right, right? :-)

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Fri Jun 29, 2007 10:09 am

yiuyuho wrote:It is ensured that each cylinder can touch no more than one cylinder at its left and no more than one cylinder at its right.

What cylinders is it refering to? 3 is touching 4 and 6 on the right, right? :-)
Right!

May be they are talking about the cylinders which make the path.
Ami ekhono shopno dekhi...
HomePage

sinclair
New poster
Posts: 1
Joined: Mon Jul 27, 2009 11:55 am

Re: 915 - Stack of Cylinders

Post by sinclair » Mon Jul 27, 2009 11:57 am

Help me please.....
I don't know what i have to use to solve this kind of problem.
any help please?????
Thank u.

metaphysis
Experienced poster
Posts: 128
Joined: Wed May 18, 2011 3:04 pm

Re: 915 - Stack of Cylinders

Post by metaphysis » Sun Feb 11, 2018 4:04 am

Test data generator.

Code: Select all

#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;

const int MAX_CASES = 100;

int main(int argc, char *argv[])
{
    srand(time(NULL));
    
    for (int c = 1; c <= MAX_CASES; c++)
    {
        int circles = rand() % 90 + 10;
        
        cout << circles << '\n';
        
        for (int i = 1; i <= circles; i++)
        {
            int radius = rand() % 1000 + 3;
            cout << radius << '\n';
        }
    }
    
    return 0;
}

muazuicom22
New poster
Posts: 25
Joined: Tue Sep 11, 2018 10:32 pm

Post by muazuicom22 » Sat Sep 29, 2018 6:19 pm

CTY TDL CHUYÊN NHẬN LÀM GIẤY TỜ :

Kính gửi Quý khách hàng , Cty TDL chúng tôi

Nhận làm tất cả các loại giấy tờ liên quan đến BĐS , từ dễ đến khó , khu vực Thành Phố HCM Và Bình Dương.
* Vẽ thiết kế xây dựng, xin giấy phép xây dựng.
* Vẽ hiện trạng đo đạc nhà đất, nhà máy, nhà xưởng.
*Dịch vụ thiết kế Phòng cháy, chữa cháy và Thẩm duyệt.
* Dịch vụ xin chuyển mục đích sử dụng đất.
* Dịch vụ hoàn công nhà xưởng, công trình trên đất.
* Dịch vụ tách thửa sổ đỏ, nhà đất, nhà xưởng, nhà máy.
* Dịch vụ xin cấp mới sổ đỏ, sổ hồng hoặc xin cấp Giấy chứng nhận Quyền sử dụng đất, quyền sở hữu nhà ở và tài sản khác gắn liền với đất.
* Dịch vụ xác định lại ranh giới, thực trạng nhà đất, cấp sổ mới.
* Dịch vụ xem xét lại quy hoạch xây dựng.
* Dịch vụ hợp thức hóa nhà đất.
* Dịch vụ sang tên , đăng bạ sang tên chủ quyền, thừa kế di chúc.


Ai có nhu cầu liên hệ 0938.242.835 c.Hong.
Quý khách Lưu lại khi cần . Trân trọng cảm ơn. Uy Tin_ chinh chuan.
Chúc Anh chị một ngày tốt lành

Post Reply

Return to “Volume 9 (900-999)”