BCOI的狂欢
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题面背景
每到春节前夕,便是我们BCOI oier的狂欢,孩子们对春节白蛋进行染色,使其五颜六色,但是我们也有染色规则。
题目描述
我们用 种颜色给 个小球染色, 要求相邻两个小球的颜色不同, 一共有多少染色方案?
输入格式
第一行输入两个整数
输出格式
输出 个整数,表示所求的答案。答案可能很大, 需要对 998244353
取模
样例 #1
样例输入 #1
2 2
样例输出 #1
2
样例 #2
样例输入 #2
1 5
样例输出 #2
5
数据范围
2025北辰贺岁杯入门赛-复现赛
- Status
- Done
- Rule
- Ledo
- Problem
- 6
- Start at
- 2025-1-18 9:00
- End at
- 2025-2-4 1:00
- Duration
- 400 hour(s)
- Host
- Partic.
- 53