Muennighoff/xP3x-sample huggingface dataset:
inputs: 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;
import javax.swing.plaf.FontUIResource;


             
                    public class CODE2{
                      private static InputStream stream;
                        private static byte[] buf = new byte[1024];
                        private static int curChar,MAX;
                        private static int numChars;
                        private static SpaceCharFilter filter;
                        private static PrintWriter pw;
                        private static long count = 0,mod=1000000007;
                        static int BIT[];
                        private static boolean primer[];
                    //    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();
   }
    static StringBuilder sb;
    public static void test(){
         sb=new StringBuilder();
        int t=nextInt();
        while(t-->0){
            
            solve();
           
        }
        pw.println(sb);
    }
    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 temp=pow(n,p/2,mod);
                 temp=(temp*temp)%mod;
                 return(temp*n)%mod;
                 
        }
    }
    public static long pow(long n, long p) {
        if(p==0)
            return... 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.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;

public class C{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        long mod=1000000007l;
        int cases=sc.nextInt();


        while(cases>0)
        {
            cases--;
            Stack<Integer> stack=new Stack<>();

            int n=sc.nextInt();

            for(int j=0;j<n;j++)
            {
                int x=sc.nextInt();
                if(x==1)
                {
                    stack.add(1);
                }
                else
                {
                    int p=stack.pop();
                    if(p==x-1)
                    {
                        stack.add(x);
                    }
                    else {
                        while (p != x-1) {
                            p = stack.pop();
                        }

                        stack.add(x);

                    }

                }
                StringBuilder f=new StringBuilder();
                Stack<Integer> temp=new Stack<>();

                while(stack.isEmpty()==false)
                {
                    temp.add(stack.pop());
                }

                while(temp.isEmpty()==false)
                {
                    int z=temp.pop();
                    f.append(z+".");
                    stack.add(z);
                }


                System.out.println(f.substring(0,f.length()-1));

            }

        }

    }
}
 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.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();
    }
} Complexity:
targets: linear
inputs: import java.io.*;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.StringTokenizer;

public class Array implements Runnable {

    void solve() throws IOException {
        int n = readInt();
        int k = readInt();
        int a[] = new int[n];
        int startIdx = 0;
        int endIdx = -1;
        Map<Integer,Integer> map = new HashMap<Integer,Integer>();
        for(int i = 0; i < n; i ++) {
            a[i] = readInt();
            if(map.containsKey(a[i]))
                map.put(a[i], map.get(a[i]) + 1);
            else
                map.put(a[i], 1);
            if(map.size() == k && endIdx == -1) {
                endIdx = i;
                break;
            }
        }

        if(endIdx != -1) {
            while(startIdx < n && map.get(a[startIdx])>1) {
                map.put(a[startIdx], map.get(a[startIdx]) - 1);
                startIdx ++;
            }
            startIdx ++;
            endIdx   ++;
        } else
            startIdx = -1;

        out.println((startIdx)+" "+(endIdx));


    }



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

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

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            if (System.getProperty("ONLINE_JUDGE") != null) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("/Users/shenchen/input.txt"));
                out = new PrintWriter("/Users/shenchen/output.txt");
            }
            Locale.setDefault(Locale.US);
            solve();
            in.close();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Throwable t) {
            t.printStackTrace(System.err);
           ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: linear
inputs: import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.io.*;
 
public class ExplorerSpace {
	
	private static class MyScanner {
	    BufferedReader br;
	    StringTokenizer st;

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

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

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

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

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

	    String nextLine(){
	        String str = "";
		  try {
		     str = br.readLine();
		  } catch (IOException e) {
		     e.printStackTrace();
		  }
		  return str;
	    }

	 }
	
    
	public static int[][][] dp; 
	
	public static boolean valid(int i, int j, int n, int m)
	{
		return i>=0 && i<n &&j>=0 && j<m;
	}
	
	public static void solution(int n, int m, int k, int[][] h, int[][] v)
			
	{
		if(k%2==1)
		{
			for(int i = 0; i<n; i++)
			{
				for(int j = 0; j<m; j++)
				   out.print(-1+" ");
				
				out.println();
				
			}
			
			return;
		}
		
		dp = new int[n][m][k/2+1];
		
		for(int t = 1; t<=k/2; t++)
		{
			for(int i = 0; i<n; i++)
			{
				for(int j = 0; j<m; j++)
				{
					dp[i][j][t] = Integer.MAX_VALUE;
						
				}
			}
		}
		
		for(int i = 0; i<n; i++)
		{
			for(int j = 0; j<m; j++)
			{
				dp[i][j][0] = 0;
					
			}
		}
		
		
		for(int t = 1; t<=k/2; t++)
		{
			for(int i = 0; i<n; i++)
			{
				for(int j = 0; j<m; j++)
				{
					if(valid(i,j+1,n,m))
						dp[i][j][t] = Math.min(dp[i][j][t], h[i][j] + dp[i][j+1][t-1]); 
				
					if(valid(i,j-1,n,m))
						 dp[i][j][t] = Math.min(dp[i][j][t],... 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.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

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

        int n = in.nextInt();
        int[] a = new int[n];
        boolean has_more_than_one = false;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            if (a[i] > 1)
                has_more_than_one = true;
        }

        Arrays.sort(a);

        if (n == 1) {
            if (a[0] == 1)
                out.print(2);
            else
                out.print(1);
        } else {
            out.print(1 + " ");
            for (int i = 1; i < n; i++) {
                if (has_more_than_one || i < n - 1)
                    out.print(a[i - 1] + " ");
                else
                    out.println(2);
            }
        }

        out.close();
    }
}
 What is the time complexity of the previous code?
targets: nlogn
inputs: import java.util.*;

import java.io.*;
public class Solution
{
    public static void main(String [] args) throws IOException
    {
        PrintWriter pw=new PrintWriter(System.out);//use pw.println() not pw.write();
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        /*
        inputCopy
5 3
xyabd
outputCopy
29
inputCopy
7 4
problem
outputCopy
34
inputCopy
2 2
ab
outputCopy
-1
inputCopy
12 1
abaabbaaabbb
outputCopy
1
        */
        int n=Integer.parseInt(st.nextToken());
        int k=Integer.parseInt(st.nextToken());
        st=new StringTokenizer(br.readLine());
        String str=st.nextToken();
        char [] arr=str.toCharArray();
        Arrays.sort(arr);
        int weight=arr[0]-96;
        char a=arr[0];
        int included=1;
        for(int i=1;i<arr.length;++i)
        {
            if(included==k)
                break;
            char c=arr[i];
            if(c-a<2)
                continue;
           
            weight+=arr[i]-96;
            ++included;
            a=arr[i];
            
        }
        if(included==k)
            pw.println(weight);
        else
            pw.println(-1);
        pw.close();//Do not forget to write it after every program return statement !!
    }
}
/*
→Judgement Protocol
Test: #1, time: 77 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK
Input
5 3
xyabd
Output
29
Answer
29
Checker Log
ok 1 number(s): "29"
Test: #2, time: 78 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK
Input
7 4
problem
Output
34
Answer
34
Checker Log
ok 1 number(s): "34"
Test: #3, time: 139 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK
Input
2 2
ab
Output
-1
Answer
-1
Checker Log
ok 1 number(s): "-1"
Test: #4, time: 124 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK
Input
12 1
abaabbaaabbb
Output
1
Answer
1
Checker Log
ok 1 number(s): "1"
Test: #5, time: 124 ms., memory: 0 KB, exit code: 0, checker... What is the time complexity of the previous code?
targets: linear
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();
    }

}
 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.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;
import java.util.Stack;
public class D527A2 {

	public static void main(String[] args) {
		FastScanner in = new FastScanner(System.in);
		int N = in.nextInt();
		Stack<Integer> stack = new Stack<>();
		for(int i = 0; i < N; i++) {
			int num = in.nextInt() % 2;
			if(stack.size() >= 1 && stack.lastElement() == num)
				stack.pop();
			else
				stack.add(num);
		}
		
		System.out.println(stack.size() <= 1 ? "YES" : "NO");
	}
	
	/**
	 * Source: Matt Fontaine
	 */
	static class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int chars;

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

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

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

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

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

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

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

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

		public String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}

}
/*
5
2 1 1 2 5
outputCopy
YES
inputCopy
3
4 5... 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.*;

/**
 __                  __
 ( _)                ( _)
 / / \\              / /\_\_
 / /   \\            / / | \ \
 / /     \\          / /  |\ \ \
 /  /   ,  \ ,       / /   /|  \ \
 /  /    |\_ /|      / /   / \   \_\
 /  /  |\/ _ '_| \   / /   /   \    \\
 |  /   |/  0 \0\    / |    |    \    \\
 |    |\|      \_\_ /  /    |     \    \\
 |  | |/    \.\ o\o)  /      \     |    \\
 \    |     /\\`v-v  /        |    |     \\
 | \/    /_| \\_|  /         |    | \    \\
 | |    /__/_ `-` /   _____  |    |  \    \\
 \|    [__]  \_/  |_________  \   |   \    ()
 /    [___] (    \         \  |\ |   |   //
 |    [___]                  |\| \|   /  |/
 /|    [____]                  \  |/\ / / ||
 (  \   [____ /     ) _\      \  \    \| | ||
 \  \  [_____|    / /     __/    \   / / //
 |   \ [_____/   / /        \    |   \/ //
 |   /  '----|   /=\____   _/    |   / //
 __ /  /        |  /   ___/  _/\    \  | ||
 (/-(/-\)       /   \  (/\/\)/  |    /  | /
 (/\/\)           /   /   //
 _________/   /    /
 \____________/    (


 @author NTUDragons-Reborn
 */

public class C{
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(in, out);
        out.close();
    }
    // main solver
    static class Task{

        double eps= 0.00000001;
        static final int MAXN = 10000001;

        // stores smallest prime factor for every number
        static int spf[] = new int[MAXN];

        Map<Integer,Set<Integer>> dp= new HashMap<>();

        // Calculating SPF (Smallest Prime Factor) for every
        // number till MAXN.
        // Time Complexity : O(nloglogn)
        public void sieve()
        {
            spf[1] = 1;
            for (int i=2; i<MAXN; i++)

                // marking smallest prime factor for every
               ... What is the time complexity of the previous code?
targets: cubic
inputs: import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if ((n % 4 == 0) || (n % 7 == 0) || (n % 44 == 0) || (n % 47 == 0) || (n % 74 == 0) || (n % 77 == 0) 
                || (n % 444 == 0) || (n % 447 == 0) || (n % 474 == 0) || (n % 477 == 0) || (n % 744 == 0) 
                || (n % 747 == 0) || (n % 774 == 0) || (n % 777 == 0)) {
            System.out.println("YES");
            return;
        }
        System.out.println("NO");
    }
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;
import java.io.*;

public class e{
  int n;
  double f[];
  double a[][];

  public void run(){
    Locale.setDefault(Locale.US);
    Scanner in = new Scanner(System.in);
    n = in.nextInt();
    a = new double[n][n];
    for(int i=0;i<n;i++) for(int j=0;j<n;j++) a[i][j] = in.nextDouble();
    f = new double[1<<n];
    for(int i=0;i<1<<n;i++) f[i] = -1;
    f[(1<<n)-1] = 1.0;
    
    for(int i=0;i<n;i++) System.out.print(doIt(1<<i) + " ");
  }

  private double doIt(int mask){
    if (f[mask] >=0) return f[mask];
    f[mask] = 0;
    double k = getBits(mask);
    k*=(k-1)/2.0;

    for(int i=0;i<n;i++)
      if ((mask & (1 << i)) > 0)
        for(int j=0;j<n;j++)
          if ((mask & (1 << j)) == 0)
            f[mask]+=doIt(mask|(1<<j))*a[i][j]/k;
    return f[mask]; 
  }
  private int getBits(int x){
    int cnt = 0;
    while(x > 0){
      x&=(x-1);
      cnt++;
    }
    return cnt+1;
  }

  public static void main(String args[]){
    new e().run();
  }
} Complexity:
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.*;
import java.io.*;

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

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		int t=in.nextInt();
		for(int i=0;i<t;i++) {
			out.println(work());
		}
		out.flush();
	}
	long mod=1000000007;
	long gcd(long a,long b) {
		return b==0?a:gcd(b,a%b);
	}
	int work() {
		int n=in.nextInt();
		int m=in.nextInt();
		int[][] A=new int[n][m];
		int[][] B=new int[n][m];
		int[][] R=new int[m][2];
		for(int i=0;i<m;i++)R[i][1]=i;
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				A[i][j]=in.nextInt();
				R[j][0]=Math.max(R[j][0], A[i][j]);
			}
		}
		Arrays.sort(R,new Comparator<int[]>() {
			public int compare(int[] arr1,int[] arr2) {
				return arr2[0]-arr1[0];
			}
		});
		for(int j=0;j<m;j++) {
			int index=R[j][1];
			for(int i=0;i<n;i++) {
				B[i][j]=A[i][index];
			}
		}
		m=Math.min(n, m);
		int[][] dp=new int[m][1<<n];
		int[][] rec=new int[m][1<<n];
		for(int j=0;j<m;j++) {
			for(int s=0;s<n;s++) {//转
				for(int i=1;i<1<<n;i++) {
					int sum=0;
					for(int b=0;b<n;b++) {
						if(((1<<b)&i)>0) {
							sum+=B[(b+s)%n][j];
						}
					}
					rec[j][i]=Math.max(sum, rec[j][i]);
				}
			}
		}
		
		for(int j=0;j<m;j++) {
			for(int i=0;i<1<<n;i++) {
				if(j==0) {
					dp[j][i]=rec[j][i];
				}else {
					for(int p=i;p<1<<n;p++) {
						p=p|i;
						dp[j][p]=Math.max(dp[j][p], rec[j][i]+dp[j-1][p^i]);
					}
				}
			}
		}
		return dp[m-1][(1<<n)-1];
	}
}



class FastReader
{
	BufferedReader br;
	StringTokenizer st;

	public FastReader()
	{
		br=new BufferedReader(new InputStreamReader(System.in));
	}

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

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

	public long nextLong()
	{
		return Long.parseLong(next());
	}
} Complexity:
targets: np
inputs: import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
public static void main(String args[]) throws Exception
    {
     
     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     int n=Integer.parseInt(br.readLine());
     System.out.println("0 0 "+n);}

}

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

import java.io.*;
import java.util.*;

public class flags1225 implements Runnable {
	static int n, k, a, b[], loy[];
	static boolean decision[];
	static double ans, max;

	static void check(int i) {
		if (i == n) {
			checkAgain();
			return;
		}
		decision[i] = true;
		check(i + 1);
		if (loy[i] < 100) {
			decision[i] = false;
			check(i + 1);
		}
	}

	static void checkAgain() {
		double prob = 1;
		int enemyEnergy = 0;
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (decision[i]) {
				count++;
				prob *= loy[i];
			} else {
				prob = prob * (100 - loy[i]);
				enemyEnergy += b[i];
			}
		}
		double killProb = (double) (a) / (a + enemyEnergy);
		if (count > n / 2) {
			ans += prob;
			return;
		}
		prob *= killProb;
		ans += prob;
	}

	static void rec(int sum, int i) {
		if (i == n || sum == 0) {
			ans = 0;
			check(0);
			max = max(ans, max);
			return;
		}
		for (int j = 0; j <= sum; j = j + 10) {
			if (loy[i] + j > 100)
				continue;
			loy[i] += j;
			rec(sum - j, i + 1);
			loy[i] -= j;
		}
	}

	public void run() {
		n = nextInt();
		k = nextInt() * 10;
		a = nextInt();
		max = 0;
		b = new int[n];
		loy = new int[n];
		decision = new boolean[n];
		for (int i = 0; i < n; i++) {
			b[i] = nextInt();
			loy[i] = nextInt();
		}
		// System.out.println(Arrays.toString(loy));
		rec(k, 0);
		long pow = (long) pow(100, n);
		out.print((double) max / pow);

		// --------------------------------------------------------------------------------------------
		out.close();
		System.exit(0);
	}

	private static boolean fileIOMode = false;
	private static String problemName = "harmful";
	private static BufferedReader in;
	private static PrintWriter out;
	private static StringTokenizer tokenizer;

	public static void main(String[] args) throws Exception {
		Locale.setDefault(Locale.ENGLISH);
		if (fileIOMode) {
			in = new BufferedReader(new FileReader(problemName + ".in"));
			out = new PrintWriter(problemName + ".out");
		} else {
			in = new BufferedReader(new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: np
inputs: import java.io.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 =... What is the time complexity of the previous code?
targets: linear
inputs: import java.io.*;
import java.util.*;

public class Solution {

    public static void main(String[] args) throws Exception {
        MyReader reader = new MyReader(System.in);
//        MyReader reader = new MyReader(new FileInputStream("input.txt"));
        MyWriter writer = new MyWriter(System.out);
        new Solution().run(reader, writer);
        writer.close();
    }

    private void run(MyReader reader, MyWriter writer) throws IOException, InterruptedException {
        int n = reader.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = reader.nextString().charAt(0);
        }
        long[][] d = new long[n + 1][n + 1];
        d[0][0] = 1;
        long mod = 1_000_000_007;
        for (int i = 1; i < n; i++) {
            for (int j = n - 1; j >= 0; j--) {
                if (a[i - 1] == 'f') {
                    d[i][j + 1] = d[i - 1][j];
                } else {
                    d[i][j] = (d[i - 1][j] + d[i][j + 1]) % mod;
                }
            }
        }
        long ans = 0;
        for (int i = 0; i <= n; i++) {
            ans += d[n - 1][i];
        }
        writer.print(ans % mod);
    }

    static class MyReader {

        final BufferedInputStream in;
        final int bufSize = 1 << 16;
        final byte buf[] = new byte[bufSize];
        int i = bufSize;
        int k = bufSize;
        boolean end = false;
        final StringBuilder str = new StringBuilder();

        MyReader(InputStream in) {
            this.in = new BufferedInputStream(in, bufSize);
        }

        int nextInt() throws IOException {
            return (int) nextLong();
        }

        int[] nextIntArray(int n) throws IOException {
            int[] m = new int[n];
            for (int i = 0; i < n; i++) {
                m[i] = nextInt();
            }
            return m;
        }

        int[][] nextIntMatrix(int n, int m) throws IOException {
            int[][] a = new int[n][0];
            for (int j = 0; j < n; j++) {
               ... What is the time complexity of the previous code?
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.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 *
 * @author Fuad
 */
public class Codeforces {

    private static boolean greater(long mid, long s) {

        int sum = 0;
        long num = mid;

        while (num != 0) {
            sum += (num % 10);
            num /= 10;

        }

        return mid - sum >= s;
    }

    static class pair {

        int first;
        int second;

        pair(int f, int s) {
            first = f;
            second = s;
        }

        pair() {

        }

    }

    public static void main(String[] args) throws Exception {
        // TODO code application logic here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        long n, s;

        String arr[] = br.readLine().split(" ");

        n = Long.parseLong(arr[0]);
        s = Long.parseLong(arr[1]);

        long l = 1;
        long h = n;

        while (l < h) {
            long mid = (l + h) / 2;
            if (greater(mid, s)) {
                h = mid;
            } else {
                l = mid + 1;
            }
        }

        System.out.println(greater(h, s) ? n - h + 1 : 0);

    }

}
 Complexity:
targets: logn
inputs: // No sorceries shall previal. //
         
import java.util.Scanner; 
import java.io.PrintWriter;
import java.util.*;
import java.util.Arrays;
     
public class InVoker {
  
   public static void main(String args[]) {
    		
    	Scanner inp = new Scanner(System.in);
    	PrintWriter out= new PrintWriter(System.out);
    	
    	int n=inp.nextInt();
    	int a[]=new int[n];
    	for(int i=0;i<n;i++)
    		a[i]=inp.nextInt();
    	Arrays.sort(a);
    	int gg=0;
    	for(int i=0;i<n;i++) {
    		if(a[i]==0)
    			continue;
    		gg++;
    		for(int j=i+1;j<n;j++) {
    			if(a[j]%a[i]==0) {
    				a[j]=0;
    			}
    		}
    	}
    	out.println(gg);
    	out.close();
    	inp.close();
    				
    }
    		
} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: quadratic
inputs: import java.io.*;
import java.util.*;

public class A {
	int n, m, k;
	int[] a;
	
	void run()throws IOException{
//		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(new InputStreamReader(System.in));
		n = sc.nextInt();
		m = sc.nextInt();
		k = sc.nextInt();
		a = new int[n];
		for(int i=0;i<n; i++) a[i] = sc.nextInt();
		Arrays.sort(a);
		
		if(m<=k){
			System.out.println(0);
			return;
		}
		
		int cnt = k;
		int ind = a.length-1;
		int ret = 0;
		while(cnt<m && ind>=0){
			cnt += a[ind]-1;
			--ind;
			ret++;
			
		}
		
		if(cnt>=m) System.out.println(ret);
		else System.out.println(-1);
	}

	public static void main(String[] args)throws IOException {
		new A().run();
	}
}
 What is the time complexity of the previous code?
targets: nlogn
inputs: import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Round313A {
	private static final int LOCAL_ENV = 0;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		try {
			if (LOCAL_ENV == 1) {
				in = new Scanner(new File("input.txt"));
			}
		} catch (FileNotFoundException e) {
			in = new Scanner(System.in);
		}

		long n = in.nextLong();

		if (n >= -9) {
			System.out.println(n);
		} else {
			long absN = Math.abs(n);
			long m1 = -(absN / 10);
			long last = absN % 10;
			long m2 = -((absN / 100) * 10 + last);
			System.out.println(Math.max(m1, m2));
		}
	}
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;
import java.io.*;
import java.awt.Point;
import java.math.BigDecimal;
import java.math.BigInteger;

import static java.lang.Math.*;

// Solution is at the bottom of code

public class B implements Runnable{
	
	final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
	
	BufferedReader in;
	OutputWriter out;
	StringTokenizer tok = new StringTokenizer("");
	
	public static void main(String[] args){
		new Thread(null, new B(), "", 128 * (1L << 20)).start();
	}
	
	/////////////////////////////////////////////////////////////////////
	
	void init() throws FileNotFoundException{
		Locale.setDefault(Locale.US);
		
		if (ONLINE_JUDGE){
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new OutputWriter(System.out);
		}else{
			in = new BufferedReader(new FileReader("input.txt"));
			out = new OutputWriter("output.txt");
		}
	}
	
	////////////////////////////////////////////////////////////////
	
	long timeBegin, timeEnd;

	void time(){
		timeEnd = System.currentTimeMillis();
		System.err.println("Time = " + (timeEnd - timeBegin));
	}
	
	void debug(Object... objects){
		if (ONLINE_JUDGE){
			for (Object o: objects){
				System.err.println(o.toString());
			}
		}
	}
	
	/////////////////////////////////////////////////////////////////////
	
	public void run(){
		try{
			timeBegin = System.currentTimeMillis();
			Locale.setDefault(Locale.US);
			
			init();
			solve();
			
			out.close();
			time();
		}catch (Exception e){
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}
	
	/////////////////////////////////////////////////////////////////////
	
	String delim = " ";
	
	String readString() throws IOException{
		while(!tok.hasMoreTokens()){
			try{
				tok = new StringTokenizer(in.readLine());
			}catch (Exception e){
				return null;
			}
		}
		
		return tok.nextToken(delim);
	}
	
	String readLine() throws IOException{
		return in.readLine();
	}
	
	/////////////////////////////////////////////////////////////////
	
	final char NOT_A_SYMBOL = '\0';
	
	char... Complexity:
targets: linear
inputs: import sun.reflect.generics.tree.Tree;

import java.io.*;
import java.math.BigInteger;
import java.net.Inet4Address;
import java.util.*;

public class l {
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////                                                                                                               /////////
////////                                                                                                               /////////
////////   HHHH        HHHH  EEEEEEEEEEEEE   MMMM          MMMM         OOOOOO             SSSSSSS      EEEEEEEEEEEEE  /////////
////////   HHHH        HHHH  EEEEEEEEEEEEE   MMMMMM      MMMMMM      OOO      OOO        SSSS   SSS     EEEEEEEEEEEEE  /////////
////////   HHHH        HHHH  EEEEE           MMMM MMM  MMM MMMM    OOO          OOO    SSSS       SSS   EEEEE          /////////
////////   HHHH        HHHH  EEEEE           MMMM  MMMMMM  MMMM   OOO            OOO   SSSS             EEEEE          /////////
////////   HHHH        HHHH  EEEEE           MMMM          MMMM  OOO              OOO   SSSSSSS         EEEEE          /////////
////////   HHHHHHHHHHHHHHHH  EEEEEEEEEEE     MMMM          MMMM  OOO              OOO      SSSSSS       EEEEEEEEEEE    /////////
////////   HHHHHHHHHHHHHHHH  EEEEEEEEEEE     MMMM          MMMM  OOO              OOO         SSSSSSS   EEEEEEEEEEE    /////////
////////   HHHH        HHHH  EEEEE           MMMM          MMMM   OOO            OOO              SSSS  EEEEE          /////////
////////   HHHH        HHHH  EEEEE           MMMM          MMMM    OOO         ... 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.Arrays;
import java.util.Scanner;

public class AAA {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = in.nextInt();
        int max = a[0];
        int ind = 0;
        for (int k = 1; k < n; k++) {
            if (a[k] > max) {
                max = a[k];
                ind = k;
            }
        }
        if (max != 1) {
            a[ind] = 1;
            Arrays.sort(a);
            for (int i = 0; i < a.length - 1; i++)
                System.out.print(a[i] + " ");
            System.out.println(a[a.length - 1]);
        } else {
            a[0] = 2;
            Arrays.sort(a);
            for (int i = 0; i < a.length - 1; i++)
                System.out.print(a[i] + " ");
            System.out.println(a[a.length - 1]);
        }
    }
}
 What is the time complexity of the previous code?
targets: nlogn
inputs: import java.util.Scanner;

public class P1177A {
		
	public static void main(String[] args) {
		
		try (Scanner sc = new Scanner(System.in)) {
			
			long k = sc.nextLong();
			int pow = 1;
			
			while ((long) ((Math.pow(10, pow) - Math.pow(10, pow - 1)) * pow) < k) {
				k -= (long) ((Math.pow(10, pow) - Math.pow(10, pow - 1)) * pow);
				pow++;
			}
			// System.out.println(k + " " + pow);
			
			k--;
			long n = (long) Math.pow(10, pow - 1) + k / pow;
			k %= pow;
			// System.out.println(k + " " + n);
			
			System.out.println(String.valueOf(n).charAt((int) k));
			
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
} What is the time complexity of the previous code?
targets: logn
inputs: import java.io.*;
import java.util.*;

public class Solution {
    static BufferedReader br=null;
    static PrintWriter pw=null;
    static StringTokenizer st=null;
    static String FILENAME="";
    
    void nline(){
        try {
            st=new StringTokenizer(br.readLine());
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    int ni(){
        while(st==null || !st.hasMoreTokens()) nline();
        return Integer.parseInt(st.nextToken());
    }
    long nl(){
        while(st==null || !st.hasMoreTokens()) nline();
        return Long.parseLong(st.nextToken());
    }
    double nd(){
        while(st==null || !st.hasMoreTokens()) nline();
        return Double.parseDouble(st.nextToken());
    }
    String ns(){
        while(st==null || !st.hasMoreTokens()) nline();
        return st.nextToken();
    }
    String nstr(){
        String s="";
        try {
            s=br.readLine();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return s;
    }

    public void solve(){
        int n = ni();
        String s = nstr();
        int[] a = new int[n];
        for (int i=0;i<n;i++)
            a[i]=s.charAt(i)=='H'?0:1;
        int hc = 0;
        for (int i=0;i<n;i++)
            if (a[i]==0) hc++;
        int min = 1000000;
        for (int ss=0;ss<n;ss++) {
            int rc = 0;
            for (int i=0;i<hc;i++)
                if (a[(i+ss)%n]==0) rc++;
            if (hc-rc<min) min=hc-rc;
        }
        pw.print(min);
    }
    public void run(){
        solve();
        pw.close();
    }
    public static void main(String[] args) {
            br = new BufferedReader(new InputStreamReader(System.in));
            pw = new PrintWriter(System.out);
        
        new Solution().run();
    }

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

public class Main{
    final long mod = (int)1e9+7, IINF = (long)1e19;
    final int MAX = (int)1e6+1, MX = (int)1e7+1, INF = (int)1e9;
    DecimalFormat df = new DecimalFormat("0.0000000000000");
    FastReader in;
    PrintWriter out;
    static boolean multipleTC = false, memory = false;

    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 26).start();
        else new Main().run();
    }

    void run() throws Exception{
        in = new FastReader();
        out = new PrintWriter(System.out);
        for(int i = 1, t = (multipleTC)?ni():1; i<=t; i++)solve(i);
        out.flush();    
        out.close();
    }

    void solve(int TC) throws Exception{
        long x = nl(), k = nl();
        if(x==0)pn(0);
        else {
            x%=mod;
            long p = modPow(2,k);
            long b = mul((x-1+mod)%mod,p), e = mul(x,p);
            long ans = c(e)%mod;
            ans -= c(b)%mod;
            ans%=mod;
            if(ans<0)ans+=mod;
            ans = mul(ans, 2);
            ans = mul(ans, modPow(p, mod-2));
            pn(ans);
        }
    }
    long modPow(long a, long p){
        long o = 1;
        while(p>0){
            if((p&1)==1)o = mul(a,o);
            a = mul(a,a);
            p>>=1;
        }
        return o;
    }
    
    
    long mul(long a, long b){
        if(a>=mod)a%=mod;
        if(b>=mod)b%=mod;
        a*=b;
        if(a>=mod)a%=mod;
        return a;
    }
    
    long c(long c){
        return (c*c+c)/2;
    }
    
    int[] reverse(int[] a){
        int[] o = new int[a.length];
        for(int i = 0; i< a.length; i++)o[i] = a[a.length-i-1];
        return o;   
    }

    int[] sort(int[] a){
        if(a.length==1)return a;
        int mid = a.length/2;
        int[] b = sort(Arrays.copyOfRange(a,0,mid)), c =... What is the time complexity of the previous code?
targets: logn
inputs: import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class ProblemA {
	
	static final int INF = 100000000;
	
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		
		String[] nmd = in.readLine().split(" ");
		long a = Long.valueOf(nmd[0]);
		long b = Long.valueOf(nmd[1]);

		long cnt = 0;
		while (true) {
			if (a == 0) {
				break;
			}
			if (a >= b) {
				cnt += a / b;
				a = a % b;
			} else {
				if (b % a == 0) {
					cnt += b / a - 1;
					b = a;
				} else {
					cnt += b / a;
					b = b % a;					
				}
			}
		}
		out.println(cnt);
		out.flush();
	}

	
	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}
}

 What is the time complexity of the previous code?
targets: constant
inputs: import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class ASubtractions {
        public void solve(int testNumber, InputReader c, OutputWriter w) {
            int tc = c.readInt();
            while (tc-- > 0) {
                int a = c.readInt(), b = c.readInt();
                int res = 0;
                while (a != 0 && b != 0) {
                    res += b / a;
                    b = b % a;
                    int t = b;
                    b = a;
                    a = t;
                }
                w.printLine(res);
            }
        }

    }

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

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

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
               ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Arrays;
import java.util.Scanner;


public class Main {
    static double[] dp;
    static double[][] P;
    public static void main(String[] args) {
        Scanner r = new Scanner(System.in);
        
        int n = r.nextInt();
        
        double[][] g = new double[n][n];
        for(int i = 0; i < n; i++)
            for(int j = 0; j < n; j++)
                g[i][j] = r.nextDouble();
        
        dp = new double[1 << n];
        P = new double[1 << n][n];
        for(int mask = 0; mask < 1 << n; mask++){
            for(int d = 0; d < n; d++)if((mask & (1 << d)) == 0)
                for(int i = 0; i < n; i++)if((mask & (1 << i)) == 0){
                    if(i == d)continue;
                    
                    P[mask][d] += g[i][d];
                }
        }
        
        for(int i = 0; i < n; i++){
            Arrays.fill(dp, -1);
            
            double res = go(i, 0, g, n, n);
            System.out.println(res);
        }
    }

    private static double go(int a, int v, double[][] g, int cnt, int n) {
        if(dp[v] != -1)return dp[v];
        
        if(cnt == 1){
            return 1;
        }else{
            double ret = 0;
            for(int d = 0; d < n; d++)if((v & (1 << d)) == 0 && d != a){
                double current =  P[v][d] * go(a, v | 1 << d, g, cnt-1, n);
                ret += current;
            }
            
            return dp[v] = ret/(cnt * (cnt-1) /2);
        }  
    }
}
 Complexity:
targets: np