Muennighoff/xP3x-sample huggingface dataset:
inputs: import java.util.*;
import java.io.*;
import java.math.*;
public class loser
{
    static class InputReader {
        public BufferedReader br;
        public StringTokenizer token;
        public InputReader(InputStream stream)
        {
            br=new BufferedReader(new InputStreamReader(stream),32768);
            token=null;
        }

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

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

        public long nextLong()
        {
            return Long.parseLong(next());
        }
    }
    static class card{
        int l;
        int r;
        public card(int ch,int i)
        {
            this.l=ch;
            this.r=i;
        }
    }
    static class sort implements Comparator<card>
    {
        public int compare(card o1,card o2)
        {
            if(o1.l!=o2.l)
                return (int)(o1.l-o2.l);
            else
                return (int)(o1.r-o2.r);
        }
    }
    static void shuffle(long a[])
    {
        List<Long> l=new ArrayList<>();
        for(int i=0;i<a.length;i++)
            l.add(a[i]);
        Collections.shuffle(l);
        for(int i=0;i<a.length;i++)
            a[i]=l.get(i);
    }

    /*static long gcd(long a,long b)
    {
    if(b==0)
    return a;
    else
    return gcd(b,a%b);
    }
    static int ans1=Integer.MAX_VALUE,ans2=Integer.MAX_VALUE,ans3=Integer.MAX_VALUE,ans4=Integer.MAX_VALUE;
    static boolean v[]=new boolean[101];
    static void dfs(Integer so,Set<Integer> s[]){
    if(!v[so.intValue()])
    {
    v[so]=true;
    for(Integer h:s[so.intValue()])
    {
    if(!v[h.intValue()])
   ... What is the time complexity of the previous code?
targets: nlogn
inputs: import java.math.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long k = scan.nextLong();
		long total = k * (k - 1) / 2 + 1;
		if (total < n) {
			System.out.println(-1);
			return;
		}
		
		long left = total - n;
		long low = 1;
		long high = k - 1;
		while (low < high) {
			long mid = (low + high) / 2;
			long temp = mid * (mid + 1) / 2;
			if (temp < left) {
				low = mid + 1;
			} else {
				high = mid;
			}
		}
		long temp = low * (low + 1) / 2;
		if (temp == left) {
			System.out.println(k - 1 - low);
		} else {
			System.out.println(k - low);
		}
	}
}
 What is the time complexity of the previous code?
targets: logn
inputs: import java.util.*;
import java.io.*;

public class Main implements Runnable {
	private void solution() throws IOException {
		int n = in.nextInt();
		int m = in.nextInt();
		boolean[][] adj = new boolean[n][n];
		long res = 0;
		for (int i = 0; i < m; ++i) {
			int x = in.nextInt();
			int y = in.nextInt();
			adj[x - 1][y - 1] = true;
			adj[y - 1][x - 1] = true;
		}
		final long[][] dp = new long[1 << n][n];
		for (int i = 0; i < n; ++i) {
			for (int mask = 0; mask < (1 << (n - i)); ++mask) {
				for (int j = 0; j < n - i; ++j) {
					dp[mask][j] = 0;
				}
			}
			dp[0][0] = 1;
			for (int mask = 0; mask < (1 << (n - i)); ++mask) {
				for (int j = 0; j < n - i; ++j) {
					if (dp[mask][j] != 0) {
						long am = dp[mask][j];
						for (int k = 0; k < n - i; ++k) {
							if (((mask >> k) & 1) == 0 && adj[j + i][k + i]) {
								dp[mask | (1 << k)][k] += am;
							}
						}
					}
				}
				if (((mask >> 0) & 1) != 0) {
					res += dp[mask][0];
				}
			}
		}
		out.println((res - m) / 2);
	}

	public void run() {
		try {
			solution();
			in.reader.close();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	private class Scanner {
		BufferedReader reader;
		StringTokenizer tokenizer;

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

		public boolean hasNext() throws IOException {
			while (!tokenizer.hasMoreTokens()) {
				String next = reader.readLine();
				if (next == null) {
					return false;
				}
				tokenizer = new StringTokenizer(next);
			}
			return true;
		}

		public String next() throws IOException {
			hasNext();
			return tokenizer.nextToken();
		}

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

		public String nextLine() throws IOException {
			tokenizer = new StringTokenizer("");
			return reader.readLine();
		}

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

	public static void... What is the time complexity of the previous code?
targets: np
inputs: import java.lang.*;
import java.util.*;
import java.io.*;

public class Main {
    void solve() {
       int n=ni();
       int a[]=new int[n+1];
       for(int i=1;i<=n;i++) a[i]=ni();
       int vis[]=new int[101];
       int ans=0;
       Arrays.sort(a,1,n+1);
       for(int i=1;i<=n;i++){
           if(vis[a[i]]==1) continue;
           ans++;
           for(int j=a[i];j<=100;j+=a[i]) vis[j]=1;
       }
       pw.println(ans);
    }

    long M = (long)1e9+7;
    // END
    PrintWriter pw;
    StringTokenizer st;
    BufferedReader br;

    void run() throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
    }
    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    String ns() {
        while (st == null || !st.hasMoreElements()) {

            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    String nextLine() throws Exception {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            throw new Exception(e.toString());
        }
        return str;
    }

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

    long nl() {
        return Long.parseLong(ns());
    }

    double nd() {
        return Double.parseDouble(ns());
    }
} What is the time complexity of the previous code?
targets: quadratic
inputs: //package fourninetysixDiv3;
import java.util.HashMap;
import java.util.Scanner;
public class Median_Segments_general {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int m = s.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = s.nextInt();
		}
		System.out.println(func(n, m, arr)-func(n, m+1, arr));
	}
	public static long func(int n,int m,int[] arr) {
		HashMap<Long, Integer> map = new HashMap<>();
		map.put((long) 0, 1);
		long sum = 0;
		long res = 0;
		long add=0;
		for(int i=0;i<n;i++) {
			if(arr[i]<m) {
				sum--;
				if(map.containsKey(sum)) {
					add-=map.get(sum);
				}
			}
			else {
				if(map.containsKey(sum)) {
					add+=map.get(sum);
				}
				sum++;
			}
			res+=add;
			if(map.containsKey(sum)) {
				map.put(sum, map.get(sum)+1);
			}
			else {
				map.put(sum,1);
			}
		}
		return res;
	}
}
 What is the time complexity of the previous code?
targets: nlogn
inputs: import java.io.*;
import java.util.*;
public class D11 {
	static HashMap<State, Integer> map;
	static long[][] ans;
	static boolean[][] connect;
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		map = new HashMap<State, Integer>();
		connect = new boolean[n][n];
		ans = new long[n][1<<n];
		for(int i = 0; i < n; i++)
			Arrays.fill(ans[i], -1);
		int m = Integer.parseInt(st.nextToken());
		while(m-- > 0)	{
			st = new StringTokenizer(br.readLine());
			int a = Integer.parseInt(st.nextToken());
			int b = Integer.parseInt(st.nextToken());
			a--;
			b--;
			connect[a][b] = connect[b][a] = true;
		}
		long ret = 0;
		int mask = 1 << n;
		mask--;
		for(int i = 0; i < n; i++)	{
			for(int out = i+1; out < n; out++)	{
				if(connect[i][out])	{
					ret += solve(mask - (1<<out), out, true);
				}
			}
			mask -= (1<<i);
		}
		System.out.println(ret/2);
	}
	public static long solve(int mask, int start, boolean a)	{
		if(ans[start][mask] != -1)
			return ans[start][mask];
		int end = 0;
		while((mask & (1<<end)) == 0)
			end++;
		long ret = 0;
		for(int out = 0; out < connect.length; out++)	{
			if(connect[start][out] && (mask & (1 << out)) != 0)	{
				if(out == end)	{
					if(!a)
						ret++;
				}
				else
					ret += solve(mask - (1<<out), out, false);
			}
		}
		ans[start][mask] = ret;
		return ret;
	}
	static class State	{
		public byte start, go;
		public int mask;
		public State(byte a, byte b, int c)	{
			start = a;
			go = b;
			mask = c;
		}
		public int hashCode()	{
			return 10007*mask + 43 * start + go;
		}
		public boolean equals(Object o)	{
			State s = (State)o;
			return start == s.start && go == s.go && mask == s.mask;
		}
	}
}
 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.util.Scanner;
import javafx.geometry.Point2D;

 
public class ChessKing {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
Scanner input = new Scanner(System.in);
long size = input.nextLong();
long a = input.nextLong();
long b = input.nextLong();
  long sum = a+b;
   long d = sum-2;
   long d1 = size*2 - sum;
if(d<d1) System.out.println("White");
else if(d>d1) System.out.println("Black");
else System.out.println("White");


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

public class C {
    String fileName = "<name>";

    public static final int MOD = (int) (1e9 + 7);

    public void solve() throws IOException {
        long x = nextLong();
        if (x == 0) {
            out.print(0);
            return;
        }
        long k = nextLong();
        BigInteger power = BigInteger.valueOf(2)
                .modPow(BigInteger.valueOf(k), BigInteger.valueOf(MOD));
        BigInteger r = BigInteger.valueOf(x).multiply(power);
        BigInteger l = r.subtract(power).add(BigInteger.ONE);
        out.print(l.add(r).mod(BigInteger.valueOf(MOD)));
    }

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

            solve();

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

    BufferedReader br;
    StringTokenizer in;
    PrintWriter out;

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

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

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

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

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new C().run();
    }
} Complexity:
targets: logn
inputs: import java.io.*;
import java.util.*;
 
 
public class Main {
 
 
	public static void main(String[] args) throws Exception{
		BufferedReader  jk =  new BufferedReader(new InputStreamReader( System.in))  ; 
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)) ; 
		StringTokenizer ana = new StringTokenizer(jk.readLine()) ;
		int n = Integer.parseInt(ana.nextToken()) ; 
		
		int t[]= new int[101] ; 
		ArrayList<Integer> v = new ArrayList<>() ; 
		ana = new StringTokenizer(jk.readLine()) ;
		for(int i=0 ; i<n ;i++)
		{
			
			int y = Integer.parseInt(ana.nextToken()) ;
			t[y]=1 ; 
			v.add(y) ; 
		}
		Collections.sort(v);
		int c= 0; 
		for(int ele : v)
		{
			if(t[ele]==1)
			{
				
				for(int i=ele ; i<=100 ; i+=ele)
				{
					t[i]=2 ; 
				}
				c++ ; 
			}
		
		}
		out.println(c);
		
 
 
 
 
 
 
 
 
		out.flush();
	}
} What is the time complexity of the previous code?
targets: quadratic
inputs: import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {
	
	Scanner in;
	static PrintWriter out;
	
	static class Scanner {
		StreamTokenizer in;
		
		Scanner(InputStream is) {
			in = new StreamTokenizer(new BufferedReader(new InputStreamReader(is)));
			  in.resetSyntax();
		         in.whitespaceChars(0, 32);
		         in.wordChars(33, 255);
		     
		}
		
		int nextInt() {
			try {
				in.nextToken();
				return Integer.parseInt(in.sval);
			} catch (IOException e) {
				throw new Error();
			}
		}
		
		String next() {
			try {
				in.nextToken();
				return in.sval;
			} catch (IOException e) {
				throw new Error();
			}
		}
	}
	
	
	
	static class Value implements Comparable <Value> {
		int x;
		int pos;
		
		Value(int x, int pos) {
			this.x = x;
			this.pos = pos;
		}
		
		public int compareTo(Value second) {
			if (this.x == second.x) {
				return this.pos - second.pos;
			} else {
				return this.x - second.x;
			}
		}
	}
	
	void solve() {
		int n = in.nextInt();
		
		Value ar[] = new Value[n];

		for (int i = 0; i < n; i++) {
			ar[i] = new Value(in.nextInt(), i);
		}
		Arrays.sort(ar);
		int cnt = 0;
		//LinkedList <Integer> gavno = new LinkedList<Integer>();
		for (int i = 0; i < n; i++) {
			if (ar[i].pos != i && ar[ar[i].pos].x != ar[i].x) {
				cnt++;
				//gavno.add(i);
			}
		}
		if (cnt > 2) {
			out.println("NO");
		} else {
			out.println("YES");
		}
	}
	
	static void asserT(boolean e) {
		if (!e) {
			throw new Error();
		}
	}
	
	
	public void run() {
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);
		
		try {
			solve();
		} finally {
			out.close();
		}
	}
	
	public static void main(String[] args) {
		new Main().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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

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

    static class TaskC {
        private final int MOD = (int) (1e9 + 7);

        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextString();
            }
            int[] dp = new int[n];
            Arrays.parallelSetAll(dp, i -> 0);
            dp[0] = 1;
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                if (arr[i].equals("f")) {
                    cnt++;
                    continue;
                }
                calc(dp, n, cnt);
                cnt = 0;
            }
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += dp[i];
                sum %= MOD;
            }
            out.println(sum);
        }

        private void calc(int[] dp, int n, int cnt) {
            for (int i = n - 1; i >= 0; i--) {
                if (i != n - 1) dp[i] += dp[i + 1];
                dp[i] %= MOD;
            }
            //int[] tmp = new int[n];
            int prev = dp[0];
            for (int i = 0, y = 0; i < MathUtil.gcdInt(n, cnt); i++)... Complexity:
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.io.InputStream ;
import java.util.InputMismatchException;
import java.util.ArrayList;


public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        //Scanner sc = new Scanner();
        Reader in = new Reader();
        Main solver = new Main();
        solver.solve(out, in);
        out.flush();
        out.close();

    }
    
    
    void solve(PrintWriter out, Reader in) throws IOException{   
        int n = in.nextInt();
        int m = in.nextInt();
        
        
        
        int[] vert = new int[n+1];
        for(int i=0 ;i<n ;i++) vert[i] = in.nextInt();
        vert[n] = (int)1e9;
        
        int cnt=0,x,y;
        ArrayList<Integer> arr = new ArrayList<>();
        for(int i=0 ;i<m ;i++) {
            x = in.nextInt();
            y = in.nextInt();
            in.nextInt();
            
            if(x==1) arr.add(y);
        }
        
        horz = new int[arr.size()];
        for(int i=0 ;i<arr.size();i++) horz[i] = arr.get(i);
        
        Arrays.sort(horz);
        Arrays.sort(vert);
        
        int ans = 2*(int)1e5+10;
        for(int i=0 ;i<=n ;i++){
            int lesshorz = bs(vert[i],horz.length);
            ans = Math.min(ans,i+horz.length-lesshorz-1);
        }
        out.println(ans);
    }
    
    static int[] horz;
    
    static int bs(int num,int m){
        int mid,lo=0,hi=m-1,r=-1;
        
        while(lo<=hi){
            mid = (lo+hi)/2;
            if(horz[mid]<num){
                lo = mid+1;
                r = mid;
            }else{
                hi =mid-1;
            }
        }
        return r;
    }
    
    static class Reader {
 
       ... Complexity:
targets: nlogn
inputs: import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;



public class ELR {

	static double solveUnweighted (int nodes, long curr, long pool, long excl) {
		if (pool == 0 && excl == 0) {
			int cnt = 0;
			for (int i = 0; i < nodes; i++)
				if ((curr & 1L << i) > 0)
					cnt++;
			
			double cont = (k / (cnt*1.0));
			double edges = (cnt) * (cnt - 1) / 2.0;
			return cont * cont * edges;
		}
		double res = 0;
		int j = 0;
		for (int i = 0; i < nodes; i++)
			if ((pool & 1L << i) > 0 || (excl & 1L << i) > 0)
				j = i;

		for (int i = 0; i < nodes; i++) {
			if ((pool & 1L << i) == 0 || adj[i][j])
				continue;
			long ncurr = curr, npool = 0, nexcl = 0;
			ncurr |= 1L << i;

			for (int k = 0; k < nodes; k++) {
				if (adj[i][k]) {
					npool |= pool & 1L << k;
					nexcl |= excl & 1L << k;
				}
			}
			res = Math.max(res, solveUnweighted(nodes, ncurr, npool, nexcl));

			pool &= ~(1L << i);
			excl |= 1L >> i;
		}
		return res;
	}
	public static void main(String[] args) {new Thread(null, new Runnable() { public void run() {try {
		sol();
	} catch (Throwable e) {
		
		e.printStackTrace();
	}}}, "2",1<<26).start();}
	
	static int n,k;
	static boolean adj[][];
	public static void sol() throws Throwable {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		adj = new boolean[n][n];
		for (int i = 0 ; i < n ; ++i) {
			for (int j = 0 ; j < n ; ++j) {
				adj[i][j] = sc.nextInt() == 1;
			}
		}
		double ans = solveUnweighted(n, 0, (1L << n) - 1, 0);
		System.out.println(ans);
	}


	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

		public Scanner(String s) throws FileNotFoundException {
			br = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: np
inputs: import java.io.*;
import java.util.*;
import java.math.*;

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

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

	public double len, d, w, vmax, a;
	
	DecimalFormat fmt = new DecimalFormat("0.0000000000000000");
	
	public void main()
	{
		a = in.nextDouble();
		vmax = in.nextDouble();
		len = in.nextDouble();
		d = in.nextDouble();
		w = in.nextDouble();
		
		out.println(fmt.format(T()));
	}//end public void main()
	
	public double T()
	{
		double t, s;
		
		double t1, s1;
		t1 = vmax / a;
		s1 = vmax*vmax/(2.0*a);
		
		double t3, s3;
		t3 = w/a;
		s3 = w*w/(2.0*a);
				
		if(w >= vmax)
		{
			if(s1 < len)
			{
				return t1 + (len - s1)/vmax;
			}
			else
			{
				return Math.sqrt(2.0*len/a);
			}			
		}
		else
		{
			//w < vmax
			
			double t2, s2, v2;
			t2 = Math.sqrt(2.0*d/a);
			v2 = a*t2;
			
			double tx, vx;
			vx = Math.sqrt((2.0*a*d + w*w)/2.0);
			tx = vx / a;	
			
			//vmax > w

			//v2 > vx > w
			
			if(v2 < w)
			{
				if(v2 > vmax)
				{
					//v2 > vmax > w
					if(vmax > vx)
					{
						return tx + (vx - w)/a + T2(w);
					}
					else
					{
						double ty, sy;
						ty = (vmax - w)/a;
						sy = ty * (vmax + w)/2.0;
						return t1 + ty + (d - s1 - sy)/vmax + T2(w);
					}
				}
				else
				{
					//v2 < w, v2 <= vmax
					return t2 + T2(v2);					
				}
			}
			else if(v2 > vmax) //v2 >= w, vmax > w
			{
				//v2 > vmax > w
				if(vmax > vx)
				{
					return tx + (vx - w)/a + T2(w);
				}
				else
				{
					double ty, sy;
					ty = (vmax - w)/a;
					sy = ty * (vmax + w)/2.0;
					return t1 + ty + (d - s1 - sy)/vmax + T2(w);
				}
			}
			else  //vmax >= v2 >= w
			{
				//out.println("Questionable.");
				//return binary() + T2(w);
				
				//return  t3 + (d-s3)/w + T2(w);

				return tx + (vx - w)/a + T2(w);
			}
		}
	}
	
	public double binary()
	{
		double low, high, t, s;
		low = 0.0; high = vmax/a;
		
		for(int c=0;c<50;++c)
		{
			t = (low+high)/2;
			s = (a*t*t)/2 + ((a*t - w)/a)*(a*t + w)/2.0;
			
			if(s > d)... 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.util.*;

public class Compute {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long M = sc.nextInt();
        long fact[] = new long[n+1];
        long inv[] = new long[n+1];
        long ifact[] = new long[n+1];
        long dp[][] = new long[n+1][n+1];
        fact[1] = 1;
        ifact[1] = 1;
        ifact[0] = 1;
        inv[1] = 1;
        dp[1][1] = 1;
        
        for(int i = 2; i <= n; i++) {
            fact[i] = (i*fact[i-1]) % M;
            inv[i] = (inv[(int)(M % i)]*(M - M/i)) % M;
            dp[i][i] = (dp[i-1][i-1] * 2) % M;
            ifact[i] = (ifact[i-1]*inv[i]) % M;
        }
            
        for(int i = 3; i <= n; i++) {
            for(int j = i/2 + 1; j <= i-1; j++) {
                for(int k = 2; k <= i-1 && j-k+1 > (i-k)/2; k++) {
                    dp[i][j] = (dp[i][j] + ((((dp[k-1][k-1]*dp[i-k][j-k+1] % M)*fact[j] % M)*ifact[k-1] % M)*ifact[j-k+1] % M)) % M;   
                }
            }   
        }
        
        long sum = 0;
        for(int i = n/2 + 1; i <= n; i++)
            sum = (sum + dp[n][i]) % M;
        
        System.out.println(sum % M);
    }
} 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: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. 
// LM10: The next Ballon d'or
import java.util.*;
import java.io.*;
import java.math.*;
import javafx.util.Pair;
public class Main
{
    static class FastReader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String next(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long 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 int i(){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 double d() throws IOException {return Double.parseDouble(next()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public void scanIntArr(int [] arr){ for(int li=0;li<arr.length;++li){ arr[li]=i();}}
        public void scanLongArr(long [] arr){for (int... Complexity:
targets: linear
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. /*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
300IQ as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class F
   {
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));  
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int M = Integer.parseInt(st.nextToken());
         int[][] grid = new int[N][M];
         for(int i=0; i < N; i++)
            grid[i] = readArr(M, infile, st);
         int[][] mindiff = new int[N][N];
         for(int a=0; a < N; a++)
            for(int b=a+1; b < N; b++)
            {
               int val = Integer.MAX_VALUE;
               for(int i=0; i < M; i++)
                  val = Math.min(val, Math.abs(grid[a][i]-grid[b][i]));
               mindiff[a][b] = mindiff[b][a] = val;
            }
         int res = 0;
         for(int start=0; start < N; start++)
         {
            int[][] dp = new int[1<<N][N];
            Arrays.fill(dp[0], Integer.MAX_VALUE);
            for(int mask=0; mask < (1<<N); mask++)
            {
               if(Integer.bitCount(mask) == 1 && mask != (1<<start))
                  continue;
               for(int prev=0; prev < N; prev++)
                  if((mask&(1<<prev)) > 0 || mask == 0)
                  {
                     for(int b=0; b < N; b++)
                        if((mask&(1<<b)) == 0)
                        {
              ... Complexity:
targets: np
inputs: import java.util.*;
import java.io.*;
import java.lang.Math.*;

public class Main{
	static long s;
	static boolean check(long n){
		int sum = 0;
		long storen=n;
		while(n>0){
			int k = (int)(n%10);
			n /=10;
			sum+=k;
		}
		return storen-(long)sum >= s;
	}
	public static void main(String args[]){
		PrintWriter pw=new PrintWriter(System.out);
		InputReader ip=new InputReader(System.in);
		
		long n;
		n=ip.nextLong();
		s=ip.nextLong();

		if(s>n){
			pw.println("0");
		}
		else{
			long l=0,r=n;
			boolean possible=false;
			long mid=0;
			int it=100;
			while(it-->0){
				mid = (l+r)/2;
				if(check(mid)){
					r=mid;
					possible = true;
				}
				else{
					l=mid+1;
				}
		//		pw.println(mid);
		//		pw.println(l+" "+r);
			}
			if(possible){
				pw.println(n-l+1);
			}	
			else{
				pw.println("0");
			}
		}
		
		pw.close();
	}
	static 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 InputMismatchException();
                }

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

        public String nextLine() {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public int nextInt() {
            int c = read();

        ... 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: // @author Sanzhar
import java.io.*;
import java.util.*;
import java.awt.Point;

public class Template {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st;

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

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

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

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

    public void run() throws Exception {
        //in = new BufferedReader(new FileReader("input.txt"));
        //out = new PrintWriter(new FileWriter("output.txt"));
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.flush();
        out.close();
        in.close();
    }

    public void solve() throws Exception {
        int n = nextInt();
        int k = nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        boolean[] ok = new boolean[n];
        Arrays.fill(ok, true);
        Arrays.sort(a);
        if (k != 1) {
            for (int i = 0; i < n; i++) {
                if (a[i] % k == 0) {
                    int x = a[i] / k;
                    int ind = Arrays.binarySearch(a, x);
                    if (ind >= 0 && ok[ind]) {
                        ok[i] = false;
                    }
                }
            }
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            if (ok[i]) {
                ans++;
            }
        }
        out.println(ans);
    }

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

public class A {
	private static Scanner in;
	
	final int M = 1000000009;

	public void run() {
		int n = in.nextInt();
		int m = in.nextInt();
		int k = in.nextInt();
		int z = n - m;
		if (z >= n / k) {
			System.out.println(m);
			return;
		}
		int f = n - k * z;
		int ans = BigInteger.ONE.shiftLeft(f / k + 1).remainder(BigInteger.valueOf(M)).intValue();
		System.out.println(((ans + M - 2L) * k + (f % k + (k - 1) * z)) % M);
	}

	public static void main(String[] args) {
		Locale.setDefault(Locale.US);
		in = new Scanner(System.in);
		new A().run();
		in.close();
	}
}
 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 a
{
	public static void main(String[] args)
	{
		
		Scanner sc=new Scanner(System.in);
		
		int N=sc.nextInt();
		
		solve(N);
		
		
	}
	
	static void solve(int a)
	{
		if((a-8)%3==0)
		{
			System.out.println(8+" "+(a-8));
			return ;
		}
		if((a-4)%3==0)
		{
			System.out.println(4+" "+(a-4));
			return ;
		}
		if((a-6)%3==0)
		{
			System.out.println(6+" "+(a-6));
			return ;
		}
	}
		
} What is the time complexity of the previous code?
targets: constant
inputs: import java.awt.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.List;

public class Main {


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long x = scanner.nextLong(), y = scanner.nextLong();
        long whiteSteps, blackSteps;

        if(x == 1 || y == 1){
            whiteSteps = (x - 1) + (y - 1);
        } else {
            whiteSteps = Math.min((x - 1) + Math.abs(y - x), (y - 1) + Math.abs(y - x));
        }

        if(x == n || y == n){
            blackSteps = (n - x) + (n - y);
        } else {
            blackSteps = Math.min((n - x) + Math.abs(y - x), (n - y) + Math.abs(y - x));
        }

        if (whiteSteps <= blackSteps){
            System.out.println("White");
        } else {
            System.out.println("Black");
        }

    }
}
 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.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;

public class BT {

    static BufferedReader in = new BufferedReader(new InputStreamReader(
            System.in));
    static StringTokenizer str;
    static String SK;

    static String next() throws IOException {
        while ((str == null) || (!str.hasMoreTokens())) {
            SK = in.readLine();
            if (SK == null)
                return null;
            str = new StringTokenizer(SK);
        }
        return str.nextToken();
    }

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

    public static void main(String[] args) throws IOException {
        int n, k;
        n = nextInt();
        k = nextInt();
        HashSet<Integer> hs = new HashSet<Integer>();
        HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();

        int[] ar = new int[n];
        int ii = 0, jj = -1;
        for (int i = 0; i < n; i++) {
            ar[i] = nextInt();

            Integer iii = hm.get(ar[i]);
            if(iii!=null)
            hm.put(ar[i], ++iii); else hm.put(ar[i], 1);
            hs.add(ar[i]);
            if (hs.size() == k) {
                jj = i;
                break;
            }
        }
        if (jj == -1) {
            System.out.println(-1 + " " + (-1));
            System.exit(0);
        }
        for (int i = 0; i < ar.length; i++) {
            Integer iii = hm.get(ar[i]);
            if (iii != null && iii - 1 > 0) {
                hm.put(ar[i], --iii);
                ii++;
            } else {
                break;
            }
        }
        System.out.println((ii+1) + " " + (jj+1));

    }

} Complexity:
targets: linear
inputs: import java.util.Scanner;


public class prob1 {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		if(n == 1)
		{
//			throw new RuntimeException();
			int m = input.nextInt();
			System.out.println("NO");
//			System.out.println(input.next());
			return;
		}
		int[] num = new int[n];
		boolean flag  = false;
		for(int i = 0; i < n; i++)
		{
			num[i] = input.nextInt();
			if(num[i] != num[0])
				flag = true;
		}
		if(!flag)
		{
			System.out.println("NO");
			return;
		}
		int min = Integer.MAX_VALUE;
		for(int i = 0; i < n; i++)
			if(num[i] < min)
				min = num[i];
		int min2 = Integer.MAX_VALUE;
		for(int i = 0; i < n; i++)
			if(num[i] <= min2 && num[i] > min)
				min2 = num[i];
		System.out.println(min2);
		
	}
}
 What is the time complexity of the previous code?
targets: nlogn
inputs: import java.io.*;
import java.util.*;
	
public	 class template
	{
		private InputStream is;
		private PrintWriter pw;
		static char[][] ch;
		static int  x1,x2,y1,y2,n,m,h,k;
		static long dist[][];
		static boolean boo[][];
		
		void soln()
		{
			is = System.in;
			pw = new PrintWriter(System.out);
			long s = System.currentTimeMillis();
			solve();
			pw.close();
			pw.flush();
			// tr(System.currentTimeMillis() - s + "ms");
		}
	
		public static void main(String[] args) throws Exception 
		{
			new Thread(null, new Runnable() 
			{
				public void run() 
				{
					try
					{
						// new CODEFORCES().soln();
					} catch (Exception e)
					{
						System.out.println(e);
					}
				}
			}, "1", 1 << 26).start();
			new template().soln();
		}
	
		void solve() 
		{
			long n = nl(), k = nl();
			if(n==0){
				pw.println(0);
				return;
			}
			long MOD = 1000000007;
			long pow1 = pow(2,k,MOD), pow2 = pow(2,k+1,MOD);
			pw.println(((((n%MOD)*pow2)%MOD) - (pow1-1+MOD)%MOD + 2*MOD)%MOD);
			pw.close();	
		}
		long pow(long x, long y, long mod){
			long ans = 1;
			while(y>0){
				if(y%2==0) {
					x *= x;
					x %= mod;
					y/=2;
				}
				else{
					ans *= x;
					ans %= mod;
					y-=1;
				}
			}
			return ans;
		}
		long gcd(long a, long b){
			if(b==0) return a;
			return gcd(b,a%b);
		}
		void printArray(long[] arr) {
			for(long i : arr) pw.print(i +" ");
			pw.println();
		}
	static long min(long x, long y){
		return (x<y)?x:y;
	}
	static class Pair implements Comparable<Pair>{
		long val;
		int  x, y;
		Pair(long v, int a, int b){
			val = v; x = a; y = b;
		}
		public int compareTo(Pair p){
			return Long.compare(this.val,p.val);
		}
	}
	private static class Queue{
		int st = 0;
		int et = 0;
		Pair[] arr;
		public Queue(int len) {
			arr = new Pair[len];
		}
		public boolean isEmpty() {
			return st==et;
		}
		public void add(Pair x) {
			arr[et++] = x;
		}
		public Pair poll() {
			return arr[st++];
		}
		public void clear() {
			st = et = 0;
		}
	}
		/*void bfs(int k) {
			while(!q.isEmpty())... 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.BufferedWriter;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Random;
import java.util.TreeSet;

/**
 * Actual solution is at the top, in class Solver
 */
final public class Main implements Runnable {
	private static String[] args;

	public static void main(String[] args) {
		Main.args = args;
		new Thread(null, new Main(), "MyRunThread", 1 << 27).start();
	}

	//@Override
	public void run() {
		long time_beg = -1;
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		if (args.length > 0 && args[0].equals("outside")) {
			time_beg = System.currentTimeMillis();
			try {
				inputStream = new FileInputStream("IO/in.txt");
//				outputStream = new FileOutputStream("IO/out.txt");
			} catch (Exception e) {
				System.err.println(e);
				System.exit(1);
			}
		} else {
			try {
//				inputStream = new FileInputStream("IO/in.txt");
//				outputStream = new FileOutputStream("IO/out.txt");
			} catch (Exception e) {
				System.err.println(e);
				System.exit(1);
			}
		}

		Solver s = new Solver();
		s.in = new InputReader(inputStream);
		s.out = new OutputWriter(outputStream);
		if (args.length > 0 && args[0].equals("outside")) {
			s.dout = new DebugWriter(s.out);
		}

		s.solve();

		if (args.length > 0 && args[0].equals("outside")) {
			s.dout.printFormat("*** Total time: %.3f ***\n", (System.currentTimeMillis() - time_beg) / 1000.0);
		}

		s.out.close();
	}
}


final class Solver {
	InputReader in;
	OutputWriter out;
	DebugWriter dout;

	public void solve() {
		int n = in.readInt();
		int k = in.readInt();


		TreeSet<Integer> q = new TreeSet<Integer>();
		int[] mas = new int[n];
		for (int i = 0; i... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: nlogn
inputs: import java.io.*;
import java.util.StringTokenizer;

public class C {

    static final int MOD = (int)1e9 + 7;

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

        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        long x = sc.nextLong(), k = sc.nextLong();
        if(x == 0)
            out.println(0);
        else
            out.println(((x % MOD * 2 - 1 + MOD) % MOD * modPow(2, k) % MOD + 1) % MOD);
        out.close();
    }

    static long modPow(long b, long e) {
        long res = 1;
        while(e > 0) {
            if((e & 1) == 1)
                res = res * b % MOD;
            b = b * b % MOD;
            e >>= 1;
        }

        return res;
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

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

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

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

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

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

        public String nextLine() throws IOException {return br.readLine();}

        public boolean ready() throws IOException { return br.ready(); }

    }
}
 What is the time complexity of the previous code?
targets: logn