经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

计算机C13001第一次小组赛D题

📝 题解 🔵 仅限 C++
题目描述
<p style="text-align:center;"> <span style="color:#003399;font-size:24px;"><strong>The Big Flag-raising</strong></span> </p> <p> <span style="color:#003399;font-size:14px;"><strong>In the Maritime University , there is a tradition that is big flag-raising .&nbsp;</strong></span> </p> <p> <span style="color:#003399;font-size:14px;"><strong>At 5:50 in the morning , wearing uniforms and lining up for each student is a big headache . In order to improve the efficiency of collection and &nbsp;save more sleep time .The school leadership decides to divide the specific area into N small areas of equal size.Now assume that we don’t consider the length &nbsp;of the queue .The small areas will be seen as a straight line. In order to look more orderly, students in each small area are required to wear the same uniform .The adjacent small area should not wear the same uniform.Moreover, the head area and the tail area can’t wear the same uniform.There are some phalanxes(each phalanx occupies one small area) dressed in the specific uniform (one of three given kinds of uniform), and we want to know how many different permutation solutions(Assume that the number of phalanxes waring each kind of uniform is a certain number).</strong></span> </p>
输入格式
<strong><span style="color:#003399;font-size:14px;">The input will contain multiple test cases ,Each case will only contain a number N(1 &lt;= N &lt;= 50).</span></strong>
输出格式
<strong><span style="color:#003399;font-size:14px;">Output the answer in a line.</span></strong>
样例
样例输入 1
1 2
样例输出 1
3 6
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用