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

public class Solution {
    public static void main (String[] args) throws IOException {
        boolean online = "true".equals(System.getProperty("ONLINE_JUDGE"));
        if (online) {
            in = new InputReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
        else {
            in = new InputReader(new FileReader("input.txt"));
            out = new PrintWriter(new File("output.txt"));
        }
        
        new Solution().run();
        
        out.close();
    }
    
    long sum (int x) {
        return x * 1l * (x+1) / 2;
    }
    
    int bins (long n, int k) {
        int l = 1,
            r = k;
        while (l < r) {
            int w = (l+r)/2;
            long s = sum(k) - sum(w-1);
            if (s == n)
                return w;
            if (s < n)
                r = w;
            else
                l = w+1;
        }
        return l;
    }
    
    private void run () {
        long n = in.nextLong();
        int k = in.nextInt();
        if (n == 1) {
            out.println(0);
            return;
        }
        if (1 + sum(k-1) < n) {
            out.println(-1);
            return;
        }
        int c = bins(n-1,k-1);
        if (1 + sum(k-1) - sum(c-1) == n)
            out.println(k-c);
        else
            out.println(k-c+1);
    }
    
    private static InputReader in;
    private static PrintWriter out;
}

class InputReader {
    public InputReader (Reader r) {
        buff = new BufferedReader(r);
        try {
            str = new StringTokenizer(buff.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    
    public String next () {
        while (!str.hasMoreTokens())
            try {
                str = new StringTokenizer(buff.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        return str.nextToken();
    }
    
    public int nextInt () {
       ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Arrays;
import java.util.Scanner;

public class problemA {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] numbs = new int[n];
        int[] smallest_color = new int[n];
        for(int i =  0; i < n;i++){
            numbs[i] = scan.nextInt();
        }
        Arrays.sort(numbs);
        int count = 0;
        for(int i =0; i < n; i++){
            for(int j=0; j <n;j++ ){
                if(smallest_color[j] == 0){
                    count++;
                    smallest_color[j] = numbs[i];
                    break;
                }
                if(numbs[i] % smallest_color[j] == 0){
                    break;
                }
            }
        }
        System.out.println(count);
    }
} Complexity:
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;

public class helloWorld 
{
	public static void main(String[] args) 
	{		
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		int[] ar = new int[200];
		
		String str = in.next();
		for(int i = 0; i < str.length(); i++)
			ar[ str.charAt(i) ]++;
			
		int ans = 100000;
		
		for(int i = 'A'; i < 'A' + m; i++)
			ans = Math.min(ans, ar[i]);
		ans *= m;
		
		System.out.println(ans);
		
		in.close();
	}
}

 Complexity:
targets: linear
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;

public class Alpha_Round {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
        String[] in = reader.readLine().split(" ");
        long n = Long.parseLong(in[0]);
        long k = Long.parseLong(in[1]);
        long D = 9 + 8*k + 8*n;
        long m = (long) ((-3 + Math.sqrt(D))/2);
        writer.write((n - m) + "");
        writer.close();
    }
} Complexity:
targets: logn
inputs: import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

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

    static class TaskE {
        HashMap<Integer, Integer> map = new HashMap<>();
        boolean[] dp;
        boolean[] vis;
        boxPair[] ans;

        int two(int bit) {
            return 1 << bit;
        }

        boolean contain(int mask, int bit) {
            return ((two(bit) & mask) > 0);
        }

        int get(long val) {
            if (val > Integer.MAX_VALUE || val < Integer.MIN_VALUE) return -1;
            int key = (int) val;
            if (map.containsKey(key) == false) return -1;
            return map.get(key);
        }

        boolean rec(int mask, boolean[] hasCycle) {
            if (hasCycle[mask]) return true;
            if (vis[mask] == true) return dp[mask];
            vis[mask] = true;
            for (int i = mask & (mask - 1); i > 0; i = mask & (i - 1)) {
                if (rec(i, hasCycle) && rec(i ^ mask, hasCycle)) {
                    return dp[mask] = true;
                }
            }
            return dp[mask] = false;
        }

        void findPath(int mask, boolean[] hasCycle, ArrayList<boxPair>[] maskPath) {
            if (hasCycle[mask]) {
                for (boxPair b : maskPath[mask]) {
                    ans[get(b.addTo)] = b;
                }
                return;
            }
            for (int i = mask & (mask -... What is the time complexity of the previous code?
targets: np
inputs: import java.io.*;
import java.util.*;

public class Codeforces913F {
	public static void main(String[] args) throws IOException {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int a = input.nextInt();
		int b = input.nextInt();
		input.close();
		final int mod = 998244353;
		
		int frac = multiply(a, inverse(b, mod), mod);
		int reverse = (mod+1-frac)%mod;
		
		int[] fracpower = new int[n+1];
		int[] reversepower = new int[n+1];
		fracpower[0] = 1;
		reversepower[0] = 1;
		for (int i = 1; i <= n; i++) {
			fracpower[i] = multiply(fracpower[i-1], frac, mod);
			reversepower[i] = multiply(reversepower[i-1], reverse, mod);
		}
		
		int[][] dp1 = new int[n+1][n+1];
		dp1[2][1] = 1;
		for (int i = 3; i <= n; i++) {
			for (int j = 1; j < i; j++) {
				if (j == 1) {
					dp1[i][j] = fracpower[i-1];
				}
				else {
					dp1[i][j] = multiply(dp1[i-1][j-1], fracpower[i-j], mod);
				}
				if (j == i-1) {
					dp1[i][j] += reversepower[i-1];
					dp1[i][j] %= mod;
				}
				else {
					dp1[i][j] += multiply(dp1[i-1][j], reversepower[j], mod);
					dp1[i][j] %= mod;
				}
			}
		}
		
		int[][] dp2 = new int[n+1][n+1];
		dp2[1][1] = 1;
		dp2[2][1] = 1;
		dp2[2][2] = 0;
		for (int i = 3; i <= n; i++) {
			int val = 0;
			for (int j = 1; j < i; j++) {
				dp2[i][j] = multiply(dp2[j][j], dp1[i][j], mod);
				val += dp2[i][j];
				val %= mod;
			}
			dp2[i][i] = (mod+1-val)%mod;
		}
		
		/*for (int i = 2; i <= n; i++) {
			for (int j = 1; j <= i; j++) {
				System.out.print(dp2[i][j] + " ");
			}
			System.out.println();
		}*/
		
		int[] EV = new int[n+1];
		EV[1] = 0;
		EV[2] = 1;
		for (int i = 3; i <= n; i++) {
			int val = 0;
			for (int j = 1; j < i; j++) {
				int r = j*(i-j) + (j*(j-1))/2 + EV[i-j] + EV[j];
				r %= mod;
				val += multiply(dp2[i][j], r, mod);
				val %= mod;
			}
			val += multiply((i*(i-1))/2, dp2[i][i], mod);
			val %= mod;
			
			int s = (mod+1-dp2[i][i])%mod;
			EV[i] = multiply(val, inverse(s, mod), mod);
		}
		
		System.out.println(EV[n]);
	}
	
	public static int... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: quadratic
inputs: import java.util.*;
import java.io.*;

public class Soldiers {
	public static void main(String[] args) throws IOException {
		new Soldiers().run();
	}

	void run() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(System.out);

		int n = nextInt();
		pw.println(3 * (n / 2));

		pw.close();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter pw;

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

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

	double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}
}
 What is the time complexity of the previous code?
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;


public class problemA {
    public  static long GCD(long number1, long number2) {
        //base case
        if(number2 == 0){
            return number1;
        }
        return GCD(number2, number1%number2);
    }
  

public static void main(String[] args) throws NumberFormatException, IOException {
    BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        long b =  Long.parseLong(st.nextToken());
        long c =  Long.parseLong(st.nextToken());
        if(c-b<2 ||((c-b==2)&& GCD(c,b)==1) ){
            System.out.println("-1");
        }else{
                if(b%2==0 ){
                    System.out.println(b+" "+(b+1)+" "+(b+2));
            }else
                System.out.println((b+1)+" "+(b+2)+" "+(b+3));
        
    
    
}
        

        

}
}
 Complexity:
targets: constant
inputs: import java.util.*;

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

public class Main {

	boolean test = false;
	PrintWriter pw = new PrintWriter(System.out);
	InputStreamReader inp = new InputStreamReader(System.in);
	BufferedReader in = new BufferedReader(inp);
	
	private String[] inData = {"zzz"
			};
	
	
	static int id = -1;
	
	public String readLine() {
		id++;
		if (test)
			return inData[id];
		else
			try{
				return in.readLine();	
			} catch( Exception e){
				e.printStackTrace();
			}
		return "";
	}

	private void solve() {
		
		String readLine = readLine();
		
		int best = 0;
		
		for (int i = 0; i < readLine.length(); i++) {
			for (int j = i; j < readLine.length(); j++) {
				String substring = readLine.substring(i,j+1);
				String remainString = readLine.substring(i+1);
				if(remainString.contains(substring)){
					if(substring.length() > best){
						best = substring.length();	
					}
					
				}
			}
		}
		System.out.println(best);
	}
	
	public static void main(String args[]) throws Exception {

		new Main().solve();
    }

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

public class utkarsh{
	BufferedReader br;
	PrintWriter out;

	int game(int s, int mid, int e, int[] a){
		int i, j, n, m;
		n = mid - s + 1;
		m = e - mid;
		int b[] = new int[n];
		int c[] = new int[m];
		for(i = 0; i < n; i++)	b[i] = a[s + i];
		for(j = 0; j < m; j++)	c[j] = a[mid + 1 + j];
		i = j = 0;
		int ans = 0;
		for(int k = s; k <= e; k++){
			if(i == n){
				a[k] = c[j++];
			}else if(j == m){
				a[k] = b[i++];
			}else{
				if(b[i] < c[j]){
					a[k] = b[i++];
				}else{
					a[k] = c[j++];
					ans += n - i;
				}
			}
		}
		return ans;
	}

	int play(int s, int e, int[] a){
		if(s >= e)	return 0;
		int m = (s + e) >> 1;
		return play(s, m, a) + play(m+1, e, a) + game(s, m, e, a);
	}

	void solve(){
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		int i, j, k, l, r, n;
		n = ni();
		int a[] = new int[n];
		int d[] = new int[n];
		for(i = 0; i < n; i++) {
			a[i] = ni();
			d[i] = a[i];
		}
		int ans = (play(0, n-1, d) & 1);

		int q = ni();
		while(q-- > 0){
			l = ni();	r = ni();
			ans ^= ((r - l + 1) * (r - l) / 2);
			//out.println(ans);
			if((ans & 1) > 0)	out.println("odd");
			else				out.println("even");
		}

		out.flush();
	}

	int ni(){
		return Integer.parseInt(ns());
	}

	String ip[];
	int len, sz;

	String ns(){
		if(len >= sz){
			try{
				ip = br.readLine().split(" ");
				len = 0;
				sz = ip.length;
			}catch(IOException e){
				throw new InputMismatchException();
			}
			if(sz <= 0)	return "-1";
		}
		return ip[len++];
	}

	public static void main(String[] args){	new utkarsh().solve();	}
} 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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class CNastyaAndAWardrobe {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long x = in.nextLong(), k = in.nextLong();
            if (x != 0) {
                long m = (int) 1e9 + 7;
                x = x % m;
                long res = in.fastPowerMod(2, k, m);
                long res1 = (2 * res) % m;
                long ans = ((res1 * x) % m - (res - 1) % m) % m;
                ans = (ans + m) % m;
                out.println(ans);
            } else {
                out.println(0);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        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;
            }
           ... What is the time complexity of the previous code?
targets: logn
inputs: import java.io.* ;
import java.util.* ;
import java.text.* ;
import java.math.* ;
import static java.lang.Math.min ;
import static java.lang.Math.max ;
import static java.lang.Math.sqrt ;
public class Codeshefcode{
	public static void main(String[] args) throws IOException{
		Solver Machine = new Solver() ;
		Machine.Solve() ;
		Machine.Finish() ;
		// new Thread(null,new Runnable(){
		// 	public void run(){
		// 		Solver Machine = new Solver() ;
		// 		try{
		// 			Machine.Solve() ;
		// 			Machine.Finish() ;
		// 		}catch(Exception e){
		// 			e.printStackTrace() ;
		// 			System.out.flush() ;
		// 			System.exit(-1) ;
		// 		}catch(Error e){
		// 			e.printStackTrace() ;
		// 			System.out.flush() ;
		// 			System.exit(-1) ;
		// 		}
		// 	}
		// },"Solver",1l<<27).start() ;
	}
}
class Mod{
	static long mod=1000000007 ;
	static long d(long a,long b){ return (a*MI(b))%mod ; }
	static long m(long a,long b){ return (a*b)%mod ; }
	static private long MI(long a){ return pow(a,mod-2) ; }
	static long pow(long a,long b){
		if(b<0) return pow(MI(a),-b) ;
		long val=a ; long ans=1 ;
		while(b!=0){
			if((b&1)==1) ans = (ans*val)%mod ; 
			val = (val*val)%mod ; 
			b/=2 ;
		}
		return ans ;
	}	
}
class pair implements Comparable<pair>{
	int x ; int y ; 
	pair(int x,int y){ this.x=x ; this.y=y ;} 
	public int compareTo(pair p){
		return (this.x<p.x ? -1 : (this.x>p.x ? 1 : (this.y<p.y ? -1 : (this.y>p.y ? 1 : 0)))) ;
	}
}
class Solver{
	Reader ip = new Reader(System.in) ;	  
	PrintWriter op = new PrintWriter(System.out) ;
	public void Solve() throws IOException{
		int n = ip.i() ; int r = ip.i() ;
		double x[] = new double[n] ;
		double y[] = new double[n] ;
		for(int i=0 ; i<n ; i++) x[i] = ip.i() ;
		for(int i=0 ; i<n ; i++){
			double my = 0 ;
			for(int j=0 ; j<i ; j++)
				my = max(my,func(x[j],y[j],r,x[i])) ;
			y[i] = my ;
		}
		for(int i=0 ; i<n ; i++) p((y[i]+r)+" ") ;
		pln("") ; 
	}
	double abd(double x,double y){
		return x>y ? x-y : y-x ;
	}
	double func(double x1,double y1,double r,double... 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.io.*;
import java.text.*;
public class Main{
    //SOLUTION BEGIN
    //Into the Hardware Mode
    void pre() throws Exception{}
    void solve(int TC)throws Exception{
        int n = ni();
        int[] a = new int[n];
        for(int i = 0; i< n; i++)a[i] = ni();
        Arrays.sort(a);
        int ans = 0;
        for(int i = 0; i< n; i++){
            if(a[i] == -1)continue;
            ans++;
            for(int j = i+1; j< n; j++)if(a[j]%a[i] == 0)a[j] = -1;
        }
        pn(ans);
    }
    //SOLUTION END
    void hold(boolean b)throws Exception{if(!b)throw new Exception("Hold right there, Sparky!");}
    void exit(boolean b){if(!b)System.exit(0);}
    long IINF = (long)1e18, mod = (long)1e9+7;
    final int INF = (int)1e9, MX = (int)2e6+5;
    DecimalFormat df = new DecimalFormat("0.00000000");
    double PI = 3.141592653589793238462643383279502884197169399, eps = 1e-6;
    static boolean multipleTC = false, memory = false, fileIO = false;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        if(fileIO){
            in = new FastReader("input.txt");
            out = new PrintWriter("output.txt");
        }else {
            in = new FastReader();
            out = new PrintWriter(System.out);
        }
        //Solution Credits: Taranpreet Singh
        int T = (multipleTC)?ni():1;
        pre();
        for(int t = 1; t<= T; t++)solve(t);
        out.flush();
        out.close();
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start();
        else new Main().run();
    }
    
    int digit(long s){int ans = 0;while(s>0){s/=10;ans++;}return ans;}
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object... What is the time complexity of the previous code?
targets: quadratic
inputs: import java.io.*;
import java.math.*;
import java.util.*;
import java.util.List;
import java.awt.*;

public class Trains1_2 implements Runnable {

    private BufferedReader br = null;
    private PrintWriter pw = null;
    private StringTokenizer stk = new StringTokenizer("");

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

    public void run() {
        /*
         * try { br = new BufferedReader(new FileReader("knapsackfixed.in")); pw
         * = new PrintWriter("knapsackfixed.out"); } catch
         * (FileNotFoundException e) { e.printStackTrace(); }
         */
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        solver();
        pw.close();

    }

    private void nline() {
        try {
            if (!stk.hasMoreTokens())
                stk = new StringTokenizer(br.readLine());
        } catch (IOException e) {
            throw new RuntimeException("KaVaBUnGO!!!", e);
        }
    }

    private String nstr() {
        while (!stk.hasMoreTokens())
            nline();
        return stk.nextToken();
    }

    private int ni() {
        return Integer.valueOf(nstr());

    }

    private long nl() {

        return Long.valueOf(nstr());
    }

    private double nd() {
        return Double.valueOf(nstr());

    }

    boolean isNumber(char c) {
        if (c <= '9' && c >= '0')
            return true;
        return false;
    }

    String to10(String s) {
        long ans = 0;
        for (int i = s.length() - 1; i >= 0; i--) {
            ans += (s.charAt(i) - 'A' + 1) * Math.pow(26, s.length() - i - 1);
        }
        return String.valueOf(ans);
    }
    
    String to26(String s){
        String ans="";
        int a = Integer.valueOf(s);
        while(a>26){
            a--;
            int k = a%26;
            ans=ans+(char)((int)'A'+k);
            a/=26;
        }
        ans+=(char)(a+'A'-1);
        String ans1 = "";
        for(int i =... What is the time complexity of the previous code?
targets: linear
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class A235 {
    public static void main(String args[]) throws Exception{
        BufferedReader ip = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(ip.readLine());
        int a,b,c;
        int x = 0,y = 0,z = 0;
        BigInteger l,t;
        
        if(n-2 > 1)
        {
            a = n;
            b = n-1;
            c = n-2;
        }
        else
        {
            a = n;
            if(n-1 > 1)
                b = n-1;
            else
                b = 1;
            c = 1;
            
            System.out.println(a*b);
            return;
        }
    
        if(n-3 > 1)
        {
            x = n-1;
            y = n-2;
            z = n-3;
        }
        
        if(n % 2 == 0)
            if(n % 3 == 0)
                l = BigInteger.valueOf(x).multiply(BigInteger.valueOf(y).multiply(BigInteger.valueOf(z)));
            else
            {
                l = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b).multiply(BigInteger.valueOf(c-1)));
                t = BigInteger.valueOf(x).multiply(BigInteger.valueOf(y).multiply(BigInteger.valueOf(z)));
                if(l.compareTo(t) < 0)
                    l = t;
            }
        else
            l = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b).multiply(BigInteger.valueOf(c)));
        
        System.out.println(l);
    }
} Complexity:
targets: constant
inputs: import java.io.*;
import java.util.*;

public class A {

	final String filename = new String("C").toLowerCase();

	void solve() throws Exception {
		int n = nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		if (isSorted(a)) {
			out.println("YES");
			return;
		}
		int pos1 = -1;
		for (int i = 0; i < n - 1; i++) {
			if (a[i] > a[i + 1]) {
				int j = i;
				while (j >= 0 && a[j] == a[i]) {
					j--;
				}
				pos1 = j + 1;
				break;
			}

		}
		int pos2 = -1;
		for (int i = n - 2; i >= 0; i--) {
			if (a[i] > a[i + 1]) {
				int j = i + 1;
				while (j < n && a[j] == a[i + 1]) {
					j++;
				}
				pos2 = j - 1;
				break;
			}
		}
		int tmp = a[pos1];
		a[pos1] = a[pos2];
		a[pos2] = tmp;
		if (isSorted(a)) {
			out.println("YES");
		} else {
			out.println("NO");
		}
	}

	boolean isSorted(int[] a) {
		for (int i = 0; i < a.length - 1; i++) {
			if (a[i] > a[i + 1]) {
				return false;
			}
		}
		return true;
	}

	void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			// in = new BufferedReader(new FileReader("input.txt"));
			// out = new PrintWriter("output.txt");

			solve();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;

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

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

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

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

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

}
 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.math.BigInteger;
import java.util.*;
 
 
public class q5 {
	
	
	
    
  
	
 
	public static void main(String[] args) throws IOException {
	
	Reader.init(System.in);
	PrintWriter out=new PrintWriter(System.out);
	long n=Reader.nextInt();
	long k=Reader.nextLong();
	long v=8*n+8*k+4;
	long v2=(long) Math.sqrt(v);
	long v3=2*n+2;
	//long v4=(v3+v2)/2;
	long v5=(v3-v2)/2;
	out.println(v5);
	
	
	
	
	
	out.flush();
	}
}




 
 
 
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("detect.in"));
    tokenizer = new StringTokenizer("");
    }
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
    /** get next word */
    static String nextLine() throws IOException{
    	return reader.readLine();
    }
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }
    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
} Complexity:
targets: logn
inputs: import java.io.*;
import java.util.*;
import java.math.*;

//created at 6:06 PM 12/9/11 by Abrackadabra

public class A {
    int IOMode = 0; //0 - consoleIO, 1 - <taskName>.in/out, 2 - input.txt/output.txt, 3 - test case generator
    String taskName = "";

    void solve() throws IOException {
        int n = nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        Arrays.sort(a);
        int z = 0;
        for (int i = 0; i < n; i++) {
            if (a[i] != 1) z++;
        }
        if (z == 0 && n > 1) a[n - 2] = 2;
        if (n == 1 && a[0] == 1) {
            out.println(2);
            return;
        }
        out.print("1 ");
        for (int i = 0; i < n - 1; i++)
            out.print(a[i] + " ");
    }

    public static void main(String[] args) throws IOException {
        if (args.length > 0 && args[0].equals("Abra")) debugMode = true;
        new A().run();
    }

    long startTime = System.nanoTime(), tempTime = startTime, finishTime = startTime;
    long startMem = Runtime.getRuntime().totalMemory(), finishMem = startMem;

    void run() throws IOException {
        init();
        if (debugMode) {
            con.println("Start");
            con.println("Console output:");
        }
        solve();
        finishTime = System.nanoTime();
        finishMem = Runtime.getRuntime().totalMemory();
        out.flush();
        if (debugMode) {
            int maxSymbols = 1000, c = 0;
            BufferedReader tbr = new BufferedReader(new FileReader("input.txt"));
            char[] a = new char[maxSymbols];
            tbr.read(a);
            if (a[0] != 0) {
                con.println();
                con.println("File input:");
                con.print(a);
            }
            boolean left = true;
            for (int i = 0; i < maxSymbols; i++) left = left && a[i] != 0;
            if (left) con.println("...");
            else con.println();
            tbr = new BufferedReader(new FileReader("output.txt"));
          ... 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.util.Scanner;

public class A {
	
	public static boolean realbig (long num, long s) {
		String str = num + "";
		String[] digs = str.split("");
		int sum = 0;
		for(String dig : digs) {
			sum+= Integer.parseInt(dig);
		}
		if(num-sum < s) {
			return false;
		} else {
			return true;
		}
	}

		
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long s = sc.nextLong();
		sc.close();
		long count = 0;
		long i = s;
		for(; i < s+200 && i <= n; i++) {
			if(realbig(i,s)) {
				count++;
			}
		}
		if(i <= n) {
			count+=n-i+1;
		}
		System.out.println(count);
	}
}
 Complexity:
targets: logn
inputs: import java.util.*;
import java.text.*;
import java.math.*;

public class Main{
    
    static double EPS=1e-10;
    static double PI=Math.acos(-1.0);
    
    static double p[][]=new double[25][25];
    static double f[]=new double[1<<20];
    static int n;
    
    
    public static void PR(String s){
        System.out.print(s);
    }
    
    public static void PR(double s)
    {
        java.text.DecimalFormat d=new java.text.DecimalFormat("#.0000000");
        System.out.print(d.format(s));
    }
    
    public static void DP()
    {
        int i,j,k,cnt;
        for(i=0;i<(1<<n);i++) f[i]=0;
        f[(1<<n)-1]=1;
        for(k=(1<<n)-1;k>=0;k--)
        {
            cnt=0;
            for(i=0;i<n;i++) if((k&(1<<i))!=0) cnt++;
            for(i=0;i<n;i++) if((k&(1<<i))!=0)
            {
                for(j=0;j<n;j++) if(i!=j&&(k&(1<<j))!=0)
                {
                    f[k^(1<<j)]+=f[k]*p[i][j]/((cnt-1)*cnt/2);
                }
            }
        }
    }
    
    public static void main(String[] args){
  
        Scanner S=new Scanner(System.in);
        while(S.hasNext())
        {
            n=S.nextInt();
            int i,j;
            for(i=0;i<n;i++) for(j=0;j<n;j++) p[i][j]=S.nextDouble();
            DP();
            for(i=0;i<n;i++) 
            {
                if(i!=0) PR(" ");
                PR(f[1<<i]);
            }
            PR("\n");
        }
    }
}
 What is the time complexity of the previous code?
targets: np
inputs: import java.io.*;
import java.util.*;

public class TaskE {

    static int[][] transpose(int[][] a, int n, int m) {
        int[][] t = new int[m][n];

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

        return t;
    }

    public static void main(String[] args) {
        FastReader in = new FastReader(System.in);
//        FastReader in = new FastReader(new FileInputStream("input.txt"));
        PrintWriter out = new PrintWriter(System.out);
//        PrintWriter out = new PrintWriter(new FileOutputStream("output.txt"));


        int t = in.nextInt();

        while (t-- > 0) {
            int n = in.nextInt();
            int m = in.nextInt();

            int[][] a = new int[n + 1][m];

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    a[i][j] = in.nextInt();
                    a[n][j] = Math.max(a[n][j], a[i][j]);
                }
            }

            a = transpose(a, n, m);

            Arrays.sort(a, new Comparator<int[]>() {
                @Override
                public int compare(int[] o1, int[] o2) {
                    int max1 = 0;
                    for (int i = 0; i < o1.length; i++) {
                        max1 = Math.max(max1, o1[i]);
                    }

                    int max2 = 0;
                    for (int i = 0; i < o2.length; i++) {
                        max2 = Math.max(max2, o2[i]);
                    }

                    return max2 - max1;
                }
            });

            a = transpose(a, m, n);

            int[] dp = new int[1 << n];

            for (int i = 0; i < Math.min(n, m); i++) {
                int[] best = new int[1 << n];

                for (int j = 1; j < (1 << n); j++) {
                    for (int k = 0; k < n; k++) {
                        int sum = 0;
                        for (int l = 0; l < n; l++) {
                            if ((j & (1 << l)) != 0)
          ... 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.OutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.Writer;
import java.io.InputStream;

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

class TaskB {

    long n,x,y,c;



	public void solve(int testNumber, InputReader in, OutputWriter out) {
        n = in.readInt();
        x = in.readInt();
        y = in.readInt();
        c = in.readInt();

        int lo = -1;
        int hi = (int)c;

        while(lo+1<hi) {
            int mi = (lo+hi)/2;
            if(P(mi)) hi = mi; else lo = mi;
        }
        out.printLine(hi);
	}

    private boolean P(int t) {
        if(t == -1) return false;

        int ans = 0;
        for(long i = Math.max(1,y-t); i <= Math.min(y+t,n); ++i) {
            long a = Math.abs(y - i);
            ans += D(Math.max(1,x-t+a), Math.min(n,x+t-a));
            if(ans >= c) return true;
        }

        return false;
    }

    private long D(long a, long b) {
        return b - a + 1;
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    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... 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.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.IntStream;

public class Test {
  static PrintWriter writer =
      new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

  static int readInt() {
    int ans = 0;
    boolean neg = false;
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '-') {
          start = true;
          neg = true;
          continue;
        } else if (c >= '0' && c <= '9') {
          start = true;
          ans = ans * 10 + c - '0';
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return neg ? -ans : ans;
  }

  static long readLong() {
    long ans = 0;
    boolean neg = false;
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '-') {
          start = true;
          neg = true;
          continue;
        } else if (c >= '0' && c <= '9') {
          start = true;
          ans = ans * 10 + c - '0';
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return neg ? -ans : ans;
  }

  static String readLine() {
    StringBuilder b = new StringBuilder();
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (Character.isLetterOrDigit(c)) {
          start = true;
          b.append((char) c);
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return b.toString();
  }

  public static void main(String[] args) {
    Test te = new Test();
    te.start();
    writer.flush();
  }

  void start() {
    int t = readInt();
    while (t-- > 0) {
      int n = readInt(), m = readInt();
      int[][] a = new int[n][m];
      for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
          a[i][j] = readInt();
      int[] dp = new... Complexity:
targets: np
inputs: import java.io.*;
import java.util.*;

public class E
{
    private static final int oo = 1000000000;
    public static void main(String[] args) throws Exception
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        if(n > m)
        {
            int t = n;
            n = m;
            m = t;
        }

        int [][] curr = new int[1<<n][1<<n];
        fill(curr, oo);
        Arrays.fill(curr[0], 0);

        for(int j = 0 ; j < m ; j++)
        {
            int [][] next = new int[1<<n][1<<n];
            fill(next, oo);
            for(int c0 = 0 ; c0 < 1<<n ; c0++)
                for(int c1 = 0 ; c1 < 1<<n ; c1++)
                    if(curr[c0][c1] != oo)
                        for(int c2 = 0 ; c2 < (j == m-1 ? 1 : 1<<n) ; c2++)
                        {
                            int all = (1<<n) - 1;
                            int done = (all&(c1>>1)) | (all&(c1<<1)) | c0 | c2;
                            done &= (all^c1);

                            next[c1][c2] = Math.min(next[c1][c2], curr[c0][c1] + n - Integer.bitCount(done));

                        }
            curr = next;
        }

        int res = oo;
        for(int i = 0 ; i < 1<<n ; i++)
            for(int j = 0 ; j < 1<<n ; j++)
                res = Math.min(res, curr[i][j]);

        System.out.println(n*m - res);
    }

    private static void fill(int[][] array, int val)
    {
        for(int [] fill : array)
            Arrays.fill(fill, val);
    }
} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: np
inputs: import java.util.Scanner;

public class MargariteBestPresent_1080B {

	private static int f(int x) {
		return (x%2==0)?x/2:(x-1)/2-x;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n,r,l;
		n = sc.nextInt();
		while(n-->0) {
			l = sc.nextInt();
			r = sc.nextInt();

			System.out.println(f(r)-f(l-1));
		}
		sc.close();
	}

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

public class B {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	long f(int x, int y, int sz) {
		if (x > y) {
			int tmp = x;
			x = y;
			y = tmp;
		}
		if (sz <= x)
			return (long) sz * (sz + 1) / 2;
		if (sz >= x + y - 1)
			return (long) x * y;
		long val = x * (x + 1) / 2;
		if (sz <= y)
			return val + (long) (sz - x) * x;

		long rest = x + y - 1 - sz;
		return (long) x * y - (long) rest * (rest + 1) / 2;
	}

	long count(int x, int y, int n, int time) {
		long DL = f(x + 1, y + 1, time + 1);
		long DR = f(n - x, y + 1, time + 1);
		long UL = f(x + 1, n - y, time + 1);
		long UR = f(n - x, n - y, time + 1);
//		if (time == 1)
//			System.err.println(DL + " " + DR + " " + UL + " " + UR);
		long L = Math.min(x + 1, time + 1);
		long R = Math.min(n - x, time + 1);
		long U = Math.min(n - y, time + 1);
		long D = Math.min(y + 1, time + 1);
//		if (time == 1)
//			System.err.println(L + " " + R + " " + U + " " + D);
		return DL + DR + UL + UR - L - R - U - D + 1;
	}

	void solve() throws IOException {
		int n = nextInt();
		int x = nextInt() - 1;
		int y = nextInt() - 1;
		long need = nextLong();

		if (need == 1) {
			out.println(0);
			return;
		}

		int low = 0;
		int high = Math.max(x, n - 1 - x) + Math.max(y, n - 1 - y);
		
//		for (int i = 0; i <= 100; i++)
//			System.err.println(count(x, y, n, i));

		while (low < high - 1) {
			int mid = (int) (((long) low + high) / 2);
			if (count(x, y, n, mid) >= need)
				high = mid;
			else
				low = mid;
		}

		out.println(high);

	}

	B() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new B();
	}

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

	String... What is the time complexity of the previous code?
targets: logn
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.Comparator;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

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

class TaskC {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int xs = in.readInt();
        int ys = in.readInt();
        int n = in.readInt();
        int[] x = new int[n];
        int[] y = new int[n];
        IOUtils.readIntArrays(in, x, y);
        int[] res = new int[1 << n];
        int[] last = new int[1 << n];
        Arrays.fill(res, Integer.MAX_VALUE);
        int[] ds = new int[n];
        for (int i = 0; i < n; i++) {
            ds[i] = (x[i] - xs) * (x[i] - xs) + (y[i] - ys) * (y[i] - ys);
        }
        int[][] d = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++)
                d[i][j] = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]);
        }
        res[0] = 0;
        for (int i = 1; i < (1 << n); i++) {
            for (int j = 0; j < n; j++) {
                if (((i >> j) & 1) != 0) {
                    if (res[i - (1 << j)] + 2 * ds[j] < res[i]) {
                        res[i] = res[i - (1 << j)] + 2 * ds[j];
                        last[i] = i - (1 << j);
                    }
                    for (int k = j + 1; k < n; k++) {
 ... Complexity:
targets: np
inputs: import java.util.HashMap;
import java.util.Scanner;

import javax.swing.text.html.HTMLDocument.Iterator;


public class Main
{
    public static double p[];
    static double s[];
    static double m[];
    static int n;
    public static double a[][];
    public static int index=0;
    public static boolean vis[];
    public static HashMap<Integer, Integer> permMap;

    public static void main(String g[])
    {

        Scanner sc = new Scanner(System.in);
        n=sc.nextInt();
        m = new double[(1<<n) +1];
        vis = new boolean[(1<<n) +1];
        a = new double[n][n];

        for(int i=0;i<n;i++)
                {
            for(int j=0;j<n;j++)
            {
                //System.out.println("read"+(c++));
                a[i][j] = sc.nextDouble();
            }
                }

        s = new double[1<<n]; // 2^n
        int perm=0;
        m[0]=1;
        p();

//      System.out.println("answers : ");

        int c=((1<<n)-1);
        for(int i=0;i<n;i++)
        {
            perm = c-(1<<i);
//          System.out.printf("permutation = %x, prob = %f\n",perm,m[perm]);
            System.out.printf("%.6f ",m[perm]);
        }
//      getPerms(0);
//      p(perm);

//      double res[] = new double[n];
//      for(int i=0;i<n;i++)
        {
//          for(int j=0;j<n;j++)
//          if((i&(i-1))!=0)
//              continue;

//          res[i] =
//              p(perm,n);
//          System.out.println(m[i][j]);
        }

//      int cur=(1<<n)-1;
//
//int i=0;
//      for(i=0;i<n;i++)
//      {
//          int val=(cur-(1<<i));
//          int L = n-1;
//          System.out.printf("running for %x .... P = %f\n",val,getProb(val,L));
//
//      }

        //getP((1<<n)-1));

//      for(int i=0;i<m.length;i++)
//      {
//          System.out.println(m[perm]);
//      }


    }



    public static void p()
    {
        
            for(int k=0;k<(1<<n);k++)
            {
                
                int perm=k;
        for(int j=0;j<n;j++)
        {

           ... What is the time complexity of the previous code?
targets: np