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... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int n = (int)s.size();
set<string> se;
for (int i = 0; i <= n; ++i) {
se.insert(s);
s = s[n - 1] + s.substr(0, n - 1);
}
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... | l=list(input())
x=[]
d=[]
a=len(l)
for i in range(1,int(a**(1/2))+1):
if not a%i:
d.append(i)
d.append(a//i)
d=list(set(d))
d.sort()
for i in d:
if l==l[:i]*(a//i):
print(i)
exit() |
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()
words = []
for i in range(len(s)):
s = s[len(s)-1]+s[:len(s)-1]
if s not in words:
words.append(s)
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... | from collections import *
A = deque(list(input()))
S = set()
for i in range(len(A) + 1):
S.add("".join(A))
A.appendleft(A.pop())
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... | text = input()
words = set()
for i in range(len(text)):
words.add(text[i:] + text[:i])
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.util.HashSet;
import java.util.Scanner;
public class Task {
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
String line = s.nextLine();
HashSet<String> words = new HashSet<>();
int i = 0;
while (i < line.length()) {
line = line.substring(1) + line.substring(... |
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)
reps = set()
for i in range(n):
ss = s[1:]+s[0]
s = ss
reps.add(s)
print(len(reps))
# C:\Users\Usuario\HOME2\Programacion\ACM |
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, lst, count = input(), [], 0
for i in range(len(s)):
if s not in lst:
count += 1
lst.append(s)
s = s[-1] + s[:-1]
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... | s=input()
l=[]
l.append(s)
for i in range(len(s)-1):
s=s[-1]+s[:len(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... | s = list()
inp = input()
for i in range(len(inp)):
s.append(inp)
inp = inp[1:] + inp[0]
print( len(set(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 = input()
y = len(s)
a = []
for i in range(len(s)):
a.append(s[i:]+s[:i])
b = []
ans = 0
for i in a:
if i not in b:
b.append(i)
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... | s = input()
test = s
count = 1
for i in range(len(s)):
test = test[1:]+test[0]
if test == s :
break
else:
count+=1
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... | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new ... |
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=set()
for i in range(len(s)):
l.add(s)
s=s[-1]+s[:-1]
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;
string s;
int main() {
cin >> s;
map<string, int> m;
int ans = 0;
for (int i = 1; i <= s.size(); i++) {
string temp;
temp += s[s.size() - 1];
s = temp + s;
s.erase(s.end() - 1);
if (!m[s]) {
m[s]++;
ans++;
}
}
cout << ans << e... |
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.stream.IntStream;
public class HongcowLearnsTheCyclicShift
{
public static void main(String [] args)
{
Scanner input = new Scanner(System.in);
String str = input.next();
int ans = (int) IntStream.range(0, str.length())
... |
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 Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
String s = sc.next();
int n = s.length();
Set<String> set = new HashSet<>();
set.add(s);
int cnt = 1;
for(int i=0; i<n; i++){
s = s.substring(n-1, n)+s.substring(0, 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=input()
k=s
l=[]
l.append(s)
j=0
c=1
while j<len(s)-1:
s=s[len(s)-1]+s[0:len(s)-1]
if s not in l:
#print(s)
l.append(s)
c=c+1
j=j+1
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... | def shift(s):
letters = list(s)
return letters[len(s) - 1] + "".join(letters[0:len(s) - 1])
s = input()
d = set()
while s not in d:
d.add(s)
s = shift(s)
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... | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
string s;
cin >> s;
vector<string> v;
while (1) {
if (find(v.begin(), v.end(), s) == v.end())
v.push_back(s);
else
break;
s += s[0];
s.erase(s.begin());
}
cout << v.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... | s=input()
l=[]
for i in range(len(s)):
l.append(s[-1]+s[:len(s)-1])
s=l[-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... | S = input()
Slen = len(S)
W = {S}
Wnew = S
Wlen = 1
for i in range(Slen-1):
Wnew = Wnew[-1] + Wnew[:-1]
if Wnew in W:
continue
W.add(Wnew)
Wlen += 1
print(Wlen) |
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()
temp = s+s
n = len(s)
count=1
newString = []
newString.append(s)
for i in xrange(1, len(s)):
tempString = temp[i: i+n]
if tempString not in newString:
count+=1
newString.append(tempString)
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... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Lexa on 17.12.2016.
*/
public class Olimp3 {
public static void main(String[] args) throws IOException {
BufferedReader red = new BufferedReader... |
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... | (function main(){
//http://codeforces.com/problemset/problem/745/A
var palabra = readline();
var combinaciones = [palabra];
for (var i = 0; i < palabra.length; i++) {
palabra = palabra.substring(1) + palabra.charAt(0);
if(combinaciones.indexOf(palabra) == -1){
combinaciones.push(palabra);
}
... |
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=input()
s=[]
count=0
while(a not in s):
s.append(a)
a=a[-1]+a[:-1]
count+=1
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... | string = input()
a = set()
for i in range(len(string)):
a.add(string[i:] + string[: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... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
public class Main2 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String in = br... |
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() {
char a[60], b[60];
int l, k, m, t, c = 1;
gets(a);
strcpy(b, a);
l = strlen(a);
do {
m = l - 1;
t = a[m];
for (k = l - 2; k >= 0; k--) {
a[m] = a[k];
m--;
}
a[0] = t;
if (strcmp(a, b) != 0) c++;
} while (strcmp(a, b) != 0);
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... | w = input()
def rota(a, b):
lef = a[:b]
rig = a[b:]
return rig + lef
##ls1 = ['1', '2', '3', '4', '5']
##
##print(rota(ls1, len(ls1)-1))
wList = []
wC = []
for i in range(len(w)):
wList.append(w[i])
for i in range(len(w)):
res = rota(wList, len(w)-1)
wC.append("".join(res))
wList =... |
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 = set()
l = input()
st = [i for i in l]
for i in range(len(st)):
l = st.pop()
st.insert(0,l)
s.add(''.join(st))
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... | #include <bits/stdc++.h>
using namespace std;
vector<string> unique(vector<string> vec) {
sort(vec.begin(), vec.end());
auto ip = unique(vec.begin(), vec.end());
vec.resize(distance(vec.begin(), ip));
return vec;
}
long long sum(vector<long long> vec) {
long long Sum = 0;
for (auto& i : vec) Sum += i;
ret... |
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
val=deque(input())
length=len(val)
all=set()
while length:
length-=1
all.add(''.join(val))
val.appendleft(val.pop())
print(len(all))
|
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=input()
r=['']
for i in range(len(a)):
s=a[len(a)-1]+a[:len(a)-1]
a=s
if a not in r:
r.append(a)
print(len(r)-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>
using namespace std;
string f(string s) {
string ret;
ret += s[int(s.size()) - 1];
for (int i = 0; i < int(int(s.size()) - 1); i++) {
ret += s[i];
}
return ret;
}
int main() {
string s;
cin >> s;
set<string> se;
se.insert(s);
for (int i = 0; i < int(int(s.size()) + 3); 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... | import java.io.*;
import java.util.*;
public class TaskA {
public static void main(String[] args) {
TaskA tA = new TaskA();
BScanner in = new BScanner();
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
tA.solve(in, out);
out.close();
}
public void 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... | import java.util.*;
public class Hongcowlearnsthecyclisshift {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
String s = input.next();
HashSet<String> set = new HashSet<String>();
int counter = 0;
while(true){
... |
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> q;
int main() {
cin >> s;
for (int i = 0; i < s.length(); ++i) {
q.insert(s.substr(i) + s.substr(0, i));
}
cout << q.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.io.File;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class A {
public static void main(String[] args) {
try {
Scanner in = new Scanner(System.in);
String s = in.nextLine();
int len = s.length();
Set<String> words = new HashSet<String>();
words.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>
struct str {
char a[505];
} s[505];
using namespace std;
int main() {
char str1[505], str2[505], str3[505];
int len1 = 0, len2 = 0;
int i = 0, k = 0, w = 0, q = 0, t = 0, f = 0;
cin >> str1;
strcpy(str2, str1);
strcat(str2, str1);
len1 = strlen(str1);
len2 = strlen(str2);
fo... |
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() {
char s[51][51];
scanf("%s", s[0]);
int i = 1, j, t, p = 1;
for (j = 0; j < strlen(s[0]); j++) {
s[i][0] = s[i - 1][strlen(s[0]) - 1];
strcpy(&s[i][1], s[i - 1]);
s[i][strlen(s[0])] = '\0';
i++;
for (t = 0; t < i - 1; t++) {
if (strcmp(s[i - 1], s[t... |
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
def main():
s = raw_input()
ar = set(s[i:]+s[:i] for i in range(len(s)))
print len(ar)
if __name__ == '__main__':
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... | s = input()
l = list(s)
a = set()
for _ in range(len(s)):
a.add(s)
lnew = l[1:]+[l[0]]
s = "".join(lnew)
l = list(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... | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
set<string> s;
int n = str.size(), i = 0;
while (i < n) {
reverse(str.begin(), str.end());
reverse(str.begin() + 1, str.end());
i++;
s.insert(str);
}
cout << s.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... | #include <bits/stdc++.h>
using namespace std;
int main() {
const int m = 100;
string s, p, l;
string A[m];
cin >> s;
int k;
int sum = 0;
bool flag = false;
int a = s.size();
for (int i = 0; i < a; i++) {
p = s[a - 1];
s.erase(a - 1, 1);
l.insert(0, p);
l.insert(1, s);
A[i] = 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... | #Amirhossein Alimirzaei
#@HajLorenzo
_=input()
__=len(_)
___=_
____=0
while(True):
__-=1
_____=_[__:len(_)]+_[0:__]
if _____==_:
print(____+1)
exit()
____+=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.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import ... |
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()
for i in range(1,len(s)//2+1):
if s.count(s[:i])*i==len(s):
print(i)
break
else: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... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
while (cin >> s) {
int cnt = 0;
int len = s.length();
string t;
string s1 = s;
t = "";
while (t != s1) {
if (t != "") s = t;
t = "";
char c = s[len - 1];
t += c;
for (int i = 0; i < len - 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... | s=raw_input()
word=s
l=[]
ctr=0
for i in range(len(word)):
word=word[-1]+word[:-1]
if word not in l:
ctr+=1
l.append(word)
else:
l.append(word)
print ctr |
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;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s = br.readLine(),f = s.concat(s);
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... | q=input()
a=[q]
l=len(q)
q=q*2
for i in range(1,l):
a.append(q[i:i+l])
print(len(set(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;
int main() {
string s, spr;
vector<string> valer;
cin >> s;
char h;
int k = (int)s.size();
valer.push_back(s);
for (int i = 1; i < k; i++) {
h = s[k - 1];
for (int j = k - 1; j > 0; j--) {
s[j] = s[j - 1];
}
s[0] = h;
spr = s;
boo... |
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... | /* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
BufferedReader ... |
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()
ans = 1
i = len(s) - 1
a = [s]
while i > 0:
t = s[i:] + s[:i]
if s[i:] + s[:i] not in a:
ans += 1
a.append(t)
i -= 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... | s=input()
r=1
t=[s]
for i in range(len(s)):
res=s[1:]+s[0]
if res not in t:
t.append(res)
s=res
print(len(t)) |
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()
cs= set()
for i in range(len(s)):
s = s[-1] + s[:-1]
cs.add(s)
print(len(cs))
|
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) {
string s;
cin >> s;
map<string, int> mp;
int n = s.size();
while (n--) {
char temp = s[s.size() - 1];
for (int i = s.size() - 1; i > 0; i--) {
s[i] = s[i - 1];
}
s[0] = temp;
mp[s]++;
}
cout << mp.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... | def Main():
s = input()
st = set()
# print(s[:2])
for i in range(len(s)):
# print(s[i:] , s[:i])
ss = s[i:] + s[:i]
# print(ss)
st.add(ss)
print(len(st))
if __name__ == '__main__':
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... | def shift(n):
a=[]
c=''
for i in range(len(n)):
a+=n[i]
b=a[-1]
for i in range(len(a)-1):
b+=a[i]
for i in range(len(b)):
c+=b[i]
return c
word=input()
a=[word]
for i in range(len(word)):
word=shift(word)
if word in a:
continue
else:
a+=[wo... |
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 rot(s):
return s[1:]+s[:1]
s=input()
a=[s]
ans=1
for i in range(len(s)-1):
s=rot(s)
if not(s in a):
ans+=1
a.append(s)
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... | s = input()
print(len(set(s[-i:] + s[:-i] for i in range(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 = list(input())
n = len(s)
dict = {}
res = 0
for i in range (n):
tmp = ''.join(s)
if dict.get(tmp) == None:
dict[tmp] = 1
res += 1
s.insert(0, s[n - 1])
s.pop(n)
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... | import java.util.*;
public class Main
{
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
String str = s.next();
StringBuffer strbuf = new StringBuffer(str);
List<Character> list = new LinkedList<>();
Set<String> set = new TreeSet<>();
set.add(strbuf.toString());
String str1 = "";
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... |
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... |
import java.util.HashMap;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner(System.in);
String str = s.next();
HashMap<String , Boolean> map = new HashMap<>();
int count=0;
for(int i=0;i<str.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... |
import java.util.Scanner;
public class Main
{
public static String s(String a)
{
return a.substring(a.length()-1)+a.substring(0,a.length()-1);
}
public static void main( String [] args )
{
Scanner sn = new Scanner( System.in );
String le = sn.next();
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... | n=input()
a=[n]
for i in range(len(n)-1):
n=n[-1]+n[:len(n)-1]
if n not in a:a.append(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... | word = raw_input()
cached = {word:1}
count = 1
for i in range(1, len(word)):
temp = word[i:] + word[:i]
if temp not in cached:
count += 1
else:
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;
string s;
int ans;
char c;
int main() {
cin >> s;
map<string, int> mp;
for (int i = 0; i < s.size(); i++) {
c = s[s.size() - 1];
for (int j = s.size() - 1; j > 0; j--) s[j] = s[j - 1];
s[0] = c;
mp[s]++;
if (mp[s] == 1) ans++;
}
printf("%d\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=input()
p=set()
for i in range(100):
if s not in p:
p.add(s)
s=s[-1]+s[: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... | n = input()
l = []
for i in range(len(n)):
l.append(n[i:]+n[:i])
print(len(list(dict.fromkeys(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() {
long long int res = 0, i, j, pos, r = 0, ans = 0, len, cnt;
char s[500][500];
cin >> s[0];
len = strlen(s[0]);
for (i = 0; i < len; i++) {
s[i + 1][0] = s[i][len - 1];
for (j = 0; j < len - 1; j++) {
s[i + 1][j + 1] = s[i][j];
}
}
... |
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()
snew = s+"#"
list = []
for i in range (len(snew)):
if (snew[i:-1]+snew[0:i]) not in list:
list.append(snew[i:-1]+snew[0:i])
print(len(list)) |
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()
se = set()
n = len(s)
for i in range(n):
se.add(s)
s = s[-1] + s[:-1]
print(len(se)) |
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;
cin >> s;
int sz = s.size();
set<string> dist;
while (sz--) {
string x = s;
char temp = s[s.size() - 1];
for (int i = s.size() - 1; i > 0; i--) {
s[i] = s[i - 1];
}
s[0] = temp;
dist.insert(x);
}
cout << dis... |
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 HongcowLearnsTheCyclicShift
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
String s = in.next();
HashSet<String> hs = new HashSet<String>();
for(int x = 0; x < s.length(); x++)
{
hs.add(s);
s = (s.charAt(s.length() - 1) + s.substr... |
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 changeword(word):
i=word
toge=[]
new=""
while i!=new:
new=""
long=len(word)
for n in range(long):
new+=word[n-1]
if new not in toge:
toge.append(new)
word=new
return toge
word=input()
answer=changeword(word)
print(len(answer))
|
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.Arrays;
import java.lang.*;
import java.io.*;
import java.util.*;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.*;
import java.util.function.Function;
import java.util.stream.IntStream;
public class HongcowLearnsTheCyclicShift745A {
public static vo... |
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()
set = set()
for i in range(len(s)):
set.add(s)
s = s[-1]+s[:-1]
print(len(set)) |
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, s2;
cin >> s;
s2 = s + s;
cout << s2.find(s, 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... | #!/bin/python3
import sys
stri = input()
str_temp = ""
l = []
l.append(stri)
for i in range(1,len(stri)):
str_temp = ""
str_temp += stri[i]
counter = i+1
c2 = 1
while c2 < len(stri):
str_temp += stri[counter%len(stri)]
counter += 1
c2 += 1
if str_temp not in 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... | x = input()
a = set()
a.add(x)
for i in range(len(x)):
y = x[len(x)-1] + x[:-1]
a.add(y)
x = y
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;
int main() {
set<string> S;
string s;
cin >> s;
int len = s.length();
for (int i = 0; i < len; ++i) {
S.insert(s);
char c = s[0];
s.erase(0, 1);
s += c;
}
cout << S.size() << "\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... |
string = input()
str1 = string
str2 = ''
count = 0
while True:
count+=1
str2 = str1[0]
str1 = str1[1 : len(str1)] + str2
if str1 == string:
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... | s = input()
se = set()
for i in range(len(s)):
se.add(s[i:]+s[:i])
print(len(se)) |
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 Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
StringBuffer s = new StringBuffer(sc.next());
Set<String> set = new HashSet();
for(int i=0 ;i<s.length() ; i++){
set.add(s.toString());
s.append(s.charAt(0));
s.delet... |
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=str(input())
res=set()
res.add(s)
for i in range(len(s)):
curr=s[i:]+s[:i]
res.add(curr)
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('')
t = list(s)
l = len(t)
cnt = 0
st = []
for i in range(l):
tmp = t[l-1]
t.insert(0,tmp)
del t[l]
st1 = ''.join(t)
if st1 in st:
pass
else:
cnt = cnt+1
st.append(st1)
print(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... | #include <bits/stdc++.h>
using namespace std;
string s;
int main() {
cin >> s;
set<string> st;
int n = s.length();
st.insert(s);
for (int i = 0; i < n; i++) {
string tmp = "" + string(1, s[n - 1]) + s.substr(0, n - 1);
st.insert(tmp);
s = tmp;
}
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... | s = raw_input()
q = s
for i in xrange(0,len(s)+1) :
r = q[-1] + q[:-1]
if r == s:
print i + 1
break
q = 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.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import static java.lang.Math.*;
import java.math.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner in = 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... | import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Hongcow {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Set <String> set = new HashSet<String>();
StringBuilder sb = new StringBuilder(sc.next());
for(int i=0;i<sb.length();i++)
{
sb.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()
n = len(s)
s = s + s
print(len(set(s[i:i+n] for i in range(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 = input()
known = set()
for i in range(len(s)):
p = s[i:]+ s[:i]
known.add(p)
print(len(known))
|
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... | z=[]
s=list(input())
count=0
x=0
while True:
s=[s[-1]]+s[:-1]
if s in z:
print(count)
break
else:z.append(s)
x+=1
count+=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>
using namespace std;
string w;
set<string> s;
int main() {
cin >> w;
int n = w.size();
for (int i = 1; i <= n; i++) {
char c = w.back();
w.pop_back();
w.insert(w.begin(), c);
s.insert(w);
}
cout << (int)s.size() << '\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... | ch=input()
l=[ch]
s=1
for i in range(len(ch)):
ch=ch[len(ch)-1]+ch[:len(ch)-1]
if ch not in l:
l.append(ch)
s=s+1
print(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... | l = raw_input()
l = list(l)
s = []
count = 0
for i in range(len(l)):
l.append(l[0])
del l[0]
s.append(str(l))
print len(set(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 s;
string cpy;
cin >> s;
set<string> se;
cpy = "";
se.insert(s);
for (int i = 0; i < s.size(); i++) {
cpy = "";
for (int j = s.size() - i - 1; j < s.size(); j++) {
cpy += s[j];
}
for (int j = 0; j < s.size() - i - 1; j... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.