UVA 455(p57)----Periodic Strings
来源:互联网 发布:三级域名申请 编辑:程序博客网 时间:2024/05/29 16:18
#include<cstdio>#include<iostream>#include<cstring>using namespace std;char st[200];int t,flag,f;int main(){ /*freopen("in.in","r",stdin); freopen("out.out","w",stdout);*/ scanf("%d",&t); for(int i=1; i<=t; i++) { cin>>st; f=0; int l=strlen(st); if(i!=1) puts(""); for(int i=1; i<=l; i++) { int flag=1; if(l%i) continue; for(int j=i; j<l; j++) if(st[j]!=st[j%i]) { flag=0; break; } if(flag) { printf("%d\n",i); break; } } } return 0;}题目地址:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=6&page=show_problem&problem=396
0 0
- UVA 455(p57)----Periodic Strings
- UVA 455 - Periodic Strings
- UVa 455 - Periodic Strings
- UVa 455 - Periodic Strings
- UVa 455 - Periodic Strings
- UVa 455 Periodic Strings
- UVa - 455 Periodic Strings
- UVa 455 Periodic Strings
- UVa 455 - Periodic Strings
- Uva 455-periodic strings
- Uva 455-periodic strings
- UVa-455Periodic Strings
- 【Uva 455】 Periodic Strings
- UVA - 455 Periodic Strings
- UVa 455 - Periodic Strings
- Uva - 455 - Periodic Strings
- UVA - 455 Periodic Strings
- UVa 455 - Periodic Strings
- HDMI和SDI的简介
- codeforces 589H DFS
- android 自定义TopBar的使用
- 网络---大文件的下载(NSURLConnection)
- 可调用对象
- UVA 455(p57)----Periodic Strings
- 史上最全的CSS hack方式一览
- 深夜学网页(2)——html(2)
- 开本博客的目的
- HDU 1171 Big Event in HDU(多重背包)
- IE8 添加class (兼容)方法
- mkString优化以及超过22字段在scala2.10中的一个小需求
- UVA 524(p194)----Prime Ring Problem
- React Native学习笔记-4:CSS优先级速记