يمنع منعا باتاً وضع اي موضوع او مشاركة مخالفة لانظمة المنتدى او تحتوي على اعلان تجاري او بريد الكتروني شخصي او رقم هاتف كما يمنع انشاء اي مجموعات

   
 

 

 


كلية الحاسبات وتقنية المعلومات منتدى خاص بكلية الحاسبات وتقنية المعلومات

 
 
LinkBack أدوات الموضوع انواع عرض الموضوع
قديم 05-07-2012, 07:19 AM   #1
اهازيج
 





اهازيج غير متواجد حالياً
للاهمية يااهل الخبره في لغه السي بلس بلس لاتخذلوني

:السلام عليكم
لو سمحتم ابغا مساعدتكم ف دا السوال

It's 3000 years ago. The Pharao's pyramid has just been finished, and now the interior needs to be worked
on. However, it's pitch dark inside, and the problem of providing light for the workers has to be solved.
Electric light hasn't been invented yet, and lighting a fire inside the pyramid isn't a good solution either,
because the interior should stay clean of smoke and ash. Therefore, the senior architect's proposal is to use
mirrors to redirect sunlight from the entrance to the construction sites. From time to time, after work had
been finished at one place, the mirrors will have to be realigned in order to direct the light to another place.
For this task of realigning the mirrors, an algorithm is needed. The input will be a two-dimensional map of
one floor. The map displays the origin and the desired destination of the light, all obstacles and all mirrors,
and the current path of the light. The output should be another map in which the mirrors are realigned
appropriately (if neccessary) so that the light reaches the destination.
As the Pharao's chief software engineer, it's your job to design this algorithm. The "computers" - a group
of mathematically trained workers - will execute the program manually later. (Now you know why it took
decades to build the pyramids.)
Input Specification
The input file consists of one or more test cases. Each test case starts with a line that contains two integers:
the number of rows R and the number of columns C of the map.
Then a map of the current situation follows, given as R rows of C characters each.
The possible characters are 'O', 'D', '/', '\', '-', '|', '+', '#' and '.'. They stand for:
O origin of light
D destination of light
/ mirror in position 1
\ mirror in position 2
# obstacle
. free space
| light ray moving vertically
- light ray moving horizontally
+ crossing light rays
The origin of light 'O' will always be on the border. The remaining border will consist entirely of '#'
characters. Light always travels vertically or horizontally, and reflections are always 90-degree turns.
Output Specification
For each test case, output the same map with the following two modifications:
· Turn mirrors where it is neccessary, i.e. replace / by \ or vice versa.
· Redraw the light ray, i.e. change the characters |,-,+ and . accordingly, so that it goes from
O to D.
The characters O, D, and # always remain unchanged.
Sample Input
4 6
###O##
#..|.#
#D.\-#
######
11 49
##O##############################################
##|#............................................#
#.|............................../..\...........#
#.|.....\.......................................#
#.|..............#####..........................#
#.|......../......................../...........#
#.|..............#####..........................#
#.\------------------------------\..............#
#......###...###.................|..............#
#......###.D.###-----------------/..............#
#################################################
0 0
Sample Output
###O##
#..|.#
#D-/.#
######
##O##############################################
##|#............................................#
#.|............................../--\...........#
#.|.....\........................|..|...........#
#.|..............#####...........|..|...........#
#.|......../---------------------+--/...........#
#.|........|.....#####...........|..............#
#.\--------+---------------------/..............#
#......###.|.###................................#
#......###.D.###................./..............#
################################################# ماعليكم امر مرررررررررره مستعجله
اهازيج غير متواجد حالياً  
قديم 05-10-2012, 06:26 AM   #2
اهازيج
 





اهازيج غير متواجد حالياً
افتراضي

مشكورين انا حليته بس كنت حابه اتاكد من حلي وكنت ابغا اعرف input ايش هي بس
اهازيج غير متواجد حالياً  
 

أدوات الموضوع
انواع عرض الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are معطلة
Pingbacks are معطلة
Refbacks are متاحة

الانتقال السريع


الساعة الآن 07:33 AM.


جميع الحقوق محفوظة لمنتديات جامعة الملك عبد العزيز

Content Relevant URLs by vBSEO 3.5.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57