codeparrot/codecomplex huggingface dataset:
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.*;
import java.util.Scanner;
import java.lang.String;
public class A23 {
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String s = in.nextLine();
    int i=0,j=0,n=0,t=0,count=0;
    n=s.length();
    String s1="y",s2="yu6j";
    for(t=1;t<n;t++)
        {
        for(i=0;i<t;i++)
            {
            s1=s.substring(i,i+n-t);
            for(j=i+1;j<=t;j++)
                {
                s2=s.substring(j,j+n-t);
                if(s1.equalsIgnoreCase(s2))
                    {
                    count++;break;
                    }
                if(count==1) break;
                }
            if(count==1) break;
            }
        if(count==1) break;
        }
	if(n==0)
		{
	  System.out.println("0");
		}
	else
	{
    if(count==1)
    {
    System.out.println(s1.length());
    }
    else  System.out.println("0");
    }
	}
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.*;
import java.util.*;

public class A {
	String line;
	
	void run()throws IOException{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));		
		line = bf.readLine();
		int i, j, len = line.length(), max=0;
		for(i=0; i<len; i++){
			for(j=i; j<len; j++){
				if(line.indexOf(line.substring(i,j+1), i+1)>0){
					if(j-i+1>max) max = j-i+1;
				}
			}
		}
		System.out.println(max);
	}
	
	public static void main(String[] args)throws IOException {
		new A().run();
	}
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.*;


public class CF23A implements Runnable{
        
    public static void main(String args[]){
       new CF23A().run();
    }
    
    @Override
    public void run(){
        try{
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            tok = null;
            solve();
            in.close();
            out.close();
            
        }
        catch(IOException e){
            e.printStackTrace();
            System.exit(0);
        }
    }
    
    int nextInt()throws IOException{
        return Integer.parseInt(nextToken());
    } 
    
    double nextDouble()throws IOException{
        return Double.parseDouble(nextToken());
    }
    
    long nextLong() throws IOException{
        return Long.parseLong(nextToken());
    }
    
    String nextToken()throws IOException{
        while(tok == null || !tok.hasMoreTokens()){
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }
    
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok;
    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////
    private void solve()throws IOException{
        String s = nextToken();
        int l = s.length();
        int ans = 0;
        for(int i = 0; i < l - 1; i++){
            for(int j = i + 1; j < l; j++){
                String now = s.substring(i, j);
                if(s.substring(i + 1).indexOf(now) >= 0){
                ans = Math.max(ans, j - i);
                
            }
            }
        }
        
        out.println(ans);
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.util.*;

public class Solution
{
    public static void main(String[] args)
    {
        new Solution().calc();
    }

    void calc()
    {
        Scanner cin = new Scanner(System.in);
        String s = cin.next();
        int ret = 0;
        for (int i = 0; i < s.length(); i++)
        {
            for (int j = i + 1; j < s.length(); j++)
            {
                for (int k = 0; j + k < s.length(); k++)
                {
                    if (s.charAt(i + k) != s.charAt(j + k)) break;
                    ret = Math.max(k + 1, ret);
                }
            }
        }
        System.out.println(ret);
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.util.Scanner;

public class A023 {
	public static void main(String[] args) {
		System.out.println(f());
	}

	static int f() {
		Scanner in = new Scanner(System.in);
		String line = in.next();
		for (int length = line.length(); length > 0; length--) {
			for (int start = 0; start + length <= line.length(); start++) {
				if(line.indexOf(line.substring(start,start+length),start+1)>=0) {
					return length;
				}
			}
		}
		return 0;
	}
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic

import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.math.BigInteger.*;
import static java.lang.Character.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class A {
    public void run() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        String[] ss = new String[n];
        for (int i = 0; i < n; i++)
            ss[i] = s.substring(i);
        sort(ss);
        int res = 0;
        for (int i = 1; i < n; i++)
            res = max(res, count(ss[i - 1], ss[i]));
        System.out.println(res);
    }

    int count(String s, String t) {
        int ret = 0;
        for (int i = 0; i < min(s.length(), t.length()); i++)
            if (s.charAt(i) != t.charAt(i))
                return ret;
            else
                ret++;
        return ret;
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String... args) {
        new A().run();
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic


import java.util.Scanner;

public class A_YoureGivenAString {

    //1:11
    
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String str = s.nextLine();
        
        for (int l = str.length()-1; l >= 1; l--) {
            for (int i = 0; i < str.length()-l+1; i++) {
                String subs = str.substring(i, i+l);
                if(str.lastIndexOf(subs) != i){
                    System.out.println(l);
                    return;
                }
            }
        }
        System.out.println(0);
    }

}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.PrintWriter;
import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String s = in.nextLine();

        int ans = 0;

        outer: for (int i = s.length() - 1; i >= 1; i--)
            for (int j = 0; j < s.length() - i; j++) {
                String sub = s.substring(j, j + i);
                String str = s.substring(j + 1);

                if (str.contains(sub)) {
                    ans = i;
                    break outer;
                }
            }

        out.print(ans);
        out.close();
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String line = in.readLine();
        int n = line.length();
        int maxlenght = 0;
        for (int i = 0; i < n; i++) {
            int j = line.indexOf(line.charAt(i), i + 1);
            while (j != -1) {
                int k = i;
                int l = j;
                while (k < n && l < n && line.charAt(k) == line.charAt(l)) {
                    k++;
                    l++;
                }
                if (k - i > maxlenght) {
                    maxlenght = k - i;
                }
                j = line.indexOf(line.charAt(i), j + 1);
            }
        }
        System.out.println(maxlenght);
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.util.Scanner;


public class A {

	public static void main(String[] args) {
		new A().run();
	}

	private void run() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		
		int res = 0;
		for (int i = 0; i < s.length(); i++)
			for (int j = i + 1; j <= s.length(); j++) {
				String sub = s.substring(i, j);
				int c = count(s, sub);
				if (c >= 2)
					res = Math.max(res, sub.length());
			}
		System.out.println(res);
	}

	private int count(String s, String sub) {
		int res = 0;
		while (s.length() > 0) {
			if (s.startsWith(sub))
				res++;
			s = s.substring(1);
		}
		return res;
	}

}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.*;
import java.math.BigInteger;

public class Main {
	BufferedReader in;
	PrintWriter out;
	
	public static void main(String[] args) throws IOException
	{
		new Main().run();
	}
	public void run() throws IOException
	{
		//in=new BufferedReader(new FileReader("input.txt"));
		//out=new PrintWriter(new FileWriter("output.txt"));
		in=new BufferedReader(new InputStreamReader(System.in));
		out=new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		
		out.flush();
	}

	public void solve() throws IOException
	{
		String now=in.readLine();
		int l=now.length();
		int answ=0;
		for(int i=0;i!=l;i++)
			for(int j=i+1;j<l;j++)
			{
				String a=now.substring(i, j);
				for(int k=i+1;k<l-j+i+1;k++)
					if(a.compareTo(now.substring(k, k+j-i))==0)
						answ=Math.max(answ, a.length());
			}
		out.print(answ);
		
		
	}
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic



import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main {

    
    public static void main(String[] args)throws java.lang.Exception {
     BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
     String s = br.readLine();
     int max = 0;
        for (int i = 0; i < s.length(); i++) {
            for (int j = i+1; j < s.length(); j++) {
                if(s.substring(i+1).contains(s.substring(i,j)))
                    max = Math.max(max, j-i);

            }}
            System.out.println(max);



    
    }

}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class A {
	public static void main(String[] args) throws Exception{
		String str = new Scanner(System.in).next();
		Set<String> set = new HashSet<String>();
		String max = "";
		for(int l = 1; l < str.length(); ++l){
			for(int i = 0; i < str.length()-l; ++i){
				String substr = str.substring(i, i+l);
				if(!set.contains(substr) && str.indexOf(substr) != str.lastIndexOf(substr)){
					set.add(substr);
					if(substr.length() > max.length()){
						max = substr;
					}
				}
			}
		}
		System.out.println(max.length());
	}
	
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.util.*;

public class A
{
    public static void main(String args[])
    {
        Scanner scan = new Scanner(System.in);
        
        String str = scan.next();
        
        for(int i=str.length();i >= 1;i--)
        {
            for(int j=0;j + i <= str.length();j++)
            {
                String sub = str.substring(j, j+i);
                
                int index = str.indexOf(sub, j+1);
                
                
                if(index > -1)
                {
                    System.out.println(i);
                    return;
                }
                
            }
        }
        
        System.out.println(0);
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.util.*;

public class Main {
    static boolean LOCAL = false;//System.getSecurityManager() == null;
    Scanner sc = new Scanner(System.in);
    
    void run() {
        char[] cs = sc.nextLine().toCharArray();
        int res = 0;
        for (int s1 = 0; s1 < cs.length; s1++) {
            for (int s2 = s1 + 1; s2 < cs.length; s2++) {
                int len = 0;
                while (s2 + len < cs.length && cs[s1 + len] == cs[s2 + len]) {
                    len++;
                }
                res = max(res, len);
            }
        }
        System.out.println(res);
    }
    
    class Scanner {
        BufferedReader br;
        StringTokenizer st;
        Scanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            eat("");
        }
        void eat(String s) {
            st = new StringTokenizer(s);
        }
        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        boolean hasNext() {
            while (!st.hasMoreTokens()) {
                String s = nextLine();
                if (s == null) return false;
                eat(s);
            }
            return true;
        }
        String next() {
            hasNext();
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
    
    void debug(Object...os) {
        System.err.println(deepToString(os));
    }
    
    public static void main(String[] args) {
        if (LOCAL) {
            try {
                System.setIn(new FileInputStream("in.txt"));
            } catch (Throwable e) {
                LOCAL = false;
            }
        }
        if (!LOCAL) {
            try {
                Locale.setDefault(Locale.US);
                System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
            } catch (Throwable e) {
            }
        }
        new Main().run();
        System.out.flush();
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.*;
import java.util.*;
public class a23
{
    public static void main(String args[])throws IOException
    {
        InputStreamReader read=new InputStreamReader(System.in);
        BufferedReader in=new BufferedReader(read);
        String s,subs;
       // System.out.println("Enter");
        s=in.readLine();
        int i,j,k,l=0,a=1,sl=0;
        for(i=0;i<s.length();i++)
        {
            a=1;
            for(j=i;j<s.length();j++)
            {
                subs=s.substring(i,i+a);
                for(k=i;k<(s.length()-a+1);k++)
                {
                    if(subs.compareTo(s.substring(k,k+a))==0)
                    l++;
                    if(l==2)
                    {
                        if(a>sl)
                        sl=a;
                        l=0;
                        break;
                    }
                }
                l=0;
                a++;
            }
        }
        System.out.println(sl);
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.*;
import java.util.StringTokenizer;

public class A {

    public static void main(String[] args) throws IOException {
        new A().solve();
    }

    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");

    private void solve() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        String s = nextToken();
        int res = 0;
        for (int i = 0; i < s.length(); i++) {
            for (int j = i + 1; j < s.length(); j++) {
                int k = 0;
                while (k < s.length() - j && s.charAt(i + k) == s.charAt(j + k)) {
                    k++;
                }
                res = Math.max(res, k);
            }
        }
        PrintWriter pw = new PrintWriter(System.out);
        pw.println(res);
        pw.close();
    }

    String nextToken() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static Scanner scan = new Scanner(System.in);
    public static boolean bg = true;

    public static void main(String[] args) throws Exception {
        String k1 = scan.next();
        HashSet<String> met = new HashSet();
        String ans = "";
        for (int i=1;i<=k1.length()-1;i++){
            for (int j=0;j+i<=k1.length();j++){
                String cur = k1.substring(j, j+i);
                if (!met.contains(cur)){
                    met.add(cur);
                }
                else {
                    if (cur.length()>ans.length())ans=cur;
                }
            }
        }
        System.out.println(ans.length());
        
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;

public class A23 {

	static StreamTokenizer in;
	static PrintWriter out;
	
	static int nextInt() throws IOException {
		in.nextToken();
		return (int)in.nval;
	}
	
	static String nextString() throws IOException {
		in.nextToken();
		return in.sval;
	}

	public static void main(String[] args) throws IOException {
		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
		out = new PrintWriter(System.out);
		
		String s = nextString();
		
		for (int i = s.length(); i > 0; i--) {
			for (int j = 0; j+i-1 < s.length(); j++)
				for (int k = j+1; k+i-1 < s.length(); k++)
					if (s.substring(j, j+i).equals(s.substring(k, k+i))) {
						out.println(i);
						out.flush();
						return;
					}
		}
		
		out.println("0");
		
		out.flush();
	}

}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.util.HashMap;
import java.util.Scanner;

public class Solution {
    public static void main(String [] args){
        Scanner in = new Scanner(System.in);

        String ins = in.nextLine();
        HashMap <String,Integer> sub = new HashMap<String,Integer>();
        for (int i=0;i<ins.length();i++){
            for (int j=i+1;j<=ins.length();j++){
                String key = ins.substring(i,j);
                if (sub.containsKey(key)){
                    sub.put(key,sub.get(key)+1);
                } else {
                    sub.put(key,1);
                }
            }
        }

        int max = 0;
        for (String key:sub.keySet()){
            if (sub.get(key) >= 2 && key.length() > max){
                max = key.length();
            }
        }

        System.out.print(max);
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import static java.util.Arrays.*;
import static java.lang.Math.*;
import static java.math.BigInteger.*;
import java.util.*;
import java.math.*;
import java.io.*;

public class A implements Runnable
{
    String file = "input";
    
    void init() throws IOException
    {
        //input = new BufferedReader(new FileReader(file + ".in"));
        input = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new BufferedOutputStream(System.out));
    }
    
    void solve() throws IOException
    {
        String s = next();
        int res = 0;
        int L = s.length();
        for(int i = 0; i < L; i++)
            for(int j = i + 1; j <= L; j++)
            {
                String ss = s.substring(i, j);
                int k = s.indexOf(ss);
                //print(ss, k);
                if(k >= 0)
                {
                    if(s.substring(k + 1).indexOf(ss) >= 0) res = max(res, j - i);
                }
            }
        System.out.println(res);
    }
    
    String next() throws IOException
    {
        if(st == null || !st.hasMoreTokens()) st = new StringTokenizer(input.readLine());
        return st.nextToken();
    }
    
    int nextInt() throws IOException
    {
        return Integer.parseInt(next());
    }
    
    long nextLong() throws IOException
    {
        return Long.parseLong(next());
    }
    
    double nextDouble() throws IOException
    {
        return Double.parseDouble(next());
    }
    
    void print(Object... o)
    {
        System.out.println(deepToString(o));
    }
    
    void gcj(Object o)
    {
        String s = String.valueOf(o);
        out.println("Case #" + test + ": " + s);
        System.out.println("Case #" + test + ": " + s);
    }
    
    BufferedReader input;
    PrintWriter out;
    StringTokenizer st;
    int test;
    
    public static void main(String[] args) throws IOException
    {
        new Thread(null, new A(), "", 1 << 20).start();
    }
    
    public void run()
    {
        try
        {
            init();
            solve();
            out.close();        
        }
        catch(Exception e)
        {
            e.printStackTrace();
            System.exit(1);
        }
    }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
//package round23;

import java.io.PrintWriter;
import java.io.StringReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

public class A {
	private Scanner in;
	private PrintWriter out;
//	private String INPUT = add("a", 100);
	private String INPUT = "";
	
	public void solve()
	{
		String str = in.next();
		int n = str.length();
		for(int k = n - 1;k >= 1;k--){
			HashSet<String> set = new HashSet<String>();
			for(int i = 0;i < str.length() - k + 1;i++){
				if(!set.add(str.substring(i, i + k))){
					out.println(k);
					return;
				}
			}
		}
		out.println(0);
	}
	
	public void run() throws Exception
	{
		in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new StringReader(INPUT));
		out = new PrintWriter(System.out);
		
		solve();
		out.flush();
	}
	
	public static String add(String str, int k)
	{
		StringBuilder mul = new StringBuilder(str);
		StringBuilder ret = new StringBuilder();
		for(int i = k;i > 0;i >>= 1){
			if((i & 1) == 1)ret.append(mul);
			mul.append(mul);
		}
		return ret.toString();
	}
	
	public static void main(String[] args) throws Exception
	{
		new A().run();
	}
	
	private int ni() { return Integer.parseInt(in.next()); }
	private static void tr(Object... o) { System.out.println(o.length == 1 ? o[0] : Arrays.toString(o)); }
}
// Problem: 23_A. You're Given a String...
// Time complexity: cubic
import java.io.*;
import java.util.*;
public class Answer23A{
    public static void main(String[] args){
	BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
	new Kai(reader).solve();
    }
}
class Kai{
    BufferedReader reader;
    public Kai(BufferedReader reader){
	this.reader=reader;
    }
    public void solve(){
	//TODO
	String s=read();
	int max=0;
	for(int i=1;i<=s.length()-1;i++){
	    for(int j=0;j<=s.length()-i;j++){
		String h=s.substring(j,j+i);
		for(int k=j+1;k<=s.length()-i;k++){
		    if(h.equals(s.substring(k,k+i))){
			max=i;
		    }
		}
	    }
	}
	pln(max);
			
    }
    //tools//////////////////////////////////////////////////
    public String read(){
	String s=null;
	try{
	    s=reader.readLine();
	}catch(IOException e){
	    e.printStackTrace();
	}
	return s;
    }
    public int[] to_i(String[] s){
	int[] tmp=new int[s.length];
	for(int i=0;i<s.length;i++){
	    tmp[i]=to_i(s[i]);
	}
	return tmp;
    }
    public long[] to_l(String[] s){
	long[] tmp=new long[s.length];
	for(int i=0;i<s.length;i++){
	    tmp[i]=to_l(s[i]);
	}
	return tmp;
    }
    public int to_i(String s){
	return Integer.parseInt(s);
    }
    public long to_l(String s){
	return Long.parseLong(s);
    }
    public void p(Object s){
	System.out.print(s);
    }
    public void pln(Object s){
	System.out.println(s);
    }
    public void debug(Object s){
	System.err.print(s);
    }
    public void debugln(Object s){
	System.err.println(s);
    }
}