国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

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

代做ECE2810J、代寫C++語言程序
代做ECE2810J、代寫C++語言程序

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



ECE2810J — Data Structures
and Algorithms
Programming Assignment 3
— UM-SJTU-JI (Fall 2024)
Notes
• Submission: on JOJ
• Due at Dec 1st, 2024, by 23:59
1 Introduction
In this assignment, you are tasked with implementing a C++ solution to a simpliffed version of the “sokoban” game,
where the objective is to push speciffc boxes to designated target positions on a grid. The challenge lies in devising an
efffcient strategy to navigate the grid, avoid obstacles, and ensure that all required boxes reach their target locations.
Your program should be able to handle various conffgurations of boxes, walls, and goals, ensuring the correct boxes are
pushed to their intended destinations. This project is C++ only, no other language is allowed.
2 Programming Assignment
2.1 Read Map
The map is designed as a grid where each cell is either a walkable path, a wall, or a point of interest (like the starting
point or a box). The ffrst line of the ffle deffnes the dimensions of the map in terms of columns and rows. The rest of
the ffle speciffes the content of each cell in the grid, using a series of symbols to represent different elements:
• . - Path: This represents a walkable path where the player can move freely. Boxes can also be pushed across
this type of cell.
• # - Wall: This represents an impassable barrier. Neither the player nor the boxes can pass through these cells.
• S - Starting Point: This is where the player begins. Each map should contain exactly one S character.
• B - Box’s Original Position: The initial position of a box.
• T - Target Position for Boxes: The destination cell for a box.
• R - Box at Target Position: This indicates that a box has been successfully pushed to its target position.
To ensure a valid and challenging map, the following constraints must be met:
(1) The outermost boundary of the map must be composed entirely of walls (#) to prevent the player or boxes from
exiting the map area.
(2) Each map must contain exactly one starting point (S).
(3) For test cases of the ffrst part on JOJ, the number of boxes (B) will be less or equal to 8 and the result of rows
times columns should be less or equal to 800.
(4) For test cases released on Canvas, it can be very complicated.
The player can move in four cardinal directions:
• Up
1• Down
• Left
• Right
The player can push a box if it is adjacent in one of these directions, and if the cell behind the box in that direction is
a path (.). Boxes can only be pushed. In other words, they cannot be pulled. Only one box can be pushed at a time,
and the player must move to the former box’s position after pushing it.
Below is an example of a map conffguration ffle. In this example, the map size is speciffed on the ffrst line as 11 10,
indicating 10 rows and 11 columns. The outer boundary is composed of walls (#), while inner cells deffne paths, the
starting point, box positions, and target positions.
11 10
###########
#..#..#...#
#..B....#.#
#..##.#...#
##.#...B###
##.#.....##
#SBBTT#..##
#..#.TT.###
####..#####
###########
2.2 Search routes
Help the player to ffnd the shortest route to push all the boxes to the expected place. Please notice that it is possible
that there are multiple boxes and multiple target positions. The player should push all the boxes to the target positions.
2.3 Show the route
The task requires the program to display the player’s route on the map, detailing each movement step-by-step. Each
step should be represented by a character indicating the direction moved:
• U for up
• R for right
• L for left
• D for down
For instance, given the map conffguration shown, the route may look like:
DRURRUURUURRDDDLLLDDRRRURULLLDLDRULLLUUULUURDRRURDDDDDLLLUUULURRRURDDDDULD
This format will be used as the return value of the solve function provided in the template code.
Bonus Requirements
(1) Display the map, player, boxes, and other elements at each step using the same format as the input map. Store
all the map state in a ffle, ensuring it is clear and easy to read.
2(2) Use a graphical interface to visually represent each step, showing the map, player, boxes, and other elements in
their updated positions. The output should be displayed as an animation, with each step shown for a brief period
before transitioning to the next step.
2.4 Unsolvable Maps
In some cases, a map conffguration may be unsolvable due to the positioning of walls or boxes, creating an impasse
that prevents the player from reaching all targets. Such conffgurations are referred to as “invalid maps.” This occurs
when one or more boxes are placed in positions from which they cannot be moved to their designated target cells.
A map is considered invalid if:
• There is more than one starting point or no starting point.
• There are more boxes than target positions.
• A box is surrounded by walls or other boxes in a way that makes it immovable.
• Any box is placed in a corner or against a wall where it has no path to the target position.
The following example demonstrates a typical invalid map layout:
11 10
In this map: The box (B) is located next to walls on two sides, which prevents it from being moved toward the target
position (P).
When the program encounters such a conffguration, it should recognize the situation as unsolvable and output a
message as “No solution!” The program should then terminate without attempting to ffnd a solution or display a route.
3 Input / Output
As mentioned above, the input map is stored in a ffle. To test your program, you can use the following command to
read the map from a ffle:
1 ./main < inputMap.txt
For submission on JOJ, the output (i.e. the return value of the function) should either be “No solution!” or the route
to push all the boxes to the target positions.
If you have implemented the ffrst bonus requirements, you should ffrst display the steps in the format mentioned above,
and then display the map at each step. We highly recommend you to store the map at all steps in a ffle. For example,
if the output is stored in a ffle named output.txt, you can use the following command:
31 ./main < inputMap.txt > output.txt
If you have implemented the second bonus requirements, you should display the map in a graphical interface.
4 Submission
(1) For part 1 and part 3 on JOJ, submit your source code in one ffle named sokoban.hpp. Your source code should
include a function named solve and a function named read_map. The test cases in part 1 and part 3 are similar,
but part 3 has stricter time and memory limitations.
(2) For part 2 on JOJ, put the detailed route output in the answers part in sokoban.hpp. The test cases will be
released on canvas, which may take a long time for your program to run. Please notice that part 2 and bonus
will be graded if and only if you can pass 70 percent of the test cases in part 1.
(3) Submit the source code for part 2 on Canvas along with a corresponding Makefile to compile the source code.
(i.e. The code you used to get answer for part 2 on JOJ. ) A sample Makefile is provided on Canvas, which
you may modify as needed. Your code submitted on Canvas should be able to compile successfully and output
the detailed route with the corresponding input ffle.
(4) (Optional) If you have implemented the ffrst bonus requirement, you also need to submit the output ffles on
Canvas. The naming format should match the original ffle name. For example, if the input ffle is named big_1.in,
the output ffle should be named big_1_detail.out. Failure to follow the correct naming format will result in
an invalid submission. You only need to submit the output ffle for one test case.
(5) (Optional) If you have implemented the second bonus requirement. You may come to the TA’s offfce hours
to demonstrate your program. The due date will be the same. The TA will give you a score based on the
demonstration.
Basic Tips for Optimizing Your Program
Deadlocks
• What is a freeze deadlock?
• List common freeze deadlocks.
• Analyze the pros and cons of adding more deadlock detections.
Efffciency
• How much memory do you need to store a “state”?
• With 100 bits, how many states can you store?
• If visiting one state takes 1ns, how much time will it take to visit through all possible states represented by 100
bits?
• How much information do you need to backtrace a path?
C++ Features
• Is std::pair fast or slow?
• How many temporary objects have you created in each iteration? Are they really necessary?
45 Implementation Requirements and Restrictions
5.1 Requirements
• You must make sure that your code compiles successfully on a Linux operating system with g++ and the options
-std=c++1z -Wall -Wextra -Werror -pedantic -Wno-unused-result -Wconversion -Wvla.
• You can use any header ffle deffned in the C++17 standard. You can use cppreference as a reference.
5.2 Memory Leak
You may not leak memory in any way. To help you see if you are leaking memory, you may wish to call valgrind, which
can tell whether you have any memory leaks. (You need to install valgrind ffrst if your system does not have this
program.) The command to check memory leak is:
valgrind --leak-check=full <COMMAND>
You should replace <COMMAND> with the actual command you use to issue the program under testing. For example, if
you want to check whether running program
./main < input.txt
causes memory leak, then <COMMAND> should be “./main < input.txt”. Thus, the command will be
valgrind --leak-check=full ./main < input.txt
5.3 Code Quality
We will use cpplint, cppcheck to check your code quality. If your code does not pass these checks, you will lose some
points.
For cpplint, you can use the following command to check your code quality:
1 cpplint --linelength=120
,→ --filter=-legal,-readability/casting,-whitespace,-runtime/printf,
2 -runtime/threadsafe_fn,-readability/todo,-build/include_subdir,-build/header_guard
,→ *.h *.cpp
For cppcheck, only things related to error will lead to deduction. You can use the following command to check your
code quality:
1 cppcheck --enable=all *.cpp
6 Grading
6.1 Correctness
We will use the test cases on JOJ and Canvas to verify the correctness of your code. This section will have a total
score of 100 points. Your score will be calculated as follows:
min
(
100,
score in part 1 + score in part 2 + score in part 3
14
)
Please notice that the total points on JOJ will be 2150 with 1000 points for part 1, 400 points for part 2, and 750
points for part 3. You only need to get 1400 points on JOJ to get full score in this section.
56.2 Code Quality
Bad code quality will lead to a deduction of up to 20 points, which will be applied directly to your final score.
6.3 Bonus
For the first bonus requirement, you can get up to 10 points. For the second bonus requirement, you can get up to
30 points. The total score for the whole project will not exceed 130 points.
7 Late Policy
Same as the course policy.
8 Honor Code
Please DO NOT violate honor code.
Some behaviors that are considered as cheating:
• Reading another student’s answer/code, including keeping a copy of another student’s answer/code
• Copying another student’s answer/code, in whole or in part
• Having someone else write part of your assignment
• Using test cases of another student
• Testing your code with another one’s account
• Post your code to github
• Using any kind of AI tools to solve the problem
9 Acknowledgement
This programming assignment is designed based on ENGR1510J Lab 3 and ENGR1510J Project 3.


請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

掃一掃在手機打開當前頁
  • 上一篇:代寫QHE5701、SQL編程語言代做
  • 下一篇:菲律賓黑名單能申請保關入境嗎(應該怎么做)
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術(shù)服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結(jié)構(gòu)仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結(jié)構(gòu)仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業(yè)
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網(wǎng)頁版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關于我們 | 打賞支持 | 廣告服務 | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产欧美欧洲| 奇米888一区二区三区| 日韩在线视频在线| 国产欧美在线一区二区| 国产精品国产精品| 欧美精品成人网| 日韩天堂在线视频| 日本久久久久亚洲中字幕| 亚洲一区二区三区av无码| 国产精品中文久久久久久久| 国产精品久久激情| 精品欧美日韩| 国产精品日韩二区| 日韩激情视频一区二区| 国产高潮呻吟久久久| 亚洲一区二区三区精品在线观看| yellow视频在线观看一区二区| 欧美精品一区二区免费| 国产一区深夜福利| 久久亚洲精品成人| 国产一区视频在线播放| 欧美精品免费在线观看| 国产精品专区在线| 亚洲视频精品一区| 91九色视频在线观看| 午夜精品区一区二区三| 久久免费视频这里只有精品| 色大师av一区二区三区| 久久网站免费视频| 日本国产高清不卡| 日韩在线视频一区| 欧美二区在线看| 久久艹在线视频| 国产美女精品免费电影| 中文精品一区二区三区| 97久久国产精品| 欧美一区二区三区成人久久片| 国产福利精品av综合导导航| 人人妻人人澡人人爽精品欧美一区 | 国产精品国产三级国产aⅴ浪潮| 男人天堂成人网| 久久中文字幕在线视频| 成人羞羞国产免费| 亚洲欧洲中文| 久久99精品久久久久久三级| 欧美精品与人动性物交免费看| 国产精品高潮视频| youjizz.com亚洲| 品久久久久久久久久96高清| 国产精品久久久久久久7电影 | 国产精品久久久久久久久久新婚| 欧美成人中文字幕在线| 97久久天天综合色天天综合色hd| 日本中文不卡| 国产精品入口夜色视频大尺度| 国产免费色视频| 三年中文高清在线观看第6集| www.日韩不卡电影av| 国产区亚洲区欧美区| 日韩中文字幕av在线| 国产精品毛片va一区二区三区| 国产精品一色哟哟| 日韩久久不卡| 欧美激情第6页| 色妞色视频一区二区三区四区| 蜜桃精品久久久久久久免费影院| 一本大道熟女人妻中文字幕在线 | 春色成人在线视频| 国产精品青青草| 91麻豆桃色免费看| 欧美高清性xxxxhd| 亚洲啊啊啊啊啊| 国产精品污www一区二区三区 | 女同一区二区| 大波视频国产精品久久| 国产精品二区二区三区| 久久一区二区精品| 国产最新免费视频| 色噜噜狠狠色综合网| 精品国产电影| 精品国产依人香蕉在线精品| av 日韩 人妻 黑人 综合 无码| 青青草视频在线视频| 亚洲永久激情精品| 国产精品久久久| 日韩在线视频观看正片免费网站| 99视频网站| 国产日韩av高清| 欧美日韩国产精品一区二区 | 国产精品一区二区欧美黑人喷潮水| 日本精品免费| 一区二区不卡在线视频 午夜欧美不卡'| 色噜噜狠狠色综合网图区| 91精品黄色| 国产美女主播在线播放| 免费看污污视频| 欧美亚洲在线播放| 日本不卡二区| 丁香色欲久久久久久综合网| 一区二区三区日韩视频| 国产精品久久国产精品99gif| 色狠狠久久aa北条麻妃| 国产成人精品免费视频| 99re在线视频上| 国产亚洲黄色片| 黄瓜视频免费观看在线观看www| 三级三级久久三级久久18| 亚洲资源在线看| 久久99视频精品| 久久亚洲欧美日韩精品专区| 久久精品在线视频| 国产成人无码av在线播放dvd| 国产成人福利视频| 久久精品一二三区| 久久婷婷人人澡人人喊人人爽| 97精品一区二区三区| 北条麻妃在线视频观看| 国产精品一区二区久久久| 国产视频一区二区视频| 僵尸世界大战2 在线播放| 欧美亚洲伦理www| 欧美性受xxxx黑人猛交| 欧日韩不卡在线视频| 奇米一区二区三区四区久久| 日韩欧美一区二区视频在线播放 | 久久久国产一区| 按摩亚洲人久久| 精品国产一区久久久| 久久九九国产精品怡红院| 精品国产欧美一区二区五十路 | 亚洲精品一卡二卡三卡四卡| 亚洲精品在线免费| 亚洲欧洲一二三| 亚州国产精品久久久| 欧美一区二区视频17c| 日韩av电影在线播放| 日韩精品一区二区三区色欲av| 欧美在线www| 黄色片一级视频| 国产一区二区视频播放| 国产美女搞久久| 97精品一区二区视频在线观看| 久久久人人爽| 久久久久久久久久码影片| 国产精品丝袜久久久久久高清 | 日本不卡免费新一二三区| 欧美午夜精品久久久久免费视| 欧美日韩亚洲第一| 国产一级做a爰片久久毛片男| 古典武侠综合av第一页| 久久久欧美一区二区| 日韩在线观看免费高清| 欧美精品一区二区三区国产精品| 中文字幕精品一区日韩| 亚洲91精品在线观看| 人妻无码久久一区二区三区免费 | 日本久久亚洲电影| 国内精品久久久久久影视8| 国产在线视频欧美一区二区三区| 国产日韩在线视频| 99久久免费观看| 久久久久久久91| 欧美猛少妇色xxxxx| 午夜精品一区二区三区在线| 日韩精品一区二区三区久久 | 国产人妖伪娘一区91| 久热免费在线观看| 国产精品美女视频网站| 亚洲精品中文字幕在线| 男人的天堂成人| 久久综合精品一区| 久久亚洲影音av资源网| 日本在线观看一区二区| 国产综合 伊人色| 91精品国产综合久久久久久蜜臀| 日韩在线中文字幕| 欧美激情视频网站| 日韩国产小视频| 超碰在线观看97| 色妞欧美日韩在线| 综合色婷婷一区二区亚洲欧美国产| 欧美一级片一区| 国产日本在线播放| 色噜噜久久综合伊人一本| 亚洲中文字幕无码中文字| 欧美国产一二三区| 久久琪琪电影院| 萌白酱国产一区二区| 青青草一区二区| 116极品美女午夜一级| 国产精品二区在线| 欧美专区第一页| 91av免费看| 精品国产一区二区三区麻豆免费观看完整版 | 久久久久免费精品| 一本二本三本亚洲码| 国产在线观看福利| 久久久91精品| 日韩精品免费一区| 91精品国产精品|