Test case 1


time:0.16 sec

Test case 2


time:2.34 sec

Test case 3

Failed (Time limit exceeded)

time:15.00 sec

※ All the test cases will be run from the first one in order. If your program does not pass one test case, no further test cases will be carried out (knockout format).


66 points Out of 100 points

I was promoted to engineer leader!

Img 03 02

How clever you are! We have a mid-size site so we should be able to sail through with this code!

Language Python2
Execution speed 0.16 sec
*Tast case 1
Python2fastest record 0.08 sec
*Test case 1
Python2submitted count 2519
(2014/01/09 updated)

Rank a

Your skills match the A paiza rank. You are highly skilled. With paiza, you will be able to have interviews with many companies straight away without having to go through an application screening process.

What is paiza online hackathon?

paiza online hackathon is Free Join. In this event, all participants will solve the problem of programming one. And compete for execution speed, and each other to share the excellent code.

The new lady programmer, Ms. Noda, has been assigned to your team. Improve her code so that it's better than what she's written already. Write more efficient code to show your skills as a programmer and fora chance to be promoted.

Use your favorite language (Java, C, C++, C#, PHP, Ruby, Python, Perl) to implement an efficient program.

Your submitted code will be run through multiple tests cases, and the number of correct answers and your code’s execution speed will be recorded to assign you a score.

  • This is a problem open to everyone so it does not have a time limit.
  • The same person can try solving this problem multiple times.
  • You are also welcome to write solutions on blogs, etc.
Get a high score and tell your friends!

paiza online hackathon is Free Join.
Let's aim for the fastest code!

View problem details



Top of page