# Problem solving

# Problem solving

vrotaru_md + 3 comments I'm looking at the second test case

5 1

5 3 4 5 6

And don't understand can it be solved in a day. We have 2 problems with the same difficulty level - 5.

Solving two problems with same difficulty in a day will be against the rules, right ?

nishant_304 + 0 comments [deleted]GrantDuan + 0 comments 5 in '5 3 4 5 6' do not mean difficulty.

ashwinscode + 1 comment It says that the two

**consecutive**problems that you solve in a given day should have a minimum difference of K in their vi ( and not every pair of problems that you solve in a given day)n=5, k=1; 5 3 4 5 6 is can be solved in a given day because that sequence has atleast a variation of 1 between consecutive numbers that is met.

However, if instead it was n=3, k=1; 5 5 6, then you need minimum 2 days to solve it.

pazdaniel7 + 1 comment It also mentions that the difficulty of problems within a same day must increase . So you cannot solve 3 4 5 5 6 in that order on a same day, because you are not increasing difficulty from 5 to 5. Therefore, I have the same doubt, seems like you need 2 days to solve the second example for me too.

reyvaj64 + 0 comments I can only assume that: " Problems with similar vi values are similar in nature" means you can solve all fives at the same time, but that might be stretching it

fengyuxue11011 + 0 comments it's a weird problem. Hard to understand.

samarthasthana11 + 0 comments Its really hard to understand the question. Can anyone please tell me what actually i have to do?

ayanbahukhandi11 + 1 comment what is the vi value?? I don't understand it... The question maybe lame.. so pardon for that but I am new here.. Kindly help me.

ahmedhafez13 + 1 comment Problems with similar

*(vi)*values are similar in nature. v is a list of integers*(Example: v[0] = 5, v[1] = 4, v[2] = 7)*as it in first test. That means**the first**problem*(v[0] = 5)*differs from**the second**problem*(v[1] = 4)*by**1**(5-4=1) and**the second**problem*(v[1] = 4)*differs from**the third**problem*(v[3] = 7)*by**3**(4-7=3) regardless the sign (positive or negative).ayanbahukhandi11 + 0 comments Thank you very much... Now I get what's the problem is...

pb1038 + 1 comment testcase #1 [113 , 128]

Expected output is 5, where as my solution solves in 3 dayz. And seems correct to me..

Day 1 :: 383 694 335 335 160 986 355 762 973 542 717 853 663 483 218 16 507 852 365 791 264 492 173 38 538 860 281 988 857 591 342 971 353 666 512 70 518 362 84 352 113 301 507 639 365 33 876 680 142 413 970 637 171 957 761 466 315 887 184 40 970 536 153 622 394 791 290 110 632 265 736 549 296 878 314 834 199 950 356 156 794 469 157 961 824 287 678 141

Day 2 :: 422 422 958 763 400 155 829 668 490 155 539 845 650 815 327 674 934 172 359

Day 3 :: 440 851 174 872 105 246

Am I missing any constraint??

Fluffy_Bunny + 0 comments 335 appears twice in a row in day 1, and 422 does the same in day 2. Not valid when you have k=128.

clarson + 0 comments Can someone share how to use the STDIN and STDOUT for the built-in Java 7/8 Compilers? I'm used to the netbeans IDE which uses System.in

prakashchandu + 0 comments In the case#0 where can we solve that as 4,7 and 5 rather than 5,7 and 4..? (its used by sorting the ratings)

nachiketg + 1 comment Why is the answer to [41 335] as 5?

The following sequence looks valid and gives min days as 4.

Day 01: [0, 3, 4, 5, 7, 10, 13, 15, 18, 20, 21, 22, 24, 26, 27, 30, 34, 35, 36, 40] (Unsolved #20: all)

Day 02: [2, 6, 8, 12, 14, 16, 19, 20, 21, 23, 25, 26, 28, 31, 35, 37] (Unsolved #12: 2, 6, 8, 12, 14, 16, 19, 23, 25, 28, 31, 37)

Day 03: [1, 5, 9, 11, 13, 17, 18, 20, 21, 23, 29, 32, 34, 35, 38] (Unsolved #7: 1, 9, 11, 17, 29, 32, 38)

Day 04: [33, 35, 39] (Unsolved #2: 33, 39)

Fluffy_Bunny + 0 comments We are not allowed to solve the same 'problem' twice. That appears to be a requirement, judging by the expected answers.

It's not clearly stated in the description, though.

rangansit + 7 comments n=8 k=51 , a[8] = {49 ,57 ,3, 95, 98, 100, 44, 40} we'll have 3 57, 40 95, 44 98 , 49 100 => 4 days total How come 3 is the answer??

dheeraj + 1 comment Hi @rangansit, [57,3,95,44] [49,100] [98,40] This gives 3.

rangansit + 0 comments But in the problem statement it is given that Youâ€™ve decided that each subsequent problem solved on the day should be tougher than the previous problem you solved on that day. Then how can the solution be 57,3,95,44

dheeraj + 2 comments 57th difficulty is 1. 3 difficulty is 2. 95 difficulty is 3. 44 difficulty is 4. so the difficulty level is increasing. The difficulty rating is the index of every element. The vi rating is the value at that array index

tlambrou + 0 comments Perhaps for clarity it would be better to call vi a "simliarity" rating or something that describes a type/category, or cardinality instead of something that is ordinal like a "rating" or "ranking". It's frustrating to have to spend time to understand a problem because of unclear language.

rangansit + 0 comments oops....Thanks a lot!

andrewmasj + 0 comments [deleted]

kiamottullah + 0 comments # include

int main(){ char c;

`while(c != '\n'){ scanf("%c", &c); printf("%c", c); }`

}

why this programe is getiing a rantime error for input 'a'?

Sort 20 Discussions, By:

Please Login in order to post a comment