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.*;
import java.util.*;

public class Solution{


    void solve()throws Exception
    {

        int n=nextInt();

        int[]a=new int[n];
        for(int i=0;i<n;i++)
            a[i]=nextInt();

        int[]b=a.clone();
        mySort(b);
        int cnt=0;
        for(int i=0;i<n;i++)
            if(a[i]!=b[i])
                cnt++;
        if(cnt<=2)
            System.out.println("YES");
        else
            System.out.println("NO");

    }

    private void mySort(int[] a) {
        if(a.length<=1)
            return;
        int n=a.length;
        int[]left=new int[n/2];
        int[]right=new int[n-n/2];
        for(int i=0;i<n;i++)
            if(i<left.length)
                left[i]=a[i];
            else
                right[i-left.length]=a[i];
        mySort(left);
        mySort(right);
        int i=0;
        int j=0;
        while (i<left.length || j<right.length)
        {
            if(i==left.length)
                a[i+j]=right[j++];
            else if(j==right.length)
                a[i+j]=left[i++];
            else if(left[i]<right[j])
                a[i+j]=left[i++];
            else
                a[i+j]=right[j++];
        }

    }

    ////////////
    BufferedReader reader;
    PrintWriter writer;
    StringTokenizer stk;
    void run()throws Exception
    {

        reader=new BufferedReader(new InputStreamReader(System.in));
        // reader=new BufferedReader(new FileReader("input.txt"));
        stk=null;
        //writer=new PrintWriter(new PrintWriter(System.out));
        //writer=new PrintWriter(new FileWriter("output.txt"));
        solve();
        reader.close();
        //writer.close();
    }
    int nextInt()throws Exception
    {
        return Integer.parseInt(nextToken());
    }

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

    }
    double nextDouble()throws Exception
    {
        return Double.parseDouble(nextToken());


    }

    String nextString()throws Exception
    {
        return... Complexity:
targets: nlogn
inputs: //package round429;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class C2 {
	InputStream is;
	PrintWriter out;
	String INPUT = "";
	
	void solve()
	{
		int n = ni();
		int[] a = na(n);
		for(int i = 0;i < n;i++){
			int v = a[i];
			for(int j = 2;j*j <= v;j++){
				while(v % (j*j) == 0){
					v /= j*j;
				}
			}
			a[i] = v;
		}
		
		Arrays.sort(a);
		int[] f = new int[n];
		int p = 0;
		for(int i= 0;i < n;i++){
			if(i > 0 && a[i] != a[i-1]){
				p++;
			}
			f[p]++;
		}
		f = Arrays.copyOf(f, p+1);
		int mod = 1000000007;
		
		int[][] fif = enumFIF(1000, mod);
		long[] res = countSameNeighborsSequence(f, fif, mod);
		long ans = res[0];
		for(int v : f){
			ans = ans * fif[0][v] % mod;
		}
		
		out.println(ans);
	}
	
	public static int[][] enumFIF(int n, int mod) {
		int[] f = new int[n + 1];
		int[] invf = new int[n + 1];
		f[0] = 1;
		for (int i = 1; i <= n; i++) {
			f[i] = (int) ((long) f[i - 1] * i % mod);
		}
		long a = f[n];
		long b = mod;
		long p = 1, q = 0;
		while (b > 0) {
			long c = a / b;
			long d;
			d = a;
			a = b;
			b = d % b;
			d = p;
			p = q;
			q = d - c * q;
		}
		invf[n] = (int) (p < 0 ? p + mod : p);
		for (int i = n - 1; i >= 0; i--) {
			invf[i] = (int) ((long) invf[i + 1] * (i + 1) % mod);
		}
		return new int[][] { f, invf };
	}

	
	public static long[] countSameNeighborsSequence(int[] a, int[][] fif, int mod)
	{
		int n = a.length;
		
		int bef = a[0];
		int aft = a[0];
		long[] dp = new long[bef];
		dp[bef-1] = 1;
		for(int u = 1;u < n;u++){
			int v = a[u];
			aft += v;
			long[][] ldp = new long[bef][aft];
			for(int i = 0;i < dp.length;i++){
				ldp[i][0] = dp[i];
			}
			
			for(int i = 0;i < v;i++){
				long[][] ndp = new long[bef][aft];
				for(int j = 0;j < bef;j++){
					for(int k = 0;j+k < aft;k++){
						if(ldp[j][k] == 0)continue;
						// XX -> XCX
						if(j > 0){
							ndp[j-1][k] += ldp[j][k] *... What is the time complexity of the previous code?
targets: cubic
inputs: import java.util.Scanner;

public class origami {
	public static void main(String args[]){
		Scanner input = new Scanner(System.in);
		double n = input.nextInt();
		double k = input.nextInt();
		double red = 0;
		double green = 0;
		double blue = 0;
		double ans = 0;
		red = (2 * n) / k;
		green = (5 * n) / k;
		blue = (8 * n) / k;

		double red1 = Math.ceil(red) ;
		double green1 = Math.ceil(green);
		double blue1 = Math.ceil(blue);

		ans+=red1;
		ans+=green1;
		ans+=blue1;
		Double answer = new Double(ans);
		int finished = answer.intValue();
		System.out.println(finished);
	}
}
 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.awt.Point;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintStream;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.HashSet;

public class FireAgain {

	Point[] coordinate;
	Queue<Point> q = new LinkedList<>();
	// HashSet<Point> vis = new HashSet<>();
	boolean[][] vis;
	PrintStream out;
	int x, y;

	boolean distance(Point word1, Point word2) {

		if (Math.abs(word1.x - word2.x) == 1 && Math.abs(word1.y - word2.y) == 1)
			return false;

		if (Math.abs(word1.x - word2.x) == 1 && word1.y == word2.y)
			return true;

		if (word1.x == word2.x && Math.abs(word1.y - word2.y) == 1)
			return true;

		return false;
	}

	void bfs(Point s) {

		while (!q.isEmpty()) {
			s = q.poll();

			Point p = new Point();
			p.x = s.x - 1;
			p.y = s.y;

			if (p.x >= 1 && p.x <= x && p.y >= 1 && p.y <= y) {
				if (!vis[p.x][p.y]) {
					vis[p.x][p.y] = true;
					q.add(p);

				}
			}

			p = new Point();
			p.x = s.x + 1;
			p.y = s.y;

			if (p.x >= 1 && p.x <= x && p.y >= 1 && p.y <= y) {
				if (!vis[p.x][p.y]) {
					vis[p.x][p.y] = true;
					q.add(p);

				}
			}

			p = new Point();
			p.x = s.x;
			p.y = s.y - 1;

			if (p.x >= 1 && p.x <= x && p.y >= 1 && p.y <= y) {
				if (!vis[p.x][p.y]) {
					vis[p.x][p.y] = true;
					q.add(p);

				}
			}
			
			p = new Point () ;
			p.x = s.x ;
			p.y = s.y + 1;
			
			if (p.x >= 1 && p.x <= x && p.y >= 1 && p.y <= y) {
				if (!vis[p.x][p.y]) {
					vis[p.x][p.y] = true ;
					q.add(p);
					
				}
			}

			if (q.size() == 0)
				out.print(s.x + " " + s.y);
		}

	}

	public static void main(String[] args) throws FileNotFoundException {
		// TODO Auto-generated method stub

		FireAgain F = new FireAgain();
		 Scanner in = new Scanner (new FileReader("input.txt"));
		 F.out = new PrintStream(new File("output.txt"));
	
		F.x = in.nextInt();
		F.y = in.nextInt();

		int l = 0;
		F.vis = new boolean[F.x + 1][F.y + 1];

		int k = in.nextInt();

		for (int i = 0; i <... Complexity:
targets: cubic
inputs: import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.System.exit;
import static java.util.Arrays.fill;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class E {

	static void solve() throws Exception {
		int tests = scanInt();
//		int tests = 40;
		for (int test = 0; test < tests; test++) {
			int n = scanInt(), m = scanInt(), a[][] = new int[n][m];
//			int n = 12, m = 2000, a[][] = new int[n][m];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					a[i][j] = scanInt();
				}
			}
			int bestCols[] = new int[min(m, n)];
			for (int i = 0; i < bestCols.length; i++) {
				bestCols[i] = i;
			}
			if (m > n) {
				int bestColMax[] = new int[n];
				for (int i = 0; i < n; i++) {
					int cmax = 0;
					for (int j = 0; j < n; j++) {
						cmax = max(cmax, a[j][i]);
					}
					bestColMax[i] = cmax;
				}
				for (int i = n; i < m; i++) {
					int cmax = 0;
					for (int j = 0; j < n; j++) {
						cmax = max(cmax, a[j][i]);
					}
					int minBC = 0, minBCM = Integer.MAX_VALUE;
					for (int j = 0; j < n; j++) {
						if (bestColMax[j] < minBCM) {
							minBC = j;
							minBCM = bestColMax[j];
						}
					}
					if (cmax > minBCM) {
						bestCols[minBC] = i;
						bestColMax[minBC] = cmax;
					}
				}
			}
			int dyn[] = new int[1 << n], dynNext[] = new int[1 << n], sums[] = new int[1 << n], csums[] = new int[1 << n];
			for (int i: bestCols) {
				fill(dynNext, 0);
				fill(sums, 0);
				for (int j = 0; j < n; j++) {
					for (int k = 1, bit = 0; k < 1 << n; k++) {
						if (k == 1 << (bit + 1)) {
							++bit;
						}
						sums[k] = max(sums[k], csums[k] = csums[k ^ (1 << bit)] + a[(bit + j) % n][i]);
					}
				}
				for (int mask1 = 0; mask1 < 1 << n; mask1++) {
					int cdyn = dynNext[mask1];
					for (int mask2 = mask1;; mask2 = (mask2 - 1) & mask1)... What is the time complexity of the previous code?
targets: np
inputs: import java.io.*;
import java.util.Arrays;
import java.util.Random;

public class ProblemC {
  
  public static void main(String[] args) throws IOException {
    init();
    new ProblemC().run();
    out.flush();
    out.close();
  }
  
  static void init() throws IOException {
    in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    out = new PrintWriter(new OutputStreamWriter(System.out));
    in.ordinaryChars(0, 65535);
    in.wordChars(0, 65535);
    in.whitespaceChars(' ', ' ');
    in.whitespaceChars('\n', '\n');
    in.whitespaceChars('\r', '\r');
  }
  
  // класс для пар
  class Pair<L, R> {
    private final L X;
    private final R Y;
    
    public Pair(L X, R Y) {
      this.X = X;
      this.Y = Y;
    }
    
    public L getX() {
      return X;
    }
    
    public R getY() {
      return Y;
    }
    
    @Override
    public int hashCode() {
      return X.hashCode() ^ Y.hashCode();
    }
    
    @Override
    public boolean equals(Object o) {
      if (!(o instanceof Pair)) return false;
      Pair pairo = (Pair) o;
      return X.equals(pairo.getX()) && Y.equals(pairo.getY());
    }
  }
  
  static final long INFL = 200000000000000000L;
  static final int INF = 2000000000;
  static final boolean DEBUG = true;
  
  static StreamTokenizer in;
  static PrintWriter out;
  
  static void print(String s) {
    print(s, 0);
  }
  
  static void print(String s, int debug) {
    if (debug == 0 || DEBUG) {
      out.print(s);
    }
  }
  
  static void println(String s) {
    println(s, 0);
  }
  
  static void println(String s, int debug) {
    if (debug == 0 || DEBUG) {
      out.println(s);
    }
  }
  
  static void printArray(int[] arr) {
    println(Arrays.toString(arr));
  }
  
  static void printArray(char[] arr) {
    println(Arrays.toString(arr));
  }
  
  static void printArray(String[] arr) {
    println(Arrays.toString(arr));
  }
  
  static void sort(int[] a) {
    Random rnd = new Random();
    for (int i = a.length - 1; i > 0; i--) {
      int index... What is the time complexity of the previous code?
targets: linear
inputs: import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

public class C {

	static int K;
	static int sz[];
	static long vs[][];
	static long curSum[];
	static HashMap<Long, Integer> valToBucket;
	static long sum;
	static int maskIfPick[][];
	static int dp[];
	
	static int pickId[];
	static int newBox[];
	public static void main(String[] args) {
		FS in = new FS();
		K = in.nextInt();
		sz = new int[K];
		valToBucket = new HashMap<Long, Integer>();
		vs = new long[K][];
		curSum = new long[K];
		sum = 0;
		for(int i = 0; i < K; i++) {
			sz[i] = in.nextInt();
			vs[i] = new long[sz[i]];
			for(int j = 0; j < sz[i]; j++) {
				long v = in.nextLong();
				sum += v;
				curSum[i] += v;
				vs[i][j] = v;
				valToBucket.put(v, i);
			}
		}
		
		if(sum % K != 0) {
			System.out.println("No");
			return;
		}
		
		sum /= K;
		maskIfPick = new int[K][];
		//go through if i pick each node
		for(int i = 0; i < K; i++) {
			maskIfPick[i] = new int[sz[i]];
			for(int j = 0; j < sz[i]; j++) {
				
				int mask = (1<<i);
				boolean works = false;
				long curLookfor = (sum - (curSum[i]-vs[i][j]));
				while(true) {
					if(!valToBucket.containsKey(curLookfor)) break;
					int nextBucket = valToBucket.get(curLookfor);
					if(nextBucket == i) {
						works = curLookfor == vs[i][j];
						break;
					}
					else if((mask & (1<<nextBucket)) > 0) break;
					else {
						mask |= (1<<nextBucket);
						curLookfor = (sum - (curSum[nextBucket]-curLookfor));
					}
				}
				if(works) maskIfPick[i][j] = mask;
			}
		}
//		System.out.println("S= "+sum);
		dp = new int[1<<K];
		Arrays.fill(dp, -1);
		int res = go(0);
		if(res == 0) {
			System.out.println("No");
		}
		else {
			System.out.println("Yes");
			pickId = new int[K];
			newBox = new int[K];
			Arrays.fill(pickId, -1);
			buildback(0);
			for(int i = 0; i < K; i++) {
				System.out.println(vs[i][pickId[i]]+" "+(newBox[i]+1));
			}
		}
		
	}
	
	static void pick(int i, int 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.Arrays;
import java.util.Scanner;

public class C {

    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        sc.nextLine();
        int[] x = new int[n];
        
        int max=0, pos=-1;
        for(int i=0; i<n; i++) {
            x[i]=sc.nextInt();
            if (max<x[i]) {
                max=x[i];
                pos=i;
            }
        }
        x[pos] = (max==1) ? 2 : 1;
        
        Arrays.sort(x);

        for(int i=0; i<n; i++) 
            System.out.print(x[i]+" ");
    }
    
} 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.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;

@SuppressWarnings("unchecked")
public class P701A {

  Map<Character, Integer> cc = new HashMap(72);

  void add(char c) {
    cc.put(c, cc.getOrDefault(c, 0) + 1);
  }

  void rem(char c) {
    Integer cnt = cc.get(c) - 1;
    if (cnt != 0) {
      cc.put(c, cnt);
    } else {
      cc.remove(c);
    }
  }

  public void run() throws Exception {
    int n = nextInt();

    char [] s = next().toCharArray();
    BitSet bs = new BitSet();
    for (char c : s) {
      bs.set(c);
    }

    int t = bs.cardinality();
    
    int m = Integer.MAX_VALUE;
    for (int i = 0, j = 0; i < n; i++) {
      while ((j < n) && (cc.size() < t)) {
        add(s[j]);
        j++;
      }
      
      if (cc.size() == t) {
        m = Math.min(m, j - i);
      }
      
      rem(s[i]);
    }
    
    println(m);
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P701A().run();
    br.close();
    pw.close();
    System.err.println("\n[Time : " + (System.currentTimeMillis() - startTime) + " ms]");
  }

  static long startTime = System.currentTimeMillis();
  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char... Complexity:
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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class ProblemD {
	

	
	static int N;
	static boolean[][] graph;
	
	public static void main(String[] args) throws IOException {
		BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		String[] data = s.readLine().split(" ");
		int n = Integer.valueOf(data[0]);
		N = n;
		int m = Integer.valueOf(data[1]);
		graph = new boolean[n][n];
		for (int i = 0 ; i < m ; i++) {
			String[] line = s.readLine().split(" ");
			int a = Integer.valueOf(line[0])-1;
			int b = Integer.valueOf(line[1])-1;
			graph[a][b] = true;
			graph[b][a] = true;
		}
		
		long ans = 0;
		for (int i = 0 ; i < n ; i++) {
			ans += doit(i);
		}
		ans /= 2;
		
		out.println(ans);
		out.flush();
	}

	static long doit(int n) {
		long[][] dp = new long[1<<n][n];
		for (int i = 0 ; i < n ; i++) {
			if (graph[i][n]) {
				dp[1<<i][i] = 1;
			}
		}
		
		for (int i = 0 ; i < (1<<n) ; i++) {
			for (int j = 0 ; j < n ; j++) {
				if (dp[i][j] >= 1) {
					for (int k = 0 ; k < n ; k++) {
						if (graph[j][k] && (i & (1<<k)) == 0) {
							dp[i|1<<k][k] += dp[i][j];
						}
					}
				}
			}
		}
		
		long ret = 0;
		for (int i = 0 ; i < (1<<n) ; i++) {
			if (Integer.bitCount(i) >= 2) {
				for (int j = 0 ; j < n ; j++) {
					if (graph[j][n]) {
						ret += dp[i][j];
					}
				}
			}
		}
		return ret;
	}
	
	
	static void generateLarge() {
		System.out.println("19 171");
		for (int i = 1 ; i <= 19 ; i++) {
			for (int j = i+1 ; j <= 19 ; j++) {
				System.out.println(i + " " + j);
			}
		}
	}


	public static void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}
} Complexity:
targets: np
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author Mostafa
 */
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        System.out.println((n/2) *3);
    }

}
 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.*;
import java.util.*;

public class Main {
    Scanner cin = new Scanner(new BufferedInputStream(System.in));
    long n;
    long maxlcm;
    
    void run(){
    	n = cin.nextInt();
    	if(n == 1 || n ==2)
    		maxlcm = n;
    	else if(n >= 3){
            	if(n % 2 != 0){
    	           	maxlcm = n * (n-1) * (n - 2);
    	        }
            	else if(n%3 != 0)
            		maxlcm = n * (n - 1) * (n - 3);
            	else maxlcm = (n - 1) * (n - 2) * (n - 3);
    	}  
    	System.out.println(maxlcm);
    }

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

	}
} 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.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;
 
public class Solution35C {
        
        final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE")!=null;
        BufferedReader in;
        PrintWriter out;
        StringTokenizer tok = new StringTokenizer("");
        
        void init() throws FileNotFoundException{
                if (ONLINE_JUDGE){
            		in = new BufferedReader(new FileReader("input.txt"));
                    out = new PrintWriter("output.txt");
                }else{
                        in = new BufferedReader(new FileReader("input.txt"));
                        out = new PrintWriter("output.txt");
                }
        }
        
        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());
        }
        
        public static void main(String[] args){
                new Solution35C().run();
        }
        
        public void run(){
                try{
                        long t1 = System.currentTimeMillis();
                        init();
                        solve();
                        out.close();
                        long t2 = System.currentTimeMillis();
                        System.err.println("Time = "+(t2-t1));
                }catch (Exception e){
                        e.printStackTrace(System.err);
                        System.exit(-1);
                }
        }
        
        static class Utils {
 
                private Utils() {}
 
    ... What is the time complexity of the previous code?
targets: cubic
inputs: /**
 * DA-IICT
 * Author : Savaliya Sagar
 */
import java.io.*;
import java.math.*;
import java.util.*;

public class C817 {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve() {
		long n = nl();
		long s = nl();
		long l = 1;
		long r = n;
		long ans = 0;
		while(l<=r){
			long mid = (l+r)/2;
			long sum = 0;
			long temp = mid;
			while(temp!=0){
				sum += temp%10;
				temp/=10;
			}
			if(mid-sum<s){
				ans = mid;
				l = mid+1;
			}else
				r = mid - 1;
		}
		out.println(n-ans);
	}

	void run() throws Exception {
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		if (!INPUT.isEmpty())
			tr(System.currentTimeMillis() - s + "ms");
	}

	public static void main(String[] args) throws Exception {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new C817().run();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}, "1", 1 << 26).start();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

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

	private char nc() {
		return (char) skip();
	}

	private String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b !=
										// ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n) {
		char[] buf = new char[n];
		int b =... 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.util.*;
import java.io.*;
import java.math.*;

public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		BigInteger l = sc.nextBigInteger();
		BigInteger r = sc.nextBigInteger();
		BigInteger a = l.add(BigInteger.ZERO);
		while (a.compareTo(r) < 0) {
			BigInteger b = a.add(BigInteger.ONE);
			while (b.compareTo(r) < 0) {
				try {
					a.modInverse(b);
				} catch (ArithmeticException e) {
					b = b.add(BigInteger.ONE);
					continue;
				}
				BigInteger c = b.add(BigInteger.ONE);
				while (c.compareTo(r) <= 0) {
					try {
						b.modInverse(c);
						try {
							a.modInverse(c);
						} catch (ArithmeticException e) {
							System.out.printf("%s %s %s\n", a.toString(), b.toString(), c.toString());
							return;
						}
					} catch (ArithmeticException e) {
						
					}
					c = c.add(BigInteger.ONE);
				}
				b = b.add(BigInteger.ONE);
			}
			a = a.add(BigInteger.ONE);
		}
		System.out.println("-1");
	}
}

 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.*;
public class j
{
public static void main(String a[])throws IOException
{
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
int n=0,i=0,k=2;
String s="\0",r="\0";
s=b.readLine();
n=s.length()-1;
while(k<=s.length())
{
for(i=0;i<k;i++)
{
r=s.substring(i,i+n);
if(s.indexOf(r)!=s.lastIndexOf(r))
{
System.out.print(n);
System.exit(0);
}
}
k++;
n--;
}
System.out.print("0");
}
} Complexity:
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.*;
import java.lang.Math.*;
public class A111
{
     public static void main(String args[])throws Exception
     {
         Scanner in=new Scanner(System.in);
         // br=new BufferedReader(new InputStreamReader(System.in));
         PrintWriter pw=new PrintWriter(System.out);
         int n,i,j,k=0,l;
         n=in.nextInt();
         int a[]=new int[n];
         int sum=0,sum1=0;
         for(i=0;i<n;i++)
         {
            a[i]=in.nextInt(); 
            sum+=a[i];
            }
            Arrays.sort(a);
         for(j=n-1;j>=0;j--)
         {
             sum1+=a[j];
             k++;
             if(sum1*2>sum)
             break;
            }
            pw.println(k);
         pw.flush();
     }
} 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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;

public class D11 {

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

	public static void main(String[] args) throws IOException {
		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
		out = new PrintWriter(System.out);

		n = nextInt();
		m = nextInt();
		
		g = new boolean[n][n];
		for (int i = 0; i < m; i++) {
			int a = nextInt()-1, b = nextInt()-1;
			g[a][b] = g[b][a] = true;
		}
		
		long ans = 0;
		for (int i = n; i > 0; i--) {
			//long cur = solve(i);
			long cur = calc(g, i-1);
			ans += cur;
		}
		
		out.println(ans/2);
		
		out.flush();
	}

	static int n, m, V;
	static boolean[][] g;
	
	/*static long solve(int V) {
		int v = V-1;
		long[][] memo = new long[V][1 << V];
		
		memo[v][1 << v] = 1;
		for (int mask = 1; mask < (1 << V); mask++)
			for (int i = 0; i < V; i++) if ((mask&(1 << i)) != 0)
				for (int j = 0; j < V; j++) if (g[i][j] && (mask&(1 << j)) == 0)
					memo[j][mask|(1 << j)] += memo[i][mask];
		
		long res = 0;
		for (int mask = 1; mask < (1 << V); mask++)
			for (int i = 0; i < V; i++)
				if (Integer.bitCount(mask) > 2 && g[v][i]) res += memo[i][mask];
		return res/2;
	}*/
	
	static long calc(boolean[][] bs,int n){
        long[][] dp=new long[1<<n][n];
        for(int i=0;i<n;i++){
                if(bs[i][n])
                        dp[1<<i][i] ++;
        }
        for(int i=1;i<1<<n;i++){
                for(int j=0;j<n;j++)if(((i>>j)&1)==1)
                        for(int k=0;k<n;k++)if(((i>>k)&1)==0 && bs[j][k]){//add
                                dp[i|(1<<k)][k] += dp[i][j];
                        }
        }
        long res=0;
        for(int i=0;i<1<<n;i++)for(int... 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.*;
import java.util.StringTokenizer;

public class Main {
    static double [] res;
    static double r;
    static double solve (int xMe, int xHim, int idxHim) {
        if (Math.abs(xMe - xHim) > 2 * r) return r;
        double hisY = res[idxHim];
        double lo = hisY, hi = hisY + 2 * r, best = hi;
        for (int cnt = 0; cnt <= 50; cnt++) {
            double myY = (lo) + ((hi - lo) / 2);
            if (notIntersect(xMe, myY, xHim, hisY)) {
                best = Math.min(best, myY);
                hi = Math.max(lo, myY);
            } else
                lo = Math.min(hi, myY);
        }
        return best;
    }
    static boolean notIntersect (double x1, double y1, double x2, double y2) {
        return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) >= 2 * r  * 2 * r;
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        res = new double[n];
        r = sc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++)
            x[i] = sc.nextInt();

        for (int i = 0; i < n; i++) {
            double max = r;
            for (int j = 0; j < i; j++) {
                max = Math.max(max, solve(x[i], x[j], j));
            }
            if (i > 0) out.print(" ");
            res[i] = max;
            out.printf("%.10f", max);
        }
        out.println();

        out.flush();
        out.close();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public Scanner(FileReader s) throws FileNotFoundException {	br = new BufferedReader(s);}

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

        public int nextInt()... 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.io.*;
import java.util.*;

public class LookingForOrder
{
	public Scanner in = new Scanner(System.in);
	public PrintStream out = System.out;

	public int[] go;
	public int[][] cost;
	
	public int [] sol;
	public Pair[] how;
	public int n, lim;
	
	public Pair bag;
	public Pair[] obj;
	
	public void main()
	{		
		bag = new Pair(in.nextInt(), in.nextInt());
		
		n = in.nextInt();
		obj = new Pair[n];
		for(int i=0;i<n;++i) obj[i] = new Pair(in.nextInt(), in.nextInt());
		
		go = new int[n];
		cost = new int[n][n];
		for(int i=0;i<n;++i)
		{
			go[i] = squDist(bag, obj[i]);
			for(int j=0;j<n;++j) cost[i][j] = squDist(obj[i], obj[j]);
		}
		
		lim = (1<<n);
		
		sol = new int[lim];
		Arrays.fill(sol, -1);
		how = new Pair[lim];
		
		out.println(solve(lim-1));
		
		Pair T;
		int set = lim-1;
		
		out.print("0");
		while(set > 0)
		{
			solve(set);
			T = how[set];
			out.print(" "+(T.x+1));
			set = off(T.x, set);
			if(T.y >= 0) 
			{
				out.print(" " + (T.y+1));
				set = off(T.y, set);
			}
			out.print(" 0");
		}
		out.println();
	}//end public void main()

	public int oo = 987654321;
	
	public boolean in(int x, int set) { return ((1<<x) & set) != 0; }
	//Turn on bit x
	public int on(int x, int set) { return (set | (1<<x)); }
	//Turn off bit x
	public int off(int x, int set) { return (set ^ (set & (1<<x)) ); }
    
	
	public int solve(int set)
	{
		if(sol[set] >= 0) return sol[set];
		
		int ret;
		if(set == 0) ret = 0;
		else
		{
			ret = oo;
			
			int x, y, sub, c;
			for(x=0;x<n;++x) if(in(x, set)) break;
			
			sub = off(x, set);
			c =  go[x]+go[x]+solve(sub);
			
			if(c < ret)
			{
				how[set] = new Pair(x, -1);
				ret = c;
			}
			
			for(y=x+1;y<n;++y) if(in(y, set))
			{
				c = go[x]+cost[x][y]+go[y] + solve(off(y, sub));
				if(c < ret)
				{
					ret = c;
					how[set] = new Pair(x, y);
				}
			}
		}
		
		return sol[set] = ret;
	}
	
	public int squDist(int ax, int ay, int bx, int by)
	{
		int dx, dy;
		dx = ax - bx; 
		dy = ay - by;
		return dx*dx + dy*dy;
	}
	
	public int... Complexity:
targets: np
inputs: import java.util.*;
import java.io.*;


public class Solution{
 
	public static Integer INT(String s){
		return Integer.parseInt(s);
	}
 
	public static Long LONG(String s){
		return Long.parseLong(s);
	}
 
	//====================================================================================================================
 
 
 	

	public static void main(String args[])throws IOException{
 
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));	Scanner in=new Scanner(System.in);	StringBuilder out=new StringBuilder();
 
		long n=in.nextLong(),
			 k=in.nextLong();

		long a=1,
			 b=3,
			 c=-2*(n+k);
		
		long r1=(-b+(long)Math.sqrt(b*b-4*a*c))/(2*a);
		long r2=(-b-(long)Math.sqrt(b*b-4*a*c))/(2*a);

		System.out.println(n-Math.max(r1, r2));
	}
} What is the time complexity of the previous code?
targets: logn
inputs: import java.util.*;
import java.io.*;

public class MotherOfDragons {
    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        PrintWriter out = new PrintWriter(System.out, false);
        int n = scanner.nextInt();
        double k = scanner.nextInt();
        long[] graph = new long[n];
        for(int i = 0; i < n; i++) {
            for(int j =0; j < n; j++) {
                int val = scanner.nextInt();
                if (val == 1 || i == j) graph[i] |= 1L << j;
            }
        }
        //meet in the middle approach
        int szLeft = n/2;
        int szRight = n - szLeft;
        //max size of clique
        int[] dp = new int[1 << szLeft];
        int maxMask = 1 << szLeft;
        //iterate over every left mask
        for(int mask = 1; mask <maxMask; mask++) {
            int curMask = mask;
            //go over every bit in the mask
            for(int j = 0; j < szLeft; j++) {
                if (((1 << j) & mask) > 0) {
                    //update the union of reachability
                    curMask &= graph[j + szRight] >> szRight;
                    //can also attempt to pull from prev mask for max size
                    //will not be optimal if end update happens, but otherwise is useful for dp
                    dp[mask] = Math.max(dp[mask], dp[mask ^ (1 << j)]);
                }
            }
            //if the union of connectedness is the starting mask then we have a clique
            if (mask == curMask) {
                dp[mask] = Math.max(dp[mask],Integer.bitCount(mask));
            }
        }
        int ans = 0;
        int rmaxMask = 1 << szRight;
        for(int mask = 0; mask < rmaxMask; mask++) {
            //mask to track if the current creates its own clique
            int curMask = mask;
            //mask to track the connection between the halves
            int oMask = maxMask -1;
            for(int j = 0; j < szRight; j++) {
                if (((1 << j) & mask) > 0) {
                    //need to mask... What is the time complexity of the previous code?
targets: np
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. /**
 * BaZ :D
 */
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main
{
    static Reader scan;
    static PrintWriter pw;
    static int n,k,left[],right[],arr[];
    static long MOD = 1000000007,count[],dp[];
    public static void main(String[] args) {
        new Thread(null,null,"BaZ",1<<25)
        {
            public void run()
            {
                try
                {
                    solve();
                }
                catch(Exception e)
                {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }
    static void solve() throws IOException
    {
        scan = new Reader();
        pw = new PrintWriter(System.out,true);
        StringBuilder sb = new StringBuilder();
        n = ni();
        k = ni();
        int stack[] = new int[1000001];
        int top = -1;
        arr = new int[n];
        left = new int[n];
        right = new int[n];
        for(int i=0;i<n;++i) {
            arr[i] = ni();
            while(top>=0 && arr[stack[top]]<=arr[i])
                top--;
            if(top==-1)
                left[i] = 0;
            else left[i] = stack[top]+1;
            stack[++top] = i;
        }
        top = -1;
        for(int i=n-1;i>=0;--i) {
            while(top>=0 && arr[stack[top]]<arr[i])
                top--;
            if(top==-1)
                right[i] = n-1;
            else right[i] = stack[top]-1;
            stack[++top] = i;
        }
        //pa("left", left);
        //pa("right", right);
        dp = new long[n+1];
        for(int i=0;i<=n;++i) {
            if(i<k)
              continue;
            dp[i] = dp[i-k+1] + (i-k+1);
        }
        count = new long[n];
        long ans = 0;
        for(int i=0;i<n;++i) {
            int len = right[i]-left[i]+1;
            int lef = i-left[i];
            int rig = right[i]-i;
            long count = dp[len] - dp[lef] - dp[rig];
            if(count>=MOD)
             ... Complexity:
targets: linear
inputs: import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

public class Main {
	public static void main(String[] args) throws IOException {
//		try {
//			if (new File("input.txt").exists())
//				System.setIn(new FileInputStream("input.txt"));
//		} catch (SecurityException e) {}
		
//		long time1 = System.currentTimeMillis();
		new Main().run();
//		checkMemory();
//		long time2 = System.currentTimeMillis();
//		System.err.println((time2 - time1) + " ms");
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	int vNum;
	int eNum;
	boolean[][] g;
	
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		vNum = nextInt();
		eNum = nextInt();
		g = new boolean [vNum][vNum];
		for (int e = 0; e < eNum; e++) {
			int u = nextInt() - 1;
			int v = nextInt() - 1;
			g[u][v] = g[v][u] = true;
		}
		
//		for (int v = 7; v <= 11; v++) {
//			genFullGraph(v);
//			if (naiveDP() != optimizedDP())
//				System.err.println("Error on " + v);
//		}
		
		out.println(optimizedDP());
		
		out.close();
	}
	
	/*************************************************************** 
	 * Test
	 **************************************************************/
	long naiveDP() {
		long[] count = new long [vNum + 1];
		int size = 1 << vNum;
		long[][] dp = new long [size][vNum];
		for (int begin = 0; begin < vNum; begin++) {
			for (long[] row : dp) fill(row, 0L);
			dp[1 << begin][begin] = 1L;
			for (int mask = 0; mask < size; mask++) {
				int len = Integer.bitCount(mask);
				for (int v = 0; v < vNum; v++) {
					long cval = dp[mask][v];
					if (cval == 0L) continue;
					if (g[v][begin]) count[len] += cval;
					for (int nv = 0; nv < vNum; nv++) {
						if (g[v][nv]) {
							int nmask = mask | (1 << nv);
							if (nmask != mask)
								dp[nmask][nv] +=... 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.Scanner;


public class A_IQTest {

    static int n;

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        
        int[] nums = new int[n];
        
        for (int i = 0; i < n; i++) {
            nums[i] = s.nextInt();
        }
        
        
        int ei = -1;
        int oi = -1;
        int ecnt = 0;
        int ocnt = 0;
        for (int i = 0; i < n; i++) {
            if(nums[i] % 2 == 0){
                ei = i;
                ecnt++;
            }else{
                oi = i;
                ocnt++;
            }
        }
        if(ecnt == 1){
            System.out.println(ei+1);
        }else{
            System.out.println(oi+1);
        }
    }

}
 What is the time complexity of the previous code?
targets: linear
inputs: import java.io.*;
        import java.math.BigInteger;
        import java.util.*;
        
        public class Main {
         
            static final double eps = 1e-8;
            
            public static void main(String[] args) throws IOException {
                try {
                    
                       int n = nextInt();
                       int k = nextInt();
                       int[] a = new int[n];
                       int[] d = new int[n];
                       int[] dr = new int[n];
                       boolean used[] = new boolean[100001];
                       a[0] = nextInt();
                       used[ a[0] ] = true;
                       d[0] = 1;
                       for(int i = 1; i < n; i++)
                       {
                           a[i] = nextInt();
                           if(!used[ a[i] ])
                           {
                               used[ a[i] ] = true;
                               d[i] = d[i - 1] + 1;
                           }
                           else
                           {
                               d[i] = d[i - 1];
                           }
                       }
                       Arrays.fill(used, false);

                       
                       int r = Arrays.binarySearch(d, k);
                       
                       if(r < 0)
                       {
                           pw.println("-1 -1");
                           return;
                       }
        
                       while( r > 0 && d[r] == d[r - 1] )
                           r--;
                       
                       used[ a[r] ] = true;
                       dr[r] = 1;
                       for(int i = r - 1; i >= 0; i--)
                       {
                           if(!used[ a[i] ])
                           {
                               used[ a[i] ] = true;
                               dr[i] = dr[i + 1] + 1;
                           }
                           else
 ... What is the time complexity of the previous code?
targets: linear
inputs: //Author: Patel Rag
//Java version "1.8.0_211"
import java.util.*;
import java.io.*;

public class Main
{
  static class FastReader
  {
    BufferedReader br;
    StringTokenizer st;

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

    String next()
    {
      while (st == null || !st.hasMoreElements())
      {
        try
        {
          st = new StringTokenizer(br.readLine());
        }
        catch (IOException  e)
        {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

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

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

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

    float nextFloat() { return Float.parseFloat(next()); }

    boolean nextBoolean() { return Boolean.parseBoolean(next()); }

    String nextLine()
    {
      String str = "";
      try
      {
        str = br.readLine();
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
      return str;
    }
  }
  static long modExp(long x, long n, long mod)    //binary Modular exponentiation
  {
    long result = 1;
    while(n > 0)
    {
        if(n % 2 == 1)
            result = (result%mod * x%mod)%mod;
        x = (x%mod * x%mod)%mod;
        n=n/2;
    }
    return result;
  }
  static long gcd(long a, long b)
  {
    if(a==0) return b;
    return gcd(b%a,a);
  }
  public static void main(String[] args)
  throws IOException
  {
    FastReader fr = new FastReader();
    long n = fr.nextLong();
    long x = fr.nextLong();
    long y = fr.nextLong();
    long w = Long.min(x,y) - 1 + (x - Long.min(x,y)) + (y - Long.min(x,y));
    long b = n - Long.max(x,y) + (Long.max(x,y) - x) + (Long.max(x,y) - y);
    if(w <= b) System.out.println("White");
    else System.out.println("Black");

  }
}
class Pair<U, V>  // Pair class
{
    public final U first;       // first field of a Pair
    public final V second;      // second field of a Pair

    private Pair(U first, V... 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.OutputStream;
import java.util.stream.IntStream;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.nio.charset.Charset;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.io.InputStream;

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

    static class APaintTheNumbers {
        public void solve(int testNumber, LightScanner in, LightWriter out) {
            // out.setBoolLabel(LightWriter.BoolLabel.YES_NO_FIRST_UP);
            int n = in.ints();
            int[] a = in.ints(n);
            IntroSort.sort(a);
            boolean[] done = new boolean[n];
            int ans = 0;
            for (int i = 0; i < n; i++) {
                if (done[i]) continue;
                int d = a[i];
                ans++;
                for (int j = 0; j < n; j++) {
                    if (a[j] % d == 0) {
                        done[j] = true;
                    }
                }
            }
            out.ans(ans).ln();
        }

    }

    static class IntroSort {
        private static int INSERTIONSORT_THRESHOLD = 16;

        private IntroSort() {
        }

        static void sort(int[] a, int low, int high, int maxDepth) {
            while (high - low > INSERTIONSORT_THRESHOLD) {
                if (maxDepth-- == 0) {
                    HeapSort.sort(a, low, high);
                    return;
        ... Complexity:
targets: quadratic