Muennighoff/xP3x-sample huggingface dataset:
inputs: import java.io.*;
import java.util.*;
/*
 * Heart beats fast
 * 		Colors and promises
 * 			How to be brave
 * 				How can I love when I am afraid...
 */
//read the question correctly (is y a vowel? what are the exact constraints?)
//look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)
//always declare multidimensional arrays as [2][n] not [n][2]
//it can lead to upto 2-3x diff in runtime
//declare int/long tries with 16 array size due to object overhead :D
public class Main
{
	
	public static void main(String[] args) throws Exception
	{
		int n=ni();
		Map<String, Integer> hola=new HashMap<String,Integer>();
		hola.put("S", 0);
		hola.put("XS", 0);
		hola.put("XXS", 0);
		hola.put("XXXS", 0);
		hola.put("M", 0);
		hola.put("L", 0);
		hola.put("XL", 0);
		hola.put("XXL", 0);
		hola.put("XXXL", 0);
		for(int i=0; i<n; i++)
		{
			String te=ns();
			hola.put(te,hola.get(te)+1);
		}
		for(int i=0; i<n; i++)
		{
			String te=ns();
			hola.put(te,hola.get(te)-1);
		}
		int ans=0;
		for(int te:hola.values())
		{
			ans+=max(te,0);
		}
		pr(ans);
		System.out.print(output);
	}
	///////////////////////////////////////////
	///////////////////////////////////////////
	///template from here
	static int pow(int a, int b)
	{
		int c=1;
		while(b>0)
		{
			if(b%2!=0)
				c*=a;
			a*=a;
		}
		return c;
	}
	static class pair
	{
		int a, b;
		pair(){}
		pair(int c,int d){a=c;b=d;}
	}
	static interface combiner
	{
		public long combine(long a,long b);
	}
	static final long mod=1000000007;
	static final double eps=1e-9;
	static final long inf=100000000000000000L;
	static Reader in=new Reader();
	static StringBuilder output=new StringBuilder();
	static Random rn=new Random();
	static void reverse(int[]a){for(int i=0; i<a.length/2; i++){a[i]^=a[a.length-i-1];a[a.length-i-1]^=a[i];a[i]^=a[a.length-i-1];}}
	static void sort(int[]a)
	{
		int te;
		for(int i=0; i<a.length; i+=2)
		{
			te=rn.nextInt(a.length);
			if(i!=te)
			{
				a[i]^=a[te];
				a[te]^=a[i];
				a[i]^=a[te];
			}
		}
		Arrays.sort(a);
	}
	static void... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: linear
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.text.*;
import java.math.*;
import java.util.*;

public class Hexadec implements Runnable {

    final static String taskname = "filename";

    public void solve() throws Exception {
    //	int n = iread();	
    	int n = Integer.parseInt(in.readLine());
    	
    	
    	
    	out.write(n + " "+0+" "+0);
    //    out.write(ans_path + "\n");
    }

    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new BufferedWriter(new OutputStreamWriter(System.out));
//             in = new BufferedReader(new FileReader(taskname + ".in"));
//             out = new BufferedWriter(new FileWriter(taskname + ".out"));
            solve();
            out.flush();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    public int iread() throws Exception {
        return Integer.parseInt(readword());
    }

    public double dread() throws Exception {
        return Double.parseDouble(readword());
    }

    public long lread() throws Exception {
        return Long.parseLong(readword());
    }

    BufferedReader in;

    BufferedWriter out;

    public String readword() throws IOException {
        StringBuilder b = new StringBuilder();
        int c;
        c = in.read();
        while (c >= 0 && c <= ' ')
            c = in.read();
        if (c < 0)
            return "";
        while (c > ' ') {
            b.append((char) c);
            c = in.read();
        }
        return b.toString();
    }

    public static void main(String[] args) {
        // Locale.setDefault(Locale.US);
        new Thread(new Hexadec()).start();
    }
} Complexity:
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class A {
	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int k = scan.nextInt()-1;
		PrimeGen p = new PrimeGen(n);
		List<Integer> prims = new ArrayList<Integer>();
		for(int i = 2; i <= n; i++){
			if(p.isPrime(i)>0){
				prims.add(i);
			}
		}
		int sum = 0;
		for(int i = 0; i < prims.size() - 1; i++){
			int c = prims.get(i) + prims.get(i+1) + 1;
			if(c <= n && p.isPrime(c)>0){
				sum ++;
			}
		}
		System.out.println(sum>=k?"YES":"NO");
	}

	static int sum(List<Integer> is) {
		int c = 0;
		for (int i : is)
			c += i;
		return c;
	}
	
	static class PrimeGen {
		public PrimeGen(int m) {
			m = (int) Math.sqrt(m);
			double max = 0;
			int r = 1;
			for (int i = 0; i < 4;) {
				max += r * m / Math.pow(Math.log1p(m), ++i);
				r *= i;
			}
			p = new int[(int) max];
			for (int i = 0, e = 2; i < p.length; i++) {
				for (; isPrime(e) < 1; e++)
					;
				p[i] = e++;
			}
			this.m = p[p.length - 1];
			this.m = this.m * this.m;
		}

		int isPrime(int n) {
			for (int e : p)
				if (e < 1)
					break;
				else if (n != e && n % e < 1)
					return 0;
			return 1;
		}

		int max() {
			return m;
		}

		int[] p;
		int m;
	}
}
 Complexity:
targets: linear
inputs: import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class D {

    int N,M;
    int[] a,l,r;

    private void solve() {
        N = nextInt();

        a = new int[N];
        for(int i = 0;i < N;i++) {
            a[i] = nextInt();
        }

        M = nextInt();

        l = new int[M];
        r = new int[M];
        for(int i = 0;i < M;i++) {
            l[i] = nextInt();
            r[i] = nextInt();
        }

        int count = 0;
        for(int i = 0;i < N - 1;i++) {
            for(int j = i + 1;j < N;j++) if (a[i] > a[j]) {
                count++;
            }
        }

        for(int i = 0;i < M;i++) {
            count += (r[i] - l[i] + 1) * (r[i] - l[i]) / 2;
            count %= 2;
            out.println(count == 0 ? "even" : "odd");
        }
    }

    public static void main(String[] args) {
        out.flush();
        new D().solve();
        out.close();
    }

    /* Input */
    private static final InputStream in = System.in;
    private static final PrintWriter out = new PrintWriter(System.out);
    private final byte[] buffer = new byte[2048];
    private int p = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (p < buflen)
            return true;
        p = 0;
        try {
            buflen = in.read(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (buflen <= 0)
            return false;
        return true;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrint(buffer[p])) {
            p++;
        }
        return hasNextByte();
    }

    private boolean isPrint(int ch) {
        if (ch >= '!' && ch <= '~')
            return true;
        return false;
    }

    private int nextByte() {
        if (!hasNextByte())
            return -1;
        return buffer[p++];
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
       ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            Arrays.sort(a);
            boolean[] dead = new boolean[n];
            int ans = 0;
            for (int i = 0; i < n; i++) {
                if (dead[i]) {
                    continue;
                }
                ++ans;
                for (int j = i; j < n; j++) {
                    if (a[j] % a[i] == 0) {
                        dead[j] = true;
                    }
                }
            }
            out.println(ans);
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

 ... Complexity:
targets: quadratic
inputs: import java.util.*;
import java.io.*;

public class C
{

	static FastIO f;

	public static void main(String args[]) throws IOException
	{
		f = new FastIO();

		int t, n, a, i;
		Node r, p, c;
		
		t = f.ni();
		
		while(t-->0)
		{
			n = f.ni();
			r = p = new Node(-1, null);
			// f.out("1\n");

			for(i = 0; i < n; i++)
			{
				a = f.ni();
				if(a != 1)
				{
					while(a != p.i + 1)
						p = p.p;
					p = p.p;
				}
				// if(a == p.i + 1)
				// 	p = p.p;
				// else if(p.p != null && a == p.p.i + 1)
				// 	p = p.p.p;
				c = new Node(a, p);
				p.c.add(c);
				p = c;
			}

			dfs(r, "");
		}

		f.flush();
	}

	public  static void dfs(Node n, String s) throws IOException
	{
		String t;

		if(n.i == -1)
			t = s;
		else
		{
			t = s + n.i + ".";
			f.out(s + n.i + "\n");
		}

		for(Node c : n.c)
			dfs(c, t);
	}

	static class Node
	{
		int i;
		Node p;
		ArrayList<Node> c;
	
		Node(int x, Node y)
		{
			i = x;
			p = y;
			c = new ArrayList<>();
		}
	
		@Override
		public int hashCode()
		{
			return super.hashCode();
		}
	
		@Override
		public boolean equals(Object obj)
		{
			Node that = (Node)obj;
	
			return super.equals(obj);
		}
	
		@Override
		public String toString()
		{
			return "[" + "PARAMETERS" + "]";
		}
	}

	public static class FastIO
	{
		BufferedReader br;
		BufferedWriter bw, be;
		StringTokenizer st;

		public FastIO()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
			bw = new BufferedWriter(new OutputStreamWriter(System.out));
			be = new BufferedWriter(new OutputStreamWriter(System.err));
			st = new StringTokenizer("");
		}

		private void read() throws IOException
		{
			st = new StringTokenizer(br.readLine());
		}

		public String ns() throws IOException
		{
			while(!st.hasMoreTokens())
				read();
			return st.nextToken();
		}

		public int ni() throws IOException
		{
			return Integer.parseInt(ns());
		}

		public long nl() throws IOException
		{
			return Long.parseLong(ns());
		}

		public float nf() throws IOException
		{
			return... What is the time complexity of the previous code?
targets: cubic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. 
public class Main {

	private static void solve() {
		int n = ni();
		double r = ni();

		double[][] p = new double[n][2];
		double EPS = 0.0000000000001;

		for (int i = 0; i < n; i ++) {
			double x = ni();
			double y = r;
			for (int j = 0; j < i; j ++) {
				double dx = Math.abs(p[j][0] - x);
				if (dx <= r * 2 + EPS) {
					double dy = Math.sqrt(4.0 * r * r - dx * dx);
					y = Math.max(y, p[j][1] + dy);
				}
			}
			out.printf("%.12f ", y);
			p[i][0] = x;
			p[i][1] = y;
		}
		out.println();
	}

	public static void main(String[] args) {
		new Thread(null, new Runnable() {
			@Override
			public void run() {
				long start = System.currentTimeMillis();
				String debug = args.length > 0 ? args[0] : null;
				if (debug != null) {
					try {
						is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
					} catch (Exception e) {
						throw new RuntimeException(e);
					}
				}
				reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
				solve();
				out.flush();
				tr((System.currentTimeMillis() - start) + "ms");
			}
		}, "", 64000000).start();
	}

	private static java.io.InputStream is = System.in;
	private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
	private static java.util.StringTokenizer tokenizer = null;
	private static java.io.BufferedReader reader;

	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new java.util.StringTokenizer(reader.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	private static double nd() {
		return Double.parseDouble(next());
	}

	private static long nl() {
		return Long.parseLong(next());
	}

	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private static char[] ns() {
		return next().toCharArray();
	}

	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n;... Complexity:
targets: quadratic
inputs: import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Round584_a {
        public static void main(String[] args) throws Exception {
                BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                StringTokenizer st;

                int n = Integer.parseInt(br.readLine());
                st = new StringTokenizer(br.readLine());
                int a[] = new int[n];
                for(int i=0 ; i<n ; i++) {
                        a[i] = Integer.parseInt(st.nextToken());
                }

                Arrays.sort(a);

                boolean vis[] = new boolean[n];
                int count = 0;
                for(int i=0 ; i<n ; i++) {
                        if(!vis[i]) {
                                for(int j=i ; j<n ; j++) {
                                        if(!vis[j]) {
                                                if(a[j]%a[i] == 0) {
                                                        vis[j] = true;
                                                }
                                        }
                                }
                                count++;
                        }
                }

                System.out.println(count);
        }
}

/*import java.io.BufferedReader;
        import java.io.InputStreamReader;
        import java.util.StringTokenizer;

public class Round584_a {
        public static void main(String[] args) throws Exception {
                BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                StringTokenizer st;
        }
}*/

 What is the time complexity of the previous code?
targets: quadratic
inputs: import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;


public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        long a,b;
        a = scn.nextLong();
        b = scn.nextLong();
        long diff = b -a , tot = 0;
        int ind = 0;
        while(true) {
            long res = (long)Math.pow(2.0, ind);
            if (res > b) break;
            if (((a>>ind) != (b>>ind)) || diff >= res)
                tot += res;
            ind++;
        }
        System.out.println(tot);
    }                                                                                                                                                                                                                          

}
 What is the time complexity of the previous code?
targets: logn
inputs: import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.io.ObjectInputStream.GetField;
import java.security.KeyStore.Entry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

import javax.swing.JLabel;

public class codeforcesreturn {
	static class edge {
		int u;
		int v;

		public edge(int u, int v) {
			this.u = u;
			this.v = v;
		}

	}

	static ArrayList<Integer>[] adjlist;
	static int[][] adjmatrix;
	static int[][] adjmatrix2;
	static boolean[] vis;
	static boolean[] intialvis;
	static boolean[] vis2;
	static int[] counter;
	static int V, E;
	static Stack<Integer> st;
	static ArrayList<Integer> arrylist;
	static boolean flag;
	static int[] dx = new int[] { 1, -1, 0, 0 };
	static int[] dy = new int[] { 0, 0, 1, -1 };
	static int[] Arr;
	static PrintWriter pw;
	static boolean ans = true;;

	public static long gcd(long u, long v) {
		if (u == 0)
			return v;
		return gcd(v % u, u);
	}

	public static void bib(int u) {

		vis[u] = true;
		for (int v : adjlist[u]) {
			if (!vis[v]) {
				counter[v] = 1 ^ counter[u];
				bib(v);
			} else if (counter[v] != (1 ^ counter[u]))
				ans = false;

		}
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		// FileWriter f = new FileWriter("C:\\Users\\Hp\\Desktop\\out.txt");
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int sum = n;

		for (long i = 0; i < 1e5; i++) {
			if (i * (i + 1) / 2 - (n - i) == k) {
				System.out.println(n - i);
				break;
			}
		}
	}

	static class Scanner {
		StringTokenizer... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: import java.util.Arrays;
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);
		int n = sc.nextInt();
		int k = sc.nextInt();
		sc.close();
		boolean[] isp = new boolean[n + 1];
		Arrays.fill(isp, true);
		isp[1] = false;
		int[] primes = new int[n];
		int pc = 0;
		for (int i = 2; i <= n; i++) {
			if (isp[i]) {
				primes[pc++] = i;
				for (int j = i * i; j <= n; j+= i) {
					isp[j] = false;
				}
			}
		}
		int res = 0;
		for (int i = 0; i < pc; i++) {
			for (int j = 1; j < i; j++)				
					if (primes[i] == primes[j] + primes[j - 1] + 1)
						res++;
		}
		System.out.println(res >= k ? "YES" : "NO");
	}

}
 What is the time complexity of the previous code?
targets: linear
inputs: import java.math.*;
import java.util.*;
import java.io.*;

public class Test5 {
    public static void main(String[] z){
        StreamTokenizer st = new StreamTokenizer(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        Scanner s = new Scanner(System.in);
        int a = s.nextInt(), o=0;
        String i = "";
        ArrayList<String> l1 = new ArrayList<>(), l2 = new ArrayList<>();
        for(int q=0; q<a; q++){
            l1.add(s.next());
        }
        for(int q=0; q<a; q++){
            i = s.next();
            if(l1.contains(i)) l1.remove(i);
            else l2.add(i);
        }
        Collections.sort(l1);
        Collections.sort(l2);

        for(int q=0; q<l1.size(); q++){
            if(l1.get(q).charAt(l1.get(q).length()-1)!=l2.get(q).charAt(l2.get(q).length()-1)) o++;
        }
        System.out.println(o);
        pw.flush();
    }

    static class PyraSort {

        private static int heapSize;

        public static void sort(int[] a) {
            buildHeap(a);
            while (heapSize > 1) {
                swap(a, 0, heapSize - 1);
                heapSize--;
                heapify(a, 0);
            }
        }

        private static void buildHeap(int[] a) {
            heapSize = a.length;
            for (int i = a.length / 2; i >= 0; i--) {
                heapify(a, i);
            }
        }

        private static void heapify(int[] a, int i) {
            int l = 2 * i + 2;
            int r = 2 * i + 1;
            int largest = i;
            if (l < heapSize && a[i] < a[l]) {
                largest = l;
            }
            if (r < heapSize && a[largest] < a[r]) {
                largest = r;
            }
            if (i != largest) {
                swap(a, i, largest);
                heapify(a, largest);
            }
        }

        private static void swap(int[] a, int i, int j) {
            a[i] ^= a[j] ^= a[i];
            a[j] ^= a[i];
        }
    }
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: linear
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. //package codeforces;

import java.util.Scanner;

public class Fingerprints {

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

		int[] code = new int[scanner.nextInt()];
		int[] prints = new int[scanner.nextInt()];

		for (int i = 0; i < code.length; i++) {
			code[i] = scanner.nextInt();
		}
		for (int i = 0; i < prints.length; i++) {
			prints[i] = scanner.nextInt();
		}
		for (int i = 0; i < code.length; i++) {
			for (int j = 0; j < prints.length; j++) {
				if (code[i] == prints[j]) {
					System.out.print(prints[j] + " ");
				}
			}
		}
		scanner.close();
	}

}
 Complexity:
targets: quadratic
inputs: import java.util.*;
import java.io.*;
public class template {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
		int n = sc.nextInt();
		int k = sc.nextInt();
		long left = 0;
		long right = n;
		long mid = left+right/2;
		while(left<=right) {
			mid = (left+(right))/2;
			if(((mid+1)*mid)/2-(n-mid)==k) {
				pw.println(n-mid);
				pw.close();
				break;
			}
			else if(((mid+1)*mid)/2-(n-mid)>k) {
				right = mid-1;
			}
			else left = mid+1;
		}
	}
}
@SuppressWarnings("all")
class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    public FastScanner(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public FastScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String nextToken() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(nextToken());
    }

    long nextLong() {
        return Long.parseLong(nextToken());
    }

    double nextDouble() {
        return Double.parseDouble(nextToken());
    }
} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader sc = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, sc, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader sc, PrintWriter out) {
            int n=sc.nextInt();
            int[] a=new int[n];
            boolean[] jud=new boolean[101];
            
            for(int i=0;i<n;i++)
            	a[i]=sc.nextInt();
            Arrays.sort(a);
            int ans=0;
            for(int i=0;i<n;i++) {
            	if(jud[a[i]])
            		continue;
            	ans++;
            	for(int j=a[i];j<=100;j+=a[i])
            		jud[j]=true;
            }
            out.println(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
   ... What is the time complexity of the previous code?
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.Map.Entry;
import java.io.BufferedReader;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Liavontsi Brechka
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        F1BlokiRavnoiSummiProstayaRedakciya solver = new F1BlokiRavnoiSummiProstayaRedakciya();
        solver.solve(1, in, out);
        out.close();
    }

    static class F1BlokiRavnoiSummiProstayaRedakciya
    {
        InputReader in;
        Map<Long, List<F1BlokiRavnoiSummiProstayaRedakciya.Block>> sums;

        public void solve(int testNumber, InputReader in, PrintWriter out)
        {
            this.in = in;

            int n = ni();
            long[] a = nla(n);

            sums = new HashMap<>();
            for (int i = 0; i < n; i++)
            {
                long sum = 0;
                for (int j = i; j < n; j++)
                {
                    sum += a[j];
                    sums.computeIfAbsent(sum, k -> new ArrayList<>()).add(
                                    new F1BlokiRavnoiSummiProstayaRedakciya.Block(i, j, sum));
                }
            }

            for (Map.Entry<Long, List<F1BlokiRavnoiSummiProstayaRedakciya.Block>> e : sums.entrySet())
            {
                Collections.sort(e.getValue());
            }

            List<F1BlokiRavnoiSummiProstayaRedakciya.Block> res = Collections.emptyList();
            for (Map.Entry<Long,... Complexity:
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Saul
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
  public void solve(int testNumber, Scanner in, PrintWriter out) {
    long n = in.nextLong() ;
    int k = in.nextInt();
    long top = 1L * k * (k+1) / 2L - k + 1;

    if ( n == 1L ){
      out.print(0);
      return;
    }

    if ( n > top ){
      out.print(-1);
      return;
    }

    int ans = 0;
    if ( n > 0 ){
      ++ans;
      n -= k;
      k -= 2;
    }

    while ( n > 0 ){
      ++ans;
      n -= k;
      k--;
    }
    out.print(ans);
  }
}
 Complexity:
targets: logn
inputs: import java.util.*;

public class Main {
	
	public static class node implements Comparable<node>{
		int l,r;
		node(){}
		node(int l,int r) {
			this.l=l;
			this.r=r;
		}
		@Override
		public int compareTo(node rhs) {
			return r-rhs.r;
		}
	}
	
	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int x[] = new int[a];
		for(int n=0;n<a;n++){
			x[n] = in.nextInt();
		}
		int max = 1;
		int t = 0;
		HashMap<Integer, ArrayList<node>> map = new HashMap<Integer, ArrayList<node>>();
		for(int n=0;n<a;n++){
			int num = 0;
			for(int m=n;m<a;m++){
				num += x[m];
				node node = new node(n, m);
				if(!map.containsKey(num)){
					ArrayList<node> list = new ArrayList<node>();
					list.add(node);
					map.put(num, list);
					if(max == 1)t = num;
				}
				else{
					ArrayList<node> list = map.get(num);
					int left = 0;
					int right = list.size()-1;				
					int res = list.size();
					while(left <= right){
						int mid = (left + right) >> 1;
						//System.out.println(mid +" "+ left +" " +right);
						if(list.get(mid).r >= n){
							res = mid;
							right = mid - 1;
						}
						else{
							left = mid + 1;
						}
					}
					if(res == list.size()){
						list.add(node);
						if(max < res+1){
							max = res+1;
							t = num;
						}
					}
					else if(list.get(res).r>m){
						list.set(res, node);
						if(max < res){
							max = list.size();
							t = num;
						}
					}
					
				}
			}
		}
		System.out.println(max);
		for(int n=0;n<max;n++){
			System.out.println((map.get(t).get(n).l+1)+" "+(map.get(t).get(n).r+1));
		}
		
	}
} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: quadratic
inputs: import java.io.*;
import java.util.*;

public class A {
    FastScanner in;
    PrintWriter out;

    void solve() {
        int tc = in.nextInt();
        for (int t = 0; t < tc; t++) {
            int n = in.nextInt();
            int m = in.nextInt();
            O[] a = new O[n * m];
            int[][] cols = new int[m][n + n];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    cols[j][i] = cols[j][i + n] = in.nextInt();
                    a[i * m + j] = new O(i, j, cols[j][i]);
                }
            }
            Arrays.sort(a);
            boolean[] used = new boolean[m];
            int cntUsed = 0;
            for (O o : a) {
                if (!used[o.y]) {
                    used[o.y] = true;
                    cntUsed++;
                    if (cntUsed == n) {
                        break;
                    }
                }
            }
            int[] dp = new int[1 << n];
            int[] ndp = new int[1 << n];
            int[] maxndp = new int[1 << n];
            for (int col = 0; col < m; col++) {
                if (!used[col]) {
                    continue;
                }
                int[] curColumn = cols[col];
                for (int shift = 0; shift < n; shift++) {
                    System.arraycopy(dp, 0, ndp, 0, ndp.length);
                    for (int mask = 0; mask < 1 << n; mask++) {
                        for (int bit = 0; bit < n; bit++) {
                            if (((1 << bit) & mask) == 0) {
                                int nmask = mask | (1 << bit);
                                ndp[nmask] = Math.max(ndp[nmask], ndp[mask] + curColumn[bit + shift]);
                            }
                        }
                    }
                    for (int i = 0; i < ndp.length; i++) {
                        maxndp[i] = Math.max(maxndp[i], ndp[i]);
                    }
                }
                int[] tmp = dp;
                dp = maxndp;
                maxndp = tmp;
 ... What is the time complexity of the previous code?
targets: np
inputs: import java.awt.*;
import java.io.*;
import java.math.*;
import java.util.*;
import static java.lang.Math.*;

public class BetaRound81_B implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    public static void main(String[] args) {
        new Thread(null, new BetaRound81_B(), "", 256 * (1L << 20)).start();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            if (System.getProperty("ONLINE_JUDGE") != null) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }
            Locale.setDefault(Locale.US);
            solve();
            in.close();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Throwable t) {
            t.printStackTrace(System.err);
            System.exit(-1);
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    /** http://pastebin.com/j0xdUjDn */
    static class Utils {

        private Utils() {}

        public static void mergeSort(int[] a) {
            mergeSort(a, 0, a.length - 1);
        }

        private static final int MAGIC_VALUE = 50;

        private static void mergeSort(int[] a, int leftIndex, int rightIndex) {
            if (leftIndex < rightIndex) {
                if (rightIndex - leftIndex... What is the time complexity of the previous code?
targets: np
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class phoenix_and_computers {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] st = br.readLine().split(" ");
		int n = Integer.parseInt(st[0]);
		int m = Integer.parseInt(st[1]);

		long[][] ncr = ncrcoll(405, 405, m);
		int[] p2 = new int[n + 1];
		p2[0] = 1;
		for (int i = 1; i < p2.length; i++) {
			p2[i] = 2 * p2[i - 1] % m;
		}

		long[][] dp = new long[405][405];
		dp[0][0] = 1;

		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= i; j++) {
				for (int k = 1; i + k <= n; k++) {
					dp[i + k + 1][j + k] += ((dp[i][j] * p2[k - 1]) % m * ncr[j + k][k]);
					dp[i + k + 1][j + k] %= m;
				}
			}
		}

		long ans = 0;
		for (int i = 0; i <= n; i++) {
			ans = (ans + dp[n + 1][i]) % m;
		}

		System.out.println(ans);
	}

	static long[][] ncrcoll(int n, int k, int p) {
		long[][] arr = new long[n + 1][k + 1];
		for (int i = 1; i < arr.length; i++) {
			arr[i][0] = 1;
		}
		for (int i = 1; i < arr.length; i++) {
			for (int j = 1; j <= i && j < arr[0].length; j++) {
				if (i == 1 && j == 1) {
					arr[i][j] = 1;
				} else {
					arr[i][j] = (arr[i - 1][j] + arr[i - 1][j - 1]) % (p);
				}
			}
		}
		return arr;
	}

	public static long xpown(long x, long n) {
		long res = 1;
		while (n > 0) {
			if (n % 2 != 0) {
				res = (res * x) % 1000000007;
				n--;
			} else {
				x = (x * x) % 1000000007;
				n = n / 2;
			}
		}
		return res;
	}
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: cubic
inputs: import java.util.Scanner;

/**
 * Created by Gantushig on 2/18/2016.
 */

public class A {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        long n = input.nextLong();
        System.out.println("25");
    }

}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: import java.io.BufferedReader;
import java.io.InputStreamReader;


public class OverlapedString {
	public static void main(String args[]) throws Exception {
		OverlapedString os = new OverlapedString();
		BufferedReader stdin =
			new BufferedReader(new InputStreamReader(System.in));
		String line;
		while ((line = stdin.readLine()) != null) {
			System.out.println(os.handleOverlap(line));
		}
	}
	private int handleOverlap(String str) {
		int len = str.length();
		int count = 0;
		for(int i=0;i<len;i++)
			for(int j=i+1;j<len;j++) {
				String _tmp = str.substring(i,j);
				if(_tmp!=null&&_tmp.length()>0) {
					if(getOverlapCount(str,_tmp)>1)
					{
						if(_tmp.length()>count)
							count = _tmp.length();
					}
				}
			}
		return count;
	}
	private int getOverlapCount(String str,String sub) {
		int start = 0;
		int count = 0;
		while(start<str.length()) {
			start = str.indexOf(sub,start);
			if(start==-1)
				break;
			else {
				start++;
				count++;
			}
		}
		return count;
	}
}
 What is the time complexity of the previous code?
targets: cubic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.util.*;

public class A {
    FastScanner in;
    PrintWriter out;

    void solve() {
        int tc = in.nextInt();
        for (int t = 0; t < tc; t++) {
            int n = in.nextInt();
            int m = in.nextInt();
            O[] a = new O[n * m];
            int[][] cols = new int[m][n + n];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    cols[j][i] = cols[j][i + n] = in.nextInt();
                    a[i * m + j] = new O(i, j, cols[j][i]);
                }
            }
            Arrays.sort(a);
            boolean[] used = new boolean[m];
            int cntUsed = 0;
            for (O o : a) {
                if (!used[o.y]) {
                    used[o.y] = true;
                    cntUsed++;
                    if (cntUsed == n) {
                        break;
                    }
                }
            }
            int[] dp = new int[1 << n];
            int[] ndp = new int[1 << n];
            int[] maxndp = new int[1 << n];
            for (int col = 0; col < m; col++) {
                if (!used[col]) {
                    continue;
                }
                int[] curColumn = cols[col];
                for (int shift = 0; shift < n; shift++) {
                    System.arraycopy(dp, 0, ndp, 0, ndp.length);
                    for (int mask = 0; mask < 1 << n; mask++) {
                        for (int bit = 0; bit < n; bit++) {
                            if (((1 << bit) & mask) == 0) {
                                int nmask = mask | (1 << bit);
                                ndp[nmask] = Math.max(ndp[nmask], ndp[mask] + curColumn[bit + shift]);
                            }
                        }
                    }
                    for (int i = 0; i < ndp.length; i++) {
                        maxndp[i] = Math.max(maxndp[i], ndp[i]);
                    }
                }
                int[] tmp = dp;
                dp = maxndp;
                maxndp = tmp;
 ... Complexity:
targets: np
inputs: import java.util.*;
	
public class A {
	public static void main(String[] args)
	{
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		s.close();
		
		if (n % 2 == 0)
			System.out.print("4 " + (n-4));
		else 
			System.out.print("9 " + (n-9));
	}
}
 What is the time complexity of the previous code?
targets: constant
inputs: import java.util.ArrayList;
import java.util.Scanner;



public class primes {

public static void main(String []  args){

ArrayList<Integer> numb=new ArrayList<Integer>();
Scanner br1 = new Scanner(System.in);
int n=br1.nextInt();
int steps=br1.nextInt();
//if(n>2)numb.add(2);
if(n>=3)numb.add(3);
for(int j=4;j<=n;j++){
if(chekprime(j)==0){

numb.add(j);
//System.out.println(j);
}

}
int counter =0;
for(int give=0;give<numb.size();give++)
{if("YES".equals(sumup(numb, 2, numb.get(give)))){
 counter++;
// System.out.println(numb.get(give)+"ksjdfskldfgaskldfgasklfgaskldfgaklsfgasdklfgaskldfgaskldfgasdklfg");
 }



}

//System.out.println(counter);
if(counter>=steps)System.out.println("YES");
else System.out.println("NO");


}

public static String sumup(ArrayList<Integer> list,int number,int NUM){

String ret="NO";
    ArrayList<Integer> result=new ArrayList<Integer>();

ArrayList<Integer>[] arList=new ArrayList[number];
for(int i=0;i<number;i++){
arList[i]=new ArrayList<Integer>();
arList[i]=(ArrayList<Integer>)list.clone();
for(int k=0;k<i;k++){
arList[i].add(0,arList[i].remove(arList[i].size()-1));
}

}


    int [] temp=new int[list.size()];
    
for(int z=0;z<list.size();z++){
    for(int count=0;count<number;count++){
        
temp[z]+=arList[count].get(z);
//System.out.println(arList[count].get(z));
    }

result.add(temp[z]);

}

if(result.contains(NUM-1))
{    //System.out.println(NUM-1);
ret="YES";
}
return ret;
}



public static int chekprime(int n){
int flag=0;

for(int i=2;i<=Math.sqrt(n)+1;i++)
{
if(n%i==0){
flag=1;
break;
}

} 

return flag;

}
}
 What is the time complexity of the previous code?
targets: linear
inputs: import java.io.*;
import java.util.*;
public class Codechef{
	static int max=Integer.MIN_VALUE;
	static int res=0;
	static int[] checkMax(int arr[],int j){
             int sum=0;
             int x=arr[j];
        		while(x!=0){
        		        if(j+1==15){
        		        	j=0;
        		        }else{
        		        	arr[j+1]=arr[j+1]+1;
        		        }
        		        // if(arr[j+1]%2==0){
        		        // 	sum=sum+arr[j+1];
        		        // 	if(sum>=max){
        		        // 	max=sum;
        		        // }
        		        // }

        		        
        		        x--;
        		        j++;
        		}
        		     return arr;

	}
      

    public static void main(String []args){
       Scanner sc = new Scanner (System.in);
    long a [] = new long [14];
    long b [] = new long [14];
    long p,q,r,s,max = 0;
    for(int i = 0; i < 14; i++) a[i] = sc.nextInt();
    for(int i = 0; i < 14; i++){
      p = a[i]%14;
      q = a[i]/14;
      r = 0;
      s = 0;
      for(int j = 0; j < 14; j++) b[j] = a[j];
      b[i] = 0;
      int j = (i+1)%14;
      for(; r < p; r++) {
        b[j]++;
        j=(j+1)%14;
      }
      for( j = 0; j < 14; j++) {
        b[j] += q;
        if(b[j] % 2 == 0) s+= b[j];
      }
      max = Math.max(max,s);
    }
    System.out.println(max);



    }

} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] wide = new int[n], sta = new int[n];
        HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();
        for (int i = 0; i < n; i++) {
        	wide[i] = sc.nextInt();
        	hm.put(wide[i], i + 1);
        }
        Util.sort(wide);
        sc.nextLine();
        String s = sc.nextLine();
        int tp = 0, pos = 0;
        StringBuilder out = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
        	int t;
        	if (s.charAt(i) == '0') {
        		t = wide[pos++];
        		sta[tp++] = t;
        	} else t = sta[--tp];
        	out.append(hm.get(t) + " ");
        }
        System.out.println(out.toString());
        sc.close();
    }
    public static class Util {
    	
    	public static <T extends Comparable<T> > void merge_sort(T[] a) {
    		Object[] aux = new Object[a.length];
    		merge_sort0(a, aux, 0, a.length);
    	}
    	
    	public static <T extends Comparable<T> > void merge_sort(T[] a, int l, int r) {
    		Object[] aux = new Object[a.length];
    		merge_sort0(a, aux, l, r);
    	}
    	
    	@SuppressWarnings("unchecked")
    	private static <T extends Comparable<T> > void merge_sort0(T[] a, Object[] temp, int l, int r) {
    		if (l + 1 == r) return;
    		int mid = (l + r) >> 1;
    		merge_sort0(a, temp, l, mid);
    		merge_sort0(a, temp, mid, r);
    		int x = l, y = mid, c = l;
    		while (x < mid || y < r) {
    			if (y == r || (x < mid && a[x].compareTo(a[y]) <= 0)) temp[c++] = a[x++];
    			else temp[c++] = a[y++];
    		}
    		for (int i = l; i < r; i++) a[i] = (T)temp[i];
    	}
    	
    	static final Random RAN = new Random();
    	
    	public static <T extends Comparable<T> > void quick_sort(T[] a) {
    		quick_sort0(a, 0, a.length);
    	}
    	
    	public static <T extends Comparable<T> > void quick_sort(T[] a, int l, int r) {
    		quick_sort0(a, l, r);
  ... Complexity:
targets: nlogn