- Practice
- Mathematics
- Fundamentals
- Maximum Draws
- Discussions

# Maximum Draws

# Maximum Draws

programmingevan + 6 comments Does this challenge seem oddly easy to anyone else? Like a warmup exercise?

Unchained + 0 comments "Warmup" is an over estimation.

Omnikron13 + 1 comment You are not alone. As far as programming is concerned this is just I/O and a single addition, so... 'challenge' isn't the word I'd use to describe this. =P

chestaisokay + 0 comments This was very very easy . I hope there are some good challenges ahead .

c650Alpha + 1 comment I agree. I saw this problem, thought I was overthinking it, and then checked the Discussion to see if I was right.

_faker_ + 1 comment Exactly the same happpened with me!

aloksingh3007 + 0 comments same here !

RubberSideDown + 0 comments The solution to this challenge is an excellent, basic example of an application of the pigeonhole principle, which definitely Falls under the fundamentals category.

jpjaspreetmahal + 0 comments I am here just to read comments XD

AllisonP + 4 comments This should really be called Maximum Draws (because it's worst-case scenario). Minimum draw would always be 2.

lvsz_ + 1 comment I like the idea of a best worst case scenario.

aigookenzaki + 0 comments ahhmm ahh can you help me to this account cuase i dont understand the terms can you help me plzzz

whyzee + 0 comments Thank you. Thats what I thought too.

Debu_Basu + 0 comments Yeah exactly! It occured to me once, but then it was clear when I saw the sample I/O :)

aigookenzaki + 0 comments ahh i am new in this account i need help cuase i dont understand can you help me pls

Neon + 5 comments Simple 3 pairs : R,B,G Draw 1 : R1 Draw 2 : B1 Draw 3 : G1 Draw 4 {R2,B2,G2} any of the pick makes a pair with previously picked color :)

revernus + 2 comments Thanks, I was able to understand the problem only after reading your explanation.

gokuvsvegita + 0 comments lol

ultimusdrago + 0 comments lol

sakib_muhit + 1 comment Perfect... :D

chvnikhil + 0 comments good

codermehraj + 0 comments thanks

sankireddyvinee1 + 0 comments nice..

panditsaurav6 + 0 comments Just a request is there any way we can write it as permutation and combination problem.

foxtrot + 2 comments I'm surprised nobody mentioned the Pigeonhole Principle :-P

thakursaurabh98 + 0 comments That was the main concept behind the question but still simpler ways! :D

sachingadagi + 5 comments Am I the only one who did (pairs+ 1) ? :P

shunn789 + 0 comments No.

trendsetter37 + 0 comments No.

M4GNV5 + 0 comments No. ++ ?

badillosoft + 0 comments Yes, you're right :D

num of pairs plus one, because in the worst case you'll get off each one of the different pairs, thus, you should get one more.Griffin_Teller + 0 comments i did that too.

wjm91 + 0 comments This one is really easy. If you have n-pairs of socks, that means that worst case you pick one sock from each pair. From there any sock you choose has to be a match.

So by the pidgeon hole principle we get the answer to just be n+1

Surprisingly basic to be honest

codespinach + 1 comment One line of Python 3:

`[print(int(input()) + 1) for i in range(int(input()))]`

canhascodez + 0 comments Ruby

puts (1..gets.to_i).map {|_| gets.to_i.succ }

Alternately:

puts Array.new(gets.to_i) {|_| gets.to_i.succ }

Or:

gets.to_i.times { puts gets.to_i.succ }

The last is probably most idiomatic.

ajinkyapathak + 0 comments import java.io.

*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*;public class Solution {

`public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int p=sc.nextInt(); int a=p+1; System.out.println(""+a); } }`

}

This Code Runs All Test Cases...

arno_lee + 0 comments It takes more to reason about possible pitfals, because you're like "it cannot be that easy!", the level should be marked as

**Moderate**

agusakov + 0 comments Easy. Pigeonhole Principle.

Sort 87 Discussions, By:

Please Login in order to post a comment