RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00348

Janje

Unrated 레이팅 미적용
난이도
1s
시간 제한
64MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

\(7^{th}\) round, March \(7^{th}\) 2015
Young Bojan, today a successful student of electrical engineering, loved coloring ever since he was a
little boy. Remembering careless days from his childhood, he decided to buy a coloring book and \(K\)
colors and get to work. It’s interesting that Bojan doesn’t like colorful pictures, so he decided to color
each picture using at most three different colors. Additionally, Bojan will never color two adjacent
areas using the same color because, as he puts it, "what’s the use of this line in between then?" Two
areas are considered adjacent if their edges have at least one joint point. For example, areas denoted
with 4 and 3 (see image below) are adjacent, whereas areas 1 and 2 aren’t. Additionally, coloring of
the image below is in accordance with all of Bojan’s demands.
Before he begins coloring a picture, Bojan asks himself in how many ways he can color that picture
so he meets with all his conditions. Given the fact that Bojan is studying electrical engineering, it is
understandable that combinatorics isn’t his strong point, so he asked you for help.

제약
입력 형식

The first and only line of input contains two integers \(N\) (1 ⩽\(N\) ⩽8) and \(K\) (1 ⩽\(K\) ⩽1 000) which
denote the ordinal number of the picture from the coloring book and the number of different colors
Bojan can use, respectively.
You can find the coloring book with the numbered pictures on the next page.

출력 형식

The first and only line of output must contain the number of ways Bojan can color the \(N\)^{th} picture
from the coloring book if he has \(K\) different colors at his disposal. Two colorings are different if they
differ in color in at least one area.

예제 1
입력
2 2
5 3
7 3
출력
output
output
0
12
96

HAPPY COLORING BOOK

Picture 1. Caterpillar (the eyes and the antennas are not areas and should not be colored)



              Picture 2. A sea cottage                                                   Picture 3. A well known logo



       Picture 4. Frosty the Snowman
        Picture 5. An abstract ball






                               Picture 6. Pyramid                                                   Picture 7. Daisy





Picture 8. Trampoline (the gray part is not considered an area and should not be colored)
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2014/2015 Contest 7

평가 및 의견

Janje

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Janje

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8