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


public class First {
    StreamTokenizer in;
    PrintWriter out;

    int nextInt() throws IOException {
        in.nextToken();
        return (int)in.nval;
    }

    long nextLong() throws IOException {
        in.nextToken();
        return (long) in.nval;
    }

    String nextString() throws IOException {
        in.nextToken();
        return in.sval;
    }



    void run() throws IOException {
        in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        solve();
        out.flush();
    }

    void solve() throws IOException {
        int n = nextInt(), k = nextInt(), sum = 0, count = 0;
        String str = nextString();
        char[] arr = str.toCharArray();
        boolean[] bool = new boolean[26];
        for(char ch: arr){
            bool[((int)ch)-97] = true;
        }
        for(int i = 0; i < 26; i++){
            if(bool[i]){
                sum += i+1;
                count++;
                i += 1;
            }
            if(count == k) break;
        }
        if(count == k) out.println(sum);
        else out.println(-1);
    }

    public static void main(String[] args) throws IOException {
        new First().run();
    }
} What is the time complexity of the previous code?
targets: linear
inputs: import java.util.*;
import java.io.*;
import java.math.*;
import java.util.HashMap;

public class Main
{
    static class Reader 
    { 
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(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 s(){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(s()) ;}
        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 static void main(String args[])
    {
     ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: linear
inputs: import java.io.*;
import java.util.*;

public class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine(), " :");
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
       ... 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.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class TaskA {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            String arr1[] = new String[n];
            String arr2[] = new String[n];
            int i, j, count = 0;
            for (i = 0; i < n; i++) {
                arr1[i] = in.nextString();
            }
            for (i = 0; i < n; i++) {
                arr2[i] = in.nextString();
                for (j = 0; j < n; j++) {
                    if (arr2[i].equals(arr1[j])) {
                        arr1[j] = "";
                        count++;
                        break;
                    }
                }
            }
            out.println(n - count);
        }

    }

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

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

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar =... Complexity:
targets: linear
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class A {

    private static final int INF = (int) 1e9 + 7;

    public static void main(String[] args) {
        FastScanner fs=new FastScanner();
        PrintWriter pr = new PrintWriter(System.out);
//        int T=fs.nextInt();
//        for (int tt=1; tt<=T; tt++) {
            int n = fs.nextInt(), m = fs.nextInt(), k = fs.nextInt();
            int[][] right = new int[n][m -1], down = new int[n - 1][m];
            for(int i = 0; i < n; i++) right[i] = fs.readArray(m - 1);
            for(int i = 0; i < n - 1; i++) down[i] = fs.readArray(m);
            if (k % 2 == 1) {
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < m; j++) pr.print(-1 + " ");
                    pr.println();
                }
            } else {
                int[][][] dp = new int[k / 2 + 1][n][m];

                for(int r = 1; 2 * r <= k; r++) {
                    for(int i = 0; i < n; i++) Arrays.fill(dp[r][i], INF);
                    for(int i = 0; i < n; i++)
                        for(int j = 0; j  + 1 < m; j++) {
                            int cost = right[i][j];
                            dp[r][i][j] = Integer.min(dp[r][i][j], dp[r - 1][i][j + 1] + cost);
                            dp[r][i][j + 1] = Integer.min(dp[r][i][j + 1], dp[r - 1][i][j] + cost);
                        }
                    for(int i = 0; i + 1 < n; i++)
                        for(int j = 0; j < m; j++) {
                            int cost = down[i][j];
                            dp[r][i][j] = Integer.min(dp[r][i][j], dp[r - 1][i + 1][j] + cost);
                            dp[r][i + 1][j] = Integer.min(dp[r][i + 1][j], dp[r - 1][i][j] + cost);
                        }
                }
                for(int i = 0; i < n; i++) {
                   ... Complexity:
targets: cubic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;

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

        int n, r;
        n = scan.nextInt();
        r = scan.nextInt();

        int[] locs = new int[n];

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

        double[] yPos = new double[n];
        Arrays.fill(yPos, 10e100);

        yPos[0] = r;
        for (int i = 1; i < n; i++) {
            double pos = r;
            for (int j = 0; j < i; j++) {
                int xDist = Math.abs(locs[i] - locs[j]);
                if (xDist <= 2 * r) {
                    double y = (2.0 * r) * (2.0 * r) - (xDist * xDist);
                    if (Math.abs(y - 0.0) < 0.0000000001) {
                        y = 0;
                    } else {
                        y = Math.sqrt(y);
                    }
                    y += yPos[j];
                    pos = Math.max(pos, y);

                } else {
                    continue;
                }
            }
            yPos[i] = pos;
        }
        String[] ans = new String[n];

        for (int i = 0; i < n; i++) {
            ans[i] = "" + yPos[i];
        }

        System.out.println(String.join(" ", ans));

    }
} Complexity:
targets: quadratic
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class LookingForOrder {
	static int[][] pos;
	static int[] dp;
	static int[] nextstate;
	static int[][] dist;
	static int r;
	static int v;

	static void print(int mask) {
		if (mask < v) {
			int c = 0;
			int x = mask ^ nextstate[mask];
			for (int i = 0; i < dist.length - 1; i++) {
				if((x & (1<<i))>0) {
					System.out.print(i+1 + " ");
					c++;
				}
			}
			System.out.print("0 ");
			print(nextstate[mask]);
		}
	}

	static int distace(int x1, int x2, int y1, int y2) {
		return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
	}

	static int solve(int mask) {
		if (mask == v) {
			nextstate[mask] = r;

			return 0;
		}
		if (nextstate[mask] != 0) {
			return dp[mask];
		}

		dp[mask] = (int) 1e9;
		for (int i = 1; i < pos.length; i++) {
			int u = (1 << (i - 1));
			int z = mask | u;
			if ((mask & u) == 0) {
				int x = 2 * dist[i][0] + solve(z);
				if (dp[mask] > x) {
					dp[mask] = x;
					nextstate[mask] = z;
				}

				for (int j = 1; j < pos.length; j++) {
					int m = (1 << j - 1);
					int y = z | m;
					if ((z & m) == 0) {
						x = dist[i][0] + solve(y) + dist[i][j] + dist[j][0];

						if (dp[mask] > x) {
							dp[mask] = x;
							nextstate[mask]= y;
						}

					}
				}
				break;
			}
		}
		return dp[mask];
	}

	public static void main(String[] args) {
		InputReader0 in = new InputReader0(System.in);
		int x = in.nextInt(), y = in.nextInt();
		int n = in.nextInt();
		r = 1 << n;
		v = r - 1;
		dp = new int[r];
		nextstate = new int[r];
		pos = new int[n + 1][2];
		pos[0][0] = x;
		pos[0][1] = y;
		for (int i = 1; i < pos.length; i++) {
			pos[i][0] = in.nextInt();
			pos[i][1] = in.nextInt();
		}
		dist = new int[n + 1][n + 1];
		for (int i = 0; i < dist.length; i++) {
			for (int j = i + 1; j < dist.length; j++) {
				dist[i][j] = dist[j][i] = distace(pos[i][0], pos[j][0], pos[i][1],... 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. /*
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 x35C
   {
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new FileReader("input.txt"));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int M = Integer.parseInt(st.nextToken());
         int K = Integer.parseInt(infile.readLine());
         int[][] grid = new int[N][M];
         for(int i=0; i < N; i++)
            Arrays.fill(grid[i], -1);
         ArrayDeque<Integer> q = new ArrayDeque<Integer>();
         st = new StringTokenizer(infile.readLine());
         while(K-->0)
         {
            int a = Integer.parseInt(st.nextToken())-1;
            int b = Integer.parseInt(st.nextToken())-1;
            grid[a][b] = 0;
            q.add(a);   q.add(b);
         }
         while(q.size() > 0)
         {
            int x = q.poll();
            int y = q.poll();
            if(x > 0 && grid[x-1][y] == -1)
            {
               grid[x-1][y] = grid[x][y]+1;
               q.add(x-1); q.add(y);
            }
            if(y > 0 && grid[x][y-1] == -1)
            {
               grid[x][y-1] = grid[x][y]+1;
               q.add(x);   q.add(y-1);
            }
            if(x+1 < N && grid[x+1][y] == -1)
            {
               grid[x+1][y] = grid[x][y]+1;
               q.add(x+1); q.add(y);
            }
       ... Complexity:
targets: cubic
inputs: import java.util.Scanner;


public class D {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[][]a = new int[n][n];
        for (int i = 1; i <= m; i++) {
            int v1 = sc.nextInt();
            int v2 = sc.nextInt();
            v1--;
            v2--;
            a[v1][v2] = a[v2][v1] = 1;
        }
        long[][]dp = new long[1 << n][n];
        for (int i = 0; i < n; i++) {
            dp[1 << i][i] = 1;
        }
        for (int mask = 0; mask < (1 << n); mask++) {
            if (Integer.bitCount(mask) > 1) {
                for (int i = 0; i < n; i++) {
                    if (i==Integer.numberOfTrailingZeros(mask))
                        continue;
                    if ((mask & (1 << i)) != 0) {
                        for (int j = 0; j < n; j++) {
                            if ((mask & (1 << j)) != 0 && a[j][i]==1) {
                                dp[mask][i] += dp[(mask ^ (1 << i))][j];
                            }
                        }
                    }
                }
            }
        }
        long ans = 0;
        for (int mask = 0; mask < (1 << n); mask++) {
            if (Integer.bitCount(mask) >= 3) {
                int t = Integer.numberOfTrailingZeros(mask);
                for (int i = 0; i < n; i++) {
                    if (a[t][i]==1)
                        ans += dp[mask][i];
                }
            }
        }
        ans /= 2;
        System.out.println(ans);
    }
}   
 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.util.Arrays;
import java.util.Scanner;

public class CF495A {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        long d = s.nextLong();
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        Arrays.sort(arr);
        long ans  = 2;
        for (int i = 0; i < n - 1; i++) {
            if(arr[i + 1] - arr[i] > 2 * d){
                ans += 2;
            }else if(arr[i + 1] - arr[i] == 2 * d){
                ans += 1;
            }
        }
        System.out.println(ans);
    }
}
 Complexity:
targets: linear
inputs: import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

/**
 * Created by hama_du on 15/09/10.
 */
public class A {
    private static final long MOD = 1000000009;

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

        long n = in.nextInt();
        long correct = in.nextInt();
        long k = in.nextInt();
        long wrong = n - correct;
        long set = wrong * k + k - 1;
        if (set >= n) {
            out.println(correct);
        } else {
            long needExtraCorrect = n - (wrong * k + k - 1);
            long firstSet = needExtraCorrect + k - 1;
            long otherSet = correct - firstSet;

            long firstDouble = firstSet / k;
            otherSet += firstSet % k;
            long[][] mat = new long[][]{ {2, 2*k}, {0, 1}};
            long[][] A = pow(mat, firstDouble, MOD);
            long score = (A[0][1] + otherSet) % MOD;
            out.println(score);
        }
        out.flush();
    }

    public static long[][] pow(long[][] a, long n, long mod) {
        long i = 1;
        long[][] res = E(a.length);
        long[][] ap = mul(E(a.length), a, mod);
        while (i <= n) {
            if ((n & i) >= 1) {
                res = mul(res, ap, mod);
            }
            i *= 2;
            ap = mul(ap, ap, mod);
        }
        return res;
    }

    public static long[][] E(int n) {
        long[][] a = new long[n][n];
        for (int i = 0 ; i < n ; i++) {
            a[i][i] = 1;
        }
        return a;
    }

    public static long[][] mul(long[][] a, long[][] b, long mod) {
        long[][] c = new long[a.length][b[0].length];
        if (a[0].length != b.length) {
            System.err.print("err");
        }
        for (int i = 0 ; i < a.length ; i++) {
            for (int j = 0 ; j < b[0].length ; j++) {
                long sum = 0;
               ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: import java.util.*;

import java.io.*;
public class C{
		public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		int n=in.nextInt(),key=in.nextInt(),ans=0;
		int[] a = new int[101], b = new int[101];
		for (int i=1;i<=n;i++) {a[i]=in.nextInt();b[i]=in.nextInt();}
		for (int i=1;i<n;i++)
			for (int j=i+1;j<=n;j++)
				if (a[i]<a[j] || (a[i]==a[j] && b[i]>b[j])) {
		int yed = a[i];a[i]=a[j];			a[j]=yed;
		yed = b[i];b[i]=b[j];b[j]=yed;
				}
		int k=0;
		
		
		for (int i=1;i<=n;i++) {
			if (a[i]==a[i-1] && b[i]==b[i-1]) k++; else 
				{if (i>key && ans==0) ans = k;k=1;}
			
		}
		if (ans == 0) ans = k;
		System.out.println(ans);
		
		}
}
 What is the time complexity of the previous code?
targets: nlogn
inputs: import javax.sound.sampled.Line;
import java.awt.Point;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.io.*;
import java.math.BigInteger;
import static java.math.BigInteger.*;
import java.util.*;
public class A{


    void solve()throws Exception
    {
      int n=nextInt();
      int[]a=new int[n];
        for(int i=0;i<n;i++)
            a[i]=nextInt();
        Arrays.sort(a);
        int[]res=new int[n];
        for(int i=0;i<n;i++)
        {
            if(i==0)
                res[i]=1;
            else
                res[i]=a[i-1];
        }
        if(a[n-1]==1)
            res[n-1]=2;
        for(int i=0;i<n;i++)
        {
            if(i==n-1)
                writer.println(res[i]);
            else
                writer.print(res[i]+" ");

        }


    }
     ////////////
    BufferedReader reader;
    PrintWriter writer;
    StringTokenizer stk;
    void run()throws Exception
    {
        reader=new BufferedReader(new InputStreamReader(System.in));
        stk=null;
        writer=new PrintWriter(new PrintWriter(System.out));
        solve();
        reader.close();
        writer.close();
    }
    int nextInt()throws Exception
    {
        return Integer.parseInt(nextToken());
    }

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

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


    }

    String nextString()throws Exception
    {
        return nextToken();
    }
    String nextLine()throws Exception
    {
        return reader.readLine();
    }
    String nextToken()throws Exception
    {
        if(stk==null || !stk.hasMoreTokens())
        {
            stk=new StringTokenizer(nextLine());
            return nextToken();

        }
        return stk.nextToken();
    }

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



} What is the time complexity of the previous code?
targets: nlogn
inputs: //package codeforces;
import java.util.*;
import java.math.BigInteger;
public class test_round_B {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		BigInteger k=sc.nextBigInteger();
		
		
		BigInteger i=new BigInteger("0");
		int d=0;
		
		BigInteger a=new BigInteger("0");
		while(i.compareTo(k)!=1)
		{
			if(i.compareTo(k)==0)
			{
				break;
			}
			else
			{
				d++;
				BigInteger temp=new BigInteger("0");
				for(int j=0;j<d;j++)
				{
					temp=temp.multiply(new BigInteger("10")).add(new BigInteger("9"));
				}
				i=i.add(new BigInteger(Integer.toString(d)).multiply(temp.subtract(a)));
				//i=i+d*(temp-a);
				a=temp;
			}
			
			
			
		}
		
		//System.out.println(a) ;
		BigInteger b=a.divide(new BigInteger("10"));
		BigInteger t=b;
		BigInteger l=t;
		//System.out.println(b);
		int dig=0;
	
		if(b.equals(new BigInteger("0")))
		{
			dig=0;
		}
		else
		{
			while(b.compareTo(new BigInteger("0"))==1)
			{
				dig++;
				b=b.divide(new BigInteger("10"));
			}
		}
		
		//System.out.println(dig);
		int flag=dig+1;
		BigInteger num=new BigInteger("0");
		b=t;
		while(b.compareTo(new BigInteger("0"))==1)
		{
			//System.out.println("sun");
			BigInteger rev=b.divide(new BigInteger("10"));
			num=num.add(new BigInteger(Integer.toString(dig)).multiply(b.subtract(rev)));
			//num+=(b-rev)*dig;
			b=b.divide(new BigInteger("10"));
			dig--;
			
		}
		//System.out.println(num);
		//System.out.println(t);
		BigInteger net=k.subtract(num);
		BigInteger div=net.divide(new BigInteger(Integer.toString(flag)));
		int q;
		if(net.mod(new BigInteger(Integer.toString(flag))).equals(new BigInteger("0")))
		{
			//System.out.println("s");
			//System.out.println();
			q=0;
			t=t.add(div);
			System.out.println(t.mod(new BigInteger("10")));
		}
		else
		{
			//System.out.println(div);
			//System.out.println(flag);
			//System.out.println(net);
			BigInteger r=div.multiply(new... What is the time complexity of the previous code?
targets: logn
inputs: import java.io.*;
import java.util.*;
 
 
 
public class Main {
	
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	static long oo = 1000000000000L;
	
	public static void main(String[] args) throws IOException {
 
		int n = in.nextInt();
		int q = in.nextInt();
		
		ArrayDeque<Integer> dq = new ArrayDeque<>();
		int max = -1;
		for(int i = 0; i < n; ++i) {
			int x = in.nextInt();
			dq.add(x);
			max = Math.max(max, x);
		}
		ArrayList<Pair> ans = new ArrayList<>();
		while(dq.peekFirst() != max) {
			int a = dq.pollFirst();
			int b = dq.pollFirst();
			ans.add(new Pair(a, b));
			if(a > b) {
				dq.addFirst(a);
				dq.addLast(b);
			}
			else {
				dq.addFirst(b);
				dq.addLast(a);
			}
		}
		ArrayList<Integer> a = new ArrayList<>();
		dq.pollFirst();
		for(int x : dq)
			a.add(x);
		while(q --> 0) {
			long m = in.nextLong() - 1;
			if(m < ans.size()) {
				System.out.println(ans.get((int)m).first + " " + ans.get((int)m).second);
			}
			else {
				int idx = (int)((m - ans.size()) % a.size());
				System.out.println(max + " " + a.get(idx));
			}
		}
		
		out.close();
	}
	
	
	
	static long lcm(long a, long b) {
		return a * b / gcd(a, b);
	}
	
	static boolean nextPermutation(int[] a) {
		for(int i = a.length - 2; i >= 0; --i) {
			if(a[i] < a[i+1]) {
				for(int j = a.length - 1; ; --j) {
					if(a[i] < a[j]) {
						int t = a[i];
						a[i] = a[j];
						a[j] = t;
						for(i++, j = a.length - 1; i < j; ++i, --j) {
							t = a[i];
							a[i] = a[j];
							a[j] = t;
						}
						return true;
					}
				}
			}
		}
		return false;
	}
	
	
	static void shuffle(int[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			int t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}
	
	static void shuffle(long[] a) {
		Random r = new Random();
		for(int i = a.length - 1; i > 0; --i) {
			int si = r.nextInt(i);
			long t = a[si];
			a[si] = a[i];
			a[i] = t;
		}
	}
	
	static int lower_bound(int[] a, int n, int... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: linear
inputs: 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.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Houses implements Runnable {
    private void solve() throws IOException {
        int n = nextInt();
        int t = nextInt();
        int[] x = new int[n];
        int[] a = new int[n];
        for (int i = 0; i < n; ++i) {
            x[i] = nextInt() * 2;
            a[i] = nextInt();
        }
        Set<Integer> res = new HashSet<Integer>();
        for (int i = 0; i < n; ++i) {
            if (valid(n, t, x, a, x[i] + a[i] + t))
                res.add(x[i] + a[i] + t);
            if (valid(n, t, x, a, x[i] - a[i] - t))
                res.add(x[i] - a[i] - t);
        }
        writer.println(res.size());
    }

    private boolean valid(int n, int t, int[] x, int[] a, int pos) {
        for (int i = 0; i < n; ++i) {
            if (Math.abs(pos - x[i]) < a[i] + t)
                return false;
        }
        return true;
    }

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

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter writer;

    public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    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 nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new... Complexity:
targets: nlogn
inputs: import java.math.BigInteger;
import java.util.Scanner;


public class Main {
	static Scanner sc = new Scanner (System.in);
    public static void main(String[] args) {
    	int n = sc.nextInt();
    	int k = sc.nextInt();
    	char str[][] = new char[5][n];
        for(int i = 0;i < 4;i ++){
        	for(int j = 0;j < n;j ++)
                str[i][j] = '.';
        }
        if(k % 2 == 0){
            k /= 2;
            for(int i = 1;i <= 2;i++){
                for(int j = 1;j <= k;j++)
                     str[i][j] = '#'; 
            }
        }
        else{
            str[1][n / 2] = '#';
            if(k != 1){
                int tmp = n / 2;
                if(k <= n - 2){
                    for(int i = 1;i<= (k - 1) / 2;i++){
                        str[1][i] = '#';
                        str[1][n - 1 - i] = '#';
                    }
                }
                else{
                    for(int i = 1;i <= n - 2;i++) str[1][i] = '#';
                    k -= n - 2;
                    for(int i = 1;i <= k/2;i++){
                        str[2][i] = '#';
                        str[2][n - 1 - i]='#';
                    }
                }
     
            }
        }
        System.out.println("YES");
        for(int i = 0;i < 4;i ++){
        	System.out.println(str[i]);
        }
    }
 } Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: linear
inputs: import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * @author pttrung
 */
public class B_Round_371_Div1 {

    public static long MOD = 1000000007;
    static int c = 0;

    public static void main(String[] args) throws FileNotFoundException {
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File(
        // "output.txt")));

        Scanner in = new Scanner();
        int n = in.nextInt();
        int minX = -1;
        int start = 1;
        int end = n;
        c = 0;
        while (start <= end) {
            int mid = (start + end) >> 1;
            c = increaseC(c);
            System.out.println("? " + mid + " 1 " + n + " " + n);
            System.out.flush();

            int v = in.nextInt();
            if (v == 2) {
                minX = mid;
                start = mid + 1;
            } else {
                end = mid - 1;
            }
        }
        //System.out.println("Minx " + minX);
        int maxX = -1;
        start = minX;
        end = n;
        while (start <= end) {
            int mid = (start + end) >> 1;
            c = increaseC(c);
            System.out.println("? " + minX + " 1 " + mid + " " + n);
            System.out.flush();
            int v = in.nextInt();
            if (v == 2) {
                maxX = mid;
                end = mid - 1;
            } else {
                start = mid + 1;
            }
        }
        //... What is the time complexity of the previous code?
targets: logn
inputs: import java.io.*;
import java.util.*;

public class A {
	
	int n;
	
	void run()throws IOException{
		Scanner sc = new Scanner(new InputStreamReader(System.in));		
		n = sc.nextInt();
		int i,tmp,even,odd,e,o;
		even=odd=e=o=0;
		for(i=1;i<=n;i++){
			tmp = sc.nextInt();
			if(tmp%2==0){
				e++;
				if(even==0) even=i;
			} else{
				o++;
				if(odd==0) odd=i;
			}
		}
		if(e>1) System.out.println(odd);
		else System.out.println(even);
	}
	
	public static void main(String[] args)throws IOException {
		new A().run();
	}
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: linear
inputs: 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 algo93
{
    public static void main(String args[])
    {
        Scanner ex=new Scanner(System.in);
        long x=ex.nextLong();
        long k=ex.nextLong();
        long mod=1000000007;
        if(k==0)
        System.out.println((2*x)%mod);
        else if(x==0)
        System.out.println("0");
        else
        {
            long pow=power(2,k);
            long pow1=(2*pow)%mod;
            long ans=(pow1*(x%mod))-pow+1;
            if(ans<0)
            ans=ans+mod;
            ans=ans%mod;
            System.out.println(ans);
        }
    }
    public static long power(long x,long y)
    {
        if (y == 0)
        return 1;
        long mod=1000000007;
        long pow=power(x,y/2);
        pow=(pow*pow)%mod;
        if(y%2==0)
        return pow;
        else
        return ((x%mod)*pow)%mod;
    }
} Complexity:
targets: logn
inputs: import java.io.*; 
import java.util.*; 
import java.util.Map.*;
import java.math.*;
//import java.lang.*;

public class q1 
{ 
    static int MOD=1000000007;
    static class Reader 
    { 
        final private int BUFFER_SIZE = 1 << 16; 
        private DataInputStream din; 
        private byte[] buffer; 
        private int bufferPointer, bytesRead; 
  
        public Reader() 
        { 
            din = new DataInputStream(System.in); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public Reader(String file_name) throws IOException 
        { 
            din = new DataInputStream(new FileInputStream(file_name)); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public String readLine() throws IOException 
        { 
            byte[] buf = new byte[1000000]; // line length 
            int cnt = 0, c; 
            while ((c = read()) != -1) 
            { 
                if (c == '\n') 
                    break; 
                buf[cnt++] = (byte) c; 
            } 
            return new String(buf, 0, cnt); 
        } 
  
        public int nextInt() throws IOException 
        { 
            int ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do
            { 
                ret = ret * 10 + c - '0'; 
            }  while ((c = read()) >= '0' && c <= '9'); 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public long nextLong() throws IOException 
        { 
            long ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((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: 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.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    static BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer tok;
    static boolean hasNext()
    {
        while(tok==null||!tok.hasMoreTokens())
            try{
                tok=new StringTokenizer(in.readLine());
            }
            catch(Exception e){
                return false;
            }
        return true;
    }
    static String next()
    {
        hasNext();
        return tok.nextToken();
    }
    static long nextLong()
    {
        return Long.parseLong(next());
    }
    static int nextInt()
    {
        return Integer.parseInt(next());
    }
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String args []){
        long x = nextLong();
        long a = 2, b = nextLong(), c = 1000000000+7;
        long res = 1;
        a %= c;
        if (x==0){
            out.println(0);
            out.flush();
            return;
        }
        for (; b != 0; b /= 2) {
            if (b % 2 == 1)
                res = (res * a) % c;
            a = (a * a) % c;
        }
        BigInteger r = new BigInteger(String.valueOf(res));
        BigInteger y = new BigInteger(String.valueOf(x));
        BigInteger ans = y.multiply(new BigInteger("2")).subtract(new BigInteger("1")).multiply(r).add(new BigInteger("1")).mod(new BigInteger(String.valueOf(c)));
        out.println(ans);
        out.flush();
    }
}
 Complexity:
targets: logn
inputs: import java.util.Scanner;


public class p23a {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] x = in.next().toCharArray();
        
        int min = 0;
        int max = x.length;
        while(true) {
            if(max-min == 1)
                break;
            int mid = (max+min)/2;
            boolean eq = false;
            for (int i = 0; i <= x.length-mid; i++) {
                for (int j = 0; j <= x.length-mid; j++) {
                    if(j == i)
                        continue;
                    eq = true;
                    for (int k = 0; k < mid; k++) {
                        if(x[i+k] != x[j+k]) { 
                            eq = false;
                            break;
                        }
                    }
                    if(eq)
                        break;
                }
                if(eq) break;
            }
            if(eq) {
                min = mid;
            } else {
                max = mid;
            }
        }
        System.out.println(min);
        
    }
}
 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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.StringTokenizer;
import java.util.Scanner;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TaskD {
        int found = 0;
        int queryCount = 0;
        int[] result = new int[8];

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            //int n = 100;
            //int n = 65536;


            int left = 1;
            int right = n + 1;
            while (left + 1 < right) {
                int middle = (left + right) / 2;
                int res = query(middle, 1, n, n);
                if (res == 2) left = middle;
                else if (res == 1) {
                    //System.out.println("Searching single: ");
                    findSingle(middle, 1, n, n);
                    found++;
                    break;
                } else {
                    right = middle;
                }
            }

            int top = 1;
            int bottom = n + 1;
            while (top + 1 < bottom) {
                int middle = (top + bottom) / 2;
                int res = query(1, middle, n, n);
                if (res == 2) top = middle;
                else if (res == 1) {
                    if ((found == 0) || (!containsRect(1, middle, n, n, result[0], result[1], result[2], result[3]))) {
                       ... Complexity:
targets: logn
inputs: /**
 *   Author: Ridam Nagar
 *   Date: 27 February 2019
 *   Time: 01:17:36
**/
/* 
package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigInteger;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{     
  static String reverse(String s){
    String reverse="";
    for(int i=s.length()-1;i>=0;i--){
        reverse=reverse + s.charAt(i);
    }
    return reverse;
  }

      
    public static void main (String[] args) throws java.lang.Exception
    {
        Scanner sc=new Scanner(System.in);
         int n=sc.nextInt();
         int m=sc.nextInt();
         int x=m%(int)Math.pow(2,n);
         System.out.println(x);



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

public class A implements Runnable {

    public void run() {
        long startTime = System.nanoTime();

        int n = nextInt();

        String[] all = new String[9];
        all[0] = "M";
        for (int i = 0; i < 4; i++) {
            String s = "";
            for (int j = 0; j < i; j++) {
                s += "X";
            }
            all[2 * i + 1] = s + "S";
            all[2 * i + 2] = s + "L";
        }

        Map<String, Integer> map1 = new HashMap<>();
        Map<String, Integer> map2 = new HashMap<>();
        for (String s : all) {
            map1.put(s, 0);
            map2.put(s, 0);
        }
        for (int i = 0; i < n; i++) {
            String s = nextToken();
            map1.put(s, map1.get(s) + 1);
        }
        for (int i = 0; i < n; i++) {
            String s = nextToken();
            map2.put(s, map2.get(s) + 1);
        }

        int res = 0;
        for (String s : all) {
            int a = map1.get(s);
            int b = map2.get(s);

            if (a > b) {
                res += a - b;
            }
        }
        println(res);

        if (fileIOMode) {
            System.out.println((System.nanoTime() - startTime) / 1e9);
        }
        out.close();
    }

    //-----------------------------------------------------------------------------------

    private static boolean fileIOMode;
    private static BufferedReader in;
    private static PrintWriter out;
    private static StringTokenizer tokenizer;

    public static void main(String[] args) throws Exception {
        fileIOMode = args.length > 0 && args[0].equals("!");
        if (fileIOMode) {
            in = new BufferedReader(new FileReader("a.in"));
            out = new PrintWriter("a.out");
        } else {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
        tokenizer = new StringTokenizer("");

        new Thread(new A()).start();
    }

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

public class A {
    FastScanner in;
    PrintWriter out;

    void solve() {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        Arrays.sort(a);
        int res = 0;
        for (int i = 0; i < n; i++) {
            boolean ok = false;
            for (int j = 0; j < i; j++) {
                if (a[i] % a[j] == 0) {
                    ok = true;
                }
            }
            if (!ok) {
                res++;
            }
        }
        out.println(res);
    }

    void run() {
        try {
            in = new FastScanner(new File("A.in"));
            out = new PrintWriter(new File("A.out"));

            solve();

            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    void runIO() {

        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        solve();

        out.close();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
   ... What is the time complexity of the previous code?
targets: quadratic