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

public class Main{
  final int mod = 1000000007;
  final int maxn = -1;
  final double eps = 1e-9;

  long digits(long n){
    if(n == 0) return 0;
    int p = (int)Math.log10(n);
    return (p + 1) * (n - (long)Math.pow(10, p) + 1) + digits((long)Math.pow(10, p) - 1);
  }

  void solve(){
    // freopen("in");
    String s = "";
    long k = nextLong();
    long i = 1;
    long j = k;
    while(i < j){
      long m = (i + j) / 2;
      if(digits(m) < k){
        i = m + 1;
      }
      else{
        j = m;
      }
    }
    if(digits(i) >= k) --i;
    printf("%c\n", String.valueOf(i + 1).charAt((int)(k - digits(i) - 1)));
  }

  final double pi = Math.acos(-1.0);
  final long infl = 0x3f3f3f3f3f3f3f3fl;
  final int inf = 0x3f3f3f3f;
  final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

  boolean zero(double x){ return x < eps; }

  /** io **/
  PrintWriter out;
  BufferedReader reader;
  StringTokenizer tokens;

  Main(){
    long s = System.currentTimeMillis();
    tokens = new StringTokenizer("");
    reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
    out = new PrintWriter(System.out);
    Locale.setDefault(Locale.US);     // imprime double com ponto
    solve();
    out.close();
    debug("Time elapsed: %dms", System.currentTimeMillis() - s);
  }

  void freopen(String s){
    try{ reader = new BufferedReader(new InputStreamReader(new FileInputStream(s)), 1 << 15); }
    catch(FileNotFoundException e){ throw new RuntimeException(e); }
  }

  /** input -- supõe que não chegou no EOF **/
  int nextInt(){ return Integer.parseInt(next()); }
  long nextLong(){ return Long.parseLong(next()); }
  double nextDouble(){ return Double.parseDouble(next()); }

  String next(){ readTokens(); return tokens.nextToken(); }
  String nextLine(){ readTokens(); return tokens.nextToken("\n"); }

  boolean readTokens(){
    while(!tokens.hasMoreTokens()){             // lê os dados, ignorando linhas vazias
      try{
     ... What is the time complexity of the previous code?
targets: logn
inputs: import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Task1b {

	static int[] fromRC (String data) {
		int pos = data.indexOf('C');
		int res[] = new int[2];
		res[0] = Integer.parseInt(data.substring(1, pos));
		res[1] = Integer.parseInt(data.substring(pos + 1));
		return res;
	}
	
	static int[] fromXC (String data) {
		int pos = 0;
		int res[] = new int[2];
		res[0] = res[1] = 0;
		while (data.charAt(pos) >= 'A' && data.charAt(pos) <= 'Z') {
			res[1] *= 26;
			res[1]++;
			res[1] += data.charAt(pos) - 'A';
			pos++;
		}
		res[0] = Integer.parseInt(data.substring(pos));
		return res;
	}
	
	static String toRC (int[] data) {
		return String.format("R%dC%d", data[0], data[1]);
	}
	
	static String toXC (int[] data) {
		StringBuilder sb = new StringBuilder();
		while (data[1] > 0) {
			data[1]--;
			sb.append((char)('A' + data[1] % 26));
			data[1] /= 26;
		}
		sb = sb.reverse();
		sb.append(data[0]);
		return sb.toString();
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		for (int i = 0; i < n; i++) {
			String s = br.readLine();
			if ((s.charAt(0) == 'R') && 
				(s.charAt(1) >= '0' && s.charAt(1) <= '9') &&
				(s.indexOf('C') != -1)) {
				
				System.out.println(toXC(fromRC(s)));
			} else {
				System.out.println(toRC(fromXC(s)));
			}
		}
	}

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

public class C {

    MyScanner in;
    PrintWriter out;

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

    public void run() throws Exception {
        in = new MyScanner();
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    public void solve() throws Exception {
        int n = in.nextInt();
        char[] a = in.next().toCharArray();
        int h = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] == 'H') h++;
        }
        char[] b = new char[2 * a.length - 1];
        for (int i = 0; i < b.length; i++) {
            b[i] = a[i % a.length];
        }
        int maxh = 0;
        int hh = 0;
        for (int i = 0; i < b.length - h; i++) {
            hh = 0;
            for (int j = 0; j < h; j++) {
                if (b[i + j] == 'H') hh++;
            }
            maxh = Math.max(maxh, hh);
        }
        /*for (int i = 0; i < b.length; i++) {
            out.print(b[i]);
        }
        out.println();*/
        //out.println(h + " " + maxh);
        out.println(h - maxh);
    }
    class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() throws Exception {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

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

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

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

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

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

 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.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main2 {

	static List<List<Integer>> getLayers(int[] numbers, int a, int b) {
		boolean[] used = new boolean[numbers.length];
		HashSet<Integer> hs = new HashSet<Integer>();
		for (int i = 0; i < numbers.length; i++) {
			hs.add(numbers[i]);
		}
		HashMap<Integer, Integer> numberToIndex = new HashMap<Integer, Integer>();
		for (int i = 0; i < numbers.length; i++) {
			numberToIndex.put(numbers[i], i);
		}

		List<List<Integer>> ans = new ArrayList<List<Integer>>();
		for (int i = 0; i < numbers.length; i++) {
			if (!used[i]) {

				List<Integer> ansRow = new ArrayList<Integer>();
				LinkedList<Integer> current = new LinkedList<Integer>();
				current.add(numbers[i]);
				while (!current.isEmpty()) {
					int c = current.removeFirst();
					used[numberToIndex.get(c)] = true;

					boolean found = false;

					if (hs.contains(a - c)) {
						found = true;
						if (a - c != c)
							current.add(a - c);
					}

					if (hs.contains(b - c)) {
						found = true;
						if (b - c != c)
							current.add(b - c);
					}

					if (found || ansRow.size() > 0)
						ansRow.add(c);

					hs.remove(c);
				}

				ans.add(ansRow);
			}
		}

		return ans;
	}

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

		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

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

		HashSet<Integer> hs = new HashSet<Integer>();
		for (int i = 0; i < numbers.length; i++) {
			hs.add(numbers[i]);
		}

		int[] belongs = new int[n];
		for (int i = 0; i < belongs.length; i++) {
			belongs[i] = -1;
		}

		HashMap<Integer, Integer> numberToIndex = new HashMap<Integer, Integer>();
		for (int i = 0; i < numbers.length; i++) {
			numberToIndex.put(numbers[i], i);
		}

		boolean possible = true;

		List<List<Integer>>... Complexity:
targets: linear
inputs: import java.util.*;

public class Main {
    static class Node implements Comparable<Node>{
        public int l,r;
        public long s;
        Node(int l,int r,long s){
            this.l=l;
            this.r=r;
            this.s=s;
        }
        public int compareTo(Node o) {
            if(o.s==s){
                if(r>o.r) return 1;
                else if(r==o.r) {
                    return 0;
                }
                else return -1;
            } else if(s>o.s){
                return 1;
            } else {
                return -1;
            }
        }
    }
    static long[] sum=new long[1550];
    public static void main(String[] args) {
        TreeMap<Long, ArrayList<Node> > mp = new TreeMap<>();
        Scanner cin = new Scanner(System.in);
        int N=cin.nextInt();
        for(int i=1;i<=N;i++){
            int x=cin.nextInt();
            sum[i]=sum[i-1]+x;
        }
        //System.out.println("here");
        ArrayList<Node> arr = new ArrayList<>();
        for(int l=1;l<=N;l++){
            for(int r=l;r<=N;r++){
                arr.add(new Node(l,r,sum[r]-sum[l-1]));
            }
        }
        Collections.sort(arr);
        for(int i=0;i<arr.size();i++){
            ArrayList<Node> a=mp.get(arr.get(i).s);
            if(a==null) {
                a=new ArrayList<>();
                mp.put(arr.get(i).s,a);
            }
            a.add(arr.get(i));
        }
        int mx=-1;
        long mxv=-1;
        Iterator<Long> it=mp.keySet().iterator();
        while(it.hasNext()){
            int ans=0,t=0;
            long v=it.next();
            ArrayList<Node> vec= mp.get(v);
            for(int i=0;i<vec.size();i++){
                if(t<vec.get(i).l){
                    ans++;
                    t=vec.get(i).r;
                }
            }
           //
            if(ans>mx){
                mx=ans;
                mxv=v;
               // System.out.println(mxv);
            }
        }
        ArrayList<Node> vec=mp.get(mxv);
       ... 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.*;
import java.lang.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.*;
import java.math.*;
public class Main {
    public void dfs(ArrayList<Integer>[] graph,int[] visited,int source) {
        
    }
    public static void main(String[] args) throws Exception{
        Reader.init(System.in);
        PrintWriter out = new PrintWriter(System.out);
        Main mm =new Main();
        int n=Reader.nextInt();
        int m=Reader.nextInt();
        String s=Reader.next();
        int[][] count=new int[m][m];
        for(int i=1;i<n;i++) {
            count[s.charAt(i)-'a'][s.charAt(i-1)-'a']++;
            count[s.charAt(i-1)-'a'][s.charAt(i)-'a']++;
        }
        int[] dp=new int[1<<m];
        Arrays.fill(dp, Integer.MAX_VALUE/10);
        for(int i=0;i<m;i++) {
            dp[1<<i]=0;
        }
        for(int i=0;i<(1<<m);i++) {
            int extra=0;
            for(int j=0;j<m;j++) {
                if((i&(1<<j))>0) {
                for(int k=0;k<m;k++) {
                    if(j!=k &&  (i&(1<<k))==0) {
                        extra+=count[j][k];
                    }
                }
               }
            }
            for(int j=0;j<m;j++) {
                if((i&(1<<j))==0) {
                    dp[i|(1<<j)]=Math.min(dp[i|(1<<j)], dp[i]+extra);
                }
            }
        }
        out.println(dp[(1<<m)-1]);
        out.close();
}
}
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;
    /** call this method to initialize reader for InputStream */
    static void init() throws IOException {
         reader = new BufferedReader(
                 new FileReader("input.txt"));
    tokenizer = new StringTokenizer("");
    }
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
    /** get next word */
    static... 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.*;
public class A {
    public static void main(String[]args) {
        Scanner in = new Scanner(System.in);
        long l = in.nextLong();
        long r = in.nextLong();
        if(r - l < 2) System.out.println(-1);
        else {
            if(l % 2 == 0)
                System.out.println(l + " " + (l+1) + " " + (l+2));
            else {
                if(r - l < 3) System.out.println(-1);
                else
                    System.out.println((l+1) + " " + (l+2) + " " + (l+3));
            }
        }
    }
}
 What is the time complexity of the previous code?
targets: constant
inputs: /**
 * Write a description of class VK2A here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
import java.util.*;
public class VK2A
{
    public static void main(String args[])
    {
        Scanner S = new Scanner(System.in);
        int n = S.nextInt();
        int a = S.nextInt();
        int b = S.nextInt();
        int[] A = new int[n];
        for(int i = 0; i < n; i++)
            A[i] = S.nextInt();
        for(int i = 0; i < n; i++)
            for(int j = 0; j < n - i - 1; j++)
            {
                if(A[j] < A[j + 1])
                {
                    int temp = A[j];
                    A[j] = A[j + 1];
                    A[j + 1] = temp;
                }
            }
        
            System.out.println(A[a - 1] - A[a]);
        }
 
}
 What is the time complexity of the previous code?
targets: nlogn
inputs: // practice with rainboy
import java.io.*;
import java.util.*;

public class CF256B extends PrintWriter {
	CF256B() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF256B o = new CF256B(); o.main(); o.flush();
	}

	long count(int n, int x, int y, int r) {
		long a = 2L * r * r + 2 * r + 1;
		int w;
		if ((w = 1 - (x - r)) > 0)
			a -= (long) w * w;
		if ((w = 1 - (y - r)) > 0)
			a -= (long) w * w;
		if ((w = (x + r) - n) > 0)
			a -= (long) w * w;
		if ((w = (y + r) - n) > 0)
			a -= (long) w * w;
		if ((w = r - 1 - (x - 1) - (y - 1)) > 0)
			a += (long) w * (w + 1) / 2;
		if ((w = r - 1 - (x - 1) - (n - y)) > 0)
			a += (long) w * (w + 1) / 2;
		if ((w = r - 1 - (n - x) - (y - 1)) > 0)
			a += (long) w * (w + 1) / 2;
		if ((w = r - 1 - (n - x) - (n - y)) > 0)
			a += (long) w * (w + 1) / 2;
		return a;
	}
	void main() {
		int n = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		int c = sc.nextInt();
		int lower = -1, upper = c;
		while (upper - lower > 1) {
			int r = (lower + upper) / 2;
			if (count(n, x, y, r) >= c)
				upper = r;
			else
				lower = r;
		}
		println(upper);
	}
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: import java.util.InputMismatchException;
import java.math.BigInteger;
import java.io.*;
import java.util.*;

/**
 * Generated by Contest helper plug-in
 * Actual solution is at the bottom
 */

public class Main {
	public static void main(String[] args) {
		InputReader in = new StreamInputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		run(in, out);
	}

	public static void run(InputReader in, PrintWriter out) {
		Solver solver = new Task();
		solver.solve(1, in, out);
		Exit.exit(in, out);
	}
}

abstract class InputReader {
	private boolean finished = false;

	public abstract int read();

	public long readLong() {
		return new BigInteger(readString()).longValue();
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuffer res = new StringBuffer();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	private boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public void setFinished(boolean finished) {
		this.finished = finished;
	}

	public abstract void close();
}

class StreamInputReader extends InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar, numChars;

	public StreamInputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

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

public class MainClass {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int arr[] = {4,7,47,74,447,474,477,744,747,774};
        int i=0, x = in.nextInt();
        while (i<arr.length)
        if (x%arr[i++] == 0)
        {
             System.out.print("YES");
             return;
        }
        System.out.print("NO");
    }
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author pttrung
 */
public class B {

    static Senator[] data;

    public static void main(String[] args) {
        Scanner in = new Scanner(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int k = in.nextInt();
        int A = in.nextInt();
        data = new Senator[n];
        for (int i = 0; i < n; i++) {
            data[i] = new Senator(in.nextInt(), in.nextInt());
        }
        out.println(cal(0, new int[n], A, k));

        out.close();
    }

    public static double cal(int index, int[] num, int A, int left) {
        if (index == data.length - 1) {
            int dif = (100 - data[index].loyal)/10;
            dif = left >= dif? dif:left;
            num[index] =  dif;
           
            double result = 0;
            for (int k = 0; k < (1 << num.length); k++) {
                double val = 1;
                double total = 0;
                for (int i = 0; i < num.length; i++) {
                    if (((1 << i) & k) != 0) {
                        val *= ((double)(data[i].loyal + 10*num[i])/100);
                    } else {
                        val *= ((double)(100 - (data[i].loyal + 10*num[i]))/100);
                        total += data[i].level;
                    }
                }
                if (countBit(k) > num.length / 2) {
                    result += val;
                } else {
                    result += val * ((double) A / (A + total));
                }
            }
//           // if(result >= 1){
//                for(int i : num){
//                    System.out.print(i + " ");
//                }
//                System.out.println("\n" + result);
//            //}
            return result;
        } else {
            double result = 0;
         ... What is the time complexity of the previous code?
targets: np
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.awt.Point;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import static java.lang.Math.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Character.*;
import static java.lang.String.*;
@SuppressWarnings("unused")

public class round169D {
    static PrintWriter out = new PrintWriter(System.out);
    static BufferedReader br = new BufferedReader(new InputStreamReader(
            System.in));
    static StringTokenizer st = new StringTokenizer("");
    static int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    static String next() throws Exception {
        while (true) {
            if (st.hasMoreTokens()) {
                return st.nextToken();
            }
            String s = br.readLine();
            if (s == null) {
                return null;
            }
            st = new StringTokenizer(s);
        }
    }
    public static void main(String[] args)throws Exception {        
        long l = parseLong(next());
        long r = parseLong(next());
        long [] min = new long [61];
        for(int i = 1 ; i <= 60 ; ++i){//(2^i)-1 is obtained by min[i]^min[i]+1
            min[i] = (long) pow(2, i - 1) - 1;          
        }
        for(int i = 60 ; i >= 0 ; --i){//try to get 2^i-1 as answer.                
            if(min[i] >= r)
                continue;
            if(min[i] >= l && min[i] + 1 <= r){             
                out.println((1L << i) - 1);
                out.flush();
                return;
            }
            if(min[i] < l){
                long one_jump = (long) pow(2, i);
                long  jumps = (long) ceil((l - min[i]) / (one_jump * 1.0));             
                long cur = min[i] + (jumps * one_jump);
                if(cur >= l && cur + 1 <= r){                                       
                    out.println((1L << i) - 1);
                   ... 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.util.*;

import java.lang.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.*;
 
public class Main {
        
    public static void main(String[] args) throws Exception{
        FastReader sc=new FastReader(); 
        OutputStream outputStream = System.out;
        PrintWriter out = new PrintWriter(outputStream);
        int n=sc.nextInt();
        HashMap<String,Integer> map=new HashMap<String,Integer>();
        for(int i=0;i<n;i++) {
            map.put(sc.next(), 1);
        }
        ArrayList<String> list=new ArrayList<String>();
        int count=0;
        if(!map.containsKey("purple")) {
            count++;
            list.add("Power");
        }
if(!map.containsKey("green")) {
    count++;
    list.add("Time");
        }

if(!map.containsKey("blue")) {
    count++;
    list.add("Space");
}

if(!map.containsKey("orange")) {
    count++;
    list.add("Soul");
}

if(!map.containsKey("red")) {
    count++;
    list.add("Reality");
}

if(!map.containsKey("yellow")) {
    count++;
    list.add("Mind");
}System.out.println(count);
    for(String s:list) {
        System.out.println(s);
    }
    }
}

class FastReader 
{ 
    BufferedReader br; 
    StringTokenizer st; 
 
    public FastReader() 
    { 
        br = new BufferedReader(new
                 InputStreamReader(System.in)); 
    } 
 
    String next() 
    { 
        while (st == null || !st.hasMoreElements()) 
        { 
            try
            { 
                st = new StringTokenizer(br.readLine()); 
            } 
            catch (IOException  e) 
            { 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } 
 
    int nextInt() 
    { 
        return Integer.parseInt(next()); 
    } 
 
    long nextLong() 
    { 
        return Long.parseLong(next()); 
    } 
 
    double nextDouble() 
    { 
        return Double.parseDouble(next()); 
    } 
 
    String nextLine() 
    { 
 ... Complexity:
targets: constant
inputs: import java.util.Scanner;


public class Round8_C {

	/**
	 * @param args
	 */
	
	int n ;
	int[] X, Y ;
	
	public Round8_C() {
		info_in() ;
		process() ;
	}
	
	void info_in()
	{
		Scanner input = new Scanner(System.in) ;
		int dx = input.nextInt() ;
		int dy = input.nextInt() ;
		
		n = input.nextInt() ;
		X = new int[n] ;
		Y = new int[n] ;
		
		for( int i=0;i<n;i++) {
			X[i] = input.nextInt() - dx ;
			Y[i] = input.nextInt() - dy ;
		}
	}
	
	int[] d  ;
	int[] trace ;
	
	public static int distance( int x1, int y1, int x2, int y2 )
	{
		return (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ;
	}
	
	void process()
	{
		int gh = 1<<n ;
		d = new int[gh] ;
		trace = new int[gh] ;
		
		d[0] = 0 ;
		for( int i=1;i<gh;i++) {
			d[i] = Integer.MAX_VALUE ;
			for( int j=0;j<n;j++)
				if ( (i & (1<<j)) > 0 ) {
					int val = d[i^(1<<j)] + ( distance( X[j], Y[j], 0, 0 ) << 1 ) ;
					if ( val < d[i] ) {
						d[i] = val ;
						trace[i] = j+1 ;
					}
					
					int state = i ^ (1<<j) ;
					for( int p=j+1;p<n;p++)
						if ( (i & (1<<p)) > 0) {
							val = d[state^(1<<p)] + distance( X[j], Y[j], 0, 0 ) + distance( X[j], Y[j], X[p], Y[p] ) + distance( X[p], Y[p], 0, 0 ) ;
							if ( val < d[i] ) {
								d[i] = val ;
								trace[i] = (j+1) * 100 + (p+1) ; 
							}
						}
					break ;
				}
		}
		
		System.out.println( d[gh-1] ) ;
		gh-- ;
		while ( gh > 0 ) {
			int v1 = trace[gh] / 100 - 1 ;
			int v2 = trace[gh] % 100 - 1 ;
			System.out.print(0 + " ") ;
			if ( v1 != -1 ) {
				System.out.print((v1+1) + " " ) ;
				gh -= 1 << v1 ;
			}
			System.out.print( (v2+1) + " " ) ;
			gh -= 1 << v2 ;
		}
		System.out.println(0) ;
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Round8_C() ;
	}

}
 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 {

    static final int primeCount = 452;
    static final int[] prime = new int[primeCount];

    static void build_prime() {
        boolean[] notPrime = new boolean[3200];
        for (int i = 2; i < 3200; i++) {
            if (notPrime[i]) continue;
            for (int j = i * i; j < 3200; j += i) {
                notPrime[j] = true;
            }
        }

        int count = 0;
        for (int i = 2; i < 3200; i++) {
            if (notPrime[i]) continue;

            prime[count++] = i;
        }
    }

    private static void run(Reader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        int m = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = getReal(in.nextInt());
        }

        int[] pre = new int[n];
        for (int i = 0; i < n; i++) pre[i] = -1;

        TreeMap<Integer, Integer> exist = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            Integer result = exist.get(a[i]);
            if (result != null) {
                pre[i] = result;
            }
            exist.put(a[i], i);
        }

        int[][] left = new int[m + 1][n];
        for (int i = 0; i <= m; i++) {
            int start = 0;
            PriorityQueue<Integer> inSame = new PriorityQueue<>();
            for (int j = 0; j < n; j++) {
                if (pre[j] >= start) {
                    inSame.add(pre[j]);

                    if (inSame.size() > i) {
                        start = inSame.poll() + 1;
                    }
                }
                left[i][j] = start;
            }
        }

        int[][] dp = new int[n][m + 1];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j <= m; j++) {
                dp[i][j] = Integer.MAX_VALUE;
            }
            for (int j = 0; j <= m; j++) {
                for (int k = 0; k <= j; k++) {
                    if (left[k][i] == 0) {
                        dp[i][j] = 1;
             ... What is the time complexity of the previous code?
targets: cubic
inputs: import java.util.*;

public class Solution {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Comp c1 = getComp(scanner);
		Comp c2 = getComp(scanner);
		c1.sortByPrice();
		c2.sortByPrice();	
		int i = 0;
		int j = 0;
		while(i < c1.num || j < c2.num) {
			Elem xi = (i < c1.num) ? c1.elems.get(i) : null;
			Elem yj = (j < c2.num) ? c2.elems.get(j) : null;
			if(xi != null && yj != null) {
				if(xi.price >= yj.price) {
					if(!c2.resultSet.contains(xi)) {
						c1.resultSet.add(xi);
					}
					i++;
				} else {
					if(!c1.resultSet.contains(yj)) {
						c2.resultSet.add(yj);
					}
					j++;
				}
			} else
			if(xi != null) {
				if(!c2.resultSet.contains(xi)) {
					c1.resultSet.add(xi);
				}
				i++;
			} else {
				if(!c1.resultSet.contains(yj)) {
					c2.resultSet.add(yj);
				}
				j++;
			}				
		}
		
		long result = c1.getResultPrice() + c2.getResultPrice();
		System.out.println(result);
   }
   
   private static Comp getComp(Scanner scanner) {
	   Comp c = new Comp();
	   c.num = scanner.nextInt();
	   for(int i = 0; i < c.num; i++) {
		   c.addElem(scanner.nextLong(), scanner.nextLong());
	   }
	   return c;
   }
}

class Comp {
	int num;
	List<Elem> elems = new ArrayList<>();
	Set<Elem> resultSet = new HashSet<>();
	
	void addElem(long el, long pr) {
		Elem elem = new Elem(el, pr);
		elems.add(elem);
	}
	
	void sortByPrice() {
		Collections.sort(elems);
	}
	
	long getResultPrice() {
		long sumPrice = 0;
		for(Elem elem : resultSet) {
			sumPrice += elem.price;
		}
		
		return sumPrice;
	}
}

class Elem implements Comparable<Elem> {
	long elem;
	long price;
	
	public Elem(long el, long pr) {
		this.elem = el;
		this.price = pr;
	}
	
	public int compareTo(Elem other) {
		return (int) (other.price - price);
	}
	
	public boolean equals(Object o) {
		if(!(o instanceof Elem)) {
			return false;
		}
		
		Elem other = (Elem) o;
		return (other.elem == elem);
	}
	
	public int hashCode() {
		return (int) elem;
	}
	
	public String toString() {
		return "(" + elem +... 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.util.*;
import java.lang.*;


public class Main implements Runnable {
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c =... Complexity:
targets: np
inputs: import java.util.*;

public class Solution {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Comp c1 = getComp(scanner);
		Comp c2 = getComp(scanner);
		c1.sortByPrice();
		c2.sortByPrice();	
		int i = 0;
		int j = 0;
		while(i < c1.num || j < c2.num) {
			Elem xi = (i < c1.num) ? c1.elems.get(i) : null;
			Elem yj = (j < c2.num) ? c2.elems.get(j) : null;
			if(xi != null && yj != null) {
				if(xi.price >= yj.price) {
					if(!c2.resultSet.contains(xi)) {
						c1.resultSet.add(xi);
					}
					i++;
				} else {
					if(!c1.resultSet.contains(yj)) {
						c2.resultSet.add(yj);
					}
					j++;
				}
			} else
			if(xi != null) {
				if(!c2.resultSet.contains(xi)) {
					c1.resultSet.add(xi);
				}
				i++;
			} else {
				if(!c1.resultSet.contains(yj)) {
					c2.resultSet.add(yj);
				}
				j++;
			}				
		}
		
		long result = c1.getResultPrice() + c2.getResultPrice();
		System.out.println(result);
   }
   
   private static Comp getComp(Scanner scanner) {
	   Comp c = new Comp();
	   c.num = scanner.nextInt();
	   for(int i = 0; i < c.num; i++) {
		   c.addElem(scanner.nextLong(), scanner.nextLong());
	   }
	   return c;
   }
}

class Comp {
	int num;
	List<Elem> elems = new ArrayList<>();
	Set<Elem> resultSet = new HashSet<>();
	
	void addElem(long el, long pr) {
		Elem elem = new Elem(el, pr);
		elems.add(elem);
	}
	
	void sortByPrice() {
		Collections.sort(elems);
	}
	
	long getResultPrice() {
		long sumPrice = 0;
		for(Elem elem : resultSet) {
			sumPrice += elem.price;
		}
		
		return sumPrice;
	}
}

class Elem implements Comparable<Elem> {
	long elem;
	long price;
	
	public Elem(long el, long pr) {
		this.elem = el;
		this.price = pr;
	}
	
	public int compareTo(Elem other) {
		return (int) (other.price - price);
	}
	
	public boolean equals(Object o) {
		if(!(o instanceof Elem)) {
			return false;
		}
		
		Elem other = (Elem) o;
		return (other.elem == elem);
	}
	
	public int hashCode() {
		return (int) elem;
	}
	
	public String toString() {
		return "(" + elem +... What is the time complexity of the previous code?
targets: nlogn
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
import java.util.regex.*;
//import java.math.*;
//import static java.lang.Math.*;
//import static java.util.Arrays.*;
 
public class Main{
    public static void main(String[] args) throws IOException { //1-checker 2-console
        //if (args.length==2) open(args[0], args[1], true, false); else open ("input.txt", "output.txt", true, false);
        open ("input.txt", "output.txt", false, true);
        char[] alph = " ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
        Pattern pat = Pattern.compile("[A-Z]+[\\d]+");
        Matcher mat;
        boolean b ;
        String  s;
        int index, coef, row, col;
        int n = nextInt();
        String[] tmp;
        char[] c;
        for (int i=0; i<n; i++)
        {
            s = nextLine();
            c = s.toCharArray();
            mat = pat.matcher(s);
            b = mat.matches();
            if (b)
            {
                
                index = c.length-1;
                coef = 1;
                row = 0;
                while (c[index]>='0' && c[index]<='9')
                {
                    row += (c[index]-'0')*coef;
                    coef*=10;
                    index--;
                }
                coef = 1;
                col = 0;
                while (index>=0)
                {
                    /*if (coef!=1)*/ col += (Arrays.binarySearch(alph, c[index]))*coef;
                    //else col += (Arrays.binarySearch(alph, c[index]))*coef;
                    coef*=26;
                    index--;
                }
                out.println("R"+row+"C"+col);
            }
            else
            {
                tmp = s.split("R|C");
                //out.print(tmp.length);
                //row = Integer.parseInt(tmp[1]);
                col = Integer.parseInt(tmp[2]);
                char[] temp = new char[10];
                int len = 0;
                int v = 0;
                while (col>0)
                {
                    index =... Complexity:
targets: linear
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. /*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

//package NumberTheory;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
 *
 * @author Sourav Kumar Paul
 */
public class A235 {
    public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        long n = Long.parseLong(reader.readLine());
        //int gcd = gcd(924,923);
        //System.out.println(gcd);
       // System.out.println(gcd(923,461));
        if(n<=2)
            System.out.println(n);
        else if(n==3)
            System.out.println("6");
        
        else if(n % 2== 0)
       {
           if(n % 3 == 0)
           {
               System.out.println((n-3)*(n-1)*(n-2));
           }
           else
               
           System.out.println(n * (n-1) * (n-3) );
       }
        else
            System.out.println(n*(n-1)*(n-2));
    }
     private static int gcd(int i, int j) {
        int a = Math.min(i,j);
        int b = Math.max(i,j);
       while(a != 0)
       {
           int temp = b % a;
           b = a;
           a = temp;
       }
       return b;
    }
}
 Complexity:
targets: constant
inputs: import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class BSportMafia {
        private InputReader in;
        private OutputWriter out;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            this.in = in;
            this.out = out;
            long n = in.nextInt();
            long k = in.nextInt();
            for (long i = 1; i * (i + 1) / 2 + i <= n + k; i++) {
                if (i * (i + 1) / 2 + i == n + k) {
                    out.println(n - i);
                    return;
                }
            }
        }

    }

    static class InputReader extends InputStream {
        private InputStream stream;
        private byte[] buf = new byte[1 << 16];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars... 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.util.*;

public class B {

	public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

	public static void main(String[] args) throws IOException {
		readInput();
		out.close();
	}

	static boolean sq(long x) {
		long l = 1;
		long r = (int)Math.sqrt(1e16)+1;
		while (l+1<r) {
			long m = (l+r)>>1;
			if (m * m > x) r = m;
			else l = m;
		}
		return l*l == x;
	}
	
	static boolean solve(long x) {
		if ((x&1)==1) return false;
		if ((x & (x-1)) == 0) return true;
		long num = 2;
		while (num < x && x % num == 0) {
			if (sq(x/num)) return true;
			num*=2;
		}
		return false;
	}
	
	public static void readInput() throws IOException {
		// br = new BufferedReader(new FileReader(".in"));
		// out = new PrintWriter(new FileWriter(".out"));
		int t = Integer.parseInt(br.readLine());
		while (t-->0) {
			int x = Integer.parseInt(br.readLine());
			out.println(solve(x) ? "YES":"NO");
		}
	}
}
 What is the time complexity of the previous code?
targets: linear
inputs: import java.io.*;
import java.util.*;

/**
 * @author Vaibhav Mittal
 */

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

        int testCases = 1;
        Task solver = new Task();
        for (int i = 1; i <= testCases; ++i)
            solver.solve(in, out);

        out.close();
    }
}

class Task {
    public void solve(Scanner in, PrintWriter out) {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] complexity = new int[n];
        for (int i = 0; i < n; ++i)
            complexity[i] = in.nextInt();
        Arrays.sort(complexity);
        out.println(complexity[b] - complexity[b - 1]);
    }
} What is the time complexity of the previous code?
targets: nlogn
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. 

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

public class phoenix_and_computers {

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

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

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

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

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

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

		System.out.println(ans);
	}

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

	public static long xpown(long x, long n) {
		long res = 1;
		while (n > 0) {
			if (n % 2 != 0) {
				res = (res * x) % 1000000007;
				n--;
			} else {
				x = (x * x) % 1000000007;
				n = n / 2;
			}
		}
		return res;
	}
}
 Complexity:
targets: cubic
inputs: import java.util.Scanner;
import java.util.StringTokenizer;

/**
 * Created with IntelliJ IDEA.
 * User: Саша
 * Date: 08.08.12
 * Time: 14:12
 */
public class LuckyDivision {

    public final String check (String s) {
        String result = "NO";
        StringTokenizer stringTokenizer = new StringTokenizer(s, "47");
        if(!stringTokenizer.hasMoreTokens()) return "YES";
        int S = Integer.parseInt(s);
        generateSimpleAndDivide(S, 4, 4, 7);
        generateSimpleAndDivide(S, 7, 4, 7);
        if(lucky) return "YES";
        return result;
    }
    public static final void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print(new LuckyDivision().check(scanner.next()));
    }

    public void generateSimpleAndDivide(int divided, int n, int n1, int n2) {
        if(lucky || n >= divided) return;
        if(divided % n == 0) lucky = true;
        generateSimpleAndDivide(divided, Integer.parseInt(n + "" + n1), n1, n2);
        generateSimpleAndDivide(divided, Integer.parseInt(n + "" + n2), n1, n2);
    }
    private boolean lucky = false;
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;
import java.io.*;
public class B {
    static class Scan {
        private byte[] buf=new byte[1024];
        private int index;
        private InputStream in;
        private int total;
        public Scan()
        {
            in=System.in;
        }
        public int scan()throws IOException
        {
            if(total<0)
            throw new InputMismatchException();
            if(index>=total)
            {
                index=0;
                total=in.read(buf);
                if(total<=0)
                return -1;
            }
            return buf[index++];
        }
        public int scanInt()throws IOException
        {
            int integer=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    integer*=10;
                    integer+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            return neg*integer;
        }
        public double scanDouble()throws IOException
        {
            double doub=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n)&&n!='.')
            {
                if(n>='0'&&n<='9')
                {
                    doub*=10;
                    doub+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            if(n=='.')
            {
                n=scan();
                double temp=1;
                while(!isWhiteSpace(n))
                {
                    if(n>='0'&&n<='9')
                   ... 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.util.*;
import java.io.*;
import java.math.*;
public class Main{
  public static void main(String[] args) {
    long  n,k;
    Scanner s= new Scanner(System.in);
	n=s.nextInt();
	k=s.nextInt();
	System.out.println((int)(n-((-3+Math.sqrt(9+8*(n+k)))/2)));  
  }
}
 Complexity:
targets: logn