2 shunfurh shunfurh 于 2017.09.10 00:30 提问

How many

Problem Description
Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell me
How many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say the two necklaces are some).
For example 0110 express a necklace, you can rotate it. 0110 -> 1100 -> 1001 -> 0011->0110.

Input
The input contains multiple test cases.
Each test case include: first one integers n. (2<=n<=10000)
Next n lines follow. Each line has a equal length character string. (string only include '0','1').

Output
For each test case output a integer , how many different necklaces.

Sample Input
4
0110
1100
1001
0011
4
1010
0101
1000
0001

Sample Output
1
2

1个回答

devmiao
devmiao   Ds   Rxr 2017.09.10 08:58
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
How many的用法
How many 问多少,       可数名词复数紧跟着。       一般疑问句随其后,       其它成分不要丢。       举个例子来说明:       How many days are there in a week?  ***********************************************************1. What animals do
HDU:1213 How Many Tables(简单并查集)
How Many Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24376    Accepted Submission(s): 12201 Problem Description Today is
HDU 3038 How Many Answers Are Wrong(并查集)
题目链接:[kuangbin带你飞]专题五 并查集 D - How Many Answers Are Wrong题意 有n次询问,给出a到b区间的总和,问这n次给出的总和中有几次是和前面已近给出的是矛盾的。 思路 sum[x]表示x到区间末尾的总和 则a到b的总和c 可以表示为sum[a]-sum[b+1] = c。 代码#include<iostream> #include<std
HDU 2138 How many prime numbers【素数判断,卡时间!!】
How many prime numbers Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 14873 Accepted Submission(s): 5150 Problem Description Give y
codeforces 9D How many trees? (组合二叉树)
题目链接:http://vjudge.net/contest/view.action?cid=47681#problem/D
hdu 1978 How many ways (动态规划、记忆化搜索)
How many ways Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2957    Accepted Submission(s): 1733 Problem Description 这是一个简单的生存游戏,
ocp-258
QUESTION NO: 258 How many database instances are used during a database-duplication process?A. One B. Two C. Three D. Four E. Five Answer: B一个数据库的复制进程使用多少数据库实例?Answer: B
杭电 HDU ACM 1213 How Many Tables
How Many Tables Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 17049    Accepted Submission(s): 8349 Problem Description Today is Igna
HDU 1130 How Many Trees?(卡特兰数+大数)
HDU 1130 How Many Trees?(卡特兰数+大数)
FZU 1012 Relatives
RelativesTime Limit:1sMemory limit:32MAccepted Submit:387Total Submit:1304Given n, a positive integer, how many positive integers less than n are relatively prime