Comments

before performing the cut you have to check if the ribbon length is greater than the piece length or not here is my solution 210109663

here is my recursive dp solution for A if anybody needs 210109663

0

198265855

in such case multiply 1ll with it to avoid overflow

0

using only prefix sum also it can be solved

0

complexity will be o(n×q×(range)) wors case will be o(n×n×q). if you pre compute worst case will be o(n×q);

0

using prefix sum. .. pre compute the prefix and suffix sum of the array. so for range[l,r] we need the sum of elements excluding this range which can be calculated using the pre computed sum. prefix[l-1]+suffix[r+1]and for the range sum can be calculated as k*(r-l+1)..

i think its easy to guess for these nos n/2,n/2=> {50,50},{500,500}....

maybe 1999 3999 59999 ....etc any such

if the number is even then n/2,n/2 is the ans. if its odd then n/2,n/2+1; edge cases 1999,3999,599999 etc we can distribute it like eg for 3999 1545 2454

0

deleted

+114 ...and then its unrated

187545653 O(n) solution for B.

On iamujj15Codeforces Heat Map, 4 years ago
+14

its because of Time Zone difference

On OrifxonGood Bye 2022, 4 years ago
0

you ok vro??

On BakryRed Isn't Impossible, 4 years ago
0

motivation to keep grinding everyday ....

On awooCodeforces Round #839 (Div. 3), 4 years ago
0

ancara Messi

.

SUN.LOVE can you please provide the test case which you used to hack my solution..others too can get the idea.

output NO?

my output is no for this one

no?

find the smallest number greater than= n which is divisible by k.. search space is from n to 1e9. as the elements are positive each one can be minimum 1. each element can be minimum 1.

find the smallest number greater than= n which is divisible by k.. search space is from n to 1e9. as the elements are positive each one can be minimum 1. each element can be minimum 1.

nice one

Hope to be green before the year ends(⁠;⁠ŏ⁠﹏⁠ŏ⁠)

im making a pair of elements and index, sort this vector of pair, start making each element a multiple of previous if numbers are repeated then im making it equal to previous element. eg: 3,2,3,4 pair[]=[{3,1},{2,2},{3,3},{4,4}] sort(pair) now it becomes [{2,2},{3,1},{3,3},{4,4}] iterate from 2nd index after 1st iteration [{2,2},{6,1},{3,3},{4,4}] after 2nd iteration [{2,2},{6,1},{6,3},{4,4}] after 3rd iteration [{2,2},{6,1},{6,3},{12,4}] total operations=n-1;

sort the array, start making each element a multiple of previous;

sort the array; start making each element a multiple of previous;

(" >") this time for messi

That Happy New year in place of Accepted is so joyful

ratings vro

precomputation with prefix sum,

164801112 whats wrong...any help

hope its not like previous D2 round

On waaitgCodeforces Round #808, 4 years ago
0

took almost a decade to solve A; ( — _ — )

probably integer overflow ; you are using int s;

answer should be 5; we can choose index 0 and 3 ; decrease the value at index 0 by 1 and increase the value at index 3 by 1; this cost 1 operation the list now becomes 1 1 1 1 4; now we can pair each index with index 4; it will cost 4 operations; now total operation =5

so an integer overflow in problem B continuously failed my pretest 2, ( " _ " ).....

whenever the contest start at unusual time, i lost ratings ;)

+10

the problem statements robbed me (" _ ")

0

deleted

0

damn!!!