99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫SI 100B、代做Python設計程序
代寫SI 100B、代做Python設計程序

時間:2024-11-01  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



SI 100B Programming Assignment 2
SI 100B TA Team
October 23, 2024
1
Notice
• This homework is due 10:00 AM October 30, Wednesday, please start early.
• The problems should be solved individually. You should submit solutions for all problems to the online
judge (OJ) system, which will give a score for each submission automatically.
• You may discuss course material, programming languages, general techniques, and share test cases with
others.
• You’re encouraged to ask any question about problem description, environment setup, error informa tion, grammar, functions, methods etc., or post general ideas at Piazza. It can help others too!
• However, you may NOT read, possess, copy, or submit any part of other’s solution. You may not ask
others to directly debug your program or provide specific lines of solution. You should not access an other person’s account. Also, do not offer such help, and protect your account and code. Giving or
receiving inappropriate help is plagiarism, an infringement of academic integrity.
• You are not allowed to write your solution directly by or based on code generated by AI tools.
• Good luck and have fun!
2
1 UNFORTUNATE STOCKHOLDER
1 Unfortunate Stockholder
“I really hate green,” the poor man sighed, looking down, and found his beloved Alexandra Nikolaevna
Petrovskaya lying on the floor, stiff and cold. With her gone, his nearly hairless head now has one less hair.
A month ago, he was still a rich man, with positive daily profit from his investments. However, without
him noticing, some of his stocks had been falling for several days, and then suddenly hit the lower limit.
Quicker than he could take any actions, his other stocks also began falling.
Because he had so many stocks, he only checked the total profit every day.“Oh God! How I wish I had a
tool that can tell me the details of my stocks!”
1.1 Task
As it happens, you know how to use python, and you will kindly fulfill his wish by writing a python
program to give the details of his stocks. You will be given a list of numbers, representing the profit of his
stocks, and a series of queries. For each query, you should perform the corresponding operation and print the
result.
1.2 Input/Output Specification
1.2.1 Input
The first line contains a string of float numbers, representing the profit of the stocks.
The second line contains a single positive integer n, indicating the number of queries.
Each of the following n lines contains a query, with details shown in the Table below. All queries will be
given in one of the formats
• query, operation
• query, operation, start_index, end_index, step
query, operation, start_index, end_index, step means querying on the profit of a subset of the stocks ob tained by performing slicing operation. It is guaranteed that start_index, end_index and step are all integers.
If the subset of the stocks to be queried is empty, print Querying on empty list! (with a single space
at the end of the output) and do nothing else.
1.2.2 Output
n lines, each line the result of the query.
3
1.2 Input/Output Specification 1 UNFORTUNATE STOCKHOLDER
Query Operation Example Input Result
find
min find, min the min profit amongst all stocks
find, min, 1, 3, 1 the min profit amongst the sliced subset of stocks
max
find, max the max profit amongst all stocks
find, max, 5, 9, 2 the max profit amongst the sliced subset of stocks
index
a single index, 10 the profit of the stock with index i
positive integer i
slice index, slice, 2, 3, 1 the list of profits of the sliced subset of stocks
compute
avg
compute, avg the average profit of all stocks
compute, avg, 5, 12, 3 the average profit of the sliced subset of stocks
all compute, all the total profit of all stocks
compute, all, 6, 3, 2 the total profit of the sliced subset of stocks
reorder
asc
reorder, asc the reordered list of profits
of all stocks in ascending order
reorder, asc, 7, 30, 1 the list of profits with the profits of the
sliced stocks reordered in ascending order
desc
reorder, desc the reordered list of profits
of all stocks in descending order
reorder, desc, 3, 4, 2 the list of profits with the profits of the
sliced stocks reordered in descending order
rev
reorder, rev the reordered list of profits
of all stocks in reverse order
reorder, rev, 9, 3, 3 the list of profits with the profits of the
sliced stocks reordered in reverse order
1.2.3 Example
1. Input
1 4 5 3 4 2 5 −2 −3 0 2
5
find, min
find, max, 0, 3, 1
compute, avg, 2, 12, 1
reorder, rev
reorder, asc, 1, 6, 1
Output
−3.0
5.0
1.7777777777777777
[2.0, 0.0, −3.0, −2.0, 5.0, 2.0, 4.0, 3.0, 5.0, 4.0, 1.0]
[2.0, −3.0, −2.0, 0.0, 2.0, 5.0, 4.0, 3.0, 5.0, 4.0, 1.0]
4
1.3 Hint 2 AVERAGE RUNNING SPEED
2. Input
1 2 3 4 5 6
5
index, 5
index, slice, 1, 4, 2
compute, all
reorder, desc, 6, 3, −1
find, max, 2, 4, 1
Output
6.0
[2.0, 4.0]
21.0
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
4.0
1.3 Hint
After each reorder query, the list is reordered (i.e., it is mutated), as shown in the examples.
2 Average Running Speed
As part of promoting a healthy lifestyle, the university has introduced a running App. The App generates
data points consecutively containing the student’s positions and timestamps during their running sessions.
The App helps generate useful statistics, such as distance covered and average speed. And students can freely
select specific data points for customized analysis.
2.1 Task
You are tasked with writing a program to process data points of a running session and then evaluate
a runner’s performance. Your program receives n data points at the beginning. The i-th data point Pi =
(xi
, yi
, ti), where xi and yi are the runner’s 2D coordinates, ti
is the timestamp measured in seconds. For
simplicity, we assume that runners travels along a straight path between two adjacent points, so the distance
between two adjacent data points is estimated using the Euclidean distance formula:
D(Pk, Pk−1) = √
(xk−xk−1)
2 + (yk−yk−1)
2
5
2.2 Input/Output Specification 2 AVERAGE RUNNING SPEED
Firstly, you need to estimate the average speed V of the entire session, note that the session starts at P0 and
ends at Pn−1:
V =
∑n
k=1 D(Pk, Pk−1)
tn−1 − t0
Then the runner will freely select m subsections, with the i-th subsection represented by the indices of two
data points, starti and endi
. And the runner wants to know what the average running speed is for each
subsection, i.e., the average speed V i running through Pstarti
, Pstarti+1, . . . , Pendi−1, Pendi
2.2 Input/Output Specification
2.2.1 Input
The first line contains a single integer n, the number of data points in the running session (2 ≤ n ≤ 100).
The next n lines of data points contains three integers each: xi
, yi
, ti
, where xi and yi
is the runner’s
coordinate (−100 ≤ xi
, yi ≤ 100), ti
is the timestamp at the i-th data point (0 ≤ t0 < t1 < t2 . . . < tn−1 ≤
103
).
The next line contains a single integer m, the number of the selected subsections.
The next m lines contains two values each: starti
, endi
, which represents the indices of start point and
end point of the i-th subsection (0 ≤ starti < endi < n).
2.2.2 Output
The first line is the average speed V of the entire session. And the next m lines: each line contains the
average speed V i for the i-th subsection. V and V i should be formatted to three decimal places.
2.2.3 Example
1. Input
4
1 2 1
** 5
4 8 12
2 1 18
1
1 3
Output
1.129
1.009
6
3 I OR E
2. Input
5
48 8 2
−83 −85 4
60 14 11
−37 −37 19
−15 −31 20
2
3 4
0 2
Output
25.943
22.804
37.176
3 I or E
Myers–Briggs Type Indicator (MBTI) is a assessment particularly popular in social occasions. There is
one dimension: energy orientation, which is divided into introversion and extraversion—— extraverted person
obtains energy from social interactions, while introverted person obtains energy from self-reflection.
However, a person’s energy orientation is not fixed. For example, a person who is initially classified as
introverted may turn out to be extraverted under some circumstances.
3.1 Task
In this scenario, a meeting consists of participants of three initial orientations: “E”, “I”, and “i”. You are
given a seating arrangement represented as an n × m matrix where n is the number of rows. And each seat
position indicates the energy orientation of a participant (E, I, or i). Your task is to print out the final energy
orientation in matrix format.
Participants will sit one by one, from the first row to the last row, and within each row, from left to right.
During this process, if an “i” participant is surrounded by introverted person (either “I” or “i”), they will change
their orientation to extraverted, denoted as “e”. A participant is considered surrounded by introverted person
if all their adjacent neighbors (up, down, left, right) are either I or i. If the participant is on the boundary
or corner, only the existing neighbors are considered.
There is a special case when the last participant seated: first update the previously seated participants
before considering the last one, in order to avoid potential conflicts.
7
3.2 Input/Output Specification 3 I OR E
3.2 Input/Output Specification
3.2.1 Input
The first line contains two integers n and m, representing the dimensions of the seating matrix (n × m),
(2 ≤ n, m ≤ 50). The following n lines each contain m separated characters c ∈ {E, I, i}, indicating the
energy orientation of the participants in each seat.
3.2.2 Output
You should output n lines, each containing one list, representing the final energy orientation of the par ticipants after they are seated in order.
3.2.3 Example
1. Input
3 4
E I i I
i I i i
i I I i
Output
['E', 'I', 'e', 'I']
['i', 'I', 'i', 'e']
['e', 'I', 'I', 'i']
Case Explanation: for convenience, we use a tuple (i, j) (count from 1), to represent the seat located
at the i-th row and j-th column. The orientation of the participant changed in the following order:
(a) (1, 3) changed when (2, 3) seated.
(b) (3, 1) changed when (3, 2) seated.
(c) (2, 3) changed when (3, 3) seated. Remember to update the previously seated participants before
the last one.
2. Input
5 5
E I i I E
i I i I I
I i I i E
I I i i I
i I I I i
8
4 TURTLE BLIND BOXES
Output
['E', 'I', 'e', 'I', 'E']
['i', 'I', 'i', 'I', 'I']
['I', 'e', 'I', 'i', 'E']
['I', 'I', 'e', 'i', 'I']
['e', 'I', 'I', 'I', 'e']
Case Explanation: The orientation of the participant changed in the following order:
(a) (1, 3) changed when (2, 3) seated.
(b) (3, 2) changed when (4, 2) seated.
(c) (5, 1) changed when (5, 2) seated.
(d) (4, 3) changed when (5, 3) seated.
(e) (5, 5) changed when (5, 5) seated.
4 Turtle Blind Boxes
Blind box opening games have become increasingly popular on platforms such as TikTok. In this assign ment, you will simulate a blind box opening game where the contents are small glass turtles of different colors
and patterns. The objective is to simulate the entire process of purchasing, opening, and placing these turtles
in a grid, following specific rules to either eliminate or reward the player with additional blind boxes based
on turtle combinations.
Each turtle has a color and a pattern, with the following possibilities:
• Colors: Red, Orange, Yellow, Green, Blue
• Patterns: Patterned, Unpatterned
The game uses a 3x3 grid to display the turtles, and there are several conditions that trigger rewards or elimi nations during the gameplay.
4.1 Task
You are required to write a Python program that simulates this turtle blind box game. The game follows
specific rules for rewarding the player with extra blind boxes or eliminating turtles from the grid. The detailed
task breakdown is as follows:
1. Get Blind Box Content: Each blind box contains one glass turtle with a randomly generated color and
pattern combination.
9
4.2 Input/Output Specification 4 TURTLE BLIND BOXES
2. Wish Mechanism: The player can wish for a specific color and pattern combination. If a turtle match ing the player’s wish is opened, they are immediately rewarded with one additional blind box.
3. Grid Filling: Each turtle is placed in a 3x3 grid (like a Tic-Tac-Toe board), and the turtles are placed
in the grid according to the numbered order of the cells (1 to 9), where 1 is the top-left and 9 is the
bottom-right.
4. Elimination and Reward Rules: After the grid is filled or all blind boxes have been opened, perform
the following operations in the specified order:
(a) All Different: If the grid is full and all turtles in the grid are different, remove all turtles and
reward the player with 5 additional blind boxes.
(b) Three of a Kind: If three identical turtles align horizontally, vertically, or diagonally, reward the
player with 5 additional blind boxes. The turtles remain in the grid. If there are multiple triples at
the same time, each triple should be given 5 new blind boxes.
(c) Pairs: If two identical turtles are found, they are eliminated from the grid, and the player is
rewarded with 1 additional blind box per pair. Turtles in cells with smaller numbers (lower numbered positions in the grid) are prioritized for removal.
5. End Condition: The game ends when no more blind boxes are available, and no turtles can be elimi nated.
4.2 Input/Output Specification
4.2.1 Input
The program will accept the following four lines of input:
1. The number of initial blind boxes purchased.
2. The player’s wish for a specific turtle’s color and pattern. Use two letters separated by a space to repre sent turtle.
3. A list of randomly generated turtles, with two lines:
• The first line represents the colors of the turtles, using the first letter of each color: R (Red), O
(Orange), Y (Yellow), G (Green), B (Blue).
• The second line represents the patterns of the turtles, using the first letter of each pattern: P
(Patterned), U (Unpatterned).
10
4.2 Input/Output Specification 4 TURTLE BLIND BOXES
The color and pattern of the i-th turtle are represented by the i-th letter in the third and fourth rows. The
number of turtles provided is undetermined, but it’s guaranteed to be larger than the number required for the
simulation.
4.2.2 Output
At the end of the game, output the list of eliminated turtles in the order they were removed from the grid.
Turtles should be represented by tuples of (color, pattern). At the end of the game, the remaining turtles in the
grid should also be eliminated in the order of the numbers in the nine-square grid. You can use print(list)
directly.
4.2.3 Example
1. Input
10
R U
YOBOOBRGOGYBYRYYGBO
UUUUPUUPPPUUUUPUUPU
Output
[('O', 'U'), ('O', 'U'), ('B', 'U'), ('B', 'U'), ('O', 'P'), ('O', 'P'),
('Y', 'U'), ('Y', 'U'), ('G', 'P'), ('G', 'P'), ('R', 'U'), ('R', 'U'),
('Y', 'U'), ('Y', 'U'), ('O', 'U'), ('G', 'U'), ('B', 'P'), ('B', 'U'),
('Y', 'P')]
2. Input
12
R P
RYOYYYROBYRBGGYOGBBYOBYBRYGOROROYGORGOY
PUPPPPUUPPPUUUPPPUPUPPUUPUPUPPUUUUPUUPU
Output
[('Y', 'P'), ('Y', 'P'), ('R', 'P'), ('R', 'P'), ('Y', 'P'), ('Y', 'P'),
('G', 'U'), ('G', 'U'), ('O', 'P'), ('O', 'P'), ('B', 'U'), ('B', 'U'),
('B', 'P'), ('B', 'P'), ('Y', 'U'), ('Y', 'U'), ('B', 'U'), ('R', 'P'),
('O', 'P'), ('B', 'P'), ('G', 'P'), ('Y', 'P'), ('R', 'U'), ('O', 'U'),
('Y', 'U'), ('Y', 'U'), ('Y', 'U'), ('O', 'U'), ('O', 'U'), ('O', 'P'),
('O', 'P'), ('R', 'U'), ('R', 'U'), ('G', 'U'), ('G', 'U'), ('Y', 'U'),
('G', 'P'), ('O', 'P'), ('R', 'P')]
11
4.3 Hint 4 TURTLE BLIND BOXES
4.3 Hint
• Randomly generate test data for debugging: To test your implementation, you can generate random
turtle combinations and simulate different scenarios (e.g., many identical turtles, all different turtles) to
check if the elimination rules are applied correctly.
• Pay attention to the execution order: Make sure that the elimination rules (e.g., three of a kind,
pairs, all different) are applied in the correct sequence. Follow the order of operations as specified in
the task to ensure accurate simulation.
• Modular design: During the implementation process, keep your code modular by breaking down dif ferent functionalities (e.g., adding turtles to the grid, checking for three of a kind, eliminating pairs) into
separate functions. This will make your code easier to understand, debug, and extend.
12

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




 

掃一掃在手機打開當前頁
  • 上一篇:CSCI 201代做、代寫c/c++,Python編程
  • 下一篇:CE243編程代寫、代做C/C++程序語言
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                欧美精品一区二区三区蜜臀| 国产乱淫av一区二区三区| 欧洲精品在线观看| av一本久道久久综合久久鬼色| 久久99国产精品免费| 日本欧美一区二区三区乱码 | 一区二区三区中文在线| 亚洲大片一区二区三区| 亚洲第一成人在线| 精品一区中文字幕| 99精品久久99久久久久| 午夜欧美视频在线观看| 免费在线看成人av| 成人黄色片在线观看| 欧美精品日韩一本| 国产精品剧情在线亚洲| 亚洲午夜精品网| 国v精品久久久网| 精品国产伦一区二区三区观看方式 | 2021国产精品久久精品 | 美脚の诱脚舐め脚责91| 欧美tickling挠脚心丨vk| 欧美国产一区二区在线观看| 成人午夜视频福利| 高清视频一区二区| 91玉足脚交白嫩脚丫在线播放| 成人午夜短视频| 欧美在线一区二区| 91精品国产综合久久国产大片| 亚洲精品日日夜夜| 美国欧美日韩国产在线播放| 在线区一区二视频| 成人午夜短视频| 亚洲图片有声小说| 亚洲在线观看免费视频| 欧美男同性恋视频网站| 精品99一区二区三区| 国产精品欧美久久久久无广告| 日韩精品一区二区三区中文不卡 | 日本欧美在线看| 亚洲精品v日韩精品| 五月婷婷另类国产| 卡一卡二国产精品| 欧美情侣在线播放| 亚洲国产成人porn| 激情五月婷婷综合| 日韩欧美一区电影| 国产一区二区看久久| 天堂精品中文字幕在线| 一区二区三区免费在线观看| 久久精品欧美日韩精品| 一二三区精品视频| 91污在线观看| 欧美一区二区三区视频免费播放| 亚洲嫩草精品久久| 国产精品一区二区无线| 蜜桃视频第一区免费观看| 国产久卡久卡久卡久卡视频精品| 在线观看成人免费视频| 久久久综合激的五月天| 天堂在线一区二区| 91美女视频网站| 欧美国产视频在线| 激情伊人五月天久久综合| 欧美日韩在线播| 一区二区久久久久| 99久久99久久久精品齐齐| 欧美精品一区二区三区蜜桃| 五月天激情小说综合| 在线亚洲一区二区| 国产精品三级视频| 精品无人码麻豆乱码1区2区 | 狠狠色狠狠色综合系列| 欧美日韩一区成人| 夜夜爽夜夜爽精品视频| 欧美一区二区三区四区五区 | 亚洲国产精品久久久久秋霞影院 | 99热99精品| 国产亚洲一区二区三区四区| 国产成人精品aa毛片| 亚洲五码中文字幕| 日韩欧美精品在线视频| av网站免费线看精品| 午夜久久久久久久久| 欧美少妇xxx| 国产一区在线不卡| 久久99最新地址| 国产精品第五页| 国产福利一区在线观看| 国产清纯白嫩初高生在线观看91 | 久久草av在线| 欧美在线播放高清精品| 97久久超碰精品国产| 精品一区二区三区免费| 亚洲一区二区在线视频| 久久综合久久综合久久综合| 国产一区二区三区免费在线观看| 久久久精品中文字幕麻豆发布| 日韩午夜电影在线观看| 麻豆91在线播放免费| 精品免费一区二区三区| 久久久不卡网国产精品二区| 午夜私人影院久久久久| 视频一区视频二区在线观看| 国产乱对白刺激视频不卡| 国产日韩欧美在线一区| 成人性色生活片| 一区二区三区色| 欧美肥大bbwbbw高潮| 国产一区二区不卡| 中文字幕五月欧美| 91.com在线观看| 国产不卡高清在线观看视频| 亚洲欧美日韩中文字幕一区二区三区| 在线观看一区日韩| 国内成+人亚洲+欧美+综合在线| ww久久中文字幕| 色偷偷久久人人79超碰人人澡 | 亚洲最大的成人av| 欧美一二三四区在线| 成人美女在线观看| 婷婷国产在线综合| 欧美激情艳妇裸体舞| 欧美日韩精品系列| 丁香激情综合国产| 青青国产91久久久久久| 中文字幕五月欧美| 久久女同互慰一区二区三区| 91一区二区三区在线观看| 日本人妖一区二区| 亚洲一区二区在线免费看| 国产色一区二区| 日韩精品一区二区三区中文精品| 色天天综合色天天久久| 精品一区二区在线观看| 亚洲国产精品视频| 国产精品二三区| 久久久久久综合| 日韩欧美一级二级| 在线观看免费视频综合| 成人av电影免费观看| 国内久久精品视频| 免费黄网站欧美| 天天操天天干天天综合网| 亚洲精品乱码久久久久久| 久久青草国产手机看片福利盒子 | av一二三不卡影片| 极品销魂美女一区二区三区| 亚洲资源中文字幕| 国产精品久久久一区麻豆最新章节| 日韩片之四级片| 欧美精品三级在线观看| 欧美在线免费观看视频| 99视频在线精品| 国产高清在线观看免费不卡| 日韩精品国产欧美| 一区二区久久久久| 亚洲另类色综合网站| 国产精品免费看片| 欧美大片顶级少妇| 精品粉嫩超白一线天av| 欧美久久久影院| 91麻豆精品国产无毒不卡在线观看| 日本伦理一区二区| 欧美日韩视频在线第一区 | 欧美系列一区二区| 欧美日韩一区二区三区四区五区| 在线免费观看日本一区| 欧美性色黄大片| 欧美日韩在线直播| 欧美精品乱人伦久久久久久| 8v天堂国产在线一区二区| 欧美一级淫片007| 欧美一卡在线观看| 久久日韩粉嫩一区二区三区 | 另类中文字幕网| 美女视频黄久久| 国产乱对白刺激视频不卡| 国产1区2区3区精品美女| 97se亚洲国产综合自在线不卡| 91香蕉视频在线| 欧美视频自拍偷拍| 欧美电影免费观看高清完整版 | 极品尤物av久久免费看| 成人免费高清视频| 色8久久人人97超碰香蕉987| 欧美日韩电影一区| 精品国产三级电影在线观看| 国产精品青草久久| 亚洲一区视频在线| 激情综合亚洲精品| 在线精品观看国产| 国产亚洲视频系列| 亚洲一区精品在线| 国产精品一二二区| 欧美午夜影院一区| 精品久久久久一区二区国产| 国产精品久久久久婷婷| 亚洲成人免费看| 国产suv精品一区二区三区|