Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need get my code working more efficiently it passed some of the test cases and timed out at the others meaning its time complexity
I need get my code working more efficiently it passed some of the test cases and timed out at the others meaning its time complexity is slow so i would like some modification to my code as as soon as possible
The Pebble Pile Problem Submissions Leaderboard Discussions Contest ends in 6 days Turkey Lurkey is working on building the biggest pile of smooth river pebbles the world has ever seen. Each day, she scours the river banks for the smoothest pebbles she can find and collects k more than she did on the previous day (k is a given, fixed integer). Her nemesis Goosey Loosey is also building a pebble pile, but instead of going to the river bank, she goes to Turkey Lurkey's pile every d days and steals kd pebbles while Turkey Lurkey is off searching the river bank. She doesn't start stealing until day d though; before that Goosey Loosey has zero pebbles. We want to answer q queries: na ... ng each query, ny, is a single integer asking how many pebbles Turkey Lurkey has at the end of day Ni (day 1 is the first day that she started collecting them, and on day O she had zero pebbles). Submissions: 37 Max Score: 25 Difficulty: Easy Rate This Challenge More Input Format There will be two lines of input, each containing space-separated integers. Line 1: kda Line 2: n_1 ... n_4 Constraints 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started