合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

        代做COMP9021、代寫Python設(shè)計(jì)編程

        時(shí)間:2024-04-03  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



        COMP**21 Principles of Programming
        Term 1, 2024
        Coding Quiz 5
        Worth 4 marks and due Week 8 Thursday @ 9pm
        Description
        You are provided with a stub in which you need to insert your code where indicated without doing
        any changes to the existing code to complete the task.
        Given the value of seed and density, the provided code randomly fills an array (or grid) of size
        10 x 10 with 0s and 1s. Your task is to determine and output the size of the largest parallelogram
        with horizontal sides. A parallelogram consists of a line with at least 2 consecutive 1s, with below
        at least one line with the same number of consecutive 1s, all those lines being aligned vertically in
        which case the parallelogram is actually a rectangle, for instance:
        1 1 1
        1 1 1
        1 1 1
        1 1 1
        or consecutive lines move to the left by one position, for instance:
         1 1 1
         1 1 1
         1 1 1
        1 1 1
        or consecutive lines move to the right by one position, e.g.
        1 1 1
         1 1 1
         1 1 1
         1 1 1
        The size is the number of 1s in the parallelogram. In the above examples, the size is 12.
        See test cases below for more examples.
        2
        Due Date and Submission
        Quiz 5 is due Week 8 Thursday 4 April 2024 @ 9.00pm (Sydney time).
        Note that late submission with 5% penalty per day is allowed up to 3 days from the due date, that
        is, any late submission after Week 7 Sunday 7 April 2024 @ 9pm will be discarded.
        Make sure not to change the filename quiz_5.py while submitting by clicking on [Mark] button
        in Ed. It is your responsibility to check that your submission did go through properly using
        Submissions link in Ed otherwise your mark will be zero for Quiz 5.
        Test Cases
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 1
        Here is the grid that has been generated:
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        There is no parallelogram with horizontal sides.
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 2
        Here is the grid that has been generated:
        1 1 0 1 1 1 1 1 1 0
        0 1 0 0 1 0 1 0 0 1
        1 0 1 1 1 0 1 1 1 0
        0 0 1 0 1 1 0 1 0 0
        0 0 0 1 0 0 1 1 0 1
        1 0 1 0 1 1 0 1 1 0
        1 0 0 0 0 1 1 0 0 0
        0 0 0 1 1 0 0 1 1 1
        1 1 0 1 0 1 1 0 0 0
        1 0 0 1 0 1 1 0 0 0
        The largest parallelogram with horizontal sides has a size of 4.
        3
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 3
        Here is the grid that has been generated:
        1 1 0 1 1 1 1 1 1 1
        1 0 1 0 1 0 0 1 1 1
        1 1 0 1 0 1 0 1 1 1
        1 0 1 1 1 1 1 0 1 1
        1 1 1 0 1 0 0 1 1 1
        1 1 0 1 1 1 0 1 1 1
        0 0 1 0 0 0 1 1 0 0
        1 1 1 0 1 1 1 1 0 1
        1 1 0 1 1 1 1 1 0 1
        1 1 1 0 1 0 0 0 0 1
        The largest parallelogram with horizontal sides has a size of 12.
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 4
        Here is the grid that has been generated:
        1 1 0 1 1 1 1 1 1 1
        1 1 1 0 1 1 1 0 0 1
        1 0 1 1 1 1 1 1 1 0
        0 0 1 0 1 1 1 1 0 1
        1 1 1 1 0 0 1 1 0 1
        1 0 1 1 1 1 0 1 1 1
        1 1 1 1 0 1 1 0 0 1
        1 0 0 1 1 1 1 1 1 1
        1 1 0 1 0 1 1 1 1 0
        1 0 1 1 1 1 1 0 0 1
        The largest parallelogram with horizontal sides has a size of 12.
        4
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 1 4
        Here is the grid that has been generated:
        1 0 1 0 1 1 1 1 1 0
        1 0 1 1 0 1 1 1 0 1
        0 0 0 0 1 1 1 0 1 1
        1 1 1 1 1 1 1 0 1 0
        1 1 0 1 1 1 1 1 1 1
        0 1 1 1 1 1 1 1 0 1
        0 1 1 1 1 0 1 0 1 1
        1 1 1 0 1 1 1 1 1 1
        1 0 1 1 1 1 0 1 1 1
        1 1 1 1 1 0 1 1 0 1
        The largest parallelogram with horizontal sides has a size of 16.
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 5
        Here is the grid that has been generated:
        1 1 0 1 1 1 1 1 1 1
        1 1 1 1 1 1 0 1 1 1
        1 1 1 0 0 1 1 1 0 1
        1 1 1 1 1 1 1 1 1 0
        1 0 0 1 0 1 1 1 1 1
        0 1 1 1 1 1 1 1 0 0
        1 1 1 0 1 1 1 0 1 1
        1 1 1 1 1 1 1 0 1 1
        1 1 1 1 1 1 1 0 1 1
        1 0 0 1 1 0 0 1 1 1
        The largest parallelogram with horizontal sides has a size of 15.
        5
        Test Cases Explained
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 1
        Here is the grid that has been generated:
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        0 0 0 0 0 0 0 0 0 0
        There is no parallelogram with horizontal sides.
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 2
        Here is the grid that has been generated:
        1 1 0 1 1 1 1 1 1 0
        0 1 0 0 1 0 1 0 0 1
        1 0 1 1 1 0 1 1 1 0
        0 0 1 0 1 1 0 1 0 0
        0 0 0 1 0 0 1 1 0 1
        1 0 1 0 1 1 0 1 1 0
        1 0 0 0 0 1 1 0 0 0
        0 0 0 1 1 0 0 1 1 1
        1 1 0 1 0 1 1 0 0 0
        1 0 0 1 0 1 1 0 0 0
        The largest parallelogram with horizontal sides has a size of 4.
        6
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 3
        Here is the grid that has been generated:
        1 1 0 1 1 1 1 1 1 1
        1 0 1 0 1 0 0 1 1 1
        1 1 0 1 0 1 0 1 1 1
        1 0 1 1 1 1 1 0 1 1
        1 1 1 0 1 0 0 1 1 1
        1 1 0 1 1 1 0 1 1 1
        0 0 1 0 0 0 1 1 0 0
        1 1 1 0 1 1 1 1 0 1
        1 1 0 1 1 1 1 1 0 1
        1 1 1 0 1 0 0 0 0 1
        The largest parallelogram with horizontal sides has a size of 12.
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 4
        Here is the grid that has been generated:
        1 1 0 1 1 1 1 1 1 1
        1 1 1 0 1 1 1 0 0 1
        1 0 1 1 1 1 1 1 1 0
        0 0 1 0 1 1 1 1 0 1
        1 1 1 1 0 0 1 1 0 1
        1 0 1 1 1 1 0 1 1 1
        1 1 1 1 0 1 1 0 0 1
        1 0 0 1 1 1 1 1 1 1
        1 1 0 1 0 1 1 1 1 0
        1 0 1 1 1 1 1 0 0 1
        The largest parallelogram with horizontal sides has a size of 12.
        7
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 1 4
        Here is the grid that has been generated:
        1 0 1 0 1 1 1 1 1 0
        1 0 1 1 0 1 1 1 0 1
        0 0 0 0 1 1 1 0 1 1
        1 1 1 1 1 1 1 0 1 0
        1 1 0 1 1 1 1 1 1 1
        0 1 1 1 1 1 1 1 0 1
        0 1 1 1 1 0 1 0 1 1
        1 1 1 0 1 1 1 1 1 1
        1 0 1 1 1 1 0 1 1 1
        1 1 1 1 1 0 1 1 0 1
        The largest parallelogram with horizontal sides has a size of 16.
        $ python3 quiz_5.py
        Enter two integers, the second one being strictly positive: 0 5
        Here is the grid that has been generated:
        1 1 0 1 1 1 1 1 1 1
        1 1 1 1 1 1 0 1 1 1
        1 1 1 0 0 1 1 1 0 1
        1 1 1 1 1 1 1 1 1 0
        1 0 0 1 0 1 1 1 1 1
        0 1 1 1 1 1 1 1 0 0
        1 1 1 0 1 1 1 0 1 1
        1 1 1 1 1 1 1 0 1 1
        1 1 1 1 1 1 1 0 1 1
        1 0 0 1 1 0 0 1 1 1
        The largest parallelogram with horizontal sides has a size of 15.

        請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

        掃一掃在手機(jī)打開當(dāng)前頁
      1. 上一篇:越南S2結(jié)婚簽證費(fèi)用是多少(S2簽證是什么)
      2. 下一篇:學(xué)生簽入境菲律賓條件(學(xué)生簽申請(qǐng)指南)
      3. 無相關(guān)信息
        合肥生活資訊

        合肥圖文信息
        出評(píng) 開團(tuán)工具
        出評(píng) 開團(tuán)工具
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        戴納斯帝壁掛爐全國售后服務(wù)電話24小時(shí)官網(wǎng)400(全國服務(wù)熱線)
        戴納斯帝壁掛爐全國售后服務(wù)電話24小時(shí)官網(wǎng)
        菲斯曼壁掛爐全國統(tǒng)一400售后維修服務(wù)電話24小時(shí)服務(wù)熱線
        菲斯曼壁掛爐全國統(tǒng)一400售后維修服務(wù)電話2
        美的熱水器售后服務(wù)技術(shù)咨詢電話全國24小時(shí)客服熱線
        美的熱水器售后服務(wù)技術(shù)咨詢電話全國24小時(shí)
        海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
        海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
      4. 上海廠房出租 短信驗(yàn)證碼 酒店vi設(shè)計(jì)

        主站蜘蛛池模板: 久久精品成人一区二区三区| 中文字幕在线一区| 精品国产高清自在线一区二区三区| 无码国产精品一区二区免费虚拟VR| 精品欧洲AV无码一区二区男男| 无码人妻精品一区二区三区久久久| 亚洲熟女乱色一区二区三区 | 日本一区二区三区在线网| 亚洲人AV永久一区二区三区久久| 国产成人久久精品麻豆一区| 日韩人妻无码一区二区三区99| 麻豆果冻传媒2021精品传媒一区下载| 精品无码国产一区二区三区麻豆| 精品无码人妻一区二区三区不卡| 国产精品女同一区二区 | 精品视频一区二区三区在线播放| 一区国严二区亚洲三区| 国产成人久久精品一区二区三区 | 美女AV一区二区三区| 日本一区精品久久久久影院| 国产一区二区好的精华液| 精品国产亚洲一区二区在线观看 | 中文字幕精品无码一区二区| 亚洲狠狠狠一区二区三区| 国产日韩视频一区| 一区二区视频在线播放| 国产一区二区视频免费| 日韩免费无码一区二区三区| 国产亚洲综合精品一区二区三区| 国产成人AV一区二区三区无码 | 国产成人精品无码一区二区| 精品国产一区二区三区香蕉事| 免费萌白酱国产一区二区三区| 日韩在线一区二区三区视频| 久久精品一区二区国产| 日本中文字幕在线视频一区| 国产一区二区三区影院| 一区二区乱子伦在线播放| 青娱乐国产官网极品一区| 亚洲AV香蕉一区区二区三区 | 国产福利91精品一区二区三区|