Muennighoff/xP3x-sample huggingface dataset:
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.math.BigInteger;
import java.io.BufferedReader;
import java.util.Collections;
import java.io.InputStream;

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

    static class TaskD {
        public void solve(int testNumber, MyReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; ++i) {
                a[i] = in.nextInt();
            }
            Map<Integer, Integer> map = new HashMap<>();
            for (int i = 0; i < n; ++i) {
                if (map.containsKey(a[i])) {
                    map.put(a[i], map.get(a[i]) + 1);
                } else {
                    map.put(a[i], 1);
                }
            }
            List<Integer> compressed = new ArrayList<>();
            compressed.add(-1);
            compressed.add(Integer.MAX_VALUE);
            compressed.addAll(map.keySet());
            Collections.sort(compressed);
            //        System.out.println(compressed);
            int N = compressed.size() + 10;
            BIT count = new BIT(N);
            BIT sum = new BIT(N);

            BigInteger ret = BigInteger.ZERO;
            for (int i = n - 1; i >= 0; --i) {
                int l = findLeft(compressed, a[i] - 2);
                int r = findRight(compressed, a[i] +... Complexity:
targets: nlogn
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 A {
    public static void main(String[]args) {
        Scanner in = new Scanner(System.in);
        long l = in.nextLong();
        long r = in.nextLong();
        if(r - l < 2) System.out.println(-1);
        else {
            if(l % 2 == 0)
                System.out.println(l + " " + (l+1) + " " + (l+2));
            else {
                if(r - l < 3) System.out.println(-1);
                else
                    System.out.println((l+1) + " " + (l+2) + " " + (l+3));
            }
        }
    }
}
 Complexity:
targets: constant
inputs: import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {

    FastScanner in = new FastScanner(System.in);
//    FastScanner in = new FastScanner(new File("test.txt"));
    
    PrintWriter out = new PrintWriter(System.out);

    public static void main (String[]args) {
        Main task = new Main();
        task.solve();
        task.close();
    }

    public void close () {
        in.close();
        out.close();
    }
    
    public void solve() {
        int n = in.nextInt();
        int k = in.nextInt();
        
        Team[]teams = new Team[n];
        
        for (int i = 0; i < n; i++) {
            Team t = new Team();
            t.tasks = in.nextInt();
            t.penalty = in.nextInt();
            teams[i] = t;
        }
        
        Arrays.sort(teams);
        
        Team t = teams[k - 1];
        int ans = 0;
        for (int i = 0; i < teams.length; i++) {
            if (teams[i].equals(t)) ans++;
        }
         
        System.out.println(ans);
            
        
    }
    class Team implements Comparable<Team>{
        int tasks;
        int penalty;
        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + getOuterType().hashCode();
            result = prime * result + penalty;
            result = prime * result + tasks;
            return result;
        }
        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (getClass() !=... What is the time complexity of the previous code?
targets: nlogn
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. 
    //~~~~~~~~~~~~~~~~~~~~~~~@@@@@@@@@@@@@@@_____________K_____S_____J__________@@@@@@@@@@@@@@@@@@@@@@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~~~
    //Date:00/00/17
    //-------------


import java.util.*;
import java.io.*;

/*

    [[[[[[[[[[[[[[[      ]]]]]]]]]]]]]]]
    [::::::::::::::      ::::::::::::::]
    [::::::::::::::      ::::::::::::::]
    [::::::[[[[[[[:      :]]]]]]]::::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[    CODE YOUR LIFE    ]:::::]
    [:::::[   Kripa Shankar jha  ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [:::::[                      ]:::::]
    [::::::[[[[[[[:      :]]]]]]]::::::]
    [::::::::::::::      ::::::::::::::]
    [::::::::::::::      ::::::::::::::]
    [[[[[[[[[[[[[[[      ]]]]]]]]]]]]]]]
*/

public class prob3{
  

    static Parser sc=new Parser(System.in);
    static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
  
  static int p[]=new int[100005];
  public static void main(String[] args) throws IOException {
    // use ((((((( sc ............... for input

   
    int n=sc.nextInt();

    int arr[]=new int[n];

    for(int i=0;i<n;i++){
      arr[i]=sc.nextInt();
    }

    int swap=0;

    for(int i=0;i<n;i++){
      for(int j=0;j<i;j++){
        if(arr[i]<arr[j]){
           swap++; 
        }
      }
    }

    swap%=2;


    int m=sc.nextInt();

    for(int i=0;i<m;i++){

      int a=sc.nextInt(),b=sc.nextInt();
      swap+=((b-a)*((b-a)+1))/2;

      swap%=2;

      if(swap%2==0){System.out.println("even");}
      else{System.out.println("odd");}
    }


          
  }

   

public static void union(int a,int b){
        int i=find(a);
        int j=find(b);

        if(p[i]!=j){
          p[i]=j;
        }
      }


      public static int find(int a){

        while(p[a]!=a){
          a=p[a];
        }

       ... Complexity:
targets: quadratic
inputs: import static java.util.Arrays.*;
import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class A implements Runnable
{
	public static void main(String [] args) throws IOException
	{
		new Thread(null, new A(), "", 1 << 20).start();
	}
	
	String file = "input";
	BufferedReader input;
	PrintWriter out;
	
	public void run() 
	{
		try
		{
			//input = new BufferedReader(new FileReader(file + ".in"));
			input = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new BufferedOutputStream(System.out));
			solve();
			input.close();
			out.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
			System.exit(1);
		}
	}

	void solve() throws IOException
	{
		ArrayList<Integer> p = new ArrayList<Integer>();
		StringTokenizer st = tokens();
		int n = nextInt(st), k = nextInt(st);
		for(int i = 2; i <= n; i++)
			if(prime(i)) p.add(i);
		
		int count = 0;
		for(int x = 2; x <= n; x++)
		{
			if(!prime(x)) continue;
			for(int i = 0; i + 1 < p.size(); i++)
			{
				int p1 = p.get(i);
				int p2 = p.get(i + 1);
				int P = p1 + p2 + 1;
				if(P == x) 
				{
					count++;
					break;
				}
				if(P > x) break;
			}
		}
		System.out.println(count >= k ? "YES" : "NO");
				
	}
	
	boolean prime(int n)
	{
		for(int i = 2; i * i <= n; i++)
			if(n % i == 0) return false;
		return true;
	}

	StringTokenizer tokens() throws IOException
	{
		return new StringTokenizer(input.readLine());
	}
	
	String next(StringTokenizer st)
	{
		return st.nextToken();
	}
	
	int nextInt() throws IOException
	{
		return Integer.parseInt(input.readLine());
	}
	
	int nextInt(StringTokenizer st)
	{
		return Integer.parseInt(st.nextToken());
	}
	
	double nextDouble() throws IOException
	{
		return Double.parseDouble(input.readLine());
	}
	
	double nextDouble(StringTokenizer st)
	{
		return Double.parseDouble(st.nextToken());
	}
	
	void print(Object... o)
	{
		out.println(deepToString(o));
	}
} 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: 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);
        TaskE2 solver = new TaskE2();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE2 {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int numTests = in.nextInt();
            for (int test = 0; test < numTests; test++) {
                int n = in.nextInt();
                int m = in.nextInt();
                int[][] a = new int[n][m];
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < m; j++) {
                        a[i][j] = in.nextInt();
                    }
                }

                if (m > n) {
                    int[] maxInColumn = new int[m];
                    for (int j = 0; j < m; j++) {
                        for (int i = 0; i < n; i++) {
                            maxInColumn[j] = Math.max(maxInColumn[j], a[i][j]);
                        }
                    }
                    Integer[] cols = new Integer[m];
                    for (int i = 0; i < m; i++) {
                        cols[i] = i;
                    }
                    Arrays.sort(cols, (u, v) -> -(maxInColumn[u] - maxInColumn[v]));

                    int[][] na = new int[n][n];
                    for (int i = 0; i < n; i++) {
                        for (int j = 0; j < n; j++) {
                            na[i][j] = a[i][cols[j]];
                        }
         ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: np
inputs: import java.util.*;
import java.io.*;

public class NewYearAndCurling {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		StringTokenizer t = new StringTokenizer(in.readLine());
		int N = Integer.parseInt(t.nextToken());
		int R = Integer.parseInt(t.nextToken());
		int[] x = new int[N];
		t = new StringTokenizer(in.readLine());
		for(int i = 0; i < N; ++i)
			x[i] = Integer.parseInt(t.nextToken());
		double[] y = new double[N];
		for(int i = 0; i < N; ++i) {
			double max = R;
			for(int j = 0; j < i; ++j ) {
				int xDiff = Math.abs(x[i] - x[j]);
				if(xDiff <= 2 * R)
					max = Math.max(max, y[j] + Math.sqrt(4*R*R - xDiff*xDiff));
			}
			y[i] = max;
		}
		out.print(y[0]);
		for(int i = 1; i < N; ++i)
			out.print(" " + y[i]);
		out.println();
		in.close();
		out.close();
	}
} 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 cf {

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        int n = sc.nextInt();
        pw.println(n/2+1);
        pw.close();
    }
} What is the time complexity of the previous code?
targets: constant
inputs: import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static final int MAX_N = 1000010;
	static final int INF = 0x3f3f3f3f;
	static final int mod = 1000000007;


	public static void main(String[] args) throws IOException {
		initReader(System.in);


//		int T = nextInt();
//		for (int i = 1; i <= T; i++)
			solve();

		pw.flush();
	}


	/*******************************************************************************************************************************/


	public static void solve() throws IOException {
		while (hasNext()) {
			long n = nextLong() - 1;

			long k = 1, x = 9;
			while (n - k * x >= 0) {
				n -= k * x;
				k += 1;
				x *= 10;
			}

			if (n == 0)
				pw.println(1);
			else {
				long num = x / 9 + n / k;
				String s = String.valueOf(num);
				pw.println(s.charAt((int) (n % k)));
			}
		}
	}




	/*******************************************************************************************************************************/

	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter pw;

	public static void initReader(InputStream input) throws IOException {
		reader = new BufferedReader(new InputStreamReader(input));
		tokenizer = new StringTokenizer("");
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

//		reader = new BufferedReader(new FileReader("ate.in"));
//		tokenizer = new StringTokenizer("");
//		printWriter = new PrintWriter(new BufferedWriter(new FileWriter("ate.out")));
	}

	public static boolean hasNext() {
		try {
			while (!tokenizer.hasMoreTokens()) {
				tokenizer = new StringTokenizer(reader.readLine());
			}
		} catch (Exception e) {
			return false;
		}
		return true;
	}

	public static String next() throws IOException {
		while (!tokenizer.hasMoreTokens()) {
			tokenizer = new... 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: 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.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
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 = in.nextIntArray(n);
            Arrays.sort(a);
            int count = 0;
            boolean[] used = new boolean[n];
            for (int i = 0; i < n; i++) {
                if (!used[i]) {
                    count++;
                    for (int j = i; j < n; j++) {
                        if (a[j] % a[i] == 0) {
                            used[j] = true;
                        }
                    }
                }
            }
            out.println(count);
        }

    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

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

        public FastScanner(String fileName) {
            try {
                br = new BufferedReader(new FileReader(fileName));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            while (st ==... Complexity:
targets: quadratic
inputs: import java.io.*;
import java.util.*;

public class A {
  public static void main(String[] args){
    FastScanner sc = new FastScanner();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long result = 0L;

    while(a != 0 && b != 0) {
      if(a > b) {
        result += a/b;
        a = a % b;
      } else {
        result += b/a;
        b = b % a;
      }

      long gcd = gcd(a, b);
      a /= gcd;
      b /= gcd;
    }

      System.out.println(result);
  }

  private static long gcd(long a, long b) {
    while(a != 0 && b != 0) {
      if(a < b) {
        long tmp = a;
        a = b;
        b = tmp;
      }
      a%=b;
    }
    return a + b;
  }

  public static class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    public FastScanner(String s) {
      try {
        br = new BufferedReader(new FileReader(s));
      } catch (FileNotFoundException e) {
        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) {
        e.printStackTrace();
      }
      return st.nextToken();
    }

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

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

    double nextDouble() {
      return Double.parseDouble(nextToken());
    }
  }
}
 What is the time complexity of the previous code?
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.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.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;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DExplorerSpace solver = new DExplorerSpace();
        solver.solve(1, in, out);
        out.close();
    }

    static class DExplorerSpace {
        int n;
        int m;
        int k;
        int[][] col;
        int[][] row;
        long[][][] memo;

        public void readInput(Scanner sc) {
            n = sc.nextInt();
            m = sc.nextInt();
            k = sc.nextInt();
            col = new int[n][m - 1];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m - 1; j++)
                    col[i][j] = sc.nextInt();
            row = new int[n - 1][m];
            for (int i = 0; i < n - 1; i++)
                for (int j = 0; j < m; j++)
                    row[i][j] = sc.nextInt();
        }

        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int q = 1;
            while (q-- > 0) {
                readInput(sc);
                if (k % 2 == 1) {
                    for (int i = 0; i < n; i++) {
                        for (int j = 0; j < m; j++)
                            pw.print(-1 + " ");
                        pw.println();
                    }
                    return;
                }
                memo = new long[k + 1][n][m];
                for (long[][] x : memo)
                    for (long[] y : x)
                        Arrays.fill(y, -1);
                for (int i = 0; i < n; i++) {
                    for (int j =... Complexity:
targets: cubic
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class A {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(reader.readLine());
        String str[] = reader.readLine().split(" ");
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(str[i]);
        }
        Arrays.sort(a);
        int k = 0;
        for (int i = 0; i < n; i++) {
            if (a[i] == 0){
                continue;
            }
            for (int j = i + 1; j < n; j++) {
                if (a[j] % a[i] == 0){
                    a[j] = 0;
                }
            }
            k++;
        }
        System.out.println(k);
    }
}
 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.util.*;

public class Task25a {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a1 = 0, a2 = 0;
		int n1 = 0, n2 = 0;
		for (int i = 1; i <= n; i++) {
			int c = sc.nextInt();
			if (c % 2 == 1) {
				a1 = i;
				n1++;
			} else {
				a2 = i;
				n2++;
			}
		}
		if (n1 == 1) {
			System.out.println(a1);
		} else {
			System.out.println(a2);
		}
	}

}
 Complexity:
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.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Scanner;

public class CodeForces {

    //private static MyScanner sc;
    private static MyPrinter out;

    public static void solve() throws IOException {
        Scanner sc = new Scanner(System.in);
        long l = sc.nextLong();
        long r = sc.nextLong();
        String ls = Long.toBinaryString(l);
        String rs = Long.toBinaryString(r);
        while (ls.length() < rs.length()) {
            ls = "0" + ls;
        }
        String res = "";
        boolean ok = false;
        for (int i = 0; i < ls.length(); i++) {
            if (ok) {
                res += "1";
            } else {
                if (ls.charAt(i) != rs.charAt(i)) {
                    res += "1";
                    ok = true;
                }
            }
        }
        long all = 0;
        for (int i = 0; i < res.length(); i++) {
            all += (long) Math.pow((long) 2, (long) res.length() - 1 - i);
        }
        System.out.println(all);
    }

    public static void main(String[] args) throws IOException {
        //sc = new MyScanner(System.in);
        out = new MyPrinter(System.out);
        solve();
        out.close();
    }
}

class MyScanner {

    private StreamTokenizer st;

    public MyScanner(InputStream is) {
        st = new StreamTokenizer(new BufferedReader(new InputStreamReader(is)));
    }

    public MyScanner(File f) throws FileNotFoundException {
        st = new StreamTokenizer(new BufferedReader(new FileReader(f)));
    }

    public int nextInt() throws IOException {
        st.nextToken();
        return ((int) st.nval);
    }

    public double nextDouble() throws IOException {
       ... Complexity:
targets: logn
inputs: import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author ilyakor
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    OutputWriter out = new OutputWriter(outputStream);
    TaskA solver = new TaskA();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskA {

    public void solve(int testNumber, InputReader in, OutputWriter out) {
      int n = in.nextInt();
      boolean[] a = new boolean[218];
      for (int i = 0; i < n; ++i) {
        a[in.nextInt()] = true;
      }
      int res = 0;
      for (int i = 1; i < a.length; ++i) {
        if (a[i]) {
          ++res;
          for (int j = i; j < a.length; j += i) {
            a[j] = false;
          }
        }
      }
      out.printLine(res);
    }

  }

  static class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
      writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
      this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
      for (int i = 0; i < objects.length; i++) {
        if (i != 0) {
          writer.print(' ');
        }
        writer.print(objects[i]);
      }
    }

    public void printLine(Object... objects) {
      print(objects);
      writer.println();
    }

    public void close() {
      writer.close();
    }

  }

  static class InputReader {

    private InputStream stream;
    private byte[] buffer = new byte[10000];
    private int... 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.util.*;
public class hackerearth {

    public  static  void main(String[] args) {

        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();

        HashMap<String,Integer> map=new HashMap<>();
        HashMap<String,Integer> map2=new HashMap<>();
        for(int i=0;i<n;i++)
        {
            String s=sc.next();
            if(map.containsKey(s))
                map.put(s,map.get(s)+1);
            else
                map.put(s,1);
        }
        for(int i=0;i<n;i++)
        {
            String s=sc.next();
            if(map2.containsKey(s))
                map2.put(s,map2.get(s)+1);
            else
                map2.put(s,1);

            if(map.containsKey(s)) {
                int feq = map.get(s);
                feq--;
                if (feq <= 0)
                    map.remove(s);
                else
                    map.put(s, feq);
            }

        }


        int ans=0;
        for(Map.Entry<String,Integer> entry:map.entrySet())
        {
            ans+=entry.getValue();
        }
        System.out.println(ans);


    }



}
 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.util.*;
public class a {
	public static void main(String[] args){
		Scanner br = new Scanner(System.in);
		long n = br.nextLong();
		System.out.println("25");
	}
}
 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.io.*;
import java.util.*;

public class Template implements Runnable {
    private void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        boolean[][] g = new boolean[n][n];
        for (int i = 0; i < m; ++i) {
            int a = nextInt() - 1;
            int b = nextInt() - 1;
            g[a][b] = true;
            g[b][a] = true;
        }
        /*for (int i = 0; i < n; ++i)
            for (int j = 0; j < n; ++j)
                g[i][j] = true;*/
        long[] am = new long[n + 1];
        long[][] ways = new long[1 << n][n];
        for (int start = 0; start < n; ++start) {
            for (int mask = 0; mask < (1 << (n - start)); ++mask)
                for (int last = start; last < n; ++last) {
                    ways[mask][last - start] = 0;
                }
            ways[1][0] = 1;
            for (int mask = 0; mask < (1 << (n - start)); ++mask) {
                int cnt = 0;
                int tmp = mask;
                while (tmp > 0) {
                    ++cnt;
                    tmp = tmp & (tmp - 1);
                }
                for (int last = start; last < n; ++last)
                    if (ways[mask][last - start] > 0) {
                        long amm = ways[mask][last - start]; 
                        for (int i = start; i < n; ++i)
                            if ((mask & (1 << (i - start))) == 0 && g[last][i]) {
                                ways[mask | (1 << (i - start))][i - start] += amm;
                            }
                        if (g[last][start])
                            am[cnt] += ways[mask][last - start];
                    }
            }
        }
        long res = 0;
        for (int cnt = 3; cnt <= n; ++cnt) {
            if (am[cnt] % (2) != 0)
                throw new RuntimeException();
            res += am[cnt] / (2);
        }
        writer.println(res);
    }


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

    BufferedReader reader;
   ... Complexity:
targets: np
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Solution implements Runnable {

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws Exception {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

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

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

	double nextDouble() throws Exception {
		return Double.parseDouble(nextToken());
	}
	
	int fu(int[] a, int l) {
		for (int i = l; i < a.length - 1; i++) {
			if (a[i] > a[i + 1]) return i;
		}
		return a.length;
	}
	
	void swap(int[] a, int q, int w) {
		int t = a[q]; a[q] = a[w]; a[w] = t;
	}
	
	void solve() throws Exception {
		int n = nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) a[i] = nextInt();
		int q = fu(a, 0);
		if (q == n) out.println("YES"); else {
			int w = fu(a, q + 1);
			if (w < n) {
				boolean ans = false;
				swap(a, q, w);
				ans |= fu(a, 0) == n;
				swap(a, q, w);
				if (q < n - 1) {
					swap(a, q + 1, w);
					ans |= fu(a, 0) == n;
					swap(a, q + 1, w);
				}
				if (w < n - 1) {
					swap(a, q, w + 1);
					ans |= fu(a, 0) == n;
					swap(a, q, w + 1);
				}
				if (q < n - 1 && w < n - 1) {
					swap(a, q + 1, w + 1);
					ans |= fu(a, 0) == n;
					swap(a, q + 1, w + 1);
				}
				if (ans) out.println("YES"); else out.println("NO");
			} else {
				int j = q + 1;
				while (j < n && a[j] == a[q + 1]) j++;
				j--;
				swap(a, q, j);
				if (fu(a, 0) == n) out.println("YES"); else {
					swap(a, q, j);
					q++;
					j =... Complexity:
targets: nlogn
inputs: //package round15;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;

public class A {

	static StreamTokenizer in =
		new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
	
	static int nextInt() throws IOException{
		in.nextToken();
		return (int)in.nval;
	}
	
	static PrintWriter out = new PrintWriter(System.out);
	
	public static void main(String[] args) throws IOException{
		int n = nextInt(),
			t = nextInt(),
			x[] = new int[n],
			a[] = new int[n];
		
		for (int i=0; i<n; i++){
			x[i] = nextInt();
			a[i] = nextInt();
		}
		
		for (int i=0; i<n-1; i++)
			for (int j=i+1; j<n; j++)
				if (x[i] > x[j]){
					int p = x[i]; x[i] = x[j]; x[j] = p;
						p = a[i]; a[i] = a[j]; a[j] = p;
				}
		
		double l[] = new double[n];
		double r[] = new double[n];
		for (int i=0; i<n; i++){
			l[i] = x[i]-a[i]/2.0;
			r[i] = x[i]+a[i]/2.0;
		}
		
		int res = 2;
		for (int i=1; i<n; i++){
			if (Math.abs(l[i]-r[i-1]-t) < 0.000001) res++;
			else if (l[i]-r[i-1] > t) res += 2;
		}
		
		out.println(res);
		out.flush();
	}

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

public class first
{
	int max(int a1,int a2,int a3)
	{
		int max=a1;
		if(a2>=max)
			max=a2;
		if(a3>=max)
			max = a3;
		return max;	
	}
	
	public static void main(String[] args)
	{
		int num=0;
		
		Scanner sc = new Scanner(System.in);
		num = sc.nextInt();
		int num2 = num/10;
		int num3 = num%10;
		int num4 = (num2/10)*10+num3;
		first fs = new first();
		int result = fs.max(num,num2,num4);
		System.out.println(result);
	}
}	
 What is the time complexity of the previous code?
targets: constant
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A23 {

    static int solve(String s) {
        for(int i = s.length(); i > 0; --i) {
            for(int start = 0; start < s.length() - i; ++start) {
                String str = s.substring(start, start + i);
                int firstIndex = s.indexOf(str);
                int lastIndex = s.lastIndexOf(str);
                if(firstIndex != lastIndex)
                    return i;
            }
        }
        return 0;
    }

    public static String[] EX = new String[] { "abcd", "ababa", "zzz", "qwertyuiopasdfghjklzxcvbnmqwepriuwpoep"};
    public static int[] EX_A = new int[] { 0, 3, 2, 3};
    
    public static void main(String[] args) throws IOException {
        if(true) {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String s = br.readLine();
            System.out.println(solve(s));
        }
        else {
            for(int i = 0; i < EX.length; ++i) {
                int result = solve(EX[i]);
                System.out.println(i + ": " + result + " " + (result == EX_A[i]? "ja" : "NEJ"));
            }
        }
    }

}
 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. // upsolve with rainboy
import java.io.*;
import java.util.*;

public class CF1187G extends PrintWriter {
	CF1187G() { super(System.out, true); }
	static class Scanner {
		Scanner(InputStream in) { this.in = in; } InputStream in;
		int k, l; byte[] bb = new byte[1 << 15];
		byte getc() {
			if (k >= l) {
				k = 0;
				try { l = in.read(bb); } catch (IOException e) { l = 0; }
				if (l <= 0) return -1;
			}
			return bb[k++];
		}
		int nextInt() {
			byte c = 0; while (c <= 32) c = getc();
			int a = 0;
			while (c > 32) { a = a * 10 + c - '0'; c = getc(); }
			return a;
		}
	}
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF1187G o = new CF1187G(); o.main(); o.flush();
	}

	static final int INF = 0x3f3f3f3f;
	ArrayList[] aa_;
	int n_, m_;
	int[] pi, kk;
	int[] uu, vv, uv, cost, cost_;
	int[] cc;
	void init() {
		aa_ = new ArrayList[n_];
		for (int u = 0; u < n_; u++)
			aa_[u] = new ArrayList<Integer>();
		pi = new int[n_];
		kk = new int[n_];
		uu = new int[m_];
		vv = new int[m_];
		uv = new int[m_];
		cost = new int[m_];
		cc = new int[m_ * 2];
		m_ = 0;
	}
	void link(int u, int v, int cap, int cos) {
		int h = m_++;
		uu[h] = u;
		vv[h] = v;
		uv[h] = u ^ v;
		cost[h] = cos;
		cc[h << 1 ^ 0] = cap;
		aa_[u].add(h << 1 ^ 0);
		aa_[v].add(h << 1 ^ 1);
	}
	boolean dijkstra(int s, int t) {
		Arrays.fill(pi, INF);
		pi[s] = 0;
		TreeSet<Integer> pq = new TreeSet<>((u, v) -> pi[u] != pi[v] ? pi[u] - pi[v] : kk[u] != kk[v] ? kk[u] - kk[v] : u - v);
		pq.add(s);
		Integer first;
		while ((first = pq.pollFirst()) != null) {
			int u = first;
			int k = kk[u] + 1;
			ArrayList<Integer> adj = aa_[u];
			for (int h_ : adj)
				if (cc[h_] > 0) {
					int h = h_ >> 1;
					int p = pi[u] + ((h_ & 1) == 0 ? cost_[h] : -cost_[h]);
					int v = u ^ uv[h];
					if (pi[v] > p || pi[v] == p && kk[v] > k) {
						if (pi[v] != INF)
							pq.remove(v);
						pi[v] = p;
						kk[v] = k;
						pq.add(v);
					}
				}
		}
		return pi[t] != INF;
	}
	int dfs(int u, int t, int c) {
		if (u == t || c... Complexity:
targets: cubic
inputs: import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;


public class A {

    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        for (int i = n; i >= 1; i--) {
            Set<String> set = new HashSet<String>();
            for (int j = 0; j < n-i+1; j++) {
                String t = s.substring(j, j+i);
                if (set.contains(t)) {
                    System.out.println(i);
                    return;
                }
                set.add(t);
            }
        }
        System.out.println(0);
    }
    
}
 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: /* 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 br = new BufferedReader(new InputStreamReader(System.in));
		int t = Integer.parseInt(br.readLine());
		for(int q=0;q<t;q++){
		      String s = br.readLine();
		      int n = Integer.parseInt(s);
		      int a[] = new int[1000];
		      int index=0;
		      for(int i=0;i<n;i++){
		            int x = Integer.parseInt(br.readLine());
		            for(int j=index;j>=0;j--){
		                  if(x-1==a[j]){
		                        a[j]=x;
		                  
		                  for(int k=0;k<j;k++){
		                        System.out.print(a[k]+".");
		                  }
		                  System.out.print(a[j]);
		                  System.out.println();
		                  for(int k=j+1;k<1000;k++){
		                        if(a[k]!=0)
		                        a[k]=0;
		                        else 
		                        break;
		                  }
		                  index=j+1;
		                //  System.out.println(a[j]+"*"+j);
		                  break;
		                  }
		            }
		      }
		}
	}
} 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: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import java.io.*;

public class Main {
    boolean[] b;
    int[] r;
    ArrayList<ArrayList<Integer>> q;

    public void dfs(int u, int p) {
        for (int i = 0; i < q.get(u).size(); i++) {
            int v = q.get(u).get(i);
            if (v != p) {
                r[v] = r[u] + 1;
                if (b[u]) {
                    b[v] = b[u];
                }
                dfs(v, u);
            }
        }
    }

    public void solve() throws IOException {
        long n = nextLong();
        long s = nextLong();
        long t = 0;
        if(s + 200 < n){
            t = n - s - 200;
        }
        for(long i = s; i <= Math.min(s + 200,n); i++){
            long p = 0;
            long u = i;
            while (u > 0){
                p += u % 10;
                u /= 10;
            }
            if(i - p >= s){
                t++;
            }
        }
        out.print(t);
    }

    BufferedReader br;
    StringTokenizer sc;
    PrintWriter out;

    public String nextToken() throws IOException {
        while (sc == null || !sc.hasMoreTokens()) {
            try {
                sc = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return sc.nextToken();
    }

    public Integer nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public Long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public static void main(String[] args) throws IOException {
        try {
            Locale.setDefault(Locale.US);
        } catch (Exception e) {
        }
        new Main().run();
    }

    public void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
//            br = new BufferedReader(new FileReader("lesson.in"));
//            out = new PrintWriter(new... Complexity:
targets: logn
inputs: import java.io.*;
import java.security.SecureRandom;
import java.util.*;
import java.math.*;
import java.awt.geom.*;

import static java.lang.Math.*;

public class Solution implements Runnable {
    
    
    
    
    public void solve() throws Exception {
        int n = sc.nextInt();
        int a[] = new int[n];
        int s = 0;
        for (int i = 0;i < n; ++ i) {
            a[i] = sc.nextInt();
            s += a[i];
        }
        Arrays.sort(a);
        int s2 = 0;
        for (int i = n - 1;i >= 0; -- i) {
            s2 += a[i];
            if (s2 > s - s2) {
                out.println(n - i);
                break;
            }
        }
        
    }
    
    class Pair implements Comparable<Pair> {
        
        int x;
        int y;
        
        public Pair() {
            
        }
        
        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair arg0) {
            if (x == arg0.x)
                return y - arg0.y;
            return x - arg0.x;
        }
    }
    
    
    
    
    /*--------------------------------------------------------------*/
    
    static String filename = "";
    static boolean fromFile = false;
    
    BufferedReader in;
    PrintWriter out;
    FastScanner sc;
    
    public static void main(String[] args) {
        new Thread(null, new Solution(), "", 1 << 25).start();
    }
   
    public void run() {
        try {
            init();
            solve();
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            out.close();
        }
    }
    
    void init() throws Exception {
        if (fromFile) {
            in = new BufferedReader(new FileReader(filename+".in"));
            out = new PrintWriter(new FileWriter(filename+".out"));
        } else {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
        sc = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: nlogn
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.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author MaxHeap
 */
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);
    CBanhMi solver = new CBanhMi();
    solver.solve(1, in, out);
    out.close();
  }

  static class CBanhMi {

    long mod = (long) (1e9 + 7);

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int n = in.nextInt();
      int q = in.nextInt();
      long[] two = new long[n + 1];
      two[0] = 1;
      for (int i = 1; i <= n; ++i) {
        two[i] = (two[i - 1] * 2L);
        two[i] %= mod;
      }

      char[] s = in.nextCharArray();
      int[] acc = new int[n + 1];
      for (int i = 1; i <= n; ++i) {
        acc[i] = s[i - 1] == '0' ? 0 : 1;
        acc[i] += acc[i - 1];
      }
      // 0 0 1 1 | 1: 1 1 2| 2: 2 3| 4: 5| 9
      // 0 1 1 1| 1: 1 2 2| 2: 3 3| 5: 6| 11
      // 0 1 1 wwqwq| 1: 1 2 2| 3: 5 3| 8: 8| 16
      // 0 0 1 1| 1: 1 1 2| 3: 3 3| 6: 6| 12
      // 0 0 0 1| 1: 1 1 1| 2: 2 2| 4: 4| 8
      while (q-- > 0) {
        int f = in.nextInt();
        int t = in.nextInt();
        int ones = acc[t] - acc[f - 1];
        int zeros = (t - f + 1) - ones;
        if (ones == 0) {
          out.println(0);
        } else {
          long ans = two[t - f + 1] - (zeros > 0 ? two[zeros] : 0);
          if (zeros == 0) {
            --ans;
          }
          ans = (ans + mod) % mod;
          out.println(ans);
        }
      }
    }

  }

  static class InputReader implements FastIO {

    private InputStream stream;
    private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
    private static final int EOF = -1;
   ... Complexity:
targets: linear