subject

Write in either C++ or Java Consider a grid of size X by Y where the column index x ranges from 0 to X-1 inclusive and the row index y ranges from 0 to Y-1. the value of any given cell is the polynomial x + y^2. given a value V. count the number of times V appears in the grid. for example, given x = 4, y = 4, and v = 3, the value 3 occurs 2 times in the 4x4 grid. X the width of the grid. Y the height of the grid. V the value to be counted.
test cases:
test 1: input = 1024,1024,83
test 1: output = 10
test 2: input = 5,5,27
test 2: output = 0
test 3: input = 144,12,12
test 3: output = 4
test 4: input = 4,4,3
test 4: output = 2
using the code below:
#include
#include
using namespace std;
int main()
{
string line;
while (getline(cin, line)) {
cout << line << endl;
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
You know the right answer?
Write in either C++ or Java Consider a grid of size X by Y where the column index x ranges from 0 t...
Questions
question
Mathematics, 23.08.2019 09:50
question
Mathematics, 23.08.2019 09:50
question
English, 23.08.2019 09:50
question
Chemistry, 23.08.2019 09:50
Questions on the website: 13722363