問題一覧 > 通常問題

No.3556 KCPC or KUPC

レベル : / AI推定難易度 : 143 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 85
作問者 : butsurizuki / テスター : 👑 みうね fluorine TKTYI HoyHoyCharhang jastaway soryuusi0219 yaaya wasab1 tatesoto KumaTachiRen
お気に入りにしたユーザー ProblemId : 13383 / 自分の提出
問題文最終更新日: 2026-08-15 03:21:44
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
KCPC新歓杯2026 (順位表) の他の問題:

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 KCPC or KUPC.

Partial Score

This problem has partial scoring based on subtasks.

SubtaskScoreConstraints
部分点15% (5 pts)$k=1$
部分点25% (5 pts)$k=2$
部分点35% (5 pts)$k=3$
部分点45% (5 pts)$k=4$
部分点55% (5 pts)$k=5$
部分点66% (6 pts)$k=6$
部分点77% (7 pts)$k=7$
部分点88% (8 pts)$k=8$
部分点99% (9 pts)$k=9$
部分点1010% (10 pts)$k=10$
部分点115% (5 pts)答えが KCPC である
部分点125% (5 pts)答えが KUPC である
部分点1325% (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もしくは右上の雲マークをクリックしてアカウントを作成してください。