Query Board              Python or Java(Preferred Python please) Thank you! Programming challenge description: There is a board (matrix). Every cell of the board contains one integer, which is 0 initially.The following operations can be applied to the Query Board:SetRow i x: change all values in the cells on row "i" to value "x".SetCol j x: change all values in the cells on column "j" to value "x".QueryRow i: output the sum of values on row "i".QueryCol j: output the sum of values on column "j".The board's dimensions are 256x256."i" and "j" are integers from 0 to 255."x" is an integer from 0 to 31. Input: Your program should read lines from standard input. Each line contains one of the above operations. Output: For each query, output the result of the query. Test 1 Test InputDownload Test 1 Input SetCol 32 20 SetRow 15 7 SetRow 16 31 QueryCol 32 SetCol 2 14 QueryRow 10 Expected OutputDownload Test 1 Input 5118 34

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter8: Working With Advanced Functions
Section: Chapter Questions
Problem 2.11CP
icon
Related questions
Question

Query Board              Python or Java(Preferred Python please) Thank you!

Programming challenge description:

There is a board (matrix). Every cell of the board contains one integer, which is 0 initially.

The following operations can be applied to the Query Board:
SetRow i x: change all values in the cells on row "i" to value "x".
SetCol j x: change all values in the cells on column "j" to value "x".
QueryRow i: output the sum of values on row "i".
QueryCol j: output the sum of values on column "j".

The board's dimensions are 256x256.
"i" and "j" are integers from 0 to 255.
"x" is an integer from 0 to 31.
Input:
Your program should read lines from standard input. Each line contains one of the above operations.
Output:
For each query, output the result of the query.

Test 1

Test InputDownload Test 1 Input
SetCol 32 20 SetRow 15 7 SetRow 16 31 QueryCol 32 SetCol 2 14 QueryRow 10
Expected OutputDownload Test 1 Input
5118 34
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L