Muennighoff/xP3x-sample huggingface dataset:
inputs: import java.util.*;
public class Main {
    public static class Pair implements Comparable<Pair> {
        int k, x;
        public Pair(int k) {
            this.k = k;
        }
        public void update(int x) {
            this.x = Math.max(this.x, x);
        }
        public int compareTo(Pair other) {
            if (x != other.x) {
                return other.x - x;
            }
            return k - other.k;
        }
    }
    public static int sum(int[] arr) {
        int sum = 0;
        for (int x : arr) {
            sum += x;
        }
        return sum;
    }
    public static int[] join(int[] a, int[] b) {
        int n = a.length;
        int[] best = new int[n];
        int sum = 0;
        for (int shift = 0; shift < n; shift++) {
            int[] curr = new int[n];
            for (int i = 0; i < n; i++) {
                curr[i] = Math.max(a[i], b[(i + shift) % n]);
            }
            int now = sum(curr);
            if (now > sum) {
                sum = now;
                best = curr;
            }
        }
        return best;
    }
    public static int n;
    public static int[] pow;
    public static int[][] dp, real;
    public static void calc(int mask) {
        int[] best = new int[n];
        int sum = 0;
        for (int i = 0; i < n; i++) {
            if ((mask & pow[i]) != 0) {
                int to = mask ^ pow[i];
                int[] init = new int[n];
                for (int j = 0; j < n; j++) {
                    init[j] = real[j][i];
                }
                int[] curr = join(dp[to], init);
                int s = sum(curr);
                if (s > sum) {
                    sum = s;
                    best = curr;
                }
            }
        }
        dp[mask] = best;
    }
    public static void main(String[] args) {
        pow = new int[15];
        pow[0] = 1;
        for (int i = 1; i < pow.length; i++) {
            pow[i] = pow[i - 1] * 2;
        }
        Scanner in = new Scanner(System.in);
        int t =... 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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class APaintTheNumbers {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            int n = sc.nextInt();
            Integer[] tab = new Integer[n];
            for (int i = 0; i < n; i++) {
                tab[i] = sc.nextInt();
            }
            Arrays.sort(tab);
            boolean[] done = new boolean[n];
            int ans = 0;
            for (int i = 0; i < n; i++) {
                if (!done[i]) {
                    ans++;
                    done[i] = true;
                    for (int j = i + 1; j < n; j++) {
                        if (!done[j] && tab[j] % tab[i] == 0) {
                            done[j] = true;
                        }
                    }
                }
            }
            out.println(ans);
        }

    }

    static class inputClass {
        BufferedReader br;
        StringTokenizer st;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                   ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. //package round15;


import java.io.BufferedOutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringReader;
import java.util.Arrays;
import java.util.Scanner;

public class A {
	private Scanner in;
	private PrintWriter out;
	
	public void solve()
	{
		int n = ni();
		int t = ni();
		Pair[] p = new Pair[n];
		for(int i = 0;i < n;i++){
			p[i] = new Pair();
			p[i].x = ni();
			p[i].a = ni();
		}
		Arrays.sort(p);
		
		int ct = 2;
		for(int i = 0;i < n - 1;i++){
			float d = p[i + 1].x - (float)p[i + 1].a / 2 - p[i].x - (float)p[i].a / 2;
			if(Math.abs(d - t) < EPS){
				ct++;
			}else if(d > t){
				ct += 2;
			}
		}
		
		out.println(ct);
	}

	double EPS = 0.0001;
	
	private static class Pair implements Comparable<Pair>
	{
		public int x;
		public int a;
		
		@Override
		public int compareTo(Pair o) {
			return x - o.x;
		}
	}	
	public void run() throws Exception
	{
//		in = new Scanner(new StringReader("2 3 0 4 5 2"));
		in = new Scanner(System.in);
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		out = new PrintWriter(System.out);
		
//		int n = in.nextInt();
		int n = 1;
		for(int i = 1;i <= n;i++){
			long t = System.currentTimeMillis();
			solve();
			out.flush();
//			System.err.printf("%04d/%04d %7d%n", i, n, System.currentTimeMillis() - t);
		}
	}
	
	
	public static void main(String[] args) throws Exception
	{
		new A().run();
	}
	
	private int ni() { return Integer.parseInt(in.next()); }
	private static void tr(Object... o) { System.out.println(o.length == 1 ? o[0] : Arrays.toString(o)); }
}
 Complexity:
targets: nlogn
inputs: import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.IOException;
import java.util.StringTokenizer;
/*
 * @author Tnascimento 
 */

public class MaeDosDragoes {
	// public static StringTokenizer tokenizer;
	// public static BufferedReader reader;
	public static PrintWriter saida = new PrintWriter(System.out, false);
	// public static String proximo() {
	// 	while (tokenizer == null || !tokenizer.hasMoreElements()) {
	// 		try {
	// 			tokenizer = new StringTokenizer(reader.readLine());
	// 		} catch (RuntimeException e) {
	// 			e.printStackTrace();
	// 		}
	// 	}
	// 	return tokenizer.nextToken();
	// }

	public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        
        public FastScanner() {
            this(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());
        }
        
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }



    public static void main(String[] args) {
		FastScanner fastScanner = new FastScanner();
        int proximoInt = fastScanner.nextInt();
        double proximoDouble = fastScanner.nextInt();
    ... 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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.File;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.UnsupportedEncodingException;
import java.io.InputStream;

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

    static class TaskC {
        public void solve(int testNumber, FastReader in, OutputWriter out) {
            int n = in.nextInt();
            double r = in.nextInt();
            double[] x = new double[n];
            for (int i = 0; i < n; i++) {
                x[i] = in.nextDouble();
            }
            double[] ans = new double[n];
            ans[0] = r;
            for (int i = 1; i < n; i++) {
                ans[i] = r;
                double maxY = 0;
                for (int j = 0; j < i; j++) {
                    if (Math.abs(x[j] - x[i]) <= 2.0 * r) {
                        double y = ans[j] + Math.sqrt(4 * r * r - (x[j] - x[i]) * (x[j] - x[i]));
                        ans[i] = Math.max(ans[i], y);
                    }
                }
            }
            for (int i = 0; i < n; i++) {
                if (i > 0) out.print(" ");
                out.printf("%.8f", ans[i]);
            }
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
 ... 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.*;
public class Main
{
	public static void main(String[] args) throws Exception
	{
	    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    String s=br.readLine();
	    String ss[]=s.split(" ");
	    int arr[]=new int[n];
	    for(int i=0;i<n;i++)
	    arr[i]=Integer.parseInt(ss[i]);
	    Arrays.sort(arr);
	    int coun=0,coun2=0;
	    for(int i=arr[0],k=0;k<n;)
	    {
	        for(int j=k;j<n;j++)
	        {
	            if(arr[j]%i==0)
	            {
	                arr[j]=-1;
	                coun2++;
	            }
	        }
	        Arrays.sort(arr);
	        k=coun2;
	        coun++;
	        if(coun2<n)
	        i=arr[coun2];
	        else
	        break;
	        
	    }
		System.out.println(coun);
	}
}
 Complexity:
targets: quadratic
inputs: import java.util.Scanner;
import java.io.OutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.io.PrintWriter;
import java.io.InputStream;

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

class TaskA {
	public void solve(int testNumber, Scanner in, PrintWriter out) {
		int n = in.nextInt();
		int m = in.nextInt();
		int k = in.nextInt();
		int[] fs = IOUtils.readIntArray(in, n);
		Arrays.sort(fs);
		int ptr = fs.length - 1;
		int res = 0;
		while (ptr >= 0 && k < m) {
			k += fs[ptr--] - 1;
			res++;
		}
		if (k < m) out.println(-1);
		else out.println(res);
	}
}

class IOUtils {
    public static int[] readIntArray(Scanner in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.nextInt();
        return array;
    }

    }

 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: nlogn
inputs: import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class VkR2A{
    static BufferedReader br;
    public static void main(String args[])throws Exception{
        br=new BufferedReader(new InputStreamReader(System.in));

        int nm[] = toIntArray();
        int n = nm[0];
        int a = nm[1];
        int b = nm[2];
        nm=toIntArray();
        Arrays.sort(nm);
        int k=nm[b-1];
        int res=nm[b]-k;
        System.out.println(res);

    }


    /****************************************************************/
    public static int[] toIntArray()throws Exception{
       String str[]=br.readLine().split(" ");
       int k[]=new int[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Integer.parseInt(str[i]);
       }
       return k;
    }
    public static int toInt()throws Exception{
       return Integer.parseInt(br.readLine());
    }
    public static long[] toLongArray()throws Exception{
       String str[]=br.readLine().split(" ");
       long k[]=new long[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Long.parseLong(str[i]);
       }
       return k;
    }
    public static long toLong()throws Exception{
       return Long.parseLong(br.readLine());
    }
    public static double[] toDoubleArray()throws Exception{
       String str[]=br.readLine().split(" ");
       double k[]=new double[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Double.parseDouble(str[i]);
       }
       return k;
    }
    public static double toDouble()throws Exception{
       return Double.parseDouble(br.readLine());
    }
    public static String toStr()throws Exception{
       return br.readLine();
    }
    public static String[] toStrArray()throws Exception{
       String str[]=br.readLine().split(" ");
       return str;
    }
    /****************************************************************/

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

/**
 * Created by aditya on 5/3/17.
 */
public class Main3 {

    static long x, k;
    static long MOD = (long)1e9 + 7;

    public static void main(String args[]) throws Exception{
        FastInput fi = new FastInput(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        x = fi.nextLong();
        k = fi.nextLong();

        if(x == 0) {
            System.out.println(0);
            return;
        }

//        System.out.println(pow(2, k+1));
        long q1 = (pow(2, k+1) * (x%MOD)) % MOD;
        long q2 = pow(2, k);
        long q3 = 1;
//        System.out.println(q1);
//        System.out.println(q2);
//        System.out.println(q3);


        long exp = (q1-q2 + MOD + MOD)%MOD;
        exp = (exp + q3)%MOD;

//        exp = (exp*2)%MOD;

        pw.println(exp);

        pw.close();
    }

    static long pow(long n, long k) {
        if(k == 0)
            return 1;
        if(k == 1)
            return n;
        long ret = pow(n, k/2)%MOD;
        ret = (ret*ret)%MOD;
        if(k%2 == 1)
            ret = (ret*n)%MOD;

        return ret;
    }

    static class FastInput {

        private Reader in;
        private BufferedReader br;
        private StringTokenizer st;

        public FastInput(Reader in) {
            this.in=in;
            br = new BufferedReader(in);
        }

        public String nextString() {

            while(st==null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    System.out.println(e.getStackTrace());
                }
            }
            return st.nextToken();
        }

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

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

       ... Complexity:
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.util.*;

public class Main {

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

		public InputReader() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}

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

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

		public char nextChar() {
			return next().charAt(0);
		}

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

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

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

	public static void main(String[] args) {
		// InputStream inputStream = System.in; // Useful when taking input other than
		// console eg file handling // check ctor of inputReader
		InputReader scn = new InputReader();
		
		int n = scn.nextInt(), r = scn.nextInt();
		double[] y = new double[n];
		int[] x = new int[n];
		boolean[] mark = new boolean[n];
		for(int i = 0; i < n; i++) {
			x[i] = scn.nextInt();
		}
		for(int i = 0; i < n; i++) {
			double yc = r;
			for(int j = 0; j < n; j++) {
				if(i == j || !mark[j]) {
					continue;
				}
				if(x[i] + r < x[j] - r || x[i] - r > x[j] + r) {
					continue;
				}
				
				yc = Math.max(yc, y[j] + Math.sqrt(Math.abs(Math.pow(x[i] - x[j], 2) - 4 * r * r)));
			}
			y[i] = yc;
			mark[i] = true;
		}
		
		for(int i = 0; i < n; i++) {
			System.out.print(y[i] + " ");
		}
		System.out.println();
	}
} Complexity:
targets: quadratic
inputs: import java.io.*;
import java.util.*;

public class Main {
	static final int MAXN= 1005;
	static final long MOD =1_000_000_007;
	static final boolean DEBUG= false;
	static int  n, m;
	static long stlr[][]= new long[MAXN][MAXN],bell[]= new long[MAXN],occ[];
	static PrintStream cerr=System.err;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Readin();
		stlr[0][0]= bell[0] =1;
		for (int i=1; i<=m; i++)
			for (int j=1;j<=i;j++) {
				stlr[i][j]= (stlr[i-1][j-1]+stlr[i-1][j]*(long)j)%MOD;
				bell[i]= (bell[i]+stlr[i][j])%MOD;
			}
		if (DEBUG)
			for (int i=1; i<=m; i++) cerr.println("Bell["+i+"] ="+bell[i]);
		Arrays.sort(occ);
		if (DEBUG) {
			cerr.println("After Sorting");
			for (int i=0;i<m; i++) cerr.println(occ[i]+" ");}
		long ans=1;
		for (int i=0,j=0; i<m; i=j) {
			for (j=i+1; j<m && occ[i]==occ[j];j++);
			ans= (ans*bell[j-i])%MOD;
		}
		System.out.println(ans);
	}
	static void Readin() {
		Scanner  cin;
		if ( !DEBUG)cin= new Scanner(System.in);
		else {
			try {
				cin = new Scanner(new File("input.txt"));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				if ( DEBUG)cerr.println("Not Fount input.txt");
				return ;
			}
		}
		m = cin.nextInt(); n=cin.nextInt();
		occ= new long[m];
		for (int i=0; i<n; i++) {
			String s= cin.next();
			for (int j=0;j <m; j++)
				occ[j]|=((long)(s.charAt(j)-'0'))<<i;
		}
		cin.close();
	}
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: quadratic
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class One {
	InputStreamReader inp = new InputStreamReader(System.in);
	BufferedReader in = new BufferedReader(inp);
	boolean test = false;

	// String[] inData = { "4", "A", "B", "C", "D", "A-B 1:1", "A-C 2:2",
	// "A-D 1:0", "B-C 1:0", "B-D 0:3", "C-D 0:3" };
	String[] inData = { "4","1 1 2" };

	static int id = -1;

	public String readLine() throws IOException {
		id++;
		if (test)
			return inData[id];
		else
			return in.readLine();
	}

	public void solve() throws Exception {
		readLine();
		String readLine = readLine();
		
		String[] split = readLine.split(" ");
		List<Integer> ints = new ArrayList<Integer>();
		
		for (int i = 0; i < split.length; i++) {
			ints.add(Integer.valueOf(split[i]));
		}
		
		Collections.sort(ints);
		Integer object = ints.get(0);
		for (int i = 0; i < split.length; i++) {
			if(ints.get(i).compareTo(object) > 0){
				System.out.println(ints.get(i));
				return;
			}
		}
		System.out.println("NO");
	}

	public static void main(String[] args) throws Exception {

		new One().solve();

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

public class A961_Tetris {

	public static void main(String[] args) {
		
		Scanner input = new Scanner(System.in);
		int platforms = input.nextInt();
		int in = input.nextInt();
		int[] cols = new int[platforms];
		int[] squares = new int[in];
		
		for (int i = 0; i < in; i ++) {
			squares[i] = input.nextInt();
		}
		
		boolean hi = false;
		int score = 0;
		
		for (int i = 0; i < in; i ++) {
			cols[squares[i] - 1] ++;
			hi = checkscore(cols);
			if (hi == true) {
				hi = false;
				score ++;
				for (int j = 0; j < cols.length; j ++) {
					cols[j] --;
				}
				
			}
			
		}
		
		System.out.println(score);
		
	}
	
	public static boolean checkscore(int[] cols) {
		for (int i = 0; i < cols.length; i ++) {
			if (cols[i] == 0) {
				return false;
			}
			
		}
		
		return true;
		
	}

}
 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: //package c;
import java.util.*;
import java.io.*;

public class Main {

	int n,m;
	int d[][];
	Queue<int[]> q = new LinkedList<int[]>();
	int cur[];
	
	public void run() throws Exception{
		Scanner in = new Scanner(new File("input.txt"));
		PrintWriter out = new PrintWriter(new File("output.txt"));
		n = in.nextInt();
		m = in.nextInt();
		int k = in.nextInt();
		d = new int[n][m];
		for(int i=0;i<n;i++) Arrays.fill(d[i], Integer.MAX_VALUE/2);
		for(int i=0;i<k;i++){
			int x = in.nextInt()-1;
			int y = in.nextInt()-1;
			d[x][y] = 0;
			q.add(new int[]{x,y});
		}
		
		
		while(q.size() > 0){
			cur = q.poll();
			int x = cur[0];
			int y = cur[1];
			add(x, y+1);
			add(x+1, y);
			add(x-1, y);
			add(x, y-1);
		}
		int max = 0;
		int x = 0;
		int y = 0;
		for(int i=0;i<n;i++)
			for(int j=0;j<m;j++)
				if (max < d[i][j]){
					max = d[i][j];
					x = i;
					y = j;
				}
		out.println((x+1) + " " + (y+1));
		out.close();
	}
	
	private void add(int x, int y){
		if (x < 0 || y < 0) return;
		if (x >=n || y >=m) return;
		if (d[x][y] > d[cur[0]][cur[1]] + 1){
			d[x][y] = d[cur[0]][cur[1]] + 1;
			q.add(new int[]{x,y});
		}
	}
	
	public static void main(String[] args) throws Exception{
		new Main().run();
	}

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

public class Main {
	FastReader scn;
	PrintWriter out;
	String INPUT = "";

	void solve() {
		long n = scn.nextLong(), k = scn.nextLong(), mod = (int)1e9 + 7;
		if(n == 0) {
			out.println(0);
			return;
		}
		n %= mod;
		long x = (pow(2, k + 1, mod) * n) % mod;
		long y = (pow(2, k, mod) + mod - 1) % mod;
		
		long ans = ((x - y) % mod + mod) % mod;
		out.println(ans);
	}
	
	long pow(long a, long x, long m) {
		if(x == 0) {
			return 1;
		}
		long p = pow(a, x / 2, m);
		p *= p;
		p %= m;
		if(x % 2 == 1) {
			p *= a;
			p %= m;
		}
		return p;
	}
	
	long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	void run() throws Exception {
		boolean onlineJudge = System.getProperty("ONLINE_JUDGE") != null;
		out = new PrintWriter(System.out);
		scn = new FastReader(onlineJudge);
		long time = System.currentTimeMillis();
		solve();
		out.flush();
		if (!onlineJudge) {
			System.out.println(Arrays.deepToString(new Object[] { System.currentTimeMillis() - time + " ms" }));
		}
	}

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

	class FastReader {
		InputStream is;

		public FastReader(boolean onlineJudge) {
			is = onlineJudge ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		}

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

		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++];
		}

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

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

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

		char nextChar() {
			return (char) skip();
		}

		String next() {
			int b = skip();
			StringBuilder sb = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: import java.io.*;
import java.nio.CharBuffer;
import java.util.NoSuchElementException;

public class P1195B {

    public static void main(String[] args) {
        SimpleScanner scanner = new SimpleScanner(System.in);
        PrintWriter writer = new PrintWriter(System.out);

        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int l = 0;
        int r = n;
        int ans = 0;
        while (l <= r) {
            int eat = (l + r) >> 1;
            int lastPut = n - eat;
            long totalPut = (long) (lastPut + 1) * lastPut / 2;
            long remain = totalPut - eat;
            if (remain == k) {
                ans = eat;
                break;
            } else if (remain > k)
                l = eat + 1;
            else
                r = eat - 1;
        }
        writer.println(ans);

        writer.close();
    }

    private static class SimpleScanner {

        private static final int BUFFER_SIZE = 10240;

        private Readable in;
        private CharBuffer buffer;
        private boolean eof;

        SimpleScanner(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
            buffer = CharBuffer.allocate(BUFFER_SIZE);
            buffer.limit(0);
            eof = false;
        }


        private char read() {
            if (!buffer.hasRemaining()) {
                buffer.clear();
                int n;
                try {
                    n = in.read(buffer);
                } catch (IOException e) {
                    n = -1;
                }
                if (n <= 0) {
                    eof = true;
                    return '\0';
                }
                buffer.flip();
            }
            return buffer.get();
        }

        void checkEof() {
            if (eof)
                throw new NoSuchElementException();
        }

        char nextChar() {
            checkEof();
            char b = read();
            checkEof();
            return b;
        }

        String next() {
   ... What is the time complexity of the previous code?
targets: logn
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("");

		n = fs.nextInt(); m = fs.nextInt();
		str = fs.next().toCharArray();
		occs = new int[m][m];
		for(int i = 0; i < n-1; i++) {
			occs[str[i]-'a'][str[i+1]-'a']++;
			occs[str[i+1]-'a'][str[i]-'a']++;
		}
		//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[i][trail];
			}
		}
		
		dp = new int[1<<m];
		Arrays.fill(dp, -1);
		System.out.println(solve(0));
		
		out.close();
	}
	
	int oo = (int)1e9;
	int solve(int mask) {
		if(mask == (1<<m)-1) return 0;
		if(dp[mask] != -1) return dp[mask];
		int res = oo;
		
		int addOn = 0;
		for(int nxt = 0; nxt < m; nxt++) {
			if(((1<<nxt)&mask) > 0) continue;
			addOn += cost[nxt][mask];
		}
		for(int nxt = 0; nxt < m; nxt++) {
			if(((1<<nxt)&mask) > 0) continue;
			int ret = addOn+solve(mask | (1<<nxt));
			res = Math.min(res, ret);
		}
		
		return dp[mask] = res;
	}
	
	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 BufferedInputStream(System.in, BS);
			}
		}

		public char... 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: 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.InputStreamReader;
import java.io.OutputStreamWriter;

public class ElevatorOrStairs {

	private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	private static final OutputStreamWriter writer = new OutputStreamWriter(System.out);
	
	public static void main(String...strings) throws Exception {
		String[] specs = reader.readLine().split(" ");
		
		int x = Integer.parseInt(specs[0]);
		int y = Integer.parseInt(specs[1]);
		int z = Integer.parseInt(specs[2]);
		int t1 = Integer.parseInt(specs[3]);
		int t2 = Integer.parseInt(specs[4]);
		int t3 = Integer.parseInt(specs[5]);
		
		reader.close();
		String ans = solve(x, y, z, t1, t2, t3);
		writer.append(ans);
		writer.flush();
		writer.close();
	}
	
	private static String solve(int x, int y, int z, int t1, int t2, int t3) {
		int time_using_stairs = Math.abs(x - y) * t1;
		int elevator_time_between_floor = Math.abs(x - z) * t2;
		int elevator_from_z_to_x = elevator_time_between_floor + 2*t3;
		
 		int time_using_elevator = elevator_from_z_to_x + (Math.abs(x - y) * t2) + t3;
 		
 		if(time_using_elevator <= time_using_stairs) {
 			return "YES";
 		}
 		return "NO";
	}
} 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.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class LookingForOrder {
	static final int INF = (int)1e9;
	static Point a[];
	static Point o;
	static int n;
	static int dp[];
	static PrintWriter out;

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

		o = new Point(sc.nextInt(), sc.nextInt());
		n = sc.nextInt();
		a = new Point[n];
		for (int i = 0; i < n; i++)
			a[i] = new Point(sc.nextInt(), sc.nextInt());
		
		dp = new int[(1 << n) + 5];
		Arrays.fill(dp, -1);
		out.println(rec(0));
		out.print(0 + " ");
		path(0);
		out.println();
		
		out.flush();
		out.close();
	}
	
	static void path(int msk) {
		if (msk == (1 << n) - 1) return;
		
		int optimal = rec(msk);
		for (int i = 0; i < n; i++) {
			if ((msk & (1 << i)) == 0) {
				if (rec(msk | (1 << i)) + 2 * o.dist(a[i]) == optimal) {
					out.print((i + 1) + " " + 0 + " ");
					path(msk | (1 << i));
					return;
				}
				
				for (int j = 0; j < n; j++) 
					if (rec(msk | (1 << i) | (1 << j)) + o.dist(a[i]) + a[i].dist(a[j]) + a[j].dist(o) == optimal) {
						out.print((i + 1) + " " + (j + 1) + " " + 0 + " ");
						path(msk | (1 << i) | (1 << j));
						return;
					}
				break;
			}
		}
	}

	static int rec(int msk) {
		if (msk == (1 << n) - 1) return 0;
		if (dp[msk] != -1) return dp[msk];
		
		int ans = INF;
		for (int i = 0; i < n; i++) {
			if ((msk & (1 << i)) == 0) {
				ans = Math.min(ans, rec(msk | (1 << i)) + 2 * o.dist(a[i]));
				for (int j = 0; j < n; j++) {
					if (i == j) continue;
					if ((msk & (1 << j)) == 0) 
						ans = Math.min(ans, rec(msk | (1 << i) | (1 << j)) + o.dist(a[i]) + a[i].dist(a[j]) + a[j].dist(o));
				}
				break;
			}
		}
		
		return dp[msk] = ans;
	}

	static class Point {
		int x, y;

		public Point(int x, int y) {
			this.x =... Complexity:
targets: np
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;

public class CTask {


    public static void main(String[] args) throws IOException {
        MyInputReader in = new MyInputReader(System.in);
        HashMap<Character, Integer> m = new HashMap<Character, Integer>();
        int n = in.nextInt();
        char[] s = in.next().toCharArray();

        for (int i = 0; i < n; i++) {
            m.put(s[i], 0);
        }
        int mx = m.size();
        int start = 0;
        int end = 0;
        int min = Integer.MAX_VALUE;
        int cur = 0;
        while (end < n) {
            while (end < n && cur != mx) {
                int x = m.get(s[end]);
                if (x == 0) {
                    cur += 1;
                }
                m.put(s[end], x + 1);
                end += 1;
            }
            while (start <= end && cur == mx) {
                int x = m.get(s[start]);
                m.put(s[start], x - 1);
                if (x - 1 == 0) {
                    cur -= 1;
                }
                start += 1;
            }
            min = Math.min(min, end - start + 1);
        }
        System.out.println(min);
    }


    static class Pair {

        long x;
        long y;

        public Pair(long x, long y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (x != pair.x) return false;
            return y == pair.y;

        }

        @Override
        public int hashCode() {
            int result = (int) (x ^ (x >>> 32));
            result = 31 * result + (int) (y ^ (y >>> 32));
            return result;
        }
    }

    static class MyInputReader {
        public BufferedReader reader;
        public... Complexity:
targets: linear
inputs: import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.FileReader;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.Arrays;

public class Fish extends Thread {

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


    private void solve() throws Throwable {
        int n = nextInt();
        double[][] a = new double[n][n];
        double[] dp = new double[(1 << n)];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                a[i][j] = nextDouble();
            }
        }
        int limit = (1 << n) - 1;
        //dp[mask] = probability of current subset (mask) to remain in the end
        dp[limit] = 1.0;
        for (int mask = limit; mask > 0; --mask) {
            int cardinality = Integer.bitCount(mask);
            int probability = cardinality * (cardinality - 1) / 2;
            for (int first = 0; first < n; ++first) {
                if ((mask & powers[first]) != 0) {
                    for (int second = first + 1; second < n; ++second) {
                        if ((mask & powers[second]) != 0) {
                            dp[mask - powers[first]] += dp[mask] * a[second][first] / probability;
                            dp[mask - powers[second]] += dp[mask] * a[first][second] / probability;
                        }

                    }
                }
            }
        }
        for (int i = 0; i < n; ++i) {
            output.printf("%.10f ", dp[powers[i]]);
        }
    }

    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.flush();
            output.close();
        }
    }


    public static void main(String[] args) {
        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: import java.io.File;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	public String[][] a;
	public void run () throws Exception {
		Scanner in = new Scanner(new File("input.txt"));
		PrintWriter pw = new PrintWriter(new  File("output.txt"));

		int n = in.nextInt();
		int m = in.nextInt();
		int k = in.nextInt();
		
		int[] xx = new int[k];
		int[] yy = new int[k];
		for(int i=0;i<k;i++){
			xx[i] = in.nextInt();
			yy[i]= in.nextInt();
		}
		int x=0,y=0,r;
		r=-1;
		
		for(int i=0;i<n;i++)
			for(int j=0;j<m;j++){
				int rr = 1000000;
				for(int q=0;q<k;q++)
					rr = Math.min(rr, Math.abs(xx[q]-1-i)+Math.abs(yy[q]-1-j));
				if(rr>r){
					r=rr;
					x=i;
					y=j;
				}
			}
		pw.print((x+1)+" "+(y+1));

		pw.close();
	}
	public static void main(String[] args) throws Exception {
		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: cubic
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Created with IntelliJ IDEA.
 * User: Alexey
 * Date: 16.09.12
 * Time: 19:29
 * To change this template use File | Settings | File Templates.
 */
public class stub implements Runnable {
    public static void main(String[] args) {
        new stub().run();
    }

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);
    StringTokenizer st;

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

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

    private void solve() throws IOException {
        int[] cnt = new int[(int) 1e6];
        int n = nextInt();
        int k = nextInt();
        int[] a = new int[n];

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

        int cur = 0;
        int left = 0;
        int i = left;
        while (i < n && cur != k) {
            if (cnt[a[i]] == 0) {
                cur++;
            }
            cnt[a[i]]++;
            i++;
        }
        i--;
        if (cur != k) {
            out.println("-1 -1");
            return;
        }
        int right = i;
        while (cnt[a[left]] > 1) {
            cnt[a[left]]--;
            left++;
        }
        out.println((left + 1) + " " + (right + 1));
    }

    public void run() {
        try {
            solve();
            out.close();
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: linear
inputs: import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;

import static java.lang.Math.*;

public class Main {

    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 Main().run();
        // Sworn to fight and die
    }

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

    private static void mergeSort(int[] a, int levtIndex, int rightIndex) {
        final int MAGIC_VALUE = 50;
        if (levtIndex < rightIndex) {
            if (rightIndex - levtIndex <= MAGIC_VALUE) {
                insertionSort(a, levtIndex, rightIndex);
            } else {
                int middleIndex = (levtIndex + rightIndex) / 2;
                mergeSort(a, levtIndex, middleIndex);
                mergeSort(a, middleIndex + 1, rightIndex);
                merge(a, levtIndex, middleIndex, rightIndex);
            }
        }
    }

    private static void merge(int[] a, int levtIndex, int middleIndex,
                ... 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.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();
 
    }
 
    static int INF = (int)1e5*4*4+5;
    static int maxn = (int)1e5*2+1;
    static int mod=(int)1e9+7 ;
    static int n,m,k,t,q,x,a,b,y;
    
    static ArrayList<Integer> adj[];
    static int[] dist,parent,back;
    static boolean[] vis,vist;
    static int root=0,ans=1;
    
    
    void solve(PrintWriter out, Reader in) throws IOException{
        n = in.nextInt();


        if(n==1) {out.println(1);return;}
        adj = new ArrayList[n+1];
        for(int i=1;i<=n;i++) 
            adj[i] = new ArrayList<Integer>();
        
        int u,v;
        for(int i=0;i<n-1;i++){
            u = in.nextInt();
            v = in.nextInt();
             
            adj[u].add(v);
            adj[v].add(u);
        }
        
        vist = new boolean[n+1];
        vis = new boolean[n+1];
        vist[1] =true;
        makeroot(1);
        
        parent = new int[n+1];
        dist = new int[n+1];
        back = new int[n+1];
        
        dfs(root,0);
        calcdist(root);
        
        vist = new boolean[n+1];
        vis = new boolean[n+1];
        vist[root] =true;
        
        

        PriorityQueue<Node> pq = new PriorityQueue<Node>();
        for(int i=1;i<=n;i++){
            if(i!=root) pq.add(new Node(i,dist[i]));
        }
        
        Node elm;
        int rt = root;
        out.print(1);
        
        makeroot(root);
        removeNodes(root,rt);
        ans+=dist[rt];
        out.print(" "+ans);
        int itr=2;
        for(int i=2;i<=n;i++){
            
            elm = pq.remove();
            if(vis[elm.idx]) continue;
            removeNodes(back[elm.idx],elm.idx);
            ans +=... Complexity:
targets: nlogn
inputs: import java.util.*;
import java.awt.*;

public class A
{
	static Comparator<Point> cmp = new Comparator<Point>()
	{
		public int compare(Point a, Point b)
		{
			if(a.x < b.x)
				return -1;
			else if(a.x > b.x)
				return 1;

			return 0;
		}
	};

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

		while(scan.hasNextInt())
		{

		int n = scan.nextInt();
		int k = scan.nextInt();

		Point[] a = new Point[n];

		for(int i=0;i < n;i++)
		{
			a[i] = new Point();
			a[i].x = scan.nextInt();
			a[i].y = scan.nextInt();
		}

		Arrays.sort(a, cmp);

		int rtn = 0;

		ArrayList<Double> ans = new ArrayList<Double>();

		for(int i=0;i < n;i++)
		{
			//Left
			double lb = a[i].x - (a[i].y / 2.0) - k;
			double pos = lb + (k/2.0);
			boolean good = true;

			for(int j=0;j < ans.size();j++)
				if(Math.abs(ans.get(j) - pos) < 0.0000001)
					good = false;


			if(good && (i == 0 || a[i-1].x + (a[i-1].y / 2.0) <= lb))
			{
				rtn++;
				ans.add(pos);
			}

			double rb = a[i].x + (a[i].y / 2.0) + k;
			pos = rb - (k/2.0);
			good = true;

			for(int j=0;j < ans.size();j++)
				if(Math.abs(ans.get(j) - pos) < 0.0000001)
					good = false;

			if(good && (i == n-1 || a[i+1].x - (a[i+1].y / 2.0) >= rb))
			{
				rtn++;
				ans.add(pos);
			}
		}

		System.out.println(rtn);
		}
	}
} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: nlogn