还需要再消化一下这个算法。。 今天没有时间了,, 六级过了 就有大把时间 快活啊!
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<set>
using namespace std;
int
getmin(string s)
{

int
n=s.size();
int
i=,j=,k=,t;
while
(i<n && j<n && k<n)
{

t=s[(i+k)%n]-s[(j+k)%n];
if
(!t) k++;
else

{

if
(t>) i+=k+;
else
j+=k+;
if
(i==j) j++;
k=;
}
}

return
i<j?i:j;
}

int
main()
{

cin.sync_with_stdio(false);
int
t;
while
(cin>>t)
{

set<string> fuck;
for
(int i=;i<=t;i++)
{

string ss;
cin>>ss;
int
temp=getmin(ss);
int
len=ss.size();
string zz;
int
z=temp,ret;
for
(ret=;ret<ss.size();ret++)
{

zz+=ss[z%len];
z++;
}

fuck.insert(zz);
}

cout<<fuck.size()<<endl;
}

return
;
}

最新文章

  1. 遍历 Input检测是否有重复的值
  2. 自绘制HT For Web ComboBox下拉框组件
  3. CI框架源码阅读笔记6 扩展钩子 Hook.php
  4. Appium 解决不能输入中文字符问题
  5. oracle空表导出的问题
  6. js 动态 activex 组件
  7. Python中的SET集合操作
  8. Chapter3:字符串、向量和数组
  9. 稀疏表示(sparse representation)和字典学习
  10. yii 获取系统级请求参数的常用方法
  11. Android 使用LinearLayout.getChildAt(i)获取一个线性布局的view,并实现content中实现方法
  12. Windows Azure 数据安全(清理和泄漏)
  13. [PHP] assert()断言检测函数
  14. 【Java】利用注解和反射实现一个&quot;低配版&quot;的依赖注入
  15. Ex 6_5棋子放置问题_第八次作业
  16. Java反射《一》获取类
  17. pom格式
  18. windows 搭建 angular2 开发环境--白纸新手可以参考一下
  19. css 计算属性 calc的使用
  20. Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level

热门文章

  1. 黑马vue---59-60、组件中的data和methods
  2. Python3 编程之字符串处理
  3. Linux命令:hexdump
  4. Job for keepalived.service failed because the control process exited with error code. See &quot;systemctl status keepalived.service&quot; and &quot;journalctl -xe&quot; for details.
  5. 记录学习Linux遇到的问题
  6. Eclipse添加Android library 错误的原因
  7. mac配置maven项目的方法(含导入selenium包)
  8. uWSGI 漏洞复现(CVE-2018-7490)
  9. Vue父子组件传值$parent , ref,$refs,props大总结
  10. 洛谷 题解 CF711A 【Bus to Udayland】