Muennighoff/xP3x-sample huggingface dataset:
inputs: import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class E implements Runnable {
	public static void main (String[] args) {new Thread(null, new E(), "_cf", 1 << 28).start();}

	int n, m;
	char[] str;
	int[][] occs, cost;
	int[] dp;
	
	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");

		//where's my 420???? :(
		
		n = fs.nextInt(); m = fs.nextInt();
		byte[] str = fs.next().getBytes();
		int[] occs = new int[1<<m];
		for(int i = 0; i < n-1; i++) {
			int l1 = str[i] - 'a';
			int l2 = str[i+1] - 'a';
			occs[(1<<l1) | (1<<l2)]++;
			occs[(1<<l2) | (1<<l1)]++;
		}
		//cost[mask][v] = numPairs with v for some all bits on in mask
		int all = (1<<m)-1;
		cost = new int[m][1<<m];
		for(int i = 0; i < m; i++) {
			for(int mask = 1; mask < all; mask++) {
				if(((1<<i)&mask) > 0) continue;
				int lb = mask & (-mask);
				int trail = Integer.numberOfTrailingZeros(lb);
				int nmask = mask ^ lb;
				cost[i][mask] = cost[i][nmask]+occs[1<<i | 1<<trail];
			}
		}
		
		dp = new int[1<<m];
		for(int mask = dp.length-2; mask >= 0; mask--) {
			int addOn = 0;
			for(int nxt = 0; nxt < m; nxt++) {
				if(((1<<nxt)&mask) > 0) continue;
				addOn += cost[nxt][mask];
			}
			int res = oo;
			for(int nxt = 0; nxt < m; nxt++) {
				if(((1<<nxt)&mask) > 0) continue;
				int ret = addOn+dp[mask | (1<<nxt)];
				res = min(res, ret);
			}
			dp[mask] = res;
		}
		
		System.out.println(dp[0]>>1);
		
		out.close();
	}
	
	int oo = (int)1e9;
	int min(int a, int b) {
		if(a < b) return a;
		return b;
	}
	
	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) {
			try {
				in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
			}
			catch (Exception e) {
				in = new... 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: /**
 * @author derrick20
 */
import java.io.*;
import java.util.*;

public class SameSumBlocks {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        int N = sc.nextInt();
        int[] pre = new int[N + 1];
        for (int i = 1; i <= N; i++) {
            pre[i] = pre[i - 1] + sc.nextInt();
        }
//        var sumMap = new HashMap<Integer, ArrayList<Pair>>();
        var sums = new ArrayList<Pair>();
        for (int i = 1; i <= N; i++) {
            for (int j = i; j <= N; j++) {
                int sum = pre[j] - pre[i - 1];
//                sumMap.computeIfAbsent(sum, val -> new ArrayList<>()).add(new Pair(i, j, sum));
                sums.add(new Pair(i, j, sum));
            }
        }
        Collections.sort(sums, (p1, p2) -> p1.sum - p2.sum != 0 ? p1.sum - p2.sum : p1.r - p2.r);
        var ans = new ArrayList<Pair>();
        int i = 0;
        while (i < sums.size()) {
            int j = i;
            var group = new ArrayList(List.of(sums.get(i)));
            int last = sums.get(i).r;
            while (j + 1 < sums.size() && sums.get(j + 1).sum == sums.get(j).sum) {
                if (sums.get(j + 1).l > last) {
                    group.add(sums.get(j + 1));
                    last = sums.get(j + 1).r;
                }
                j++;
            }
//            System.out.println(group);
            if (group.size() > ans.size()) {
                ans = group;
            }
            i = j + 1;
        }
        out.println(ans.size());
        for (Pair p : ans) {
            out.println(p);
        }
        out.close();
    }

    static class Pair {
        int l, r, sum;
        public Pair(int ll, int rr, int ss) {
            l = ll; r = rr; sum = ss;
        }
        public String toString() {
            return l + " " + r;
        }
    }

    static class FastScanner {
        private int BS = 1<<16;
        private char NC = (char)0;
       ... What is the time complexity of the previous code?
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.util.*;
import java.math.*;

public class Solution implements Runnable {
	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;
	private Random rnd;
	
	double Vend;
	
	private double calcFirstSegment(double a, double Vmax, double Vend, double l) {
		double Vl = 0, Vr = Vmax;
		
		for(int it = 0; it < 256; it++) {
			double Vm = (Vl + Vr) / 2.0;
			
			double tFirst = Vm / a;
			
			double tSecond = 0;
			if(Vend < Vm) tSecond = (Vm - Vend) / a;
			
			double firstPart = a * tFirst * tFirst / 2.0;
			double secondPart = Vm * tSecond - a * tSecond * tSecond / 2.0;
			
			double res = firstPart + secondPart;
			
			if(res < l) Vl = Vm;
			else Vr = Vm;
		}
		
		this.Vend = Math.min(Vl, Vend);
		
		double res = 0.0;
		
		{
			double Vm = Vl;
			
			double tFirst = Vm / a;
			double tSecond = 0;
			if(Vend < Vm) tSecond = (Vm - Vend) / a;
			
			//out.println(tSecond);
			
			double firstPart = a * tFirst * tFirst / 2.0;
			double secondPart = Vm * tSecond - a * tSecond * tSecond / 2.0;
			
			double remain = l - firstPart - secondPart;
			
			res = tFirst + tSecond + (remain / Vm);
		}
		
		return res;
	}
	
	private double calcSecondPart(double a, double Vmax, double Vstart, double l) {
		double Vl = Vstart, Vr = Vmax;
		
		//out.println(Vstart);
		
		for(int it = 0; it < 256; it++) {
			double Vm = (Vl + Vr) / 2.0;
			double t = (Vm - Vstart) / a;
			
			double s = Vstart * t + a * t * t / 2.0;
			
			if(s < l) Vl = Vm;
			else Vr = Vm;
		}
		
		double res = 0.0;
		
		{
			double Vm = (Vl + Vr) / 2.0;
			double t = (Vm - Vstart) / a;
			
			double s = Vstart * t + a * t * t / 2.0;
			
			double remain = l - s;
			
			res = t + (remain / Vmax);
		}
		
		return res;
	}
	
	public void solve() throws IOException {
		double a = nextDouble(), v = nextDouble(), l = nextDouble(), d = nextDouble(), w = nextDouble();
		
		double res = calcFirstSegment(a, v, w, d);
		res += calcSecondPart(a, v, Vend, l - d);
		
		out.println(res);
	}
		
	public static void... Complexity:
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;

public class SimpleTask {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		boolean[][] graph = new boolean[n][n];
		for (int i = 0; i < m; i++) {
			int u = scan.nextInt() - 1;
			int v = scan.nextInt() - 1;
			graph[u][v] = true;
			graph[v][u] = true;
		}

		long[][] dp = new long[1 << n][n];
		long sum = 0;

		for (int i = 0; i < n; i++)
			dp[1 << i][i] = 1;

		for (int mask = 1; mask < (1 << n); mask++) {

			int first = Integer.numberOfTrailingZeros(mask);

			for (int i = 0; i < n; i++) {
				if ((mask & (1 << i)) == 0 || first == i)
					continue;

				for (int j = 0; j < n; j++) {
					if (graph[i][j] && (mask & (1 << j)) != 0)
						dp[mask][i] += dp[mask ^ 1 << i][j];
				}

				if (Integer.bitCount(mask) >= 3 && graph[i][first])
					sum += dp[mask][i];
			}

		}

		System.out.println(sum / 2);
		scan.close();
	}
}
 Complexity:
targets: np
inputs: import java.util.*;

public class ErrorCorrectSystem
{

	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String a = scan.next();
		String b = scan.next();
		
		int[][] mismatch = new int[26][26];
		for(int i = 0; i < 26; i++) Arrays.fill(mismatch[i], -1);
		int[][] pair = new int[2][26];
		for(int i = 0; i < 2; i++) Arrays.fill(pair[i], -1);
		int hd = 0;
		for(int i = 0; i < n; i++) {
			if(a.charAt(i) != b.charAt(i)) {
				hd++;
				mismatch[a.charAt(i)-'a'][b.charAt(i)-'a'] = i;
				pair[0][a.charAt(i)-'a'] = i;
				pair[1][b.charAt(i)-'a'] = i;
			}
		}
		for(int i = 0; i < 26; i++) {
			for(int j = i+1; j < 26; j++) {
				if(mismatch[i][j] > -1 && mismatch[j][i] > -1) {
					System.out.println(hd-2);
					System.out.println((mismatch[i][j]+1)+" "+(mismatch[j][i]+1));
					return;
				}
			}
		}
		for(int i = 0; i < n; i++) {
			if(a.charAt(i) != b.charAt(i)) {
				//try a gets b's letter
				if(pair[0][b.charAt(i)-'a'] > -1) {
					System.out.println(hd-1);
					System.out.println((i+1)+" "+(pair[0][b.charAt(i)-'a']+1));
					return;
				}
			}
		}
		
		System.out.println(hd);
		System.out.println("-1 -1");
	}

}
 What is the time complexity of the previous code?
targets: linear
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class A {
    static MyScanner sc;
    static PrintWriter pw;

    public static void main(String[] args) throws Throwable {
        sc = new MyScanner();
        pw = new PrintWriter(System.out);

        n = sc.nextInt();
        int m = sc.nextInt();
        int[][] a = new int[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                a[i][j] = sc.nextInt();
        val = new int[n][n];
        for (int i = 0; i < n; i++)
            Arrays.fill(val[i], Integer.MAX_VALUE);
        for (int i = 0; i < n; i++)
            for (int j = i; j < n; j++) {
                for (int k = 0; k < m; k++)
                    val[i][j] = val[j][i] = Math.min(val[i][j], Math.abs(a[i][k] - a[j][k]));
            }

        val2 = new int[n][n];
        for (int i = 0; i < n; i++)
            Arrays.fill(val2[i], Integer.MAX_VALUE);
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++) {
                for (int k = 0; k < m - 1; k++)
                    val2[i][j] = Math.min(val2[i][j], Math.abs(a[i][k] - a[j][k + 1]));
            }
        mem = new Integer[n][n][1 << n];
        int ans = 0;
        for (int i = 0; i < n; i++) {
            ans = Math.max(ans, dp(i, i, 1 << i));
        }
        if (n == 1)
            pw.println(val2[0][0]);
        else
            pw.println(ans);


        pw.flush();
        pw.close();
    }

    static int n;
    static int[][] val, val2;
    static Integer[][][] mem;

    static int dp(int st, int lst, int msk) {
        int bits = Integer.bitCount(msk);
        if (mem[st][lst][msk] != null)
            return mem[st][lst][msk];
        int ans = 0;
        for (int i = 0; i < n; i++)
            if ((msk & (1 << i)) == 0) {
                int newMsk = (msk | (1 << i));
                if (bits < n - 1)
                    ans = Math.max(ans, Math.min(val[lst][i], dp(st, i, newMsk)));
                else
                    ans =... 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.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class P111C{
	Scanner sc=new Scanner(System.in);

	int INF=1<<28;
	double EPS=1e-9;

	int h, w;

	void run(){
		h=sc.nextInt();
		w=sc.nextInt();
		solve();
	}

	void shuffle(int[] is){
		Random rand=new Random();
		for(int i=is.length-1; i>=1; i--){
			int j=rand.nextInt(i+1);
			int t=is[i];
			is[i]=is[j];
			is[j]=t;
		}
	}

	void solve(){
		n=w*h;
		g=new long[n];
		int[] dx={0, 0, -1, 1};
		int[] dy={-1, 1, 0, 0};
		for(int y=0; y<h; y++){
			for(int x=0; x<w; x++){
				for(int k=0; k<4; k++){
					int x2=x+dx[k];
					int y2=y+dy[k];
					if(x2>=0&&x2<w&&y2>=0&&y2<h){
						g[y*w+x]|=1L<<(y2*w+x2);
					}
				}
			}
		}
		candidate=new int[n];
		mds=(1L<<n)-1;
		mds(0, 0, 0);
		println((n-Long.bitCount(mds))+"");
	}

	int n;
	long[] g;
	long mds;
	int[] candidate;

	void mds(long choosed, long removed, long covered){
		if(Long.bitCount(choosed)>=Long.bitCount(mds))
			return;

		if(covered==((1L<<n)-1)){
			if(Long.bitCount(choosed)<Long.bitCount(mds))
				mds=choosed;
			return;
		}

		long s=covered;
		for(long remained=~removed&((1L<<n)-1); remained!=0; remained&=remained-1){
			int i=Long.numberOfTrailingZeros(remained);
			s|=(1L<<i)|g[i];
		}
		if(s!=((1L<<n)-1))
			return;

		int k=-1;
		for(long remained=~removed&((1L<<n)-1); remained!=0; remained&=remained-1){
			int i=Long.numberOfTrailingZeros(remained);
			if((covered>>>i&1)==1){
				if(Long.bitCount(g[i]&~covered)==0){
					mds(choosed, removed|(1L<<i), covered);
					return;
				}else if(Long.bitCount(g[i]&~covered)==1
						&&(g[i]&~covered&~removed)!=0){
					mds(choosed, removed|(1L<<i), covered);
					return;
				}
			}else{
				if(Long.bitCount(g[i]&~removed)==0){
					mds(choosed|(1L<<i), removed|(1L<<i), covered|(1L<<i)|g[i]);
					return;
				}else... Complexity:
targets: np
inputs: import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;


public class Main {
	static int n, m, k;
	static int inf = (int) 1e9;
	static class Pair {
		int x, y;
		Pair(int a, int b) {
			x = a; y = b;
		}
	}
	static int[] dx = {1, -1, 0, 0}, dy = {0, 0, 1, -1};
	static boolean valid(int x, int y) {
		return x >= 0 && x < n && y >= 0 && y < m;
	}
	static int[][] bfs(int[] xs, int[] ys) {
		int[][] dist = new int[n][m];
		for(int i = 0; i < n; i++)
			Arrays.fill(dist[i], inf);
		Queue<Pair> q = new LinkedList<>();
		for(int i = 0; i < k; i++) {
			dist[xs[i]][ys[i]] = 0;
			q.add(new Pair(xs[i], ys[i]));
		}

		while(!q.isEmpty()) {
			Pair p = q.remove();
			for(int d = 0; d < 4; d++) {
				int nx = p.x + dx[d], ny = p.y + dy[d];
				if(valid(nx, ny) && dist[nx][ny] == inf) {
					dist[nx][ny] = dist[p.x][p.y] + 1;
					q.add(new Pair(nx, ny));
				}
			}
		}

		return dist;
	}

	public static void main(String[] args) throws IOException {
		Scanner in = new Scanner();
		int n = in.nextInt() ; 
		int m = in.nextInt(); 
		int k = in.nextInt(); 
		int x[] = new int[k] ; 
		int y[] = new int[k] ; 
		int trees [][] = new int [n][m] ;


		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				trees[i][j]=Integer.MAX_VALUE ;

		for (int i = 0; i < k; i++)
		{
			x[i]=in.nextInt()-1; 
			y[i]=in.nextInt()-1;
			trees[x[i]][y[i]]=0 ;
		}

		int dis = Integer.MIN_VALUE ; ;
		int xp=0; ;
		int yp=0;
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				if(trees[i][j] != 0)
					for (int j2 = 0; j2 < k; j2++)
						trees[i][j]=Math.min(trees[i][j], Math.abs(i-x[j2])+Math.abs(j-y[j2]));

		for (int i = 0; i <n; i++)
			for (int j = 0; j < m; j++)
				if(trees[i][j] > dis)
				{
					dis=trees[i][j];
					xp=i+1;
					yp=j+1;
				}
		PrintWriter out = new PrintWriter("output.txt");
		out.printf("%d... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: cubic
inputs: import java.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));
	}
} What is the time complexity of the previous code?
targets: np
inputs: import java.io.*;
import java.util.*;

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

	static final int A = 10000000, K = 20;
	int[] cc = new int[A + 1]; {
		boolean[] composite = new boolean[A + 1];
		for (int a = 1; a <= A; a++)
			cc[a] = a;
		for (int a = 2; a <= A; a++) {
			if (composite[a])
				continue;
			for (int b = a + a; b <= A; b += a)
				composite[b] = true;
			if (a <= A / a) {
				int a2 = a * a;
				for (int b = a2; b <= A; b += a2) {
					int c = cc[b];
					while (c % a2 == 0)
						c /= a2;
					cc[b] = c;
				}
			}
		}
	}
	void main() {
		int[] pp = new int[A + 1]; Arrays.fill(pp, -1);
		int t = sc.nextInt();
		while (t-- > 0) {
			int n = sc.nextInt();
			int k = sc.nextInt();
			int[] aa = new int[n];
			for (int i = 0; i < n; i++)
				aa[i] = cc[sc.nextInt()];
			int[] mp = new int[k + 1];
			int[] ip = new int[k + 1];
			for (int i = 0; i < n; i++) {
				int a = aa[i];
				for (int h = k; h >= 0; h--) {
					if (pp[a] >= ip[h]) {
						mp[h]++;
						ip[h] = i;
					}
					if (h > 0 && (mp[h - 1] < mp[h] || mp[h - 1] == mp[h] && ip[h - 1] > ip[h])) {
						mp[h] = mp[h - 1];
						ip[h] = ip[h - 1];
					}
				}
				pp[a] = i;
			}
			println(mp[k] + 1);
			for (int i = 0; i < n; i++) {
				int a = aa[i];
				pp[a] = -1;
			}
		}
	}
}
 What is the time complexity of the previous code?
targets: cubic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.util.*;

public class Main implements Runnable {
	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;
	
	private void eat(String line)
	{
		st = new StringTokenizer(line);
	}
	
	private String next() throws IOException
	{
		while(!st.hasMoreTokens()) {
			String line = in.readLine();
			if(line == null)
				return null;
			eat(line);
		}
		return st.nextToken();
	}
	
	private int nextInt() throws IOException
	{
		return Integer.parseInt(next());
	}
	
	public void run()
	{
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			eat("");
			
			go();
			
			out.close();
		} catch(Exception e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}
	
	public static void main(String[] args)
	{
		new Thread(new Main()).start();
	}
	
	public void go() throws IOException
	{
		int n = nextInt();
		int[] v = new int[n], count = new int[2];
		for(int i = 0; i < n; ++i) {
			v[i] = nextInt();
			++count[v[i] % 2];
		}
		int residue = count[0] == 1 ? 0 : 1;
		for(int i = 0; i < n; ++i)
			if(v[i] % 2 == residue)
				out.println(i + 1);
	}
}
 Complexity:
targets: linear
inputs: /**
 * Created by IntelliJ IDEA.
 * User: Taras_Brzezinsky
 * Date: 8/13/11
 * Time: 6:10 PM
 * To change this template use File | Settings | File Templates.
 */

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

public class DarkAssembly extends Thread {

    public DarkAssembly() {
        this.input = new BufferedReader(new InputStreamReader(System.in));
        this.output = new PrintWriter(System.out);
        this.setPriority(Thread.MAX_PRIORITY);
    }

    static class Senator {
        int loyalty;
        int level;

        public Senator(int level, int loyalty) {
            this.level = level;
            this.loyalty = loyalty;
        }
    }

    private static double doIt(Senator[] senators, int A) {
        double probability = .0;
        for (int mask = 0; mask < (1 << senators.length); ++mask) {
            int sum = A;
            double current = 1.0;
            for (int i = 0; i < senators.length; ++i) {
                if ((mask & (1 << i)) != 0) {
                    current *= .01 * senators[i].loyalty;
                } else {
                    current *= .01 * (100 - senators[i].loyalty);
                    sum += senators[i].level;
                }
            }
            if (getOnes(mask) > senators.length / 2) {
                probability += current;
            } else {
                probability += current * (double)A / sum;
            }
        }
        return probability;
    }

    private static double go(Senator []senators, int candies, int A, int current) {
        if (current == senators.length) {
            return doIt(senators, A);
        } else {
            double result = go(senators, candies, A, current + 1);
            if (candies > 0 && senators[current].loyalty < 100) {
                senators[current].loyalty += 10;
                result = Math.max(result, go(senators, candies - 1, A, current));
                senators[current].loyalty -= 10;
         ... What is the time complexity of the previous code?
targets: np
inputs: import java.io.*;
import java.util.*;

public class Main {
	private void run() throws IOException {
		int cx = in.nextInt();
		int cy = in.nextInt();
		int n = in.nextInt();
		int[] x = new int[n];
		int[] y = new int[n];
		for (int i = 0; i < n; ++i) {
			x[i] = in.nextInt() - cx;
			y[i] = in.nextInt() - cy;
		}
		int[] dp = new int[1 << n];
		Arrays.fill(dp, Integer.MAX_VALUE);
		dp[0] = 0;
		int[] prev = new int[1 << n];
		for (int mask = 0; mask < (1 << n); ++mask) {
			if (dp[mask] == Integer.MAX_VALUE) {
				continue;
			}
			for (int i = 0; i < n; ++i) {
				if (((mask >> i) & 1) == 0) {
					if (dp[mask | (1 << i)] > dp[mask] + dist(x[i], y[i])) {
						dp[mask | (1 << i)] = dp[mask] + dist(x[i], y[i]);
						prev[mask | (1 << i)] = mask;
					}
					for (int j = i + 1; j < n; ++j) {
						if (((mask >> j) & 1) == 0) {
							if (dp[mask | (1 << i) | (1 << j)] > dp[mask] + dist(x[i], y[i], x[j], y[j])) {
								dp[mask | (1 << i) | (1 << j)] = dp[mask] + dist(x[i], y[i], x[j], y[j]);
								prev[mask | (1 << i) | (1 << j)] = mask;
							}
						}
					}
					break;
				}
			}
		}
		out.println(dp[(1 << n) - 1]);
		int mask = (1 << n) - 1;
		out.print(0);
		while (mask != 0) {
			int p = prev[mask];
			int cur = p ^ mask;
			List<Integer> who = new ArrayList<Integer>();
			for (int i = 0; i < n; ++i) {
				if (((cur >> i) & 1) != 0) {
					who.add(i + 1);
				}
			}
			for (int t : who) {
				out.print(" " + t);
			}
			out.print(" " + 0);
			mask = p;
		}
		out.flush();
	}

	private int dist(int x, int y, int x2, int y2) {
		return x * x + y * y + x2 * x2 + y2 * y2 + (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);
	}

	private int dist(int x, int y) {
		return 2 * (x * x + y * y);
	}

	private class Scanner {
		private StringTokenizer tokenizer;
		private BufferedReader reader;

		public Scanner(Reader in) {
			reader = new BufferedReader(in);
			tokenizer = new StringTokenizer("");
		}

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

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

public class Main {
	boolean eof;

	public String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "-1";
			}
		}
		return st.nextToken();
	}

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

	int NOD(int a, int b) {
		while (a * b > 0) {
			if (a > b) {
				a %= b;
			} else {
				b %= a;
			}
		}
		return a + b;
	}

	void solve() {
		int n = nextInt(), k= nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; ++i){
			a[i] = nextInt() - 1;
		}
		int[] b = new int[100000];
		int p = 0;
		for (int i = 0; i < n; ++i){
			++b[a[i]];
			if (b[a[i]] == 1){
				++p;
			}
			if (k == p){
				int j;
				for (j = 0; j <= i; ++j){
					if (b[a[j]] > 1){
						--b[a[j]];
					} else {
						break;
					}
				}
				out.print((j + 1) + " " + (i + 1));
				return;
			}
		}
		out.print("-1 -1");
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;

	void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));

			// br = new BufferedReader(new FileReader("input.txt"));
			// out = new PrintWriter(new FileWriter("output.txt"));
			solve();
			br.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}
 What is the time complexity of the previous code?
targets: linear
inputs: import java.io.*;
import java.util.Scanner;
public class Test {
	public static int digit(long number){
		int i = 1;
		long exp = 1;
		while(number > i * 9 * exp){
			number -= i * 9 * exp;
			i++;
			exp *= 10;
		}
		return i;
	}
	public static int result(long number){
		int digit = digit(number);
		long exp = 1;
		for(int i = 0; i < (digit - 1); i++){
			number -= (i+1) * 9 * exp;
			exp *= 10;
		}
		long b = number / digit;
		int c = (int)(number % digit);
		if(c > 0){
			String d = Long.toString(exp + b);
			return d.charAt(c - 1) - '0';
		}
		else{
			String d = Long.toString(exp + b - 1);
			return d.charAt(d.length() - 1) - '0';
		}

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



 What is the time complexity of the previous code?
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.*;
import java.lang.*;
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main {

    Main() throws IOException {
        String a = nextLine();
        String b = nextLine();
        long ans = 0;
        int s = 0;
        for (int i = 0; i < b.length() - a.length(); ++i) {
            s += b.charAt(i) == '1' ? 1 : 0;
        }

        for (int i = 0; i < a.length(); ++i) {
            s += b.charAt(i + b.length() - a.length()) == '1' ? 1 : 0;
            ans += a.charAt(i) == '1' ? b.length() - a.length() + 1 - s : s;
            s -= b.charAt(i) == '1' ? 1 : 0;
        }
        out.println(ans);
    }


    //////////////////////////////
    PrintWriter out = new PrintWriter(System.out, false);
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer stok = null;
    String nextLine() throws IOException {
        while (stok == null || !stok.hasMoreTokens()) {
            stok = new StringTokenizer(in.readLine());
        }
        return stok.nextToken();
    }


    public static void main(String args[]) throws IOException {
        if (args.length > 0) {
            setIn(new FileInputStream(args[0] + ".inp"));
            setOut(new PrintStream(args[0] + ".out"));
        }
        Main solver = new Main();
        solver.out.flush();  //  could be replace with a method, but nah, this is just competitive programming :p
    }
}
 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.*;
import java.util.*;

public class Main {

    public void solve() throws IOException {
        int n = nextInt();
        output.println(n / 2 * 3);
    }

    public void run() throws IOException {
        input = new BufferedReader(new InputStreamReader(System.in));
        output = new PrintWriter(System.out);
        solve();
        input.close();
        output.close();
    }

    BufferedReader input;
    PrintWriter output;
    StringTokenizer tok;

    String nextToken() throws IOException {
        while(tok == null || !tok.hasMoreTokens())
            tok = new StringTokenizer(input.readLine());

        return tok.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.valueOf(nextToken());
    }

    long nextLong() throws IOException {
        return Long.valueOf(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.valueOf(nextToken());
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}
 Complexity:
targets: constant
inputs: //make sure to make new file!
import java.io.*;
import java.util.*;

public class B713{
   
   public static BufferedReader f;
   public static PrintWriter out; 
   
   public static void main(String[] args)throws IOException{
      f = new BufferedReader(new InputStreamReader(System.in));
      out = new PrintWriter(System.out);
      
      int n = Integer.parseInt(f.readLine());
      
      
      int l;
      int r;
      int mid;
      int ans;
      
      
      l = 1;
      r = n;
      ans = -1;
      //see if you can draw vertical line between them
      
      while(l <= r){
         mid = l + (r-l)/2;
         if(mid == n) break;
         
         int il = query(1,1,n,mid);
         int ir = query(1,mid+1,n,n);
         
         if(il == 1 && ir == 1){
            ans = mid;
            break;
         }
         
         if(il > ir){
            r = mid-1;
         } else {
            l = mid+1;
         }
      }
      
      int x11 = -1;
      int y11 = -1;
      int x12 = -1;
      int y12 = -1;
      int x21 = -1;
      int y21 = -1;
      int x22 = -1;
      int y22 = -1;
      if(ans == -1){
         //find horizontal line
         l = 1;
         r = n;
         ans = -1;
      
         while(l <= r){
            mid = l + (r-l)/2;
         
         
            int il = query(1,1,mid,n);
            int ir = query(mid+1,1,n,n);
         
            if(il == 1 && ir == 1){
               ans = mid;
               break;
            }
         
            if(il > ir){
               r = mid-1;
            } else {
               l = mid+1;
            }
         }
      
         int bar = ans;
         
                  //find top line of top block
         l = 1;
         r = bar;
         ans = -1;
         while(l <= r){
            mid = l + (r-l)/2;
            
            int i = query(mid,1,bar,n);
            if(i == 1){
               ans = mid;
               l = mid+1;
            } else {
               r = mid-1;
            }
         }
         
         x11 =... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.HashMap;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.PrintWriter;
import java.io.OutputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
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);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskC {
        int BAD = 11111;
        int rows;
        int cols;
        HashMap<IntIntPair, Integer>[] mem;

        boolean contains(int mem, int index) {
            if(index < 0) return false;
            return ((mem >> index) & 1) == 1;
        }

        int add(int mem, int index) {
            if(((mem >> index) & 1) == 0) {
                mem += (1 << index);
            }
            return mem;
        }

        int size(int mem) {
            int res = 0;
            while(mem > 0) {
                if(mem % 2 == 1) res++;
                mem /= 2;
            }
            return res;
        }

        void test() {
            if(contains(5, 0) == false) throw new RuntimeException();
            if(contains(5, 1) == true) throw new RuntimeException();
            if(contains(5, -1) == true) throw new RuntimeException();
            if(contains(5, 2) == false) throw new RuntimeException();
            if(contains(5, 3) == true) throw new RuntimeException();
            if(add(0, 2) != 4) throw new RuntimeException();
            if(add(4, 0) != 5) throw new RuntimeException();
            if(add(5, 0) != 5) throw new RuntimeException();
            if(size(5) != 2) throw... 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.HashSet;
import java.util.Iterator;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner  scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] nums = new int[n];
        for(int i = 0; i < n; i++){
            nums[i] = scan.nextInt();
        }
        Arrays.sort(nums);
        boolean[] div = new boolean[n];
        int count = 0;
        for(int i = 0; i < n; i++) {
            if (!div[i]) {

                count++;
                div[i] = true;
                for(int j = i+1; j < n; j++) {
                    if (nums[j] % nums[i] == 0) {
                        div[j] = true;
                    }
                }
            }
        }
        System.out.println(count);

    }
}
 What is the time complexity of the previous code?
targets: quadratic
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;



public class BankAccount {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		String s = in.readLine();
		int n = Integer.parseInt(s);

		if (s.charAt(0) == '-')
			if (Integer.parseInt(s.substring(0, s.length()-1))>Integer.parseInt(s.substring(0, s.length()-2)+s.charAt(s.length()-1)))
				s=s.substring(0, s.length()-1);
			else
				s=s.substring(0, s.length()-2)+s.charAt(s.length()-1);

		System.out.println(Integer.parseInt(s));
		in.close();
	}

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

public class Subtractions {

	public static void main(String[] args) {
		Scanner kb = new Scanner(System.in);
		int count = kb.nextInt();
		while(count > 0) {
			int smaller = kb.nextInt();
			int larger = kb.nextInt();
			int ops = 0;
			
			while(smaller > 0 && larger > 0) {
				if(smaller > larger) {
					int temp = smaller;
					smaller = larger;
					larger = temp;
				}
					
				ops += larger/smaller;
				larger = larger % smaller;
			}
			System.out.println(ops);
			count--;
		}

	}

} What is the time complexity of the previous code?
targets: constant
inputs: import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class template {
	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner();
		PrintWriter pw = new PrintWriter(System.out);
		int n = sc.nextInt();
		Integer[] arr = new Integer[n];
		for(int i=0;i<n;i++) {
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		int ct = 0;
		boolean[] ar = new boolean[n];
		for(int i=0;i<n;i++) {
			if(!ar[i]) {
				ar[i]=true;
				ct++;
				int x = arr[i];
				for(int j=0;j<n;j++) {
					if(arr[j]%x==0) {
						ar[j]=true;
					}
				}
			}
		}
		
		pw.println(ct);
		pw.close();
	}
}
@SuppressWarnings("all")
class FastScanner {
    BufferedReader br;
    StringTokenizer st;
    public FastScanner(BufferedReader d) {
        br=d;
    }
    public FastScanner(String s) {
        try {
            br = new BufferedReader(new FileReader(s));
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
 
    public FastScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }
 
    String nextToken() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
 
    int nextInt() {
        return Integer.parseInt(nextToken());
    }
 
    long nextLong() {
        return Long.parseLong(nextToken());
    }
 
    double nextDouble() {
        return Double.parseDouble(nextToken());
    }
} What is the time complexity of the previous code?
targets: quadratic
inputs: /*
 * Code Author: Akshay Miterani
 * DA-IICT
 */
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
 
public class A {
 
	static double eps=(double)1e-15;
	static long mod=(int)1e9+7;
	public static void main(String args[]){
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		//----------My Code----------
		int n=in.nextInt();
		int l=0,r=0;
		String s=in.nextLine();
		HashSet<Character> size=new HashSet<>();
		for(int i=0;i<n;i++){
			char p=s.charAt(i);
			size.add(p);
		}
		int chk=size.size();
		HashMap<Character, Integer> hm=new HashMap<>();
		int ans=Integer.MAX_VALUE;
		while(l<n){
			if(hm.size()<chk && r<n){
				char p=s.charAt(r);
				if(hm.containsKey(p)){
					hm.put(p, hm.get(p)+1);
				}
				else{
					hm.put(p, 1);
				}
				r++;
			}
			else{
				char p=s.charAt(l);
				if(hm.get(p)==1){
					hm.remove(p);
				}
				else{
					hm.put(p, hm.get(p)-1);
				}
				l++;
			}
			if(hm.size()==chk){
				ans=Math.min(ans, r-l);
			}
		}
		out.println(ans);
		out.close();
		//---------------The End------------------
 
	}
	static class Pair implements Comparable<Pair> {
		int u;
		int v;
 
		public Pair(int u, int v) {
			this.u = u;
			this.v = v;
		}
 
		public int hashCode() {
			int hu = (int) (u ^ (u >>> 32));
			int hv = (int) (v ^ (v >>> 32));
			return 31 * hu + hv;
		}
 
		public boolean equals(Object o) {
			Pair other = (Pair) o;
			return u == other.u && v == other.v;
		}
 
		public int compareTo(Pair other) {
			return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
		}
 
		public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}
	}
	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
	static long modulo(long a,long b,long c) {
		long x=1;
		long y=a;
		while(b > 0){
			if(b%2 == 1){
				x=(x*y)%c;
			}
			y = (y*y)%c; // squaring the base
			b /= 2;
		}
		return  x%c;
	}
	static long... What is the time complexity of the previous code?
targets: linear
inputs: import java.io.*;
import java.util.*;


public class test {
    static boolean DEBUG_FLAG = false;
    int INF = (int)1e9;
    long MOD = 1000000007;
    
    static void debug(String s) {
        if(DEBUG_FLAG) {
            System.out.print(s);
        }
    }
    
    long pow(long a, long n, long mod) {
        if (n == 0) {
            return 1;
        }
        long rs = 1;
        while (n != 0) {
            if (n % 2 == 1) {
                rs *= a;
            }
            rs %= mod;
            n >>= 1;
            a *= a;
            a %= mod;
        }
        return rs;
    }
    
    void solve(InputReader in, PrintWriter out) throws IOException {
        long x = in.nextLong();
        long k = in.nextLong();
        if(x==0) {
            out.println(0);
            return;
        }
        long a = (2 * x - 1) % MOD;
        long b = pow(2, k, MOD);
        a = (a * b) % MOD;
        a += 1;
        a %= MOD;
        out.println(a);
    }
    
    
    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new test().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return... What is the time complexity of the previous code?
targets: logn
inputs: import java.util.*;
import java.io.*;
public class CF911D {
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      
      int n = sc.nextInt();
      int[] array = new int[n];
      for(int i = 0; i < n; i++){
         array[i] = sc.nextInt();
      }
      int count = 0;
      for(int i = 0; i < array.length; i++){
         for(int j = i+1; j < array.length; j++){
            if(array[i] > array[j]){
               count++;
            }
         }
      }
      count%=2;
      int q = sc.nextInt();
      for(int i = 0; i < q; i++){
         int l = sc.nextInt();
         int r = sc.nextInt();
         int sz = r - l + 1;
         count += (sz*(sz-1))/2;
         count %= 2;
         if(count == 1) 
            System.out.println("odd");
         else 
            System.out.println("even");
      }
   }
} 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 A912 {

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

		Scanner scan = new Scanner(System.in);
		
		int A = scan.nextInt();
		int B = scan.nextInt();
		long x = scan.nextInt();
		long y = scan.nextInt();
		long z = scan.nextInt();
		
		long requiredA = x * 2 + y;
		long requiredB = y + z * 3;
		
		long neededA = Math.max(0, requiredA - A);
		long neededB = Math.max(0, requiredB - B);
		System.out.print(neededA + neededB);
	}

}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Stream;

public class C_455
{
	public static final long[] POWER2 = generatePOWER2();
	public static final IteratorBuffer<Long> ITERATOR_BUFFER_PRIME = new IteratorBuffer<>(streamPrime(1000000).iterator());
	private static BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
	private static StringTokenizer stringTokenizer = null;
	private static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

	static class Array<Type> implements Iterable<Type>
	{
		private final Object[] array;

		public Array(int size)
		{
			this.array = new Object[size];
		}

		public Array(int size, Type element)
		{
			this(size);
			Arrays.fill(this.array, element);
		}

		public Array(Array<Type> array, Type element)
		{
			this(array.size() + 1);
			for (int index = 0; index < array.size(); index++)
			{
				set(index, array.get(index));
			}
			set(size() - 1, element);
		}

		public Array(List<Type> list)
		{
			this(list.size());
			int index = 0;
			for (Type element : list)
			{
				set(index, element);
				index += 1;
			}
		}

		public Type get(int index)
		{
			return (Type) this.array[index];
		}

		@Override
		public Iterator<Type> iterator()
		{
			return new Iterator<Type>()
			{
				int index = 0;

				@Override
				public boolean hasNext()
				{
					return this.index < size();
				}

				@Override
				public Type next()
				{
					Type result = Array.this.get(index);
					index += 1;
					return result;
				}
			};
		}

		public Array set(int index, Type value)
		{
			this.array[index] = value;
			return this;
		}

		public int size()
		{
			return this.array.length;
		}

		public List<Type> toList()
		{
			List<Type> result = new ArrayList<>();
			for (Type element : this)
			{
				result.add(element);
			}
			return... Complexity:
targets: quadratic
inputs: import java.util.Arrays;
import java.util.Scanner;

public class test {

    public static void main(String[] args) {
        Scanner kb = new Scanner(System.in);
        int n = kb.nextInt();
        int a = kb.nextInt();
        int b = kb.nextInt();
        int array[] = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = kb.nextInt();
        }
        Arrays.sort(array);
        int k = 0;
        int t1 = 0;
        int t2 = 0;
        for (int i = 0; i < b; i++) {
            t1= array[i];
            if(i<n-1){
                t2=array[i+1];
                k=t2-t1;
            }
            else k=0;
        }
        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: nlogn