CTU Open Contest 2018 - Die

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

The boss of Binary Casino wants to have control over games played in his casino. This is especially true in the case of dice games, as from time to time people try to cheat their way to the victory by manipulating dice even after a throw has already occurred. Therefore, there is a camera installed to monitor the course of every single dice game. Dice recognition, however, is not an easy task and sometimes a camera may produce a faulty image which makes the task of recognition impossible.

There are rasterized data available from a camera which took pictures of several dice. The task is to write a program which determines the value of the top side of the die in the picture or detects that the picture is corrupted. Note that the picture is transformed in such way that the sides incident to the captured top side of the die are parallel to the x and y axis. However, it is unknown which of the four possible rotations of the top side is depicted.

Input Specification

The input specifies the top side of a captured die. It consists of three lines, each with three characters o or : representing a dent or a smooth surface, respectively.

Output Specification

Output a single line with either the number represented by the captured top side of the die or unknown if the image is incorrect.

Sample Input 1

o:o
:o:
o:o

Sample Output 1

5

Sample Input 2

::o
:o:
o::

Sample Output 2

3

Sample Input 3

ooo
:::
o:o

Sample Output 3

unknown
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Comments


  • 0
    SeanJxie  commented on Nov. 18, 2019, 8:44 p.m.

    My code gives the correct answer to case #30. I get WA on #31. I don't see anything that should get me. What's wrong with ME code??