『杭电1821』Get The Treasure

880 篇文章 122 订阅 ¥29.90 ¥99.00
考古团队发现一个由n个点构成的圆形图案,每个点代表一种颜色,解开谜题需用这些颜色重新绘制所有连线。题目要求计算最糟糕情况下尝试打开宝藏门的次数。输入包含点数n和可用颜色字符串S,输出最大尝试次数。示例输入输出已给出。
摘要由CSDN通过智能技术生成

Problem Description

One day, a team of archaeologists found a figure and some ancient charactors at a relique. The figure was made up of n points distributing on a circle symmetrically.
After investigating the charactors, they got to know that a treasure was hid beneath the figure. In order to open the door to the treasure, they must redraw all the lines between any two points in the figure with some colors. If the figure was right, the door would open.
Now they want to know how many times they have to try at most to open the door, and they ask you for help.

Input

Each test case contains an integer n and a string S in a line. n is t

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

漠宸离若

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值