No.3556 KCPC or KUPC
タグ : / 解いたユーザー数 85
作問者 :
butsurizuki
/ テスター :
👑
jastaway
yaaya
Problem Statement
You are given $N$ strings $S_1,S_2,\dots,S_N$, each of length $N$.
The given strings are a $k$-times ( $1 \le k \le 10$ ) similarity enlargement of one of the following ASCII arts.
Both of the original ASCII arts consist of $11$ rows and $11$ columns.
ASCII art KCPC
#...#.#####
#.##..#....
##....#....
#.##..#....
#...#.#####
...........
####..#####
#...#.#....
####..#....
#.....#....
#.....#####
ASCII art KUPC
#...#.#...#
#.##..#...#
##....#...#
#.##..#...#
#...#.#####
...........
####..#####
#...#.#....
####..#....
#.....#....
#.....#####
Here, for a positive integer $k$, the $k$-times similarity enlargement of an ASCII art is defined as follows.
- Suppose the original ASCII art consists of $n$ rows and $n$ columns.
- The enlarged ASCII art consists of $kn$ rows and $kn$ columns.
- The character written in the $i$-th row from the top and the $j$-th column from the left of the enlarged ASCII art is the same as the character written in the $\displaystyle 1+ \left \lfloor \frac{i-1}{k} \right \rfloor$-th row from the top and the $\displaystyle 1+ \left \lfloor \frac{j-1}{k} \right \rfloor$-th column from the left of the original ASCII art. ( $1 \le i,j \le kn$ )
If the original ASCII art is KCPC, print KCPC; if it is KUPC, print KUPC.
Input
The input is given from Standard Input in the following format.
$N$ $S_1$ $S_2$ $\vdots$ $S_N$
- There exists some $k$ ( $1 \le k \le 10$ ) such that the tuple $S_1, S_2, \dots, S_N$ is the $k$-times similarity enlargement of the ASCII art
KCPCorKUPC.
Partial Score
This problem has partial scoring based on subtasks.
| Subtask | Score | Constraints |
|---|---|---|
| 部分点1 | 5% (5 pts) | $k=1$ |
| 部分点2 | 5% (5 pts) | $k=2$ |
| 部分点3 | 5% (5 pts) | $k=3$ |
| 部分点4 | 5% (5 pts) | $k=4$ |
| 部分点5 | 5% (5 pts) | $k=5$ |
| 部分点6 | 6% (6 pts) | $k=6$ |
| 部分点7 | 7% (7 pts) | $k=7$ |
| 部分点8 | 8% (8 pts) | $k=8$ |
| 部分点9 | 9% (9 pts) | $k=9$ |
| 部分点10 | 10% (10 pts) | $k=10$ |
| 部分点11 | 5% (5 pts) | 答えが KCPC である |
| 部分点12 | 5% (5 pts) | 答えが KUPC である |
| 部分点13 | 25% (25 pts) | 追加の制約はない |
Here, the given strings are assumed to be a $k$-times similarity enlargement of an ASCII art.
Output
If the original ASCII art is KCPC, print KCPC; if it is KUPC, print KUPC.
Sample
Sample 1
Input
11 #...#.##### #.##..#.... ##....#.... #.##..#.... #...#.##### ........... ####..##### #...#.#.... ####..#.... #.....#.... #.....#####
Output
KCPC
This is the $1$-times similarity enlargement of the ASCII art KCPC.
Sample 2
Input
22 ##......##..##......## ##......##..##......## ##..####....##......## ##..####....##......## ####........##......## ####........##......## ##..####....##......## ##..####....##......## ##......##..########## ##......##..########## ...................... ...................... ########....########## ########....########## ##......##..##........ ##......##..##........ ########....##........ ########....##........ ##..........##........ ##..........##........ ##..........########## ##..........##########
Output
KUPC
This is the $2$-times similarity enlargement of the ASCII art KUPC.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。