You are not logged in. Please login at www.codechef.com to post your questions!

×

doubt in CSTRIKE1

https://www.codechef.com/COSE2015/problems/CSTRIKE1

in the above problem consider the below test case: t=1 n=2

7 3

o/p should "NO" because both can't kill enemies at rhe same time... but in the successful submission it is "YES"

asked 01 Sep '15, 16:33

ajay_bhammar's gravatar image

1★ajay_bhammar
362
accept rate: 20%

edited 01 Sep '15, 16:33


Yes..it should be "NO" and my solution gives the same... My soln

link

answered 01 Sep '15, 16:46

harry_1008's gravatar image

2★harry_1008
2047
accept rate: 9%

edited 01 Sep '15, 16:51

your solution is successful??

(01 Sep '15, 17:14) ajay_bhammar1★

Yes, as it shows...

(01 Sep '15, 17:23) harry_10082★

It is a simple problem, that outputs "YES" if the total strength can be divided into two parts, otherwise "NO"

In

7 3 the output should be YES

link

answered 01 Sep '15, 19:14

bradley's gravatar image

3★bradley
6562321
accept rate: 20%

1

in case of 7 3 sinchan and ace can't kill enemies at same time because one take 7 and other take 3..so o/p should "NO".

(01 Sep '15, 19:49) ajay_bhammar1★

I also encountered the same problem in this set : 2 4 5 7 10 12 . Used this input on a successful submission. They can't kill the terrorists at the same time in whatever way they try. But, the output shows yes. Any explanation for such situations ?

link

answered 01 Sep '15, 23:50

borodor's gravatar image

0★borodor
111
accept rate: 0%

edited 01 Sep '15, 23:54

yes..the same problem occurs with me..

(02 Sep '15, 00:08) ajay_bhammar1★

I am the author for that question. I am extremely sorry for weak test cases. The question can be broken down to Can an Array be partitioned into two non-empty equal sub-arrays. For implementation you can visit here http://www.geeksforgeeks.org/dynamic-programming-set-18-partition-problem/

link

answered 02 Sep '15, 09:33

ankurverma1994's gravatar image

4★ankurverma1994
415114
accept rate: 8%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×4

question asked: 01 Sep '15, 16:33

question was seen: 557 times

last updated: 02 Sep '15, 09:33