paiza > paiza online hackathon Vol.5 > POH5+ Int'l Comp

Too much Turmoil My Childhood and My Affianced one

Share

[ Rena and Minami International Programming Competition ]
Problem

If you thought the other questions were too easy, here’s something for you…
It’s the International Programming Battle, launched at the same time as POH5! Go head-to-head with Rena and Minami!

The game proceeds by moving any tiles to adjacent empty space. For instance, the game may proceed as follows:
Figure special
Write a program that slides the tiles and completes the play board. However, you don't need to solve the problem in minimum moves.
Hint
The board can be completed by repeatedly moving the tiles in a random fashion.
For instance, if you want to move tile 1 to the upper left corner, continue randomly moving tiles until tile 1 reaches that position. If you want to move tile 2 to the right of tile 1, continue randomly moving tiles until tile 2 reaches that position. When taking this step, tile 1 should be left untouched while the others are moved.
Also note that, when randomly moving tiles on a given grid, the probability of moving a certain tile to a specific location within 10,000 moves is over 99%.
ミッションX

Write a program that slides the tiles and completes the play board.

Expected input:

The initial state of the play board is given in the following format as input:
t_1 t_2 t_3 t_4
t_5 t_6 t_7 t_8
t_9 t_10 t_11 t_12
t_13 t_14 t_15 t_16




The grid is labeled starting from the upper left cell (t_1) and ending with the lower right cell (t_16).

Constraints

The input values have the following constraints for all test cases.
Input constraints:
Cell t_i (1 ≦ i ≦ 16) meet the following constraints.
If the tile exists, it must be a number between 1 and 15. If the tile does not exist, it is marked with an asterisk (*).
Each item for t_i should be different.
The given play board can always be solved.
A solved play board will never be given as input.
Output constraints:
Tiles that cannot physically be slid (tiles with no empty spaces around them) cannot be slid.
The puzzle must be completed within 1,000,000 mvoes.

Expected output:

Output the numbers of each sliding tile in each line.
At the end of moving, the board must be completed.
Please add a new line at the end, and do not include any unnecessary characters or empty lines.
Example 1(input)
1 2 3 4
5 6 7 8
9 10 * 11
13 14 15 12
Example 1(output)
11
12
Example 2(input)
2 3 4 *
1 5 6 7
10 11 12 8
9 13 14 15
Example 2(output)
4
3
2
1
5
6
7
8
12
11
10
9
13
14
15

Answer

Please enter and submit the code that solves the problem above using the text box below.
You can use the following languages: Java, PHP, Ruby, Perl, Python, C, C#, and C++.

To find out about methods for reading values from standard input, please refer to the sample codes shown in the pages below:

Let's take the challenge!!Choose your best programming language and write some code!

Select language

Select your best programming language!

Code execution result

Nickname (Required)
You can use letters and numbers. This nickname may be displayed on our site when we publish your codes as sample solutions, or when we announce the prize winners.
email (Required)
Your registered e-mail address will not be used outside of Paiza Online Hackathon.
Once you submit your code, we will e-mail your results page.
Country to represent (Required)

Workflow

STEP1 Write code

STEP2 Compile and test the code

STEP3 Submit

STEP4 Then, we will show your score!
下へ
参加者の中から抽選で3名様ねるねるねるね10個セットプレゼント!!
参加者の中から抽選で1名様にRaspberry-Piプレゼント!!
  • *Submitted code with nickname is to be open to other challenger.

Event schedule, Prize

Schedule

Submission Period
April 14 (Thu) - May 19 (Thu)
Examination period
May 20 (Wed) - May 26 (Thu)
Result announcement
May 27 (Wed)

Prize

By lot from among the participants, 6 sets of Momoya of goods towards 3 person, and "Intel Edison Kit for Arduino" towards one person. Only Japanese residents are eligible for the prize.

Events Terms

  •  In this campaign, with problems open to the public, you can take the test without membership registration. However, when submitting, it is assumed that you are familiar with the following important points.
  • *Important Points*
  • (1) Membership registration is not required, but it is necessary to register an email address. However, this company will not use this email address for any other purposes outside of this campaign.
  • (2) Existing members may also take the test in this campaign, but as this has no effect on personal skill ranks, please note this in advance.
  • (3) The copyright for submitted code belongs to the examinee, but this company will make that code open to the public on our website, SNS, etc., and may use it freely. This complies fully with the rules of use, in Article 5, section 2.
  • (4) As there may the case that codes submitted may not be completely preserved, they should be backed personally based on the needs of the examinee, and we ask for the appropriate support.

Too Much Turmoil Over My Childhood and My Affianced One

paiza online hackathon vol.5 [POH vol.5] Too Much Turmoil Over My Childhood and My Affianced One.

Result summary by country

Country

The number of submissions

Average steps

Average time

Jp 日本

2844 submission

1531.59 step

1.15 sec

Us United States

112 submission

176.05 step

1.32 sec

Cn China

163 submission

78.09 step

0.68 sec

Kr Korea

1 submission

- step

- sec

Es Spain

7 submission

- step

- sec

Id Indonesia

80 submission

348.8 step

0.17 sec

Tw Taiwan

60 submission

58.86 step

0.06 sec

Nl Netherlands

2 submission

112.8 step

0.08 sec

Ca Canada

22 submission

2590.17 step

0.26 sec

Se Sweden

1 submission

4260.4 step

0.11 sec

Sg Singapore

2 submission

- step

- sec

Ph Philippines

27 submission

112.8 step

0.23 sec

Hk Hong Kong

231 submission

60.72 step

0.01 sec

Ee Estonia

2 submission

- step

- sec

other

7 submission

- step

- sec

(2015/05/20Update)

TOP50 Ranking by person

It is a ranking of the average step.

Nickname

Average steps

Average time

Language

No1 Jp uwi

39.6 step

2.39 sec

Java

No2 Jp IL_k

39.6 step

0.03 sec

C#

No3 Jp hackByMikeCAT

39.6 step

0.01 sec

C

No4 Jp hiromi_ayase

39.6 step

0.59 sec

C#

No5 Jp lassie

39.6 step

0.09 sec

Ruby

No6 Jp carrotflakes

39.6 step

0.01 sec

C++

No7 Jp hogeover30

40.4 step

0.85 sec

C++

No8 Jp orisano

41.6 step

0.85 sec

C++

No9 Jp nus

41.6 step

0.89 sec

C++

No10 Jp aspen

42.8 step

0.49 sec

C#

No11 Tw holydc

43.2 step

0.03 sec

C++

No12 Jp y_mazun

43.2 step

0.75 sec

C++

No13 Jp siman

43.6 step

0.9 sec

C++

No14 Jp qaolwsik

44.4 step

0.32 sec

C#

No15 Cn romain_li

46.0 step

1.27 sec

Python2

No16 Jp r

46.0 step

0.7 sec

C++

No17 Jp iwata0303

46.0 step

3.55 sec

Python2

No18 Jp iwashi31

46.4 step

0.19 sec

C++

No19 Jp mayoko

46.4 step

0.2 sec

C++

No20 Jp y_uti

46.4 step

0.04 sec

PHP

No21 Jp ReiFNSK

46.8 step

1.47 sec

Java

No22 Jp ark214

46.8 step

0.09 sec

C#

No23 Jp quarter_moon

47.6 step

1.26 sec

Ruby

No24 Jp neko

48.4 step

0.15 sec

C++

No25 Jp ha2ne2

48.8 step

1.81 sec

Ruby

No26 Jp kurapan

48.8 step

1.13 sec

Python2

No27 Jp tekitouk

48.8 step

0.38 sec

C++

No28 Jp roiti46

49.6 step

1.03 sec

C++

No29 Jp heinetsu

49.6 step

0.49 sec

C#

No30 Jp DoG

50.0 step

7.64 sec

Ruby

No31 Jp kazekaoru

50.4 step

0.2 sec

C++

No32 Jp homulerdora

50.8 step

0.92 sec

Haskell(Beta)

No33 Jp Leonardone

51.6 step

0.02 sec

C++

No34 Jp MikeCAT

52.0 step

0.56 sec

C++

No35 Id n_toriq

52.0 step

0.42 sec

C#

No36 Us cozziekuns

52.8 step

2.14 sec

Ruby

No37 Jp chitose

53.2 step

0.2 sec

C++

No38 Cn chexq09

53.6 step

0.67 sec

C++

No39 Jp mugenen

54.4 step

0.72 sec

Python2

No40 Jp cozziechang

55.6 step

1.17 sec

Ruby

No41 Jp pkc

58.4 step

0.85 sec

C

No42 Us cozykuns

58.4 step

1.56 sec

Ruby

No43 Jp Gasu

58.8 step

2.33 sec

Perl

No44 Hk Bruce

59.2 step

0.01 sec

C

No45 Cn hejob

61.2 step

0.37 sec

C++

No46 Cn Kay

64.0 step

0.01 sec

C++

No47 Jp 448

64.8 step

0.22 sec

C++

No48 Jp haraduka

66.0 step

0.73 sec

C++

No49 Jp kos

66.8 step

1.33 sec

C#

No50 Jp iicafiaxus

68.8 step

0.54 sec

D(Beta)

(2015/05/20Update)

Facebook

Twitter

Paiza is a coding career change site for IT/Web engineers.

Coding test supported languages

Expected coding period is 20 minutes! Supported languages are Java, C, C++, C#, PHP, Ruby, Python, Perl, and JavaScript.

Primary interview without document screening, Company inspection

Depending on you scores, you can skip document screening process and can have casual interview, a job offer may be possible by companies seeking workers. Until, applying, results are not reported to companies seeking workers.

Collected job offer tickets from the programmer’s perspective

The thorough collection of development techniques, development environment, tools used, method of evaluation and supervisor profiles necessary for job selection of engineers and programmers.

Automatic scoring

Checking code with several test cases, calculating scores by memory usage and execution speed. At the time of an interview, we will ask about the source code.

Problems are organized by 2 questions per elementary, intermediate, and advance levels.

Problems are organized by rank S,A,B,C,D. Problems can be worked on one at a time. The best algorythym in the time limit!

Possibility of a re-challenge

We update problems every week! It is possible to challenge problems of the same rank when updated. It is also optimum to practice skill-ups.

If you register (login) for paiza, you can download wallpapers!

Then user registration (login) can download 5 kinds of wallpaper in paiza!

Wallpaper 1
Wallpaper 2
Wallpaper 3
ページの先頭へ戻る