编程介的小学生 2019-06-04 21:55 采纳率: 20.5%
浏览 165

计算尝试所需要的最大的次数,怎么使用 C 语言的程序编写出来的代码的方式计算实现的

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 the number of points in the figure and S is a string made up of distinct capital letters, each indicating a color that can be used to redraw the figure. 3 <= n <= 50.

Output
Each case outputs the maximum times they may try in one line. Note that two figures are considered the same if one can be obtained by having rotation and mirroring on the other one.

Sample Input
3 BW
3 RGB
4 RG

Sample Output
4
10
19

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)