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.

Country Summary

Country

Submit Count

Avg Step

Avg Time

Jp 日本

2844 Submit

1531.59 Step

1.15 Sec

Us United States

112 Submit

176.05 Step

1.32 Sec

Cn China

163 Submit

78.09 Step

0.68 Sec

Kr Korea

1 Submit

- Step

- Sec

Es Spain

7 Submit

- Step

- Sec

Id Indonesia

80 Submit

348.8 Step

0.17 Sec

Tw Taiwan

60 Submit

58.86 Step

0.06 Sec

Nl Netherlands

2 Submit

112.8 Step

0.08 Sec

Ca Canada

22 Submit

2590.17 Step

0.26 Sec

Se Sweden

1 Submit

4260.4 Step

0.11 Sec

Sg Singapore

2 Submit

- Step

- Sec

Ph Philippines

27 Submit

112.8 Step

0.23 Sec

Hk Hong Kong

231 Submit

60.72 Step

0.01 Sec

Ee Estonia

2 Submit

- Step

- Sec

other

7 Submit

- Step

- Sec

(2015/05/20Sum Update

Ranking

Ranking Description

Nickname

Avg Step

Avg Time

Programming Language

Place Jp uwi

39.6 Step

2.39 Sec

Java

Place Jp IL_k

39.6 Step

0.03 Sec

C#

Place Jp hackByMikeCAT

39.6 Step

0.01 Sec

C

Place Jp hiromi_ayase

39.6 Step

0.59 Sec

C#

Place Jp lassie

39.6 Step

0.09 Sec

Ruby

Place Jp carrotflakes

39.6 Step

0.01 Sec

C++

Place Jp hogeover30

40.4 Step

0.85 Sec

C++

Place Jp orisano

41.6 Step

0.85 Sec

C++

Place Jp nus

41.6 Step

0.89 Sec

C++

Place Jp aspen

42.8 Step

0.49 Sec

C#

Place Tw holydc

43.2 Step

0.03 Sec

C++

Place Jp y_mazun

43.2 Step

0.75 Sec

C++

Place Jp siman

43.6 Step

0.9 Sec

C++

Place Jp qaolwsik

44.4 Step

0.32 Sec

C#

Place Cn romain_li

46.0 Step

1.27 Sec

Python2

Place Jp r

46.0 Step

0.7 Sec

C++

Place Jp iwata0303

46.0 Step

3.55 Sec

Python2

Place Jp iwashi31

46.4 Step

0.19 Sec

C++

Place Jp mayoko

46.4 Step

0.2 Sec

C++

Place Jp y_uti

46.4 Step

0.04 Sec

PHP

Place Jp ReiFNSK

46.8 Step

1.47 Sec

Java

Place Jp ark214

46.8 Step

0.09 Sec

C#

Place Jp quarter_moon

47.6 Step

1.26 Sec

Ruby

Place Jp neko

48.4 Step

0.15 Sec

C++

Place Jp ha2ne2

48.8 Step

1.81 Sec

Ruby

Place Jp kurapan

48.8 Step

1.13 Sec

Python2

Place Jp tekitouk

48.8 Step

0.38 Sec

C++

Place Jp roiti46

49.6 Step

1.03 Sec

C++

Place Jp heinetsu

49.6 Step

0.49 Sec

C#

Place Jp DoG

50.0 Step

7.64 Sec

Ruby

Place Jp kazekaoru

50.4 Step

0.2 Sec

C++

Place Jp homulerdora

50.8 Step

0.92 Sec

Haskell(Beta)

Place Jp Leonardone

51.6 Step

0.02 Sec

C++

Place Jp MikeCAT

52.0 Step

0.56 Sec

C++

Place Id n_toriq

52.0 Step

0.42 Sec

C#

Place Us cozziekuns

52.8 Step

2.14 Sec

Ruby

Place Jp chitose

53.2 Step

0.2 Sec

C++

Place Cn chexq09

53.6 Step

0.67 Sec

C++

Place Jp mugenen

54.4 Step

0.72 Sec

Python2

Place Jp cozziechang

55.6 Step

1.17 Sec

Ruby

Place Jp pkc

58.4 Step

0.85 Sec

C

Place Us cozykuns

58.4 Step

1.56 Sec

Ruby

Place Jp Gasu

58.8 Step

2.33 Sec

Perl

Place Hk Bruce

59.2 Step

0.01 Sec

C

Place Cn hejob

61.2 Step

0.37 Sec

C++

Place Cn Kay

64.0 Step

0.01 Sec

C++

Place Jp 448

64.8 Step

0.22 Sec

C++

Place Jp haraduka

66.0 Step

0.73 Sec

C++

Place Jp kos

66.8 Step

1.33 Sec

C#

Place Jp iicafiaxus

68.8 Step

0.54 Sec

D(Beta)

(2015/05/20Sum Update

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

無料でプログラミングスキルチェックを試してみる(登録は10秒!)
すぐにプログラミング力をはかるスキルチェック問題にチャレンジできます。(想定回答時間20分)

会員登録(無料)

ページの先頭へ戻る