Muennighoff/xP3x-sample huggingface dataset:
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;
public class USACO {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(reader.readLine()," ");
        int n= Integer.parseInt(st.nextToken());
        int r= Integer.parseInt(st.nextToken());
        StringTokenizer st2 = new StringTokenizer(reader.readLine()," ");
        double[][] coord = new double[n][2];
        for (int i=0;i<n;i++) {
            coord[i][0] = Integer.parseInt(st2.nextToken());
            double y=r;
            for (int j=0;j<i;j++) {
                if (coord[j][0]<=coord[i][0]+2*r&&coord[j][0]>=coord[i][0]-2*r) {
                    if (coord[j][1]+Math.sqrt(4*r*r-(coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0]))>y) {
                        y=coord[j][1]+Math.sqrt(4*r*r-(coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0]));
                    }
                }
            }
            coord[i][1]=y;
        }
        for (int i=0;i<n;i++) {
            System.out.print(coord[i][1]);
            if (i<n-1) {
                System.out.print(" ");
            } else {
                System.out.print("\n");
            }
        }
        reader.close();
    }
} Complexity:
targets: quadratic
inputs: import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */
public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ACodehorsesTShirts solver = new ACodehorsesTShirts();
        solver.solve(1, in, out);
        out.close();
    }

    static class ACodehorsesTShirts {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            ArrayList<String>[] arrayLists = new ArrayList[5];
            ArrayList<String>[] arrayLists1 = new ArrayList[5];
            for (int i = 0; i < 5; i++) {
                arrayLists[i] = new ArrayList<>();
                arrayLists1[i] = new ArrayList<>();
            }
            for (int i = 0; i < n; i++) {
                String s = in.scanString();
                arrayLists[s.length()].add(s);
            }
            for (int i = 0; i < n; i++) {
                String s = in.scanString();
                arrayLists1[s.length()].add(s);
            }
            long ans = 0;
            for (int i = 0; i < 5; i++) {
                for (int diff = 0; diff < 5; diff++) {

                    for (int j = 0; j < arrayLists[i].size(); j++) {
                        int min = Integer.MAX_VALUE;
                        int index = -1;
                        for (int k = 0; k < arrayLists1[i].size(); k++) {
                            int tt = 0;
                            for (int l = 0; l < i; l++)
         ... What is the time complexity of the previous code?
targets: linear
inputs: import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*; 
import java.util.*;
import java.util.regex.*;
/*
	  br = new BufferedReader(new FileReader("input.txt"));
	  pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
	  br = new BufferedReader(new InputStreamReader(System.in));
	  pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
 */


public class Main {
	private static BufferedReader br;
	private static StringTokenizer st;
	private static PrintWriter pw;

	public static void main(String[] args) throws Exception {
		br = new BufferedReader(new FileReader("input.txt"));
		pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
		//int qq = 1;
		int qq = Integer.MAX_VALUE;
		//int qq = readInt();
		for(int casenum = 1; casenum <= qq; casenum++)	{
			int r = readInt();
			int c = readInt();
			int n = readInt();
			int[][] dist = new int[r][c];
			for(int i = 0; i < r; i++) {
				Arrays.fill(dist[i], 1 << 25);
			}
			LinkedList<State> q = new LinkedList<State>();
			while(n-- > 0) {
				q.add(new State(readInt()-1, readInt()-1));
				dist[q.peekLast().x][q.peekLast().y] = 0;
			}
			int[] dx = new int[]{-1,1,0,0};
			int[] dy = new int[]{0,0,-1,1};
			State ret = q.peekLast();
			while(!q.isEmpty()) {
				State curr = q.removeFirst();
				ret = curr;
				for(int k = 0; k < dx.length; k++) {
					int nx = curr.x + dx[k];
					int ny = curr.y + dy[k];
					if(nx >= 0 && nx < r && ny >= 0 && ny < c && dist[nx][ny] > 1 + dist[curr.x][curr.y]) {
						dist[nx][ny] = 1 + dist[curr.x][curr.y];
						q.add(new State(nx, ny));
					}
				}
			}
			pw.println(ret.x+1 + " " + (ret.y+1));
		}
		exitImmediately();
	}

	static class State {
		public int x,y;

		public State(int x, int y) {
			super();
			this.x = x;
			this.y = y;
		}
		
	}
	
	private static void exitImmediately() {
		pw.close();
		System.exit(0);
	}

	private static long readLong() throws IOException... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: cubic
inputs: import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;

public class Array {

    void run() {
        try {
            BufferedReader bfd = new BufferedReader(new InputStreamReader(
                    System.in));
            StringTokenizer tk = new StringTokenizer(bfd.readLine());
            int n = Integer.parseInt(tk.nextToken());
            int k = Integer.parseInt(tk.nextToken()), i;
            int arr[] = new int[n];
            tk = new StringTokenizer(bfd.readLine());
            for(i=0;i<n;++i)
                arr[i] = Integer.parseInt(tk.nextToken());
            int dist=0,l=0,r=0;
            HashSet<Integer> hs = new HashSet<Integer>();
            for(i=0; i<n; ++i) {
                if(!hs.contains(arr[i])){
                    hs.add(arr[i]);
                    dist++;
                }
                if(dist==k) break;
                r++;
            }
            int freq[] = new int[100010];
            if(hs.size()<k) System.out.println("-1 -1");
            else {
                while(l<arr.length-1 && l<r && arr[l]==arr[l+1])
                    ++l;
                while(r>=1 && r>l && arr[r]==arr[r-1])
                    --r;
                for(i=l;i<=r;++i)
                    freq[arr[i]]++;
                while(freq[arr[l]]>1){
                    freq[arr[l]]--;
                    l++;
                }
                while(freq[arr[r]]>1){
                    freq[arr[r]]--;
                    r--;
                }
                System.out.println((l+1)+" " +(r+1));
            }
        } catch (Exception e) {

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

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


public class A113 {

    public static void main(String[] args) {
        new A113().run();
    }
    
    public void run() {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        Team[] teams = new Team[n];
        for (int i = 0; i < teams.length; i++) {
            teams[i] = new Team(in.nextInt(), in.nextInt());
        }
        Arrays.sort(teams);
        int counter = 1;
        int index = k-2;
        while (index >= 0 && teams[index].p == teams[k-1].p && teams[index].t == teams[k-1].t) {
            index--;
            counter++;
        }
        index = k;
        while (index < n && teams[index].p == teams[k-1].p && teams[index].t == teams[k-1].t) {
            index++;
            counter++;
        }
        System.out.println(counter);
    }
    
    private class Team implements Comparable<Team> {
        int p;
        int t;
        
        public Team(int pp, int tt) {
            p = pp; t = tt;
        }

        @Override
        public int compareTo(Team o) {
            if (o.p - this.p == 0)
                return this.t - o.t;
            return o.p - this.p;
        }
    }
}
 Complexity:
targets: nlogn
inputs: import java.util.Scanner;


public class Main {

	/**
	 * @param args
	 */
	static long[] dx = new long[]{0, 1, 0, -1};
	static long[] dy = new long[]{-1, 0, 1, 0};
	public static void main(String[] args) {
		Scanner r = new Scanner(System.in);
		
		long N = r.nextLong();
		long X = r.nextLong();
		long Y = r.nextLong();
		long C = r.nextLong();
		
		long lo = 0, hi = N * 2;
		
		while(lo < hi){
			long T = (lo + hi) / 2;
			
			long[] NX = new long[4];
			long[] NY = new long[4];
			
			for(int d = 0; d < 4; d++){
				NX[d] = X + dx[d] * T;
				NY[d] = Y + dy[d] * T;
			}
			
			long ret = (T + 1) * (T + 1) + T * T;
			
			ret -= half(1 - NY[0]);
			ret -= half(NY[2] - N);
			ret -= half(NX[1] - N);
			ret -= half(1 - NX[3]);
			
			ret += quarter(1 - NY[0] - (N - X + 1));
			ret += quarter(1 - NY[0] - (X));
			ret += quarter(NY[2] - N - (N - X + 1));
			ret += quarter(NY[2] - N - (X));
			
			if(ret < C)lo = T + 1;
			else hi = T;
		}
		
		System.out.println(lo);
		
	}
	private static long half(long x) {
		if(x <= 0)return 0;
		else return 2 * quarter(x) - x;
	}
	private static long quarter(long x){
		if(x <= 0)return 0;
		return x * (x + 1) / 2;
	}

}
 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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
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;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE2 solver = new TaskE2();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE2 {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int t = in.nextInt();
            while (t-- > 0) {
                int n = in.nextInt(), m = in.nextInt();
                int[][] a = new int[m][n];
                int[] bestMask = new int[1 << n];
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < m; j++) {
                        a[j][i] = in.nextInt();
                    }
                }
                int[] dp = new int[1 << n];
                for (int i = 0; i < m; i++) {
                    int[] array = a[i];
                    for (int j = 0; j < n; j++) {
                        int val = array[j];
                        for (int mask = 0; mask < 1 << n; mask++) {
                            if ((mask & (1 << j)) == 0) {
                                dp[mask | (1 << j)] = Math.max(dp[mask | (1 << j)], dp[mask] + val);
                            }
                        }
                    }
                    for (int mask = 0; mask < 1 << n; mask++) {
                        int best = 0;
                        int cur = mask;
                        for (int j = 0; j < n; j++) {
                            best =... Complexity:
targets: np
inputs: import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Math.min;
import static java.lang.System.exit;

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

public class F {

	static void solve() throws Exception {
		int n = scanInt();
		long l[] = new long[n];
		for (int i = 0; i < n; i++) {
			l[i] = scanLong();
		}
		long e1 = 0, e2 = 0, ans = 0;
		boolean water = false;
		String types = scanString();
		for (int i = 0; i < n; i++) {
			long li = l[i], cur;
			switch (types.charAt(i)) {
			case 'G':
				cur = min(e1, li);
				e1 -= cur;
				li -= cur;
				e2 += 2 * cur;
				ans += 2 * cur;
				e2 += li;
				ans += 3 * li;
				break;
			case 'W':
				water = true;
				e1 += li;
				ans += 2 * li;
				break;
			case 'L':
				cur = min(e1, li);
				e1 -= cur;
				li -= cur;
				ans += 2 * cur;
				cur = min(e2, li);
				e2 -= cur;
				li -= cur;
				ans += 3 * cur;
				ans += (water ? 4 : 6) * li;
				break;
			default:
				throw new AssertionError();
			}
		}
		out.print(ans);
	}

	static int scanInt() throws IOException {
		return parseInt(scanString());
	}

	static long scanLong() throws IOException {
		return parseLong(scanString());
	}

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

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
} What is the time complexity of the previous code?
targets: linear
inputs: import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

public class Main {
	public static void main(String[] args) throws IOException {
		try {
			if (new File("input.txt").exists()) {
				System.setIn(new FileInputStream("input.txt"));
			}
		} catch (SecurityException e) {
		}
		
		new Main().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		int N = nextInt();
		double[][] a = new double [N][N];
		
		for (int i = 0; i < N; i++)
			for (int j = 0; j < N; j++)
				a[i][j] = nextDouble();
		
		int NN = 1 << N;
		
		double[] dp = new double [NN];
		dp[NN - 1] = 1.0;
		
		for (int mask = NN - 1; mask > 0; mask--) {
			int b = Integer.bitCount(mask);
			if (b <= 1)
				continue;

			double k = 2.0 / (b * (b - 1));
			
			for (int i = 0; i < N; i++) {
				if ((mask & (1 << i)) == 0)
					continue;
				
				for (int j = i + 1; j < N; j++) {
					if ((mask & (1 << j)) == 0)
						continue;
					
					double p = a[i][j];
					dp[mask & (~(1 << j))] += k * p * dp[mask];
					dp[mask & (~(1 << i))] += k * (1.0 - p) * dp[mask];
				}
			}
		}
		
		out.printf(Locale.US, "%.8f", dp[1]);
		
		for (int i = 1, ind = 2; i < N; ind <<= 1, i++)
			out.printf(Locale.US, " %.8f", dp[ind]);
		out.println();
		out.close();
	}
	
	String nextToken() throws IOException {
		while (!st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		
		return st.nextToken();
	}
	
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return... 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.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.net.Inet4Address;
import java.util.*;
import java.lang.*;
import java.util.HashMap;
import java.util.PriorityQueue;
public class templ implements Runnable{
    static class pair implements Comparable
    {
        int f;
        int s;
        pair(int fi,int se)
        {
            f=fi;
            s=se;
        }
        public int compareTo(Object o)//ascending order
        {
            pair pr=(pair)o;
            if(s>pr.s)
                return 1;
            if(s==pr.s)
            {
                if(f>pr.f)
                    return 1;
                else
                    return -1;
            }
            else
                return -1;
        }
        public boolean equals(Object o)
        {
            pair ob=(pair)o;
            int ff;
            int ss;
            if(o!=null)
            {
                ff=ob.f;
                ss=ob.s;
                if((ff==this.f)&&(ss==this.s))
                    return true;
            }
            return false;
        }
        public int hashCode()
        {
            return (this.f+" "+this.s).hashCode();
        }
    }
    public class triplet implements Comparable
    {
        int f,t;
        int s;
        triplet(int f,int s,int t)
        {
            this.f=f;
            this.s=s;
            this.t=t;
        }
        public boolean equals(Object o)
        {
            triplet ob=(triplet)o;
            int ff;
            int ss;
            int tt;
            if(o!=null)
            {
                ff=ob.f;
                ss=ob.s;
                tt=ob.t;
                if((ff==this.f)&&(ss==this.s)&&(tt==this.t))
                    return true;
            }
            return false;
        }
        public int hashCode()
        {
            return (this.f+" "+this.s+" "+this.t).hashCode();
        }
        public int compareTo(Object o)//ascending order
        {
            triplet tr=(triplet)o;
         ... Complexity:
targets: logn
inputs: /*
⠀⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀
⠀⠀⠀⣴⠿⠏⠀⠀⠀⠀⠀⠀⢳⡀⠀⡏⠀⠀Y⠀⠀⢷
⠀⠀⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀A⠀⠀ ⡇
⠀⠀⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿⠀⣸⠀⠀S⠀  ⡇
⠀⠀⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀⠀⣿⠀⢹⠀⠀H⠀⠀ ⡇
⠀⠀⠙⢿⣯⠄⠀⠀⠀⢀⡀⠀⠀⡿⠀⠀⡇⠀⠀⠀⠀⡼
⠀⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀⠀⠘⠤⣄⣠⠞⠀
⠀⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀
⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀
⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀⠀⣄⢸⠀⠀⠀⠀⠀⠀
⣿⣿⣧⣀⣿………⣀⣰⣏⣘⣆⣀⠀⠀
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter; // System.out is a PrintStream
// import java.util.Arrays;
import java.util.ArrayDeque;
// import java.util.ArrayList;
// import java.util.Collections;    //  for sorting ArrayList mainly
// import java.util.HashMap;
// import java.util.HashSet;
// import java.util.Random;
import java.util.StringTokenizer;

public class C {
    public static void main(String[] args) throws IOException {
        FastScanner scn = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        for (int tc = scn.nextInt(); tc > 0; tc--) {
            int N = scn.nextInt();
            int[] arr = new int[N];
            for (int i = 0; i < N; i++) {
                arr[i] = scn.nextInt();
            }
            StringBuilder[] ans = new StringBuilder[N];
            ans[0] = new StringBuilder("1");
            ArrayDeque<Integer> st = new ArrayDeque<>();
            st.addLast(0);
            for (int i = 1; i < N; i++) {
                // System.out.println(st);
                ans[i] = new StringBuilder();
                if (arr[i] == 1) {
                    st.addLast(i);
                    ans[i].append(ans[i - 1].toString() + ".1");
                } else {
                    while (arr[st.getLast()] != arr[i] - 1) {
                        st.removeLast();
                    }
                    int pos = st.removeLast();
                    String[] prev = ans[pos].toString().split("[.]");
                    for (int j = 0, sz = prev.length - 1; j < sz; j++) {
                        ans[i].append(prev[j] + ".");
                    }
                    ans[i].append(arr[i] + "");
            ... 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. import static java.util.Arrays.*;
import static java.lang.Math.*;
import static java.math.BigInteger.*;
import java.util.*;
import java.math.*;
import java.io.*;

public class A implements Runnable
{
    String file = "input";
    
    void init() throws IOException
    {
        //input = new BufferedReader(new FileReader(file + ".in"));
        input = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new BufferedOutputStream(System.out));
    }
    
    void solve() throws IOException
    {
        String s = next();
        int res = 0;
        int L = s.length();
        for(int i = 0; i < L; i++)
            for(int j = i + 1; j <= L; j++)
            {
                String ss = s.substring(i, j);
                int k = s.indexOf(ss);
                //print(ss, k);
                if(k >= 0)
                {
                    if(s.substring(k + 1).indexOf(ss) >= 0) res = max(res, j - i);
                }
            }
        System.out.println(res);
    }
    
    String next() throws IOException
    {
        if(st == null || !st.hasMoreTokens()) st = new StringTokenizer(input.readLine());
        return st.nextToken();
    }
    
    int nextInt() throws IOException
    {
        return Integer.parseInt(next());
    }
    
    long nextLong() throws IOException
    {
        return Long.parseLong(next());
    }
    
    double nextDouble() throws IOException
    {
        return Double.parseDouble(next());
    }
    
    void print(Object... o)
    {
        System.out.println(deepToString(o));
    }
    
    void gcj(Object o)
    {
        String s = String.valueOf(o);
        out.println("Case #" + test + ": " + s);
        System.out.println("Case #" + test + ": " + s);
    }
    
    BufferedReader input;
    PrintWriter out;
    StringTokenizer st;
    int test;
    
    public static void main(String[] args) throws IOException
    {
        new Thread(null, new A(), "", 1 << 20).start();
    }
    
    public void run()
    {
        try
        {
    ... Complexity:
targets: cubic
inputs: import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;


public class TaskA implements Runnable {
	
	@Override
	public void run() {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n = in.readInt();
		if (n > 0) {
			out.println(n);
		}
		else {
			int nn = -n;
			int x = nn/10;
			int lastDigit = nn%10;
			int y = 10*(x/10) + lastDigit;
			x = -x;
			y = -y;
			out.println(x > y ? x : y);
		}
		out.flush();
	}

	public static void main(String[] args) {
		new TaskA().run();
	}
	
	private class InputReader {
		
	    public BufferedReader reader;
	    public StringTokenizer tokenizer;

	    public InputReader(InputStream stream) {
	        reader = new BufferedReader(new InputStreamReader(stream));
	        tokenizer = null;
	    }

	    public String next() {
	        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }
	    
	    public int readInt() {
	    	return Integer.parseInt(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.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.Set;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.HashSet;
import java.io.InputStream;

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

class TaskD {
    public void solve(int testNumber, InputReader jin, OutputWriter jout) {
        int n = jin.int32();
        int a = jin.int32();
        int b = jin.int32();



        Set<Integer> present = new HashSet<Integer>();
        int[] arr = new int[n];
        int[] sarr = new int[n];
        for(int i = 0; i < n; i++) {
            sarr[i] = arr[i] = jin.int32();
            present.add(arr[i]);
        }

        boolean rev = b < a;
        if(b < a) {b ^= a; a ^= b; b ^= a; }

        Arrays.sort(sarr);

        Set<Integer> set1 = new HashSet<Integer>();
        Set<Integer> set2 = new HashSet<Integer>();

        for(int i = 0; i < n; i++) {
            if(set1.contains(sarr)) continue;
            if(set2.contains(sarr)) continue;
            int comp1 = b - sarr[i];
            if(present.contains(comp1)) {
                set2.add(sarr[i]);
                set2.add(comp1);
                present.remove(comp1);
            } else {
                int comp2 = a - sarr[i];
                if(present.contains(comp2)) {
                    set1.add(sarr[i]);
                    set1.add(comp2);
                    present.remove(comp2);
                } else {
                    jout.println("NO");
                    return;
                }
            }
        }

       ... Complexity:
targets: linear
inputs: import java.util.*;
import java.io.*;
 

 public class SolutionC{
       public static void main(String[] args) throws Exception{
               Scanner sc=new Scanner(System.in);
        PrintWriter out=new PrintWriter(System.out);
       int t=sc.nextInt();
       int[] arr=new int[10000002];
       for(int i=0;i<arr.length;i++){
           arr[i]=i;
       }
       for(int i=2;i*i<arr.length;i++){
           int b=i*i;
          for(int j=b;j<arr.length;j+=b){
              arr[j]=j/b;
          }
       }
      int[] pp = new int[10000001]; Arrays.fill(pp, -1);
       while(t-->0){
           
        int n=sc.nextInt();
        int k=sc.nextInt();
        int[] aa=new int[n];
         for(int i=0;i<n;i++){
             int a=sc.nextInt();
             aa[i]=arr[a];
         }
        
         int[] mp = new int[k + 1];
			int[] ip = new int[k + 1];
			for (int i = 0; i < n; i++) {
				int a = aa[i];
				for (int h = k; h >= 0; h--) {
					if (pp[a] >= ip[h]) {
						mp[h]++;
						ip[h] = i;
					}
					if (h > 0 && (mp[h - 1] < mp[h] || mp[h - 1] == mp[h] && ip[h - 1] > ip[h])) {
						mp[h] = mp[h - 1];
						ip[h] = ip[h - 1];
					}
				}
				pp[a] = i;
			}
         
       
        out.println(mp[k]+1);
        
       for (int i = 0; i < n; i++) {
				pp[aa[i]] = -1;
			}
        
       }
           
           out.close();
}

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


public class Solution{
 
	public static Integer INT(String s){
		return Integer.parseInt(s);
	}
 
	public static Long LONG(String s){
		return Long.parseLong(s);
	}
 
	//====================================================================================================================
 
 
 	

	public static void main(String args[])throws IOException{
 
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));	Scanner in=new Scanner(System.in);	StringBuilder out=new StringBuilder();
 
		long n=in.nextLong(),
			 k=in.nextLong();

		long a=1,
			 b=3,
			 c=-2*(n+k);
		
		long r1=(-b+(long)Math.sqrt(b*b-4*a*c))/(2*a);
		long r2=(-b-(long)Math.sqrt(b*b-4*a*c))/(2*a);

		System.out.println(n-Math.max(r1, r2));
	}
} 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = null;

	private void solution() throws IOException {
		int n = nextInt();
		int[] mas = new int[n];
		for (int i = 0; i < n; i++) {
			mas[i] = nextInt();
		}

		Arrays.sort(mas);

		if (mas[n - 1] == 1) {
			mas[n - 1] = 2;
		} else {
			mas[n - 1] = 1;
		}
		Arrays.sort(mas);
		for (int i = 0; i < n; i++) {
			System.out.print(mas[i] + " ");
		}

	}

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

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

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

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

	public static void main(String args[]) throws IOException {
		new C().solution();
	}
} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: nlogn
inputs: import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;


public class A23 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		Map<String, Boolean> map = new HashMap<String, Boolean>();
		for (int i = s.length(); i >= 1; i--) {
			map.clear();
			for (int j = 0; j < s.length()-i+1; j++) {
				String temp = s.substring(j, j+i);
				if (map.containsKey(temp)) {
					System.out.println(i);
					return;
				}
				map.put(temp, true);
			}
		}
		System.out.println(0);
	}

}
 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 B {
    static FastScanner fs;
    public static void main(String[] args) {
        fs=new FastScanner();
        int t = fs.nextInt();
        while (t-->0)
            solve();
    }
    public static void solve() {
        int n = fs.nextInt()*2;
        int sq = (int)Math.sqrt(n);
        int sq2 = (int)Math.sqrt(n/2);
        if (sq*sq==n) System.out.println("YES");
        else if (sq2*sq2==n/2.0 && sq2%2==0) System.out.println("YES");
        else System.out.println("NO");
    }
    static int gcd(int a, int b) {
        if (a==0) return b;
        return gcd(b%a, a);
    }
    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }
    static final Random random =new Random();
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }

    static int[] reverse(int[] a) {
        int n=a.length;
        int[] res=new int[n];
        for (int i=0; i<n; i++) res[i]=a[n-1-i];
        return res;
    }
} What is the time complexity of the previous code?
targets: linear
inputs: import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Solution {
    
    private static final long MODULUS = 1000000007;
    private static final boolean DEBUG = false;

    private static long modularPow(long base, long exponent, long modulus) {
        long result = 1;
        while (exponent > 0) {
            if (exponent % 2 == 1) {
               result = (result * base) % modulus;
            }
            exponent >>= 1;
            base = (base * base) % modulus;
        }
        return result;
    }

    public static void main(String[] args) throws FileNotFoundException {
        long beginTime = System.nanoTime();
        InputStream is = DEBUG ? new FileInputStream("resources/codeforcesedu43/ProblemC-1.in") : System.in;
        try (Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(is)))) {
            long x = scanner.nextLong();
            long k = scanner.nextLong();
            if (x != 0) {
                x = (2 * x - 1) % MODULUS;
                long twoPowK = modularPow(2, k, MODULUS);
                x = (x * twoPowK + 1) % MODULUS;
            }
            System.out.println(x % 1000000007);
        }
        System.err.println( "Done in " + ((System.nanoTime() - beginTime) / 1e9) + " seconds.");
    }
} 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.*;

public class D {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long L = sc.nextLong();
		long R = sc.nextLong();
		long res = Math.max(2 * Long.highestOneBit(L ^ R) - 1, 0);
		System.out.println(res);
	}
}
 Complexity:
targets: logn
inputs: import java.util.*;

public class Solution {
    public void doMain() throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt();
        boolean[][] adj = new boolean[n][n];
        for (int i=0; i<m; i++) {
            int a = sc.nextInt()-1, b = sc.nextInt()-1;
            adj[a][b] = adj[b][a] = true;
        }
        
        long res = 0;
        
        for (int st=0; st+1<n; st++) {
            //System.out.println("st="+st);
            long[][] numWays = new long[1<<(n-st-1)][n-st-1];
            for (int i=st+1; i<n; i++)
                if (adj[st][i]) numWays[1<<(i-st-1)][i-st-1] = 1;
            
            for (int mask=1; mask < (1<<(n-st-1)); mask++) {
                boolean simple = ((mask & (mask-1)) == 0);
                for (int last=0; last<n-st-1; last++) if (numWays[mask][last]!=0) {
                    if (adj[last+st+1][st] && !simple) res += numWays[mask][last];
                    for (int next=0; next<n-st-1; next++)
                        if (adj[last+st+1][next+st+1] && (mask & (1<<next)) == 0)
                            numWays[mask | (1<<next)][next] += numWays[mask][last];
                }
            }
        }
        
        System.out.println(res/2);
    }
    public static void main(String[] args) throws Exception {
        (new Solution()).doMain();
    }
}
 What is the time complexity of the previous code?
targets: np
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Collection;
import java.util.AbstractList;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Deque;
import java.util.ArrayDeque;
import java.util.NoSuchElementException;
import java.util.ConcurrentModificationException;
import java.io.InputStream;

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

    static class DPairOfLines {
        private static final int INF = (int) 2e9 + 7;
        private InputReader in;
        private PrintWriter out;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            this.in = in;
            this.out = out;
            int n = in.nextInt();
            if (n <= 4) {
                out.println("YES");
                return;
            }
            TreeList<PairII> list = new TreeList<>();
            PairII[] a = new PairII[n + 1];
            for (int i = 1; i <= n; i++) {
                a[i] = (new PairII(in.nextInt(), in.nextInt()));
                list.add(a[i]);
            }
            PairII pos1 = new PairII(INF, INF);
            PairII pos2 = new PairII(INF, INF);
            for (int i = 1; i <= 5; i++) {
                for (int j = i + 1; j <= 5; j++) {
                    for (int k = j + 1; k <= 5; k++) {
                        int x1 = a[i].first;
                        int y1 = a[i].second;
                        int x2 = a[j].first;
                        int y2 =... Complexity:
targets: nlogn
inputs: import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.*;

/**
 * Generated by Contest helper plug-in
 * Actual solution is at the bottom
 */
public class Main {
    public static void main(String[] args) {
        InputReader in = new StreamInputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        run(in, out);
    }

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

abstract class InputReader {
    private boolean finished = false;

    public abstract int read();

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

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

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

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

    public abstract void close();
}

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

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

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >=... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: nlogn
inputs: import java.util.*;
import java.io.*;

public class cf1497_Div2_E2 {
	static int[] spf;
	
	public static int factor(int n) {
		int val = 1;
		while (n > 1) {
			int cnt = 0;
			int p = spf[n];
			while (n % p == 0) {
				cnt++;
				n /= p;
			}
			if (cnt % 2 == 1)
				val *= p;
		}
		return val;
	}
	
	public static void main(String args[]) throws IOException {
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		int t = in.nextInt();
		int max = (int)(1e7) + 1;
		
		boolean[] prime = new boolean[max + 1]; 
		Arrays.fill(prime, true);
		prime[0] = prime[1] = false;
		spf = new int[max];
		for (int i = 2; i < max; i++) spf[i] = i;
		for (int i = 2; i * i < max; i++) {
			if (prime[i]) {
				spf[i] = i;
				for (int j = i * i; j < max; j += i) {
					prime[j] = false;
					spf[j] = i;
				}
			}
		}
		
		int[] cnts = new int[max];
		
		for ( ; t > 0; t--) {
			int n = in.nextInt();
			int k = in.nextInt();
			int[] vals = new int[n];
			for (int i = 0; i < n; i++)
				vals[i] = factor(in.nextInt());
			
			// left[i][x] = l where al ... ai such that in x moves it is valid subsequence
			int[][] left = new int[n + 1][k + 1];
			// x y z w a b c
			
			for (int x = 0; x <= k; x++) {
				int l = n;
				int now = 0;
				for (int i = n - 1; i >= 0; i--) {
					while (l - 1 >= 0 && now + ((cnts[vals[l - 1]] > 0) ? 1 : 0) <= x) {
						l--;
						now += ((cnts[vals[l]] > 0) ? 1 : 0);
						// System.out.println(now);
						cnts[vals[l]]++;
					}
					// System.out.println(i + " " + x + " " + l + " " + now);
					left[i][x] = l;
					if (cnts[vals[i]] > 1) now--;
					cnts[vals[i]]--;
				}
			}
			
			// for (int[] x: left)
				// System.out.println(Arrays.toString(x));
		
				
			int oo = (int)(1e9);
			
			int[][] dp = new int[n + 1][k + 1];
			
			for (int i = 1; i <= n; i++)
				Arrays.fill(dp[i], oo);
			
			for (int i = 1; i <= n; i++) {
				for (int j = 0; j <= k; j++) {
					if (j > 0) dp[i][j] = dp[i][j - 1];
					for (int x = 0; x <= j; x++) {
						int l =... What is the time complexity of the previous code?
targets: cubic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] in = br.readLine().split(" ");
		
		int n=Integer.parseInt(in[0]),m=Integer.parseInt(in[1]),k=Integer.parseInt(in[2]);
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] caps = new int[n];
		for (int i = 0; i < caps.length; i++) {
			caps[i] = Integer.parseInt(st.nextToken());
		}
		Arrays.sort(caps);
		
		int curSockets=k, neededLines=0;
		int i = n-1;
		while(curSockets<m && i>=0){
			curSockets+=caps[i]-1;
			neededLines++;
			i--;
		}
		if(curSockets>=m)
			System.out.println(neededLines);
		else
			System.out.println(-1);
	}
}
 Complexity:
targets: nlogn
inputs: import java.util.*;
import java.lang.*;
import java.io.*;

public class java2 {
    public static void main(String[] args) {
        Scanner r = new Scanner(System.in);
        int n=r.nextInt();
        int []l=new int[1005];
        int []ri=new int[1005];
        int []candy=new int[1005];
        for(int i=1;i<=n;++i)
        {
            l[i]=r.nextInt();
        }
        for(int i=1;i<=n;++i)
        {
            ri[i]=r.nextInt();
        }
        for(int i=1;i<=n;++i)
        {
            if(l[i]>i-1||ri[i]>n-i)
            {
                System.out.println("NO");
                System.exit(0);
            }
            candy[i]=n-l[i]-ri[i];
        }
        for(int i=1;i<=n;++i)
        {
            int left=0,right=0;
            for(int j=1;j<=i-1;++j)
            {
                if(candy[j]>candy[i])
                {
                    ++left;
                }
            }
            for(int j=i+1;j<=n;++j)
            {
                if(candy[j]>candy[i])
                {
                    ++right;
                }
            }
            if(left!=l[i]||right!=ri[i])
            {
                System.out.println("NO");
                System.exit(0);
            }
        }
        System.out.println("YES");
        for(int i=1;i<=n;++i)
        {
            System.out.print(candy[i]+" ");
        }
    }
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. 
/**
 *
 * @author saurabh
 */
public class myTemplate {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception{
        // TODO code application logic here
       java.io.BufferedReader br = new java.io.BufferedReader(new 
                 java.io.InputStreamReader(System.in));
       
       int ch[],arr[];
       int x,i,j,k,t,n=Integer.parseInt(br.readLine());
        //System.out.println(n);
        
       if(n>0)
            System.out.println(n);
       else
       {
           //n= -n;
           //n=-n;
           x= n/100;
           
           x = x*10 + n%10;
         //  System.out.println(x);
           if(n/10 > x)
               System.out.println(n/10);
           else
              System.out.println(x);
           
       }
       
    }
}
 Complexity:
targets: constant
inputs: /*
	        		     * Author- Priyam Vora
	        		     * BTech 2nd Year DAIICT
	        		     */
	     
	     
	        		    import java.awt.Checkbox;
	import java.awt.Point;
	import java.io.*;
	        		    import java.math.*;
	        		    import java.util.*;
	import java.util.Map.Entry;
	
	import javax.print.attribute.SetOfIntegerSyntax;
	
	     
	        		    public class Main{
	        		  	private static InputStream stream;
	        		    	private static byte[] buf = new byte[1024];
	        		    	private static int curChar;
	        		    	private static int numChars;
	        		    	private static SpaceCharFilter filter;
	        		    	private static PrintWriter pw;
	        		    	private static long count = 0,mod=1000000007;
	        		    //	private static TreeSet<Integer> ts=new TreeSet[200000];
	        		    	public final static int INF = (int) 1E9;
	
	        		        
	        		        public static void main(String[] args) {
	        		        	InputReader(System.in);
	        		    		pw = new PrintWriter(System.out); 
	        		            new Thread(null ,new Runnable(){
	        		               public void run(){
	        		                   try{
	        		                       solve();
	        		                       pw.close();
	        		                   } catch(Exception e){
	        		                       e.printStackTrace();
	        		                   }
	        		               }
	        		           },"1",1<<26).start();
	        		       }
	        		        public static void test(){
	        		        	int t=nextInt();
	        		        	while(t-->0){
	        		        		solve();
	        		        	}
	        		        }
	        		        public static long pow(long n, long p,long mod) {
	        					if(p==0)
	        						return 1;
	        					if(p==1)
	        						return n%mod;
	        					if(p%2==0){
	        						long temp=pow(n, p/2,mod);
	        					return (temp*temp)%mod;
	        					}else{
	        						 	long... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn