prompt string | response string |
|---|---|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
s1 = s
s2 = ""
cou = 0
while s2 != s1:
s3 = s[0:len(s) - 1]
s2 = s[-1] + s3
cou += 1
s = s2
print(cou) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = raw_input()
a = s
l = []
count = 0
for i in xrange(0,len(s)):
a = a[-1] + a[:-1]
if a not in l:
count += 1
l.append(a)
print count |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | lis = []
s = input()
for i in range(len(s)):
lis.append(s[i:] + s[:i])
print(len(set(lis))) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=(input())
s1=set()
for i in range(len(s)):
s1.add(s[i:]+s[:i])
print(len(s1))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import sys
n=raw_input()
import copy
lst=list(n)
lst3=list(n)
l=len(n)
lst2=[n]
for i in range(0,l):
sto=lst[l-1]
for j in range(-1,l-1):
#prev=lst[j]
lst3[j+1]=lst[j]
#lst[0]=sto
s2="".join(lst3)
lst2.append(s2)
lst=copy.deepcopy(lst3)
print len(set(lst2))
sy... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
chg = s
lgt = len(s)-1
hasil = [s]
cycle = 1
while (lgt > 0):
lgt -= 1
chg = chg[-1] + chg[:-1]
if (chg not in hasil) :
cycle += 1
hasil.append(chg)
print(cycle)
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... |
stc = list(input())
st = stc
l = []
n = len(st)
for _ in range(n):
stc.insert(0, stc[n-1])
stc.pop()
si = (''.join(stc))
if si not in l:
l.append(si)
print(len(l))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, s1;
int cnt = 1;
map<string, int> x;
cin >> s;
x[s] = 1;
for (int i = 0; i < s.size() - 1; i++) {
s1 = s.substr(i + 1, s.size() - 1) + s.substr(0, i + 1);
if (s != s1) {
x[s1] = 1;
}
}
cout << x.size() << endl;
}
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | str=input();
l=len(str);
m={};
for i in range(1,l+1):
ch=str[l-1:l];
st=str[0:l-1];
ch+=st;
if (not(ch in m)):
m[ch]=1;
#print(ch)
str=ch;
print(len(m)); |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
d = s + s
l = len(s)
c = set()
for i in range(l):
aux = d[i:i + l]
if aux not in c:
c.add(aux)
print(len(c))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
set<string> ss;
set<string>::iterator iter;
string s;
int main() {
cin >> s;
for (int i = 0; i < s.size(); i++) {
string a = s;
for (int j = 0; j < s.size(); j++) {
a[j] = s[(i + j) % s.size()];
}
ss.insert(a);
}
cout << ss.size();
return 0;
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// package hongcow.learns.the.cyclic.shift;
import java.util.Scanner;
/**
*
* @author Mostafa
*/
public class HongcowLearnsTheCycl... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | words = dict()
def shift(s):
n = s[-1]
for i in range(len(s)-1):
n += s[i]
return n
def addAll(s):
for i in range(len(s)):
if s in words:
words[s] += 1
else:
words[s] = 0
s = shift(s)
addAll(input())
ma = 0
print(len(words)) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeSet;
//change to Main!
//chhange ... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
/**
* @author Don Li
*/
public class CyclicShift {
void solve() {
String s = in.nextToken();
i... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
set<string> st;
int main() {
string s;
cin >> s;
string a = s + s;
for (int i = 0; i < a.size() - s.size(); i++) {
string k = "";
for (int j = i; j < i + s.size(); j++) k += a[j];
st.insert(k);
}
cout << st.size();
}
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.io.*;
import java.text.DecimalFormat;
import java.util.*;
public class CF_A {
public static void main(String[] args) {
new CF_A().run();
}
public void run(){
FastScanner sc = new FastScanner(System.in);
PrintWriter out = new PrintWriter(System.out);
String s = sc.next();
HashSet<String> res... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | def test(s):
t = [s]
for i in range(len(s)-1):
s = s[len(s)-1] + s[:len(s)-1]
if str(s) not in t:
t.append(s)
print(len(t))
if __name__ == '__main__':
s = input()
test(s) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
string s;
map<string, int> M;
int main() {
cin >> s;
int cnt = 0;
int n = s.size();
for (int i = 0; i < n; i++) {
string tmp = "";
for (int j = 0; j < n; j++) {
tmp += s[(i + j) % n];
}
if (M[tmp] == 0) {
M[tmp] = 1;
cnt++;
}
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = list(input())
used = []
ans = 0
for i in range(len(s)):
z = s[0]
s.append(s[0])
s.pop(0)
p = ''.join(s)
if p not in used:
used.append(p)
ans += 1
print(ans) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | b = list(input())
l = []
for _ in range(len(b)):
b.insert(0,b[-1])
b.pop()
l.append("".join(b))
print(len(set(l)))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.io.*;
import java.math.*;
import java.util.*;
public class Main
{
static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(new InputStreamReader(System.in));
}
String next()
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... |
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Hongcow {
public static void main(String[] args){
String input;
Scanner sc = new Scanner(System.in);
Set<String> list = new HashSet<String>();
list.add(input = sc.nextLine());
int len = i... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=input()
L=[]
for i in range(len(s)):
s = s[-1]+s[:-1:]
if s not in L:
L.append(s)
print(len(L))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.*;
import java.util.*;
import java.util.LinkedList;
import java.math.*;
import java.lang.*;
import java.util.PriorityQueue;
import static java.lang.Math.*;
@SuppressWarnings("unchecked")
public class Solution implements R... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
public class CodeForces
{
public static void main(String[] args)
{
Scanner input = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
String s = input.next();
ArrayList<String... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
n = len(s)
s += s
dl = len(s)
d = set()
ans = 0
for i in range(dl - n):
str = s[i : i + n ]
if not str in d:
ans += 1
d.add(str)
print(ans)
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
int main() {
int count = 0;
string s, c;
cin >> s;
c = s;
do {
rotate(s.begin(), s.begin() + 1, s.end());
count++;
} while (c != s);
cout << count << "\n";
return 0;
}
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
print(len({s[-i:] + s[:-i] for i in range(50)})) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const double EPS = 1e-9;
using namespace std;
int main() {
set<string> c;
string line;
getline(cin, line);
c.insert(line);
int sz = line.size();
for (int i = (int)(0); i < (int)(sz); ++i) {
line.push_back(line[0]);
line.erase(line.begin());
c.... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.ArrayList;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.PrintWriter;
public class A_385 {
/**************Scanner********************/
static class FastReader {
private byte[] buf = new byte[1024];
private int curChar;
private int snumChars;
public in... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
dct = {}
for i in range(len(s)):
a = (s[i:]+s[:i])
if a not in dct: dct[a] = 1
print(sum(dct.values())) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=input()
n=len(s)
a=[s]
s+=s
for i in range(n):
tst=0
for j in a:
if s[i:i+n]==j:
tst=1
break
if tst==0:
a.append(s[i:i+n])
print(len(a)) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #!/usr/bin/env python3
def main():
try:
while True:
s = input()
a = set()
for i in range(len(s)):
a.add(s)
s = s[1:] + s[0]
print(len(a))
except EOFError:
pass
main()
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | x=str(input())
clone=x
len_=len(x)
count=0
for i in range(len_):
first=clone[-1]
second=clone[0: len_-1]
clone=first+second
if clone !=x:
count=count+1
else:
count=count+1
break
print(count)
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string str, str1, str2, str3;
int r = 0, i, l, n = 0, u, p, o, m = 0, k;
cin >> str;
str1 = str + str;
cout << str1.find(str, 1);
return 0;
}
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=input()
n=len(s)
a=[]
a.append(s)
k=1
for i in range(n):
s=s[-1]+s[:n-1]
if s not in a:
a.append(s)
k+=1
print(k) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=raw_input()
n=len(s)
a=set()
for i in range(n):
a.add(s[n-i:]+s[0:n-i])
print len(a) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
set<string> ss;
string s;
int main() {
cin >> s;
for (int i = 0; i < s.size(); i++) {
ss.insert(s.substr(s.size() - i, i) + s.substr(0, s.size() - i));
}
cout << ss.size() << endl;
return 0;
}
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.*;
import java.math.*;
import java.io.*;
import java.util.Collections;
public class Solution {
static class Solver {
Solver() {
}
public void solve(FastScanner scanner, PrintWriter out) throws IOException{
String line = scanner.nextLine();
Set<Str... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
char string[52];
scanf("%s", string);
int i, j, k, l, ans = 0, length = strlen(string), freq[26] = {0};
for (i = 0; i < length; i++) freq[string[i] - 97]++;
if (freq[string[0] - 97] == length)
cout << 1;
else {
for (i = 2; i < length; i+... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
st = set()
for i in range(len(s)):
s = s[1:] + s[0]
st.add(s)
print(len(st)) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
template <class T>
inline T power(T base, int p) {
T f = 1;
for (int i = 1; i <= p; i++) f *= base;
return f;
}
template <typename T>
string NumberToString(T Number) {
ostringstream ss;
ss << Number;
return ss.str();
}
int setbit(int N, int pos) { return N = N |... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=raw_input()
p={s[i:]+s[:i] for i in xrange(0, len(s)+1)}
print len(p) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
ss = set()
for i in range(len(s)):
ss.add(s[i:] + s[:i])
print(len(ss))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=raw_input();
S=set()
for i in range(len(s)):
S.add(s[i:]+s[0:i])
print len(S) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | from collections import deque
arr = deque(input())
res = set()
res.add(arr.__str__())
for i in range(len(arr)):
arr.rotate(1)
res.add(arr.__str__())
print(len(res)) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
d = {}
n = len(s)
for i in range(n):
d[s] = 1
s = s[-1] + s[:n-1]
print(len(d))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=input()
s2=s*2
a=set()
for i in range(len(s)):
a.add(s2[i:i+len(s)])
print(len(a))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
w = s
x = s[len(s) - 1]
s = x + s[:len(s) - 1]
if s != w:
ans = 2
else:
ans = 1
while (s != w):
x = s[len(s) - 1]
s = x + s[:len(s) - 1]
if s != w:
ans += 1
print(ans) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
string s;
set<string> se;
int main() {
cin >> s;
for (int i = 0; s[i]; i++) {
se.insert(s);
s = s.substr(1) + s[0];
}
cout << se.size() << endl;
return 0;
}
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... |
import java.util.Scanner;
public class JavaApplication170 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String x = sc.next();
int count = 1;
String y = x;
for(int i=0; i<x.length(); i++){
x = x.charAt(x.length()-1) + x.sub... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | # cook your code here
s = raw_input()
l = []
for i in range(0,len(s)) :
t = s[i:] + s[:i]
if t not in l :
l.append(t)
print len(l) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
int BinarySearch(int a, int b, int aa[], int x) {
while (a <= b) {
int mid = (a + b) / 2;
if (aa[mid] == x)
return mid;
else if (aa[mid] > x)
b = mid - 1;
else
a = mid + 1;
}
return -1;
}
int gcd(int a, int b) {
if (b == 0)
retu... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = raw_input().strip()
variants = set([ s ])
for i in range(1, len(s)):
variants.add(s[i:] + s[:i])
print(len(variants))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.Scanner;
import java.util.TreeSet;
public class HongcowLearnsTheCyclicShift {
static TreeSet<String> t;
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
t = new TreeSet<>();
t.add(s);
for(int i = 0 ; i < s.length() ; i++){
s = s... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
int main() {
int k = 0;
std::string t;
std::cin >> t;
int n = t.length();
std::string s[50];
for (int i = 0; i < n; ++i) {
s[i] = t.substr(i, n - i);
s[i] += t.substr(0, i);
for (int j = 0; j < i; ++j) {
if (s[i] == s[j]) {
--k;
break;
}
}... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = raw_input()
i = 0
sumstr = {}
while i < len(s):
st = ''
st = st + s[len(s)-1]
j = 0
while j < len(s) -1:
st = st + s[j]
j = j + 1
if st in sumstr.keys():
sumstr[st] = sumstr[st] + 1
else:
sumstr[st] = 1
s = st
i = i + 1
print len(sumstr) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
template <typename Iter>
ostream& _out(ostream& s, Iter a, Iter b) {
for (auto it = a; it != b; it++) s << (it == a ? "" : " ") << *it;
return s;
}
template <typename A, typename B>
ostream& operator<<(ostream& s, pair<A, B>& p) {
return s << "(" << p.first << " , " <... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String str = s.next();
s.close();
HashSet<String> w = new HashSet<>();
w.add(str);
int a = str.length() - 1;
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
int i, count;
int N;
char str[90];
int main() {
while (scanf("%s", str) != EOF) {
int len = strlen(str);
for (i = 1; i < len; i++) {
if (len % i == 0) {
for (int k = 0; k < len - i; k++) {
if (str[k] != str[k + i]) {
count = 0;
break;
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
int main() {
char a[100];
char b[100];
int i, len, num, temp, point;
while (scanf("%s", a) != EOF) {
num = 0;
len = strlen(a);
strcpy(b, a);
point = 0;
do {
point++;
temp = b[0];
for (i = 0; i < len; i++) b[i] = b[i + 1];
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.ArrayList;
import java.util.Scanner;
public class q1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String s=scanner.nextLine();
int n=s.length();
int ans=1;
ArrayList<String> l=new ArrayList<String>();
l.add(s);
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
int main() {
string str, s;
cin >> str;
s = str;
s += str;
s.erase(0, 1);
cout << s.find(str) + 1;
}
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | from collections import Counter
s = input()
z = set()
for i in range(len(s)):
s = s[1:] + s[:1]
z.add(s)
print(len(Counter(z))) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... |
k=list(input())
l=[]
z=0
for i in k:
l.append(i)
i=1
while i<=50:
r=k.pop()
k=[r]+k
z=z+1
if l==k:
break
i=i+1
print(z)
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.HashSet;
import java.util.Scanner;
public class testmain {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc= new Scanner(System.in);
String input= sc.nextLine();
int length=input.length();
StringBuilder rot=new StringBuilder(... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Kevin
*/
import java.io.*;
import java.util.*;
public class codeforce {
static Scanner sc = new Scanner(System... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
c_dict = set([s])
for i in range(len(s)):
s = s[1:] + s[0]
c_dict.add(s)
print(len(c_dict)) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
string wasp[a.length()];
wasp[0] = a;
int cur = 1, tot = 1;
for (int j = 0; j < a.length(); j++) {
char c;
c = a[0];
a[0] = a[a.length() - 1];
for (int i = a.length() - 1; i > 0; i--) {
a[i] = a[i - 1];
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.*;
public class dummy
{
public static void main(String args[])throws Exception
{
Scanner sc=new Scanner(System.in);
String s = sc.next();
int n = s.length();
int i,j;
int count=1;
ArrayList<String> ar =new ArrayList<>();
ar.add(s);
String temp;
OUTER:
for(i=n-1;i>0;i--)
{
tem... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | string = input()
a = len(string)
words = set()
for x in range(a):
words.add(string)
letters = list(string)
temp = letters[-1]
del letters[-1]
letters.insert(0, temp)
string = "".join(letters)
print(len(words))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s=raw_input()
t=""
ans=0
for i in range(len(s)):
t+=s[i]
if(len(t)*(s.count(t)) == len(s)):
ans=len(t)
break
if(ans==0):
print len(s)
else:
print ans |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | word = input()
aux = word
n = len(word)
res = 1
while True:
word2 = aux[n-1] + aux[0:n-1]
if word2 != word:
res+=1
aux=word2
else:
break
print(str(res))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | a = str(input())
b = []
c = len(a)
for i in range(c):
a = a[c-1:c] + a[0:c-1]
b.append(a[c-1:c] + a[0:c-1])
print(len(set(b)))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
string f(string s) {
string an = "";
an += s[s.size() - 1];
for (int i = 0; i < s.size() - 1; i++) {
an += s[i];
}
return an;
}
int main() {
string s;
cin >> s;
vector<string> v;
v.push_back(s);
for (int i = 0; i < s.size() - 1; i++) {
v.push_bac... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | n=input()
ans=1
chk=n
for i in range(len(n)):
chk=chk[-1]+chk[:-1]
if chk!=n:
ans+=1
else:
break
print(ans) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #----Kuzlyaev-Nikita-Codeforces-----
#------------02.04.2020-------------
alph="abcdefghijklmnopqrstuvwxyz"
#-----------------------------------
s=str(input())
arr=[s]
for i in range(len(s)):
s=s[1:len(s)]+s[0]
arr.append(s)
print(len(list(set(arr)))) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
a = set()
while (s not in a):
a.add(s)
s = s[-1] + s[:-1]
print(len(a)) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | count={}
str=input()
count[str]=1
l=(len(str))
for i in range(l):
str=str[-1]+str[0:l-1]
count[str]=(count.get(str,0))
print(len(count))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | from collections import defaultdict
import sys, os, math
if __name__ == "__main__":
#n, m = list(map(int, input().split()))
s = input()
st = {s}
for i in range(len(s)):
st.add(s[i:]+s[:i])
print(len(st))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class ProbE implements Runnable{
private static InputStream stream;
private static byte[] buf = new byte[1024];
private static int curChar;
private static int numChars;
private static SpaceCharFilter filter;
private static PrintWriter pw;... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | n=list(input())
tam=len(n)
con=1
w=n[:tam]
y=n[:len(n)]
pas=True
i=0;
while (i<tam and pas==True):
y.insert(0,w.pop())
y.pop()
if(y==n):
pas=False
i=tam
else:
con=con+1
i=i+1
print(con) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return list(map(int, sys.stdin.r... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | text = input()
l = len(text)
text += text
allwords = set()
for i in range(l):
s = text[i:i+l]
allwords.add(s)
print(len(allwords)) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.HashMap;
import java.util.Scanner;
public class Competencia5 {
public static void main(String[] args){
Scanner scan = new Scanner (System.in);
String string = scan.next();
HashMap<String, String> map = new HashMap<String, String>();
map.put(string, string);
for (char c : string.toCharArray(... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import math
import sys
import re
s = input()
n = len(s)
l = []
x = 0
while x!=n:
s = s[-1] + s[:-1]
l.append(s)
x = x + 1
print(len(set(l))) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
char s[60];
int main() {
cin >> s;
set<string> A;
int n = strlen(s);
for (int i = 0; i < n; ++i) {
string cur;
for (int j = 0; j < n; ++j) {
cur += s[(i + j) % n];
}
A.insert(cur);
}
cout << A.size() << endl;
retu... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
a= set()
for i in range(len(s)):
a.add(s[i:] +s[:i])
print(len(a))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | ##n = int(input())
##a = list(map(int, input().split()))
##print(" ".join(map(str, res)))
s = input()
n = len(s)
v = set()
for i in range(n):
t = s[1:n]+s[0]
v.add(t)
s = t
print(len(v)) |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.io.*;
import java.math.BigInteger;
import java.util.*;
//Mann Shah [ DAIICT ].
//fast io
public class Main {
static int mod = (int) (1e9+7);
static InputReader in;
static PrintWriter out;
public static void main(String args[] ) {
in = new InputReader(System.in);
... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = input()
k = set()
for i in range(len(s)):
s = s[-1] + s[:-1]
k.add(s)
print(len(k))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | def solveMeFirst(a):
# Hint: Type return a+b below
cycle =a[len(a)-1] + a [:len(a)-1]
times = 0
while a != cycle :
temp = cycle [:]
cycle =temp[len(a)-1] + temp [:len(a)-1]
times+=1
return times+1
num1 = input()
res = solveMeFirst(num1)
print(res)
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | '''input
yzyz
'''
x = input()
s = set()
for _ in range(len(x)):
s.add(x)
x = x[-1] + x[:-1]
print(len(s))
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | s = raw_input('')
x = len(s)
c = 1
j = s
tmp = s[:x-1]
tmp = s[x-1] + tmp
for i in range(x):
if tmp not in j:
c+=1
j+= ' ' + tmp
s = tmp
tmp = s[:x-1]
tmp = s[x-1] + tmp
print c |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
void MAIN();
int main() {
MAIN();
return 0;
}
const long long N = 1e6 + 1, mod = 1e9 + 7;
string s;
map<string, bool> ok;
void MAIN() {
int ans = 1;
cin >> s;
ok[s] = 1;
for (int i = 0; i < s.size() - 1; ++i) {
s = s[s.size() - 1] + s;
s.erase(s.end() - ... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | #include <bits/stdc++.h>
using namespace std;
string f(string s, int idx) {
string ret = "";
for (int i = 0; i < s.size(); i++) {
ret += s[(i + idx) % s.size()];
}
return ret;
}
int main() {
string s;
cin >> s;
set<string> st;
for (int i = 0; i < s.size(); i++) {
st.insert(f(s, i));
}
printf... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Hongcow {
public static void main(String[] args){
String input;
Scanner sc = new Scanner(System.in);
Set<String> list = new HashSet<String>();
list.add(input = sc.nextLine());
for(int i=0; i<input.length()-1; i+... |
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | w = str(input().strip())
l = len(w)
k = w+w
i = k.find(w,1)
if i==-1:
print(l)
else:
print(i)
|
Problem: Hongcow is learning to spell! One day, his teacher gives him a word that he needs to learn to spell. Being a dutiful student, he immediately learns how to spell the word.
Hongcow has decided to try to make new words from this one. He starts by taking the word he just learned how to spell, and moves the last c... | a=raw_input()
s=[]
n=len(a)
c=0
for i in range(0,n):
a=str(a[n-1])+a[0:n-1]
if a not in s:
s.append(a)
c=c+1
print c
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.