"{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner scan = new Scanner(System.in);\\n long n = scan.nextLong();\\n long k = scan.nextLong();\\n long D = 9 + 4 * (2 * k + 2 * n);\\n long y = (- 3 + (long)Math.sqrt(D)) \\/ 2;\\n System.out.println(n - y);\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.util.HashMap;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.util.Map;\\nimport java.util.Map.Entry;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n HashMap map = new HashMap<>();\\n for (int i = 0; i < n; i++) {\\n String next = in.next();\\n map.put(next, map.getOrDefault(next, 0) + 1);\\n }\\n int ct = 0;\\n for (int i = 0; i < n; i++) {\\n String next = in.next();\\n if (map.containsKey(next)) {\\n map.put(next, map.get(next) - 1);\\n if (map.get(next) <= 0) {\\n map.remove(next);\\n }\\n }\\n }\\n for (Map.Entry entry : map.entrySet()) {\\n ct += entry.getValue();\\n }\\n out.println(ct);\\n }\\n\\n }\\n\\n static class OutputWriter {\\n private final PrintWriter writer;\\n\\n public OutputWriter(OutputStream outputStream) {\\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\\n }\\n\\n public OutputWriter(Writer writer) {\\n this.writer = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main implements Runnable {\\n\\n\\tpublic void _main() throws IOException {\\n\\t\\tint n = nextInt();\\n\\t\\tint k = nextInt();\\n\\t\\tboolean[] p = new boolean[n + 1];\\n\\t\\tArrays.fill(p, true);\\n\\t\\tList primes = new ArrayList();\\n\\t\\tfor (int i = 2; i <= n; i++)\\n\\t\\t\\tif (p[i]) {\\n\\t\\t\\t\\tprimes.add(i);\\n\\t\\t\\t\\tfor (int j = i + i; j <= n; j += i)\\n\\t\\t\\t\\t\\tp[j] = false;\\n\\t\\t\\t}\\n\\t\\tboolean[] ok = new boolean[n + 1];\\n\\t\\tfor (int i = 0; i < primes.size() - 1; i++) {\\n\\t\\t\\tint x = primes.get(i);\\n\\t\\t\\tint y = primes.get(i + 1);\\n\\t\\t\\tif (x + y + 1 <= n)\\n\\t\\t\\t\\tok[x + y + 1] = true;\\n\\t\\t}\\n\\t\\tfor (int i = 2; i <= n; i++)\\n\\t\\t\\tif (p[i] && ok[i]) {\\n\\t\\t\\t\\t--k;\\t\\t\\t\\t\\n\\t\\t\\t}\\t\\t\\n\\t\\tout.println(k <= 0 ? \\\"YES\\\" : \\\"NO\\\");\\n\\t}\\n\\n\\tprivate BufferedReader in;\\n\\tprivate PrintWriter out;\\n\\tprivate StringTokenizer st;\\n\\n\\tprivate String next() throws IOException {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tString rl = in.readLine();\\n\\t\\t\\tif (rl == null)\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\tst = new StringTokenizer(rl);\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tprivate int nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\n\\tprivate long nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\n\\tprivate double nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew Thread(new Main()).start();\\n\\t}\\n\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\n\\t\\t\\t_main();\\n\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(202);\\n\\t\\t}\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\npublic class MainC {\\n\\n private FastScanner in;\\n private PrintWriter out;\\n\\n private int N;\\n private Dist[] dists;\\n private int countDists;\\n private int[][] minLeft;\\/\\/ startsFrom, count\\n\\n private int[] minOrder;\\n private int minOrderCount = 10000000;\\n\\n public void solve() throws IOException {\\n int xb = in.nextInt();\\n int yb = in.nextInt();\\n N = in.nextInt();\\n int[] x, y;\\n boolean isOdd;\\n if (N % 2 == 0) {\\n x = new int[N];\\n y = new int[N];\\n isOdd = false;\\n }\\n else {\\n x = new int[N + 1];\\n y = new int[N + 1];\\n isOdd = true;\\n }\\n for (int i = 0; i < N; i++) {\\n x[i] = in.nextInt() - xb;\\n y[i] = in.nextInt() - yb;\\n }\\n if (N % 2 == 1) {\\n N++;\\n x[N - 1] = 0;\\n y[N - 1] = 0;\\n }\\n\\n countDists = N * (N - 1) \\/ 2;\\n dists = new Dist[countDists];\\n int c = 0;\\n int commonSum = 0;\\n for (int i = 0; i < N; i++) {\\n for (int j = i + 1; j < N; j++) {\\n dists[c] = new Dist();\\n dists[c].from = i;\\n dists[c].to = j;\\n dists[c].dist = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j])\\n * (y[i] - y[j]);\\n dists[c].dist = Math.min(dists[c].dist, x[i] * x[i] + y[i]\\n * y[i] + x[j] * x[j] + y[j] * y[j]);\\n c++;\\n }\\n commonSum += x[i] * x[i] + y[i] * y[i];\\n }\\n\\n Arrays.sort(dists);\\n\\n minLeft = new int[countDists][N + 1];\\n for (int i = 0; i < countDists; i++) {\\n int sum = 0;\\n for (int j = 1; j <= N; j++) {\\n if (i + j - 1 < countDists) {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A\\n{\\n\\tString line;\\n\\tStringTokenizer inputParser;\\n\\tBufferedReader is;\\n\\tFileInputStream fstream;\\n\\tDataInputStream in;\\n\\tString FInput=\\\"\\\";\\n\\t\\n\\tvoid openInput(String file)\\n\\t{\\n\\n\\t\\tif(file==null)is = new BufferedReader(new InputStreamReader(System.in));\\/\\/stdin\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\ttry{\\n\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\tfstream = new FileInputStream(file);\\n\\t\\t\\tin = new DataInputStream(fstream);\\n\\t\\t\\tis = new BufferedReader(new InputStreamReader(in));\\n\\t\\t\\t}catch(Exception e)\\n\\t\\t\\t{\\n\\t\\t\\t\\tSystem.err.println(e);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n\\t\\n\\tvoid readNextLine()\\n\\t{\\n\\t\\ttry {\\n\\t\\t\\tline = is.readLine();\\n\\t\\t\\tinputParser = new StringTokenizer(line, \\\" \\\");\\n\\t\\t\\t\\/\\/System.err.println(\\\"Input: \\\" + line);\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\tSystem.err.println(\\\"Unexpected IO ERROR: \\\" + e);\\n\\t\\t}\\t\\n\\t\\tcatch (NullPointerException e)\\n\\t\\t{\\n\\t\\t\\tline=null;\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t}\\n\\t\\n\\tint NextInt()\\n\\t{\\n\\t\\tString n = inputParser.nextToken();\\n\\t\\tint val = Integer.parseInt(n);\\n\\t\\t\\n\\t\\t\\/\\/System.out.println(\\\"I read this number: \\\" + val);\\n\\t\\treturn val;\\n\\t}\\n\\t\\n\\tlong NextLong()\\n\\t{\\n\\t\\tString n = inputParser.nextToken();\\n\\t\\tlong val = Long.parseLong(n);\\n\\t\\t\\n\\t\\t\\/\\/System.out.println(\\\"I read this number: \\\" + val);\\n\\t\\treturn val;\\n\\t}\\n\\t\\n\\tString NextString()\\n\\t{\\n\\t\\tString n = inputParser.nextToken();\\n\\t\\treturn n;\\n\\t}\\n\\t\\n\\tvoid closeInput()\\n\\t{\\n\\t\\ttry {\\n\\t\\t\\tis.close();\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\tSystem.err.println(\\\"Unexpected IO ERROR: \\\" + e);\\n\\t\\t}\\n\\t\\t\\t\\n\\t}\\n\\t\\n\\t\\n\\tpublic static void main(String [] argv)\\n\\t{\\n\\t\\tString filePath=null;\\n\\t\\tif(argv.length>0)filePath=argv[0];\\n\\t\\tnew A(filePath);\\n\\t}\\n\\t\\n\\tpublic void readFInput()\\n\\t{\\n\\t\\tfor(;;)\\n\\t\\t{\\n\\t\\t\\ttry\\n\\t\\t\\t{\\n\\t\\t\\t\\treadNextLine();\\n\\t\\t\\t\\tFInput+=line+\\\" \\\";\\n\\t\\t\\t}\\n\\t\\t\\tcatch(Exception e)\\n\\t\\t\\t{\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tinputParser = new StringTokenizer(FInput, \\\" \\\");\\n\\t}\\n\\t \\n\\tpublic A(String inputFile)\\n\\t{\\n\\t\\topenInput(inputFile);\\n\\t\\t\\n\\t\\treadNextLine();\\n\\t\\tint n=NextInt();\\n\\t\\t\\n\\t\\tint ret=0;\\n\\t\\tint [] p = new int [n];\\n\\t\\treadNextLine();\\n\\t\\tint sum=0;\\n\\t\\tfor(int i=0; i=0;... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author kessido\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n BTheHat solver = new BTheHat();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class BTheHat {\\n PrintWriter out;\\n InputReader in;\\n int n;\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n this.out = out;\\n this.in = in;\\n n = in.NextInt();\\n int desiredPair = -1;\\n int result = query(1);\\n if (result != 0) {\\n int l = 2, r = 1 + n \\/ 2;\\n while (l < r) {\\n int m = (l + r) \\/ 2;\\n int mRes = query(m);\\n if (mRes == 0) {\\n desiredPair = m;\\n break;\\n } else if (mRes == result) {\\n l = m + 1;\\n } else {\\n r = m;\\n }\\n }\\n } else {\\n desiredPair = 1;\\n }\\n out.println(\\\"! \\\" + desiredPair);\\n }\\n\\n private int query(int i) {\\n int iV = queryValue(i);\\n int iN2V = queryValue(i + n \\/ 2);\\n if (iV < iN2V) {\\n return -1;\\n } else if (iV > iN2V) {\\n return 1;\\n }\\n return 0;\\n }\\n\\n private int queryValue(int i) {\\n out.println(\\\"? \\\" + i);\\n out.flush();\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.security.SecureRandom;\\nimport java.util.*;\\nimport java.math.*;\\nimport java.awt.geom.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Solution implements Runnable {\\n \\n \\n \\n \\n public void solve() throws Exception {\\n \\n int n = sc.nextInt();\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n long h[] = new long[n];\\n \\n for (int i = 0;i < n; ++ i) {\\n h[i] = sc.nextLong();\\n }\\n Arrays.sort(h);\\n long l = h[n - a];\\n long r = h[n - a - 1];\\n out.println(l - r);\\n }\\n \\n \\n \\n \\n \\/*--------------------------------------------------------------*\\/\\n \\n static String filename = \\\"\\\";\\n static boolean fromFile = false;\\n \\n BufferedReader in;\\n PrintWriter out;\\n FastScanner sc;\\n \\n public static void main(String[] args) {\\n new Thread(null, new Solution(), \\\"\\\", 1 << 25).start();\\n }\\n \\n public void run() {\\n try {\\n init();\\n solve();\\n } catch (Exception e) {\\n throw new RuntimeException(e);\\n } finally {\\n out.close();\\n }\\n }\\n \\n void init() throws Exception {\\n if (fromFile) {\\n in = new BufferedReader(new FileReader(filename+\\\".in\\\"));\\n out = new PrintWriter(new FileWriter(filename+\\\".out\\\"));\\n } else {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n }\\n sc = new FastScanner(in);\\n }\\n}\\n\\nclass FastScanner {\\n \\n BufferedReader reader;\\n StringTokenizer strTok;\\n \\n public FastScanner(BufferedReader reader) {\\n this.reader = reader;\\n }\\n \\n public String nextToken() throws IOException {\\n while (strTok == null || !strTok.hasMoreTokens()) {\\n strTok = new StringTokenizer(reader.readLine());\\n }\\n \\n return strTok.nextToken();\\n }\\n \\n public int nextInt() throws IOException {\\n return... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Aman Kumar Singh\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n BSportMafia solver = new BSportMafia();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class BSportMafia {\\n int MAXN = 200005;\\n PrintWriter out;\\n InputReader in;\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n this.out = out;\\n this.in = in;\\n long n = nl();\\n long k = nl();\\n long i = 0;\\n k += n;\\n for (i = 0; i < MAXN; i++) {\\n long x = (i * (i + 3)) \\/ 2;\\n if (k == x) {\\n pn(n - i);\\n return;\\n }\\n }\\n\\n }\\n\\n long nl() {\\n return in.nextLong();\\n }\\n\\n void pn(long zx) {\\n out.println(zx);\\n }\\n\\n }\\n\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1) {\\n throw new UnknownError();\\n }\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new UnknownError();\\n }\\n if (numChars <= 0) {\\n return -1;\\n... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/بسم الله الرحمن الرحيم\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.nio.*;\\nimport java.io.*;\\npublic class as {\\n\\tstatic class Reader \\n { \\n final private int BUFFER_SIZE = 1 << 16; \\n private DataInputStream din; \\n private byte[] buffer; \\n private int bufferPointer, bytesRead; \\n \\n public Reader() \\n { \\n din = new DataInputStream(System.in); \\n buffer = new byte[BUFFER_SIZE]; \\n bufferPointer = bytesRead = 0; \\n } \\n \\n public Reader(String file_name) throws IOException \\n { \\n din = new DataInputStream(new FileInputStream(file_name)); \\n buffer = new byte[BUFFER_SIZE]; \\n bufferPointer = bytesRead = 0; \\n } \\n \\n public String readLine() throws IOException \\n { \\n byte[] buf = new byte[100000000]; \\/\\/ line length \\n int cnt = 0, c; \\n while ((c = read()) != -1) \\n { \\n if (c == '\\\\n') \\n break; \\n buf[cnt++] = (byte) c; \\n } \\n return new String(buf, 0, cnt); \\n } \\n \\n public int nextInt() throws IOException \\n { \\n int ret = 0; \\n byte c = read(); \\n while (c <= ' ') \\n c = read(); \\n boolean neg = (c == '-'); \\n if (neg) \\n c = read(); \\n do\\n { \\n ret = ret * 10 + c - '0'; \\n } while ((c = read()) >= '0' && c <= '9'); \\n \\n if (neg) \\n return -ret; \\n return ret; \\n } \\n \\n public long nextLong() throws IOException \\n { \\n long ret = 0; \\n byte c = read(); \\n while (c <= ' ') \\n c = read(); \\n boolean neg = (c == '-'); \\n if (neg) \\n c = read(); \\n do { \\n ret = ret * 10 + c - '0'; \\n } \\n while ((c = read()) >= '0' && c <= '9'); \\n if... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n \\npublic class digits {\\n public static void main(String[] args) throws IOException {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n long k = Long.parseLong(br.readLine());\\n long temp = 9 * (int)Math.pow(10,0);\\n int count = 0;\\n long initial = 0;\\n while(k > temp) {\\n count++;\\n initial = temp;\\n temp += 9 * (long)Math.pow(10,count)*(count+1);\\n }\\n long index = (k-initial-1)%(count+1);\\n long num = (long)Math.pow(10,count) + (k-initial-1)\\/(count+1);\\n System.out.println((num+\\\"\\\").charAt((int)index));\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.StringTokenizer;\\n\\npublic class NewYearCurling908C {\\n public static void main(String[] args) throws IOException {\\n FastScanner in = new FastScanner();\\n int n = in.nextInt();\\n \\n double r = (double) in.nextInt();\\n double[] answers = new double[n];\\n double[] xCoords = new double[n];\\n for (int i = 0; i < n; i++) xCoords[i] = (double) in.nextInt();\\n \\n answers[0] = r;\\n for (int i = 1; i < n; i++) {\\n double bound = r;\\n for (int j = 0; j < i; j++) {\\n double xDif = xCoords[i] - xCoords[j];\\n double y = answers[j];\\n double yNew = y + Math.sqrt(4 * r * r - xDif * xDif);\\n if (yNew > bound) bound = yNew;\\n }\\n answers[i] = bound;\\n }\\n for (int i = 0; i < n; i++) System.out.print(answers[i] + \\\" \\\");\\n System.out.println();\\n }\\n\\n public static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner(String s) {\\n try {\\n br = new BufferedReader(new FileReader(s));\\n } catch (FileNotFoundException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n }\\n\\n public FastScanner() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n String nextToken() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n String nextLine() {\\n st = null;\\n try {\\n return br.readLine();\\n } catch (IOException e) {\\n \\/\\/ TODO Auto-generated catch block\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class TaskA\\n{\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tnew TaskA(System.in, System.out);\\n\\t}\\n\\n\\tstatic class Solver implements Runnable\\n\\t{\\n\\t\\tint n;\\n\\t\\tString[] last, curr;\\n\\t\\tBufferedReader in;\\n\\t\\tPrintWriter out;\\n\\n\\t\\tvoid solve() throws IOException\\n\\t\\t{\\n\\t\\t\\tn = Integer.parseInt(in.readLine());\\n\\t\\t\\tlast = new String[n];\\n\\t\\t\\tcurr = new String[n];\\n\\n\\t\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\t\\tlast[i] = in.readLine();\\n\\n\\t\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\t\\tcurr[i] = in.readLine();\\n\\n\\t\\t\\tint changes = 0;\\n\\t\\t\\tString[] sizes = new String[]{\\\"S\\\", \\\"M\\\", \\\"L\\\", \\\"XS\\\", \\\"XXS\\\", \\\"XXXS\\\", \\\"XL\\\", \\\"XXL\\\", \\\"XXXL\\\"};\\n\\t\\t\\tint[] old = count(last, sizes);\\n\\t\\t\\tint[] now = count(curr, sizes);\\n\\n\\t\\t\\tfor (int i= 0; i < sizes.length; i++)\\n\\t\\t\\t{\\n\\t\\t\\t\\tchanges += Math.abs(old[i] - now[i]);\\n\\t\\t\\t}\\n\\n\\t\\t\\tout.println(changes \\/ 2);\\n\\n\\/*\\t\\t\\tif (now[0] > old[0])\\n\\t\\t\\t{\\n\\t\\t\\t\\tint add = now[0] - old[0];\\n\\n\\t\\t\\t\\tchanges += add;\\n\\n\\n\\t\\t\\t}*\\/\\n\\t\\t}\\n\\n\\t\\tint[] count(String[] s, String[] sizes)\\n\\t\\t{\\n\\t\\t\\tint len = sizes.length;\\n\\t\\t\\tint[] cnt = new int[len];\\n\\n\\t\\t\\tfor (int i = 0; i < len; i++)\\n\\t\\t\\t{\\n\\t\\t\\t\\tfor (String str : s)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tif (str.equals(sizes[i]))\\n\\t\\t\\t\\t\\t\\tcnt[i]++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn cnt;\\n\\t\\t}\\n\\n\\t\\tvoid debug(Object... o)\\n\\t\\t{\\n\\t\\t\\tSystem.err.println(Arrays.deepToString(o));\\n\\t\\t}\\n\\n\\t\\tpublic Solver(BufferedReader in, PrintWriter out)\\n\\t\\t{\\n\\t\\t\\tthis.in = in;\\n\\t\\t\\tthis.out = out;\\n\\t\\t}\\n\\n\\t\\t@Override\\n\\t\\tpublic void run()\\n\\t\\t{\\n\\t\\t\\ttry\\n\\t\\t\\t{\\n\\t\\t\\t\\tsolve();\\n\\t\\t\\t}\\n\\t\\t\\tcatch (IOException e)\\n\\t\\t\\t{\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic class CMath\\n\\t{\\n\\t\\tstatic long power(long number, long power)\\n\\t\\t{\\n\\t\\t\\tif (number == 1 || number == 0 || power == 0)\\n\\t\\t\\t\\treturn 1;\\n\\n\\t\\t\\tif (power == 1)\\n\\t\\t\\t\\treturn number;\\n\\n\\t\\t\\tif (power % 2 == 0)\\n\\t\\t\\t\\treturn power(number * number, power \\/ 2);\\n\\t\\t\\telse\\n\\t\\t\\t\\treturn power(number * number, power \\/ 2) * number;\\n\\t\\t}\\n\\n\\t\\tstatic long modPower(long number, long power, long mod)\\n\\t\\t{\\n\\t\\t\\tif (number == 1 || number == 0 || power == 0)\\n\\t\\t\\t\\treturn 1;\\n\\n\\t\\t\\tnumber = mod(number, mod);\\n\\n\\t\\t\\tif (power == 1)\\n\\t\\t\\t\\treturn number;\\n\\n\\t\\t\\tlong square = mod(number * number, mod);\\n\\n\\t\\t\\tif (power... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class AnnoyingPresent {\\n\\n\\t\\n\\t\\/\\/UPSOLVED\\n\\tpublic static void main(String[] args) throws IOException {\\n\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tStringTokenizer st = new StringTokenizer(br.readLine());\\n long n = Long.parseLong(st.nextToken()) , m = Long.parseLong(st.nextToken());\\n \\n long sum = 0;\\n \\n for(int i=0;ih)\\n\\t\\treturn -1;\\n\\n\\t\\tint mid=(l+h)\\/2;\\n\\n\\t\\tif(n==arr[mid])\\n\\t\\treturn mid;\\n\\t\\telse if(n>arr[mid])\\n\\t\\treturn(bsearch(arr,mid+1,h,n));\\n\\t\\telse\\n\\t\\treturn(bsearch(arr,l,mid-1,n));\\n\\t}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\npublic class CoveredPointsCount {\\n\\t\\n\\t\\/\\/UPSOLVE\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\t\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tStringTokenizer st = new StringTokenizer(br.readLine());\\n\\t \\n\\t\\tint n = Integer.parseInt(st.nextToken());\\n\\t \\n\\t\\tlong[] myArray = new long[2 * n];\\n\\t \\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t \\tStringTokenizer st1 = new StringTokenizer(br.readLine());\\n\\t \\tmyArray[2 * i] = Long.parseLong(st1.nextToken()) * 2;\\n\\t \\tmyArray[2 * i + 1] = Long.parseLong(st1.nextToken()) * 2 + 1;\\n\\t } \\n\\t \\n\\t Arrays.sort(myArray);\\n\\t long[] ans = new long[n + 1];\\n\\t int cnt = 0;\\n\\t \\n\\t for (int i = 0; i < 2 * n - 1; i++) {\\n\\t if (myArray[i] % 2 == 0) cnt++; else cnt--;\\n\\t ans[cnt] += (myArray[i + 1] + 1) \\/ 2 - (myArray[i] + 1) \\/ 2;\\n\\t } \\n\\t \\n\\t StringBuilder answer = new StringBuilder();\\n\\t \\n\\t for (int i = 1; i < n + 1; i++) {\\n\\t \\tanswer.append(ans[i]);\\n\\t \\tanswer.append(\\\" \\\");\\n\\t } \\n\\t \\n\\t System.out.println(answer);\\n\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.util.function.Function;\\n\\npublic class Main {\\n\\n static int N;\\n static int[] U, V;\\n static int[] A;\\n\\n public static void main(String[] args) {\\n FastScanner sc = new FastScanner(System.in);\\n N = sc.nextInt();\\n U = new int[N-1];\\n V = new int[N-1];\\n for (int i = 0; i < N - 1; i++) {\\n U[i] = sc.nextInt()-1;\\n V[i] = sc.nextInt()-1;\\n }\\n A = sc.nextIntArray(N, -1);\\n\\n System.out.println(solve() ? \\\"Yes\\\" : \\\"No\\\");\\n }\\n\\n static boolean solve() {\\n if( A[0] != 0 ) return false;\\n\\n int[][] G = adjB(N, U, V);\\n\\n Map parents = new HashMap<>();\\n for (Node node : orderFromRoot(N, G, 0)) {\\n parents.put(node.a, node.parent);\\n }\\n ArrayDeque q = new ArrayDeque<>();\\n for (int next : G[0]) {\\n q.add(0);\\n }\\n\\n int idx = 1;\\n while(!q.isEmpty()) {\\n int p = q.poll();\\n int a = A[idx++];\\n if( parents.get(a) != p ) {\\n return false;\\n }\\n\\n for (int next : G[a]) {\\n if( next == p ) continue;\\n\\n q.add(a);\\n }\\n }\\n return true;\\n }\\n\\n static int[][] adjB(int n, int[] from, int[] to) {\\n int[][] adj = new int[n][];\\n int[] cnt = new int[n];\\n for (int f : from) {\\n cnt[f]++;\\n }\\n for (int t : to) {\\n cnt[t]++;\\n }\\n for (int i = 0; i < n; i++) {\\n adj[i] = new int[cnt[i]];\\n }\\n for (int i = 0; i < from.length; i++) {\\n adj[from[i]][--cnt[from[i]]] = to[i];\\n adj[to[i]][--cnt[to[i]]] = from[i];\\n }\\n return adj;\\n }\\n\\n static Node[] orderFromRoot(int N, int[][] G, int root) {\\n ArrayDeque q = new ArrayDeque<>();\\n Node[] ret = new Node[N];\\n int idx = 0;\\n q.add(new Node(-1, root));\\n while(!q.isEmpty()) {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class main {\\n\\tInputStream is;\\n\\tPrintWriter out;\\n\\tstatic long mod=pow(10,9)+7;\\n\\tint dx[]= {0,0,1,-1},dy[]={+1,-1,0,0};\\n\\tvoid solve()\\n\\t{\\n\\t\\tlong x=nl();\\n\\t\\tlong k=nl();\\n\\t\\tif(x==0)\\n\\t\\t{\\n\\t\\t\\tout.println(0);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tlong term=(pow(2,k,mod))%mod;\\n\\t\\tlong last=((x%mod)*pow(2,k+1,mod))%mod;\\n\\t\\tlong sumdom=((2*last)%mod+(((term-1+mod)%mod)*((-2+mod)%mod))%mod)%mod;\\n\\t\\tsumdom=(sumdom*term)%mod;\\n\\t\\tsumdom=(sumdom*pow(2,mod-2,mod))%mod;\\n\\t\\tsumdom=(sumdom*pow(term,mod-2,mod))%mod;\\n\\t\\tout.println(sumdom);\\n\\t\\t\\t\\t\\n\\t}\\n\\tint bsdown(ArrayList al,int l) {\\n\\t\\tint low=0,high=al.size()-1,ans=-1;\\n\\t\\twhile(low<=high) {\\n\\t\\t\\tint mid=low+(high-low)\\/2;\\n\\t\\t\\tif(al.get(mid)<=l) {\\n\\t\\t\\t\\tlow=mid+1;\\n\\t\\t\\t\\tans=mid;\\n\\t\\t\\t}else\\n\\t\\t\\t\\thigh=mid-1;\\t\\t\\t\\n\\t\\t}\\n\\t\\treturn ans;\\n\\t}\\n\\tArrayListal [];\\n\\tvoid take(int n,int m)\\n\\t{\\n\\t\\tal=new ArrayList[n];\\n\\t\\tfor(int i=0;i();\\n\\t\\tfor(int i=0;i=1){\\n\\t\\t\\tint mid = (l+r)\\/2;\\n\\t\\t\\tmergeSort(arr,l,mid);\\n\\t\\t\\tmergeSort(arr,mid+1,r);\\n\\t\\t\\tmerge(arr,l,r,mid);\\n\\t\\t}\\n\\t}\\n\\tpublic static void merge(int arr[], int l, int r, int mid){\\n\\t\\tint n1 =... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Sunits789\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tTaskA solver = new TaskA();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskA {\\n\\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n=in.nextInt();\\n int arr[]=new int[n];\\n in.getArray(arr);\\n int arrc[]=new int[n];\\n for(int i=0;i2){\\n out.println(\\\"NO\\\");\\n }\\n else{\\n out.println(\\\"YES\\\");\\n }\\n\\t}\\n}\\n\\nclass InputReader{\\n private BufferedReader reader;\\n private StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream){\\n reader = new BufferedReader(new InputStreamReader(stream));\\n tokenizer = null;\\n }\\n public String next(){\\n while (tokenizer == null||!tokenizer.hasMoreTokens()){\\n try{\\n tokenizer = new StringTokenizer(reader.readLine());\\n }\\n catch (IOException e){\\n throw new RuntimeException(e);\\n }\\n }\\n return tokenizer.nextToken();\\n }\\n\\n public int nextInt(){\\n return Integer.parseInt(next());\\n }\\n\\n public void getArray(int arr[]){\\n for(int i=0;i v || ttt * a < w) {\\n\\t\\t\\tans = time(a, l, 0, v);\\n\\t\\t} else {\\n\\t\\t\\tdouble B = 2 * w \\/ a, C = -w * w \\/ (a * a) - 4 * d \\/ a;\\n\\t\\t\\tdouble D = Math.sqrt(B * B - 4 * C);\\n\\t\\t\\tans = (-B + D) \\/ 2;\\n\\t\\t\\tif ((a * ans + w) \\/ 2.0 > v) {\\n\\t\\t\\t\\tdouble t1 = v \\/ a;\\n\\t\\t\\t\\tdouble t2 = (v - w) \\/ a;\\n\\t\\t\\t\\tdouble s = (a * t1 * t1 \\/ 2.0) + (v * t2 - a * t2 * t2 \\/ 2.0);\\n\\t\\t\\t\\tans = t1 + t2 + (d - s) \\/ v;\\n\\t\\t\\t}\\n\\t\\t\\tans += time(a, l - d, w, v);\\n\\t\\t}\\n\\t\\tDecimalFormat df = new DecimalFormat(\\\"0.000000000\\\");\\n\\t\\tout.write(df.format(ans) + \\\"\\\\n\\\");\\n\\t}\\n\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new BufferedWriter(new OutputStreamWriter(System.out));\\n\\t\\t\\tsolve();\\n\\t\\t\\tout.flush();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(1);\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\ttry {\\n\\t\\t\\tLocale.setDefault(Locale.US);\\n\\t\\t} catch (Exception e) {\\n\\t\\t}\\n\\t\\tnew Main().run();\\n\\t}\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\n\\npublic class ProblemA {\\n\\n\\tpublic static void main(String [] args) throws NumberFormatException, IOException{\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint n = Integer.parseInt(br.readLine());\\n\\t\\tint num1,num2;\\n\\t\\tif(n % 2 == 0){\\n\\t\\t\\tnum1 = n \\/ 2;\\n\\t\\t\\tif(num1 % 2 == 0){\\n\\t\\t\\t\\tnum2 = num1;\\n\\t\\t\\t}\\n\\t\\t\\telse{\\n\\t\\t\\t\\tnum1--;\\n\\t\\t\\t\\tnum2 = num1 + 2;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tnum1 = 9;\\n\\t\\t\\tnum2 = n - num1;\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(num1+\\\" \\\"+num2);\\n\\t}\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n}\\n\\nclass TaskA {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int m = in.nextInt();\\n int k = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++)\\n a[i] = in.nextInt();\\n Arrays.sort(a);\\n if (k >= m) {\\n out.println(0);\\n return;\\n }\\n for (int i = 1; i <= n; i++) {\\n int sockets = k - 1;\\n for (int j = 0; j < i; j++)\\n sockets += a[n - j - 1];\\n sockets -= i - 1;\\n if (sockets >= m) {\\n out.println(i);\\n return;\\n }\\n }\\n out.println(-1);\\n }\\n}\\n\\nclass InputReader {\\n private BufferedReader reader;\\n private StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream));\\n tokenizer = null;\\n }\\n\\n public int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n public String next() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n try {\\n tokenizer = new StringTokenizer(reader.readLine());\\n } catch (IOException e) {\\n throw new RuntimeException(e);\\n }\\n }\\n return tokenizer.nextToken();\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n CNastyaAndAWardrobe solver = new CNastyaAndAWardrobe();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class CNastyaAndAWardrobe {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n long x = in.nextLong(), k = in.nextLong();\\n if (x != 0) {\\n long m = (int) 1e9 + 7;\\n x = x % m;\\n long res = in.fastPowerMod(2, k, m);\\n long res1 = (2 * res) % m;\\n long ans = ((res1 * x) % m - (res - 1) % m) % m;\\n ans = (ans + m) % m;\\n out.println(ans);\\n } else {\\n out.println(0);\\n }\\n }\\n\\n }\\n\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private InputReader.SpaceCharFilter filter;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n\\n if (numChars <= 0)\\n return -1;\\n }\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class ReallyBigNumbers1 \\n{\\n \\n public static void main(String[] args) \\n {\\n Scanner sc = new Scanner(System.in);\\n long n = sc.nextLong();\\n long s = sc.nextLong();\\n \\n int r = 0 ;\\n \\n long l = 0L ;\\n long u = n ;\\n \\n if( (l-sumDigits(l)< s ) && (u-sumDigits(u)< s ) )\\n {\\n System.out.println(0);\\n return ;\\n }\\n \\n long specified = 0L ;\\n while( true )\\n {\\n long m = (l + u) \\/ 2L ;\\n \\n if( ( m - sumDigits(m) ) >= s && ( (m-1) - sumDigits(m-1) ) < s )\\n {\\n specified = m ;\\n break ;\\n }\\n \\n if( l > u )\\n break ;\\n \\n else\\n {\\n if( ( m - sumDigits(m) ) >= s )\\n u = m-1 ;\\n else\\n l = m+1 ;\\n }\\n }\\n \\n System.out.println( n-specified+1 );\\n \\n \\n }\\n \\n public static int sumDigits(long n)\\n {\\n char [] a = (n+\\\"\\\").toCharArray();\\n int sum = 0 ;\\n for(int k = 0 ; k < a.length ; k++)\\n {\\n sum += Integer.parseInt(a[k]+\\\"\\\") ;\\n }\\n return sum ;\\n }\\n \\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.HashMap;\\nimport java.util.HashSet;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\nimport java.util.TreeSet;\\n\\npublic class c {\\n\\t\\n\\n\\tpublic static void main(String args[]) throws IOException {\\n\\t\\tFastScanner in = new FastScanner(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\t\\/\\/BEGIN HERE\\n\\t\\tint n = in.nextInt();\\n\\t\\tint r = in.nextInt();\\n\\t\\tint xs[] = new int[n];\\n\\t\\tfor(int i = 0; i < n; i++) xs[i] = in.nextInt();\\n\\t\\tdouble ys[] = new double[n];\\n\\t\\tys[0] = r;\\n\\t\\tfor(int i = 1; i < n; i++) {\\n\\t\\t\\tdouble worst = r;\\n\\t\\t\\tfor(int j = 0; j < i; j++) {\\n\\t\\t\\t\\tif(xs[i] == xs[j]) {\\n\\t\\t\\t\\t\\tworst = Math.max(worst, ys[j] + r + r);\\n\\t\\t\\t\\t}else if((xs[i] - xs[j]) * (xs[i] - xs[j]) <= 4*r*r ) {\\n\\n\\t\\t\\t\\t\\tdouble hypot = r + r;\\n\\t\\t\\t\\t\\tdouble adj = Math.abs((xs[i] - xs[j]));\\n\\t\\t\\t\\t\\tdouble theta = Math.acos(adj\\/hypot);\\n\\t\\t\\t\\t\\tworst = Math.max(hypot * Math.sin(theta) + ys[j], worst);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tys[i] = worst;\\n\\t\\t}\\n\\t\\tfor(int i = 0; i < n; i++)\\n\\t\\t\\tout.printf(\\\"%.10f \\\",ys[i]);\\n\\t\\tout.close();\\n\\t}\\n\\n\\tstatic class FastScanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic FastScanner(InputStream i) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(i));\\n\\t\\t\\tst = null;\\n\\t\\t}\\n\\n\\t\\tpublic String next() throws IOException {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic String nextLine() throws IOException {\\n\\t\\t\\tif (st == null) {\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t}\\n\\t\\t\\tString line = st.nextToken(\\\"\\\\n\\\");\\n\\t\\t\\tst = null;\\n\\t\\t\\treturn line;\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() throws IOException {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic double nextDouble() throws IOException {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static class combinatorics {\\n\\t\\tstatic long... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class B{\\n\\n\\tstatic long []sum;\\n\\t\\n\\tstatic int n;\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner sc=new Scanner();\\n\\t\\tPrintWriter out=new PrintWriter(System.out);\\n\\t\\tn=sc.nextInt();\\n\\t\\tsum=new long [n+1];\\n\\t\\tfor(int i=1;i<=n;i++)\\n\\t\\t\\tsum[i]=sc.nextInt()+sum[i-1];\\n\\t\\tHashMap map=new HashMap();\\n\\t\\tArrayList[]adj=new ArrayList[n*n+10];\\n\\t\\tfor(int i=0;ilist=adj[idx];\\n\\t\\t\\tif(list.isEmpty())\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\tint curr=1;\\n\\t\\t\\tint R=list.get(0)[1];\\n\\t\\t\\tfor(int i=1;iR)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tR=tmp[1];\\n\\t\\t\\t\\t\\tcurr++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(curr>=ans) {\\n\\t\\t\\t\\tans=curr;\\n\\t\\t\\t\\tbestIdx=idx;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(ans);\\n\\t\\tArrayListlist=adj[bestIdx];\\n\\t\\tint R=list.get(0)[1];\\n\\t\\tout.println(list.get(0)[0]+\\\" \\\"+R);\\n\\t\\tfor(int i=1;iR)\\n\\t\\t\\t{\\n\\t\\t\\t\\tR=tmp[1];\\n\\t\\t\\t\\tout.println(tmp[0]+\\\" \\\"+tmp[1]);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.close();\\n\\n\\t}\\n\\t\\n\\tstatic class Scanner\\n\\t{\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\t\\tScanner(){\\n\\t\\t\\tbr=new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\t\\tScanner(String fileName) throws FileNotFoundException{\\n\\t\\t\\tbr=new BufferedReader(new FileReader(fileName));\\n\\t\\t}\\n\\t\\tString next() throws IOException {\\n\\t\\t\\twhile(st==null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst=new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\t\\tString nextLine() throws IOException {\\n\\t\\t\\treturn br.readLine();\\n\\t\\t}\\n\\t\\tint nextInt() throws IOException{\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\t\\tlong nextLong() throws NumberFormatException, IOException {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\t\\tdouble nextDouble() throws NumberFormatException,... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\npublic class D5 {\\npublic static void main(String[] args)\\n{\\n Scanner input = new Scanner(System.in);\\n int a = input.nextInt(), v = input.nextInt();\\n int l = input.nextInt(), d = input.nextInt(), w = input.nextInt();\\n double lo = 0, hi = v;\\n for(int iter = 0; iter < 1000; iter++)\\n {\\n double mid = (lo+hi)\\/2;\\n if(can(mid, a, d, w)) lo = mid;\\n else hi = mid;\\n }\\n \\/\\/System.out.println(lo);\\n double t1 = lo \\/ a;\\n double gone = .5 * t1 * t1 * a;\\n if(lo > w)\\n {\\n gone += -a * .5 * (lo - w) \\/ a * (lo - w) \\/ a + lo * (lo - w) \\/ a;\\n t1 += (lo - w) \\/ a;\\n }\\n t1 += (d - gone) \\/ lo;\\n \\/\\/System.out.println(t1);\\n double v0 = Math.min(lo, w);\\n double togo = l - d;\\n double toAdd = (-v0 + Math.sqrt(v0 * v0 + 4 * togo * .5 * a)) \\/ a;\\n if(toAdd * a + v0 > v)\\n {\\n double tt = (v - v0) \\/ a;\\n t1 += tt;\\n togo -= .5 * a * tt * tt + v0 * tt;\\n t1 += togo \\/ v;\\n }\\n else t1 += toAdd;\\n System.out.println(t1);\\n}\\nstatic boolean can(double v, double a, double d, double max)\\n{\\n double t1 = v \\/ a;\\n double distGone = .5 * a * t1 * t1;\\n if(v > max)\\n {\\n t1 = (v - max) \\/ a;\\n distGone += -.5 * a * t1 * t1 + v * t1;\\n }\\n return distGone <= d;\\n}\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class CF {\\n private FastScanner in;\\n private PrintWriter out;\\n\\n final int mod = (int) 1e9 + 7;\\n\\n private long f(String s, int digit) {\\n final int n = s.length();\\n int[][] dp = new int[2][n + 1]; \\/\\/ [less][cntBigger] -> sum\\n dp[0][0] = 1;\\n int[][] ndp = new int[2][n + 1];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < 2; j++) {\\n Arrays.fill(ndp[j], 0);\\n }\\n for (int less = 0; less < 2; less++) {\\n for (int cntBigger = 0; cntBigger <= n; cntBigger++) {\\n int cur = dp[less][cntBigger];\\n if (cur == 0) {\\n continue;\\n }\\n int max = less == 1 ? 9 : (s.charAt(i) - '0');\\n for (int next = 0; next <= max; next++) {\\n int nextLess = (less == 1) || (next < max) ? 1 : 0;\\n int nextCntBigger = cntBigger + ((next >= digit) ? 1 : 0);\\n ndp[nextLess][nextCntBigger] += cur;\\n while (ndp[nextLess][nextCntBigger] >= mod) {\\n ndp[nextLess][nextCntBigger] -= mod;\\n }\\n }\\n }\\n }\\n int[][] tmp = dp;\\n dp = ndp;\\n ndp = tmp;\\n }\\n long result = 0;\\n for (int less = 0; less < 2; less++) {\\n long sum = 0;\\n for (int cntBigger = 1; cntBigger <= n; cntBigger++) {\\n sum = (sum * 10 + 1) % mod;\\n result = (result + sum * dp[less][cntBigger]) % mod;\\n }\\n }\\n return result % mod;\\n }\\n\\n private void solve() {\\n final String number = in.next();\\n long result = 0;\\n for (int digit = 1; digit < 10; digit++) {\\n long cur = f(number, digit);\\n result += cur;\\n }\\n out.println(result % mod);\\n }\\n\\n private void run() {\\n try... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.util.InputMismatchException;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.Reader;\\nimport java.io.Writer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Niyaz Nigmatullin\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tFastScanner in = new FastScanner(inputStream);\\n\\t\\tFastPrinter out = new FastPrinter(outputStream);\\n\\t\\tTaskB solver = new TaskB();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskB {\\n\\n static int myLevel;\\n static int[] level;\\n static int[] loyalty;\\n\\n static double get(int n) {\\n double ret = 0;\\n for (int mask = 0; mask < 1 << n; mask++) {\\n int k = Integer.bitCount(mask);\\n double prob = 1.;\\n int sum = 0;\\n for (int i = 0; i < n; i++) {\\n if (((mask >> i) & 1) == 1) {\\n prob *= loyalty[i] * .1;\\n } else {\\n prob *= (10 - loyalty[i]) * .1;\\n sum += level[i];\\n }\\n }\\n if (k * 2 > n) {\\n ret += prob;\\n } else {\\n ret += prob * myLevel \\/ (myLevel + sum);\\n }\\n }\\n return ret;\\n }\\n\\n static double go(int x, int k, int n) {\\n if (x == n) {\\n return get(n);\\n }\\n double ret = 0;\\n for (int i = 0; i <= k && loyalty[x] + i <= 10; i++) {\\n loyalty[x] += i;\\n ret = Math.max(go(x + 1, k - i, n), ret);\\n loyalty[x] -= i;\\n }\\n return ret;\\n }\\n\\n public void solve(int testNumber, FastScanner in, FastPrinter out) {\\n int n = in.nextInt();\\n int k = in.nextInt();\\n myLevel = in.nextInt();\\n level = new int[n];\\n loyalty = new int[n];\\n for (int i = 0; i < n;... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class substring\\n{\\npublic static void main(String[] args)\\n{\\nScanner input = new Scanner(System.in);\\nString s = input.nextLine();\\nBoolean found = false;\\nint i = s.length();\\nwhile(found==false)\\n{\\ni--;\\nArrayList sub = new ArrayList();\\nfor(int j = 0; j <= s.length() - i; j++)\\n{\\nif(sub.contains(s.substring(j, j+i)))\\nfound = true;\\nelse\\nsub.add(s.substring(j, j+i));\\n}\\n\\n}\\nSystem.out.println(i);\\n}\\n} What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author vadimmm\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tTaskD solver = new TaskD();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskD {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n long l = in.nextLong();\\n long r = in.nextLong();\\n \\/*\\n long max = 1;\\n boolean good = false;\\n for (int i = 0; i < 62; ++i) {\\n max <<= 1;\\n if (max > r) {\\n max >>= 1;\\n if (max >= l) {\\n good = true;\\n }\\n break;\\n }\\n }\\n if (good) {\\n if (max - 1 >= l)\\n out.println(max ^ (max - 1));\\n else\\n out.println(max ^ r);\\n return;\\n }\\n *\\/\\n boolean[][] answer = new boolean[2][100];\\n int cur = 0;\\n while (r > 0) {\\n answer[0][cur] = (r % 2 != 0);\\n ++cur;\\n r >>= 1;\\n }\\n cur = 0;\\n while (l > 0) {\\n answer[1][cur] = (l % 2 != 0);\\n ++cur;\\n l >>= 1;\\n }\\n int old = -1;\\n for (int i = 63; i >= 0; --i) {\\n if (answer[0][i] && !answer[1][i]) {\\n old = i;\\n break;\\n }\\n }\\n if (old == -1) {\\n out.println(0);\\n return;\\n }\\n long a = 1;\\n for (int i = 0; i < old; ++i) {\\n a <<= 1;\\n a += 1;\\n }\\n out.println(a);\\n }\\n}\\n\\nclass InputReader {\\n\\n private... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class first\\n{\\n\\tint max(int a1,int a2,int a3)\\n\\t{\\n\\t\\tint max=a1;\\n\\t\\tif(a2>=max)\\n\\t\\t\\tmax=a2;\\n\\t\\tif(a3>=max)\\n\\t\\t\\tmax = a3;\\n\\t\\treturn max;\\t\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tint num=0;\\n\\t\\t\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tnum = sc.nextInt();\\n\\t\\tint num2 = num\\/10;\\n\\t\\tint num3 = num%10;\\n\\t\\tint num4 = (num2\\/10)*10+num3;\\n\\t\\tfirst fs = new first();\\n\\t\\tint result = fs.max(num,num2,num4);\\n\\t\\tSystem.out.println(result);\\n\\t}\\n}\\t\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/contest 23. You're Given A String\\nimport java.util.*;\\npublic class ProblemA\\n{\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tScanner keyboard = new Scanner(System.in);\\n\\t\\tString input = keyboard.nextLine();\\n\\t\\tboolean con = false;\\n\\t\\tfor( int i = input.length()-1; i > 0 ; i--)\\n\\t\\t{\\t\\n\\t\\t\\tfor ( int j = 0; j+i< input.length(); j++ )\\n\\t\\t\\t\\tfor( int k = j+1; k+i <= input.length(); k++ )\\n\\t\\t\\t\\t\\tif( input.substring(j,j+i).equals( input.substring(k,k+i) ) ) \\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tSystem.out.print(i+\\\"\\\\n\\\");\\n\\t\\t\\t\\t\\t\\tk = input.length()+1;\\n\\t\\t\\t\\t\\t\\tj = input.length();\\n\\t\\t\\t\\t\\t\\ti = -1;\\n\\t\\t\\t\\t\\t\\tcon = true;\\n\\t\\t\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif( con == false )\\n\\t\\t\\tSystem.out.print(0+\\\"\\\\n\\\");\\n\\t}\\t\\n} Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class TaxiDriversAndLyft2 {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner scanner = new Scanner(System.in);\\n\\t\\tlong n = scanner.nextLong();\\n\\t\\tlong m = scanner.nextLong();\\n\\t\\tlong[] people = new long[(int) (n+m)];\\n\\t\\tint[] taxiDrivers = new int[(int) (n+m)];\\n\\t\\t\\n\\t\\tfor(int i = 0;i< (n+m); i++) {\\n\\t\\t\\tpeople[i] = scanner.nextLong();\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int i = 0;i< (n+m); i++) {\\n\\t\\t\\ttaxiDrivers[i] = scanner.nextInt();\\n\\t\\t}\\n\\t\\t\\n\\t\\tint lastTaxiDriverIndex = -1;\\n\\t\\tlong[] riderCountArray = new long[(int) (m)];\\n\\t\\tlong[] a1 = new long[(int)n];\\n\\t\\tlong[] b1 = new long[(int)m];\\n\\t\\t\\n\\t\\tint j=0, k=0;\\n\\t\\tfor(int i = 0;i< (n+m); i++) {\\t\\n\\t\\t\\tif(taxiDrivers[i] == 0) {\\n\\t\\t\\t\\ta1[j] = people[i];\\n\\t\\t\\t\\tj++;\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tb1[k] = people[i];\\n\\t\\t\\t\\tk++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tint l = 0, q=0;\\n\\t\\tfor(int i=0;i1) && Math.abs(a1[i] - b1[l]) > Math.abs(a1[i] - b1[l+1])) {\\n\\t\\t\\t\\tl++; \\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\triderCountArray[l]++;\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int i = 0;i< (m); i++) {\\n\\t\\t\\tSystem.out.print(riderCountArray[i]+\\\" \\\");\\n\\t\\t}\\n\\t} \\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.Scanner;\\n\\npublic class CF125A {\\n\\n\\tprivate void work() throws IOException {\\n\\t\\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(\\n\\t\\t\\t\\tSystem.in)));\\n\\t\\tint n = sc.nextInt();\\n\\t\\tSystem.out.printf(\\\"%d %d %d\\\\n\\\", 0, 0, n);\\n\\t\\tSystem.out.close();\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tnew CF125A().work();\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collections;\\nimport java.util.Comparator;\\nimport java.util.List;\\nimport java.util.StringTokenizer;\\n\\/**\\n * 9:50 ~ \\n *\\n *\\/\\npublic class Main {\\n\\tpublic static int n, x, y;\\n\\tpublic static int[] a,b;\\n\\tpublic static int dp[], before[];\\n\\tpublic static int dx[];\\n\\tpublic static int d[][];\\n\\tpublic static final int INF = 24 * 201 * 201; \\n\\tpublic static void main(String[] argv) {\\n\\t\\tFastScanner scan = new FastScanner(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tx = scan.nextInt();\\n\\t\\ty = scan.nextInt();\\n\\t\\t\\n\\t\\tn = scan.nextInt();\\n\\t\\t\\n\\t\\ta = new int[n+1];\\n\\t\\tb = new int[n+1];\\n\\t\\tdx = new int[n+1];\\n\\t\\td = new int[n+1][n+1];\\n\\t\\tfor(int i = 0; i < n; ++i){\\n\\t\\t\\ta[i] = scan.nextInt();\\n\\t\\t\\tb[i] = scan.nextInt();\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int i = 0; i < n; ++i){\\n\\t\\t\\tdx[i] = dist(i);\\n\\t\\t}\\n\\t\\tfor(int i = 0; i < n; ++i){\\n\\t\\t\\tfor(int j = 0; j < n; ++j){\\n\\t\\t\\t\\td[i][j] = dist(i,j);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tdp = new int[1 << n];\\n\\t\\tbefore = new int[1 << n];\\n\\t\\tArrays.fill(dp, INF);\\n\\t\\tdp[0] = 0;\\n\\t\\tfor(int state = 0; state < (1< 0){\\n\\t\\t\\t\\t\\tif(dp[state - ii] == INF) continue;\\n\\t\\t\\t\\t\\tint newdist = dp[state - ii] + dx[i] + dx[i];\\n\\t\\t\\t\\t\\tif(dp[state] > newdist){\\n\\t\\t\\t\\t\\t\\tdp[state] = newdist;\\n\\t\\t\\t\\t\\t\\tbefore[state] = state - ii;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t} else continue;\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tfor(int j = i + 1; j < n; ++j){\\n\\t\\t\\t\\t\\tif(i == j) continue;\\n\\t\\t\\t\\t\\tint jj = (1 << j);\\n\\t\\t\\t\\t\\tif((state & jj) > 0){\\n\\t\\t\\t\\t\\t\\tif(dp[state - ii - jj] == INF) continue;\\n\\t\\t\\t\\t\\t\\tint newdist = dp[state - ii - jj] + dx[i] + d[i][j] + dx[j];\\n\\t\\t\\t\\t\\t\\tif(dp[state] > newdist){\\n\\t\\t\\t\\t\\t\\t\\tdp[state] = newdist;\\n\\t\\t\\t\\t\\t\\t\\tbefore[state] = state - ii - jj;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tSystem.out.println(dp[(1< 0){\\n\\t\\t\\tint... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*; \\nimport java.util.*; \\n\\n\\npublic class p7{\\n\\t\\n\\tstatic class FastReader{ \\n\\t\\tBufferedReader br; \\n\\t\\tStringTokenizer st; \\n\\n\\t\\tpublic FastReader() \\n\\t\\t{ \\n\\t\\t\\tbr = new BufferedReader(new\\n\\t\\t\\t\\t\\tInputStreamReader(System.in)); \\n\\t\\t} \\n\\n\\t\\tString next() \\n\\t\\t{ \\n\\t\\t\\twhile (st == null || !st.hasMoreElements()) \\n\\t\\t\\t{ \\n\\t\\t\\t\\ttry\\n\\t\\t\\t\\t{ \\n\\t\\t\\t\\t\\tst = new StringTokenizer(br.readLine()); \\n\\t\\t\\t\\t} \\n\\t\\t\\t\\tcatch (IOException e) \\n\\t\\t\\t\\t{ \\n\\t\\t\\t\\t\\te.printStackTrace(); \\n\\t\\t\\t\\t} \\n\\t\\t\\t} \\n\\t\\t\\treturn st.nextToken(); \\n\\t\\t} \\n\\n\\t\\tint nextInt() \\n\\t\\t{ \\n\\t\\t\\treturn Integer.parseInt(next()); \\n\\t\\t} \\n\\n\\t\\tlong nextLong() \\n\\t\\t{ \\n\\t\\t\\treturn Long.parseLong(next()); \\n\\t\\t} \\n\\n\\t\\tdouble nextDouble() \\n\\t\\t{ \\n\\t\\t\\treturn Double.parseDouble(next()); \\n\\t\\t} \\n\\n\\t\\tString nextLine() \\n\\t\\t{ \\n\\t\\t\\tString str = \\\"\\\"; \\n\\t\\t\\ttry\\n\\t\\t\\t{ \\n\\t\\t\\t\\tstr = br.readLine(); \\n\\t\\t\\t} \\n\\t\\t\\tcatch (IOException e) \\n\\t\\t\\t{ \\n\\t\\t\\t\\te.printStackTrace(); \\n\\t\\t\\t} \\n\\t\\t\\treturn str; \\n\\t\\t} \\n\\t}\\n\\n\\tpublic static void main(String[] args) \\n\\t{ \\n FastReader sc = new FastReader(); \\n \\/\\/PrintWriter out = new PrintWriter(System.out); \\n int n = sc.nextInt();\\n\\t\\tint k = sc.nextInt();\\n\\t\\tlong one = (long)Math.pow(2, k) - 1;\\n\\t\\t\\n\\t\\tlong[] arr = new long[n+1];\\n\\t\\t\\n\\t\\tarr[0] = 0;\\n\\t\\tfor(int i=1;i<=n;i++){\\n\\t\\t\\tarr[i] = sc.nextLong();\\n\\t\\t\\tarr[i] ^= arr[i-1];\\n\\t\\t}\\n\\n\\t\\tMap count = new HashMap<>();\\n\\n\\t\\tfor(int i=0;i<=n;i++){\\n\\t\\t\\tLong key = Math.min(arr[i], (arr[i]^one));\\n\\t\\t\\tLong val = count.get(key);\\n\\t\\t\\tif(val==null) val = 0L;\\n\\t\\t\\tcount.put(key, val+1);\\n\\t\\t}\\n\\n\\t\\tlong num = n;\\n\\t\\tlong ans = num*(num+1)\\/2;\\n\\t\\t\\n\\t\\tfor(Map.Entry ent: count.entrySet()){\\n\\t\\t\\t\\n\\t\\t\\tLong cnt = ent.getValue();\\n\\t\\t\\t\\n\\t\\t\\tlong num1 = cnt\\/2;\\n\\t\\t\\tlong num2 = (cnt+1)\\/2;\\n\\t\\t\\t\\n\\t\\t\\tans -= ( (num1*(num1-1))\\/2 );\\n\\t\\t\\tans -= ( (num2*(num2-1))\\/2 );\\n\\t\\t}\\n\\n\\t\\tSystem.out.println(ans);\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Beta17PA {\\n\\n\\tboolean[] isPrime = new boolean[1001];\\n\\tint[] prime = new int[200];\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\t\\tnew Beta17PA().solve();\\n\\t}\\n\\n\\tpublic void solve() {\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tint n, k;\\n\\t\\tn = scan.nextInt();\\n\\t\\tk = scan.nextInt();\\n\\t\\tinit();\\n\\t\\tint m = 0;\\n\\t\\tfor(int i=2; i<=n; i++) {\\n\\t\\t\\tif(check(i)) m ++;\\n\\t\\t}\\n\\t\\tif(m>=k) System.out.println(\\\"YES\\\");\\n\\t\\telse System.out.println(\\\"NO\\\");\\n\\t}\\n\\n\\tprivate boolean check(int n) {\\n\\t\\tif(n<6||!isPrime[n]) return false;\\n\\t\\tint d = n-1;\\n\\t\\tfor(int i=0; i<199&&prime[i]+prime[i+1]<=d; i++) {\\n\\t\\t\\tif(prime[i]+prime[i+1]==d) return true;\\n\\t\\t}\\n\\t\\treturn false;\\n\\t}\\n\\n\\tprivate void init() {\\n\\t\\tArrays.fill(isPrime, true);\\n\\t\\tisPrime[0] = isPrime[1] = false;\\n\\t\\tfor(int i=2; i<1001; i++) {\\n\\t\\t\\tif(!isPrime[i]) continue;\\n\\t\\t\\tfor(int j=i+i; j<1001; j+=i) {\\n\\t\\t\\t\\tisPrime[j] = false;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint count = 0;\\n\\t\\tfor(int i=2; i<1001; i++) {\\n\\t\\t\\tif(isPrime[i]) prime[count++] = i;\\n\\t\\t}\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class A{\\n\\n void solve(){\\n int n=ni();\\n s=new char[n+1];\\n s[0]='.';\\n for(int i=1;i<=n;i++) s[i]=ns().charAt(0);\\n dp=new long[5001][5001];\\n\\n dp[1][0]=1;\\n long sum[]=new long[n+2];\\n sum[0]=1;\\n for(int i=2;i<=n;i++){\\n for(int j=0;j<=n;j++) {\\n if (s[i - 1] == 'f') {\\n if(j-1>=0) dp[i][j]=dp[i-1][j-1];\\n else dp[i][j]=0;\\n }else {\\n dp[i][j]=sum[j];\\n }\\n }\\n for(int j=n;j>=0;j--){\\n sum[j]=(sum[j+1]+dp[i][j])%M;\\n }\\n }\\n long ans=0;\\n for(int i=0;i<=n;i++){\\n ans+=dp[n][i];\\n if(ans>=M) ans%=M;\\n }\\n pw.println(ans);\\n\\n }\\n char s[];\\n long dp[][];\\n long go(int x,int cnt,int n){\\n \\/\\/ pw.println(x+\\\" \\\"+cnt);\\n if(x>n) return 1;\\n long cc=0;\\n if(dp[x][cnt]!=-1) return dp[x][cnt];\\n if(s[x]=='f'){\\n cc=(cc+go(x+1,cnt+1,n))%M;\\n }else {\\n\\n for(int j=cnt;j>=0;j--) cc=(cc+go(x+1,j,n))%M;\\n if(x==n) cc=(cc-cnt+M)%M;\\n }\\n cc%=M;\\n\\n dp[x][cnt]=cc;\\n return cc;\\n }\\n\\n\\n\\n long M=(long)1e9+7;\\n InputStream is;\\n PrintWriter pw;\\n String INPUT = \\\"\\\";\\n void run() throws Exception {\\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\\n pw = new PrintWriter(System.out);\\n long s = System.currentTimeMillis();\\n solve();\\n pw.flush();\\n if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+\\\"ms\\\");\\n }\\n\\n public static void main(String[] args) throws Exception { new A().run(); }\\n\\n private byte[] inbuf = new byte[1024];\\n public int lenbuf = 0, ptrbuf = 0;\\n\\n private int readByte() {\\n if(lenbuf == -1)throw new InputMismatchException();\\n if(ptrbuf >= lenbuf){\\n ptrbuf = 0;\\n try { lenbuf... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.Scanner;\\n\\npublic class three {\\n static boolean check;\\n\\n public static void main(String[] args) {\\n check = true;\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n String s = n + \\\"\\\";\\n recurse(n, s.length(), \\\"4\\\");\\n if (!check)\\n System.out.println(\\\"YES\\\");\\n else {\\n recurse(n, s.length(), \\\"7\\\");\\n if (!check)\\n System.out.println(\\\"YES\\\");\\n else\\n System.out.println(\\\"NO\\\");\\n }\\n }\\n\\n private static void recurse(int n, int length, String string) {\\n int k = Integer.parseInt(string);\\n if (n % k == 0) {\\n check = false;\\n } else if (string.length() <= length && check) {\\n recurse(n, length, string + \\\"4\\\");\\n recurse(n, length, string + \\\"7\\\");\\n }\\n\\n }\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class _1036_B_DiagonalWalkingV2 {\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tint Q = readInt();\\n\\t\\twhile(Q-- > 0) {\\n\\t\\t\\tlong n = readLong(), m = readLong(), k = readLong();\\n\\t\\t\\tif(Math.max(n, m) > k) println(-1);\\n\\t\\t\\telse {\\n\\t\\t\\t\\tlong ans = k;\\n\\t\\t\\t\\tif(n%2 != k%2) ans--;\\n\\t\\t\\t\\tif(m%2 != k%2) ans--;\\n\\t\\t\\t\\tprintln(ans);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\texit();\\n\\t}\\n\\n\\tfinal private static int BUFFER_SIZE = 1 << 16;\\n\\tprivate static DataInputStream din = new DataInputStream(System.in);\\n\\tprivate static byte[] buffer = new byte[BUFFER_SIZE];\\n\\tprivate static int bufferPointer = 0, bytesRead = 0;\\n\\tstatic PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\n\\tpublic static String readLine() throws IOException {\\n\\t\\tbyte[] buf = new byte[64]; \\/\\/ line length\\n\\t\\tint cnt = 0, c;\\n\\t\\twhile ((c = Read()) != -1) {\\n\\t\\t\\tif (c == '\\\\n')\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tbuf[cnt++] = (byte) c;\\n\\t\\t}\\n\\t\\treturn new String(buf, 0, cnt);\\n\\t}\\n\\n\\tpublic static String read() throws IOException {\\n\\t\\tbyte[] ret = new byte[1024];\\n\\t\\tint idx = 0;\\n\\t\\tbyte c = Read();\\n\\t\\twhile (c <= ' ') {\\n\\t\\t\\tc = Read();\\n\\t\\t}\\n\\t\\tdo {\\n\\t\\t\\tret[idx++] = c;\\n\\t\\t\\tc = Read();\\n\\t\\t} while (c != -1 && c != ' ' && c != '\\\\n' && c != '\\\\r');\\n\\t\\treturn new String(ret, 0, idx);\\n\\t}\\n\\n\\tpublic static int readInt() throws IOException {\\n\\t\\tint ret = 0;\\n\\t\\tbyte c = Read();\\n\\t\\twhile (c <= ' ')\\n\\t\\t\\tc = Read();\\n\\t\\tboolean neg = (c == '-');\\n\\t\\tif (neg)\\n\\t\\t\\tc = Read();\\n\\t\\tdo {\\n\\t\\t\\tret = ret * 10 + c - '0';\\n\\t\\t} while ((c = Read()) >= '0' && c <= '9');\\n\\n\\t\\tif (neg)\\n\\t\\t\\treturn -ret;\\n\\t\\treturn ret;\\n\\t}\\n\\n\\tpublic static long readLong() throws IOException {\\n\\t\\tlong ret = 0;\\n\\t\\tbyte c = Read();\\n\\t\\twhile (c <= ' ')\\n\\t\\t\\tc = Read();\\n\\t\\tboolean neg = (c == '-');\\n\\t\\tif (neg)\\n\\t\\t\\tc = Read();\\n\\t\\tdo {\\n\\t\\t\\tret = ret * 10 + c - '0';\\n\\t\\t} while ((c = Read()) >= '0' && c <= '9');\\n\\t\\tif (neg)\\n\\t\\t\\treturn -ret;\\n\\t\\treturn ret;\\n\\t}\\n\\n\\tpublic static double readDouble() throws IOException {\\n\\t\\tdouble ret = 0, div = 1;\\n\\t\\tbyte c = Read();\\n\\t\\twhile (c <= ' ')\\n\\t\\t\\tc = Read();\\n\\t\\tboolean neg = (c == '-');\\n\\t\\tif (neg)\\n\\t\\t\\tc =... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n \\nimport java.math.*;\\nimport java.awt.Point;\\n \\npublic class Main {\\n \\/\\/static final long MOD = 1000000007L;\\n \\/\\/static final long MOD2 = 1000000009L;\\n static final long MOD = 998244353L;\\n \\/\\/static final long INF = 500000000000L;\\n static final int INF = 1000000005;\\n static final int NINF = -1000000005;\\n \\/\\/static final long NINF = -1000000000000000000L;\\n static FastScanner sc;\\n static PrintWriter pw;\\n static final int[][] dirs = {{-1,0},{1,0},{0,-1},{0,1}};\\n\\n\\n public static void main(String[] args) {\\n sc = new FastScanner();\\n pw = new PrintWriter(System.out);\\n \\n\\n\\n int Q = sc.ni();\\n for (int q = 0; q < Q; q++) {\\n int N = sc.ni();\\n String ans = \\\"NO\\\";\\n if (N%2==0 && isSquare(N\\/2))\\n ans = \\\"YES\\\";\\n if (N%4==0 && isSquare(N\\/4))\\n ans = \\\"YES\\\";\\n pw.println(ans);\\n }\\n pw.close();\\n }\\n\\n public static boolean isSquare(int x) {\\n int s = (int)Math.round(Math.sqrt(x));\\n return s*s==x;\\n }\\n\\n \\n public static void sort(int[] arr) {\\n Random rgen = new Random();\\n for (int i = 0; i < arr.length; i++) {\\n int r = rgen.nextInt(arr.length);\\n int temp = arr[i];\\n arr[i] = arr[r];\\n arr[r] = temp;\\n }\\n Arrays.sort(arr);\\n }\\n \\n public static void sort(long[] arr) {\\n Random rgen = new Random();\\n for (int i = 0; i < arr.length; i++) {\\n int r = rgen.nextInt(arr.length);\\n long temp = arr[i];\\n arr[i] = arr[r];\\n arr[r] = temp;\\n }\\n Arrays.sort(arr);\\n }\\n \\n \\/\\/Sort an array (immune to quicksort TLE)\\n public static void sort(int[][] arr) {\\n Random rgen = new Random();\\n for (int i = 0; i < arr.length; i++) {\\n int r = rgen.nextInt(arr.length);\\n int[] temp = arr[i];\\n arr[i] = arr[r];\\n arr[r] = temp;\\n }\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\n\\npublic class B {\\n\\tpublic static BufferedReader in;\\n\\tpublic static PrintWriter out;\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\n\\t\\tboolean showLineError = true;\\n\\t\\tif (showLineError) {\\n\\t\\t\\tsolve();\\n\\t\\t\\tout.close();\\n\\t\\t} else {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tsolve();\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t} finally {\\n\\t\\t\\t\\tout.close();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic void debug(Object... os) {\\n\\t\\tout.println(Arrays.deepToString(os));\\n\\t}\\n\\n\\tprivate static void solve() throws IOException {\\n\\t\\tString[] line = in.readLine().split(\\\" \\\");\\n\\t\\tlong n = Long.parseLong(line[0]) - 1;\\n\\t\\tlong k = Long.parseLong(line[1]) - 1;\\n\\t\\tif (f(1, k) < n) {\\n\\t\\t\\tout.println(-1);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tif (n == 0) {\\n\\t\\t\\tout.println(0);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tlong lo = 0l;\\n\\t\\tlong hi = k;\\n\\t\\twhile (lo + 1l < hi) {\\n\\t\\t\\tlong m = (lo + hi) \\/ 2l;\\n\\t\\t\\tlong f = f(k - m + 1, k);\\n\\t\\t\\tif (f < n) {\\n\\t\\t\\t\\tlo = m;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\thi = m;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(hi);\\n\\n\\t}\\n\\n\\tprivate static long f(long lo, long hi) {\\n\\t\\treturn (lo + hi) * (hi - lo + 1l) \\/ 2l;\\n\\t}\\n} Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.StringTokenizer;\\n\\nimport static java.lang.Math.max;\\nimport static java.lang.Math.min;\\n\\npublic class Main {\\n FastScanner in;\\n PrintWriter out;\\n\\n void run() {\\n in = new FastScanner();\\n out = new PrintWriter(System.out);\\n solve();\\n out.close();\\n }\\n\\n class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n public FastScanner(String s) {\\n try {\\n br = new BufferedReader(new FileReader(s));\\n } catch (FileNotFoundException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n public String nextToken() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n }\\n }\\n return st.nextToken();\\n }\\n\\n public int nextInt() {\\n return Integer.parseInt(nextToken());\\n }\\n\\n public long nextLong() {\\n return Long.parseLong(nextToken());\\n }\\n\\n public double nextDouble() {\\n return Double.parseDouble(nextToken());\\n }\\n }\\n\\n public static void main(String[] args) {\\n new Main().run();\\n }\\n\\n void solve() {\\n int t = in.nextInt();\\n\\n for (int sdfsdf = 0; sdfsdf < t; sdfsdf++) {\\n long n = in.nextLong();\\n long k = in.nextLong();\\n\\n if (n == 1) {\\n if (k == 1) {\\n out.println(\\\"YES 0\\\");\\n } else {\\n out.println(\\\"NO\\\");\\n }\\n continue;\\n }\\n\\n if (k == 3) {\\n if (n == 2) {\\n out.println(\\\"NO\\\");\\n } else {\\n out.println(\\\"YES \\\" + (n - 1));\\n }\\n continue;\\n }\\n\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.readInt();\\n boolean[] isF = new boolean[n];\\n for (int i = 0; i < n; i++) {\\n isF[i] = in.readCharacter() == 'f';\\n }\\n FenwickTree[] fenwickTrees = new FenwickTree[n + 1];\\n for (int i = 0; i < fenwickTrees.length; i++) {\\n fenwickTrees[i] = new FenwickTree(n + 1);\\n }\\n fenwickTrees[n].add(0, 1);\\n for (int idx = n - 1; idx >= 0; idx--) {\\n for (int indentLevel = 0; indentLevel < n; indentLevel++) {\\n long fenwickRes;\\n if (isF[idx]) {\\n fenwickRes = fenwickTrees[idx + 1].get(indentLevel + 1, indentLevel + 1);\\n } else {\\n fenwickRes = fenwickTrees[idx + 1].get(0, indentLevel);\\n }\\n fenwickTrees[idx].add(indentLevel, fenwickRes % MiscUtils.MOD7);\\n }\\n }\\n out.printLine(fenwickTrees[0].get(0, 0));\\n }\\n }\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Beta22PA {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tint n = scan.nextInt();\\n\\t\\tint minimum = 200, second = 200;\\n\\t\\tfor(int i=0; iminimum&&temp100) {\\n\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t\\t} else {\\n\\t\\t\\tSystem.out.println(second);\\n\\t\\t}\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class practice {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\t\\/\\/Scanner in = new Scanner(new File(\\\"practice.in\\\"));\\n\\t\\tScanner in = new Scanner(System.in);\\n\\n\\t\\tString str = in.nextLine();\\n\\t\\tlong n = Long.parseLong(str.substring(0, str.indexOf(\\\" \\\")));\\n\\t\\tlong m = Long.parseLong(str.substring(str.indexOf(\\\" \\\") + 1));\\n\\t\\tif(m - n < 2) {\\n\\t\\t\\tSystem.out.println(\\\"-1\\\");\\n\\t\\t} else {\\n\\t\\t\\tif(m - n == 2 && m % 2 == 1) {\\n\\t\\t\\t\\tSystem.out.println(\\\"-1\\\");\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tSystem.out.println((n + n % 2) + \\\" \\\" + (n + 1 + n % 2) + \\\" \\\" + (n + 2 + n % 2));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\nimport java.awt.geom.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Solution implements Runnable {\\n\\t\\n\\n\\tpublic void solve() throws Exception {\\n\\t\\tint n = nextInt();\\n\\t\\tint a [] = new int [n];\\n\\t\\tfor (int i = 0 ;i < n; i++) {\\n\\t\\t\\ta[i] = nextInt();\\n\\t\\t}\\n\\t\\tArrays.sort(a);\\n\\t\\tif (n == 1) {\\n\\t\\t\\tif (a[0] == 1) {\\n\\t\\t\\t\\tout.print(2);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tout.print(1);\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\tout.print(1);\\n\\t\\t\\tfor (int i = 1; i < n; i++) {\\n\\t\\t\\t\\tif (i == n-1 && a[i] == 1) {\\n\\t\\t\\t\\t\\tout.print(\\\" \\\"+2);\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tout.print(\\\" \\\"+a[i-1]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\t\\n\\t\\/********************************************************************************************\\/\\n\\t\\/* THERE IS INPUT *\\/\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\n\\tlong stime=0;\\n\\t\\n\\tprivate String next() throws Exception {\\n\\t\\twhile (st == null || !st.hasMoreElements())\\n\\t\\t\\tst = new StringTokenizer(in.readLine());\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tprivate int nextInt() throws Exception {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\n\\tprivate long nextLong() throws Exception {\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\n\\tprivate double nextDouble() throws Exception {\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\t\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\t\\/\\/Locale.setDefault(Locale.US);\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(new OutputStreamWriter(System.out));\\n\\t\\t\\tsolve();\\n\\t\\t} catch (Exception ex) {\\n\\t\\t\\tthrow new RuntimeException(ex);\\n\\t\\t} finally {\\n\\t\\t\\tout.close();\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tnew Thread(null, new Solution(), \\\"\\\", 1 << 25).start();\\n\\t}\\n\\n\\t\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n \\npublic class Main{\\n private static final int MAX_SIZE = 100005;\\n public static void main(String args[]){\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n int m = sc.nextInt();\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n if(((m + 1) \\/ 60 < a) || ((m + 1) \\/ 60 == a && (m + 1) % 60 <= b)) {\\n out(0, 0);\\n System.exit(0);\\n }\\n for(int i = 2; i <= n; i++) {\\n int x = sc.nextInt();\\n int y = sc.nextInt();\\n\\n int bb = b + 2 * m + 2;\\n int aa = a + bb \\/ 60;\\n bb %= 60;\\n\\n if((aa < x) || (aa == x && bb <= y)) {\\n b = b + m + 1;\\n a = a + b \\/ 60;\\n b %= 60;\\n out(a, b);\\n System.exit(0);\\n }\\n a = x;\\n b = y;\\n }\\n b = b + m + 1;\\n a = a + b \\/ 60;\\n b = b % 60; \\n out(a, b);\\n }\\n\\n private static void out(int a, int b) {\\n cout(a);\\n cout(\\\" \\\");\\n cout(b);\\n }\\n\\n private static void cout(Object a) {\\n System.out.print(a);\\n }\\n} Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.*;\\n\\n\\npublic class A {\\t\\n\\tBufferedReader reader;\\n StringTokenizer tokenizer;\\n PrintWriter out;\\n \\n\\tpublic void solve() throws IOException {\\t\\t\\t\\t\\n\\t\\tlong A = nextLong();\\n\\t\\tlong B = nextLong();\\t\\t\\n\\t\\tlong ans = 0;\\n\\t\\twhile(A > 0){\\n\\t\\t\\tif(A >= B){\\n\\t\\t\\t\\tans += A\\/B;\\n\\t\\t\\t\\tA %= B;\\n\\t\\t\\t\\tif(A == 0) break;\\n\\t\\t\\t}\\n\\t\\t\\telse{\\n\\t\\t\\t\\tlong tmp = A; A = B; B = tmp;\\n\\t\\t\\t}\\t\\t\\t\\n\\t\\t}\\t\\t\\n\\t\\tout.println(ans);\\n\\t}\\n\\t\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew A().run();\\n\\t}\\n\\t\\n\\tpublic void run() {\\n try {\\n reader = new BufferedReader(new InputStreamReader(System.in));\\n tokenizer = null;\\n out = new PrintWriter(System.out);\\n solve();\\n reader.close();\\n out.close();\\n } catch (Exception e) {\\n e.printStackTrace();\\n System.exit(1);\\n }\\n }\\n\\n int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() throws IOException {\\n return Double.parseDouble(nextToken());\\n }\\n\\n String nextToken() throws IOException {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n tokenizer = new StringTokenizer(reader.readLine());\\n }\\n return tokenizer.nextToken();\\n }\\n\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\nimport java.awt.geom.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Solution implements Runnable {\\n\\t\\n\\n\\tpublic void solve() throws Exception {\\n\\t\\tint n = nextInt();\\n\\t\\tint a [] = new int [n];\\n\\t\\tfor (int i = 0 ;i < n; i++) {\\n\\t\\t\\ta[i] = nextInt();\\n\\t\\t}\\n\\t\\tArrays.sort(a);\\n\\t\\tif (n == 1) {\\n\\t\\t\\tif (a[0] == 1) {\\n\\t\\t\\t\\tout.print(2);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tout.print(1);\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\tout.print(1);\\n\\t\\t\\tfor (int i = 1; i < n; i++) {\\n\\t\\t\\t\\tif (i == n-1 && a[i] == 1) {\\n\\t\\t\\t\\t\\tout.print(\\\" \\\"+2);\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tout.print(\\\" \\\"+a[i-1]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\t\\n\\t\\/********************************************************************************************\\/\\n\\t\\/* THERE IS INPUT *\\/\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\n\\tlong stime=0;\\n\\t\\n\\tprivate String next() throws Exception {\\n\\t\\twhile (st == null || !st.hasMoreElements())\\n\\t\\t\\tst = new StringTokenizer(in.readLine());\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tprivate int nextInt() throws Exception {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\n\\tprivate long nextLong() throws Exception {\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\n\\tprivate double nextDouble() throws Exception {\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\t\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\t\\/\\/Locale.setDefault(Locale.US);\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(new OutputStreamWriter(System.out));\\n\\t\\t\\tsolve();\\n\\t\\t} catch (Exception ex) {\\n\\t\\t\\tthrow new RuntimeException(ex);\\n\\t\\t} finally {\\n\\t\\t\\tout.close();\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tnew Thread(null, new Solution(), \\\"\\\", 1 << 25).start();\\n\\t}\\n\\n\\t\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\npublic class Main {\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tString[] in = br.readLine().split(\\\" \\\");\\n\\t\\tlong n = Long.parseLong(in[0]), s = Long.parseLong(in[1]);\\n\\t\\tSolver solver = new Solver(n, s);\\n\\t\\tSystem.out.println(solver.solve());\\n\\n\\t}\\n\\n}\\n\\nclass Solver {\\n\\n\\tprivate long n, s;\\n\\n\\tSolver(long n, long s) {\\n\\t\\tthis.n = n;\\n\\t\\tthis.s = s;\\n\\t}\\n\\n\\tpublic long solve() {\\n\\t\\tlong low = 1, high = n;\\n\\t\\tfor (int i = 0; i < 72; ++i) {\\n\\t\\t\\tlong x = low + (high - low) \\/ 2;\\n\\t\\t\\tif (check(x))\\n\\t\\t\\t\\thigh = x - 1;\\n\\t\\t\\telse\\n\\t\\t\\t\\tlow = x + 1;\\n\\t\\t}\\n\\t\\treturn n - high;\\n\\t}\\n\\n\\tprivate boolean check(long x) {\\n\\n\\t\\tlong tmp = x;\\n\\t\\tint sum = 0;\\n\\t\\twhile (tmp > 0) {\\n\\t\\t\\tsum += tmp % 10;\\n\\t\\t\\ttmp \\/= 10;\\n\\t\\t}\\n\\t\\treturn x - sum >= s;\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class R025A {\\n\\tint n;\\n\\tint[] nums;\\n\\tpublic R025A() {\\n\\t\\tScanner scanner = new Scanner(System.in);\\n\\t\\tn = scanner.nextInt();\\n\\t\\tnums = new int[n];\\n\\t\\tfor(int i=0; i= m) {\\n cost[x][mask] = w;\\n return;\\n }\\n pre(x, pos + 1, mask, w);\\n pre(x, pos + 1, set(mask, pos), w + 2 * g[x][pos]);\\n }\\n\\n static int solve(int pos, int mask) {\\n if (pos >= m) return 0;\\n if (dp[mask] != -1) return dp[mask];\\n int min = inf;\\n for (int i = 0; i < m; i++) {\\n if (!check(mask, i)) {\\n int res = cost[i][mask] * pos + solve(pos + 1, set(mask, i));\\n min = min(min, res);\\n }\\n }\\n return dp[mask] = min;\\n }\\n\\n static boolean check(int N, int pos) {\\n return (N & (1 << pos)) != 0;\\n }\\n\\n static int set(int N, int pos) {\\n return N = N | (1 << pos);\\n }\\n\\n static int reset(int N, int pos) {\\n return N = N & ~(1 << pos);\\n }\\n\\n static void debug(Object... obj) {\\n ... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*; \\nimport java.util.*; \\nimport java.math.*; \\n\\n \\npublic class Main implements Runnable {\\n\\/\\/public static final String FileName = \\\"test\\\";\\nStreamTokenizer ST; \\nPrintWriter out; \\nBufferedReader br; \\nScanner in;\\nstatic final int inf = 1000000000;\\n \\nint nextInt() throws IOException{ \\n ST.nextToken(); \\n return (int)ST.nval; \\n}\\nlong nextLong() throws IOException{ \\n ST.nextToken(); \\n return (long)ST.nval; \\n} \\nString next() throws IOException{ \\n ST.nextToken(); \\n return ST.sval; \\n} \\ndouble nextD() throws IOException{ \\n ST.nextToken(); \\n return ST.nval; \\n} \\npublic static void main(String[] args) throws IOException { \\n new Thread(new Main()).start();\\n\\/\\/ new Main().run();\\n}\\n \\npublic void run() { \\n try {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); \\n \\/\\/br = new BufferedReader(new FileReader(new File(FileName+\\\".in\\\")));\\n \\/\\/out = new PrintWriter(new BufferedWriter(new FileWriter(FileName+\\\".out\\\")));\\n in = new Scanner(br);\\n ST = new StreamTokenizer(br); \\n solve(); \\n out.close();\\n \\/\\/in.close();\\n br.close(); \\n } \\n catch (IOException e) { \\n e.printStackTrace();\\n throw new IllegalStateException(e); \\n } \\n}\\n\\n\\npublic void solve() throws IOException {\\n int n = nextInt();\\n int K = nextInt();\\n boolean[] f = new boolean[n+1];\\n Arrays.fill(f, true);\\n Vector P = new Vector();\\n for (int i=2; i<=n; i++)\\n if (f[i]) {\\n for (int j=2*i; j<=n; j+=i) \\n f[j] = false;\\n P.add(i);\\n }\\n for (int i=0; i0){\\n continue;\\n }\\n else{\\n power = i;\\n break;\\n }\\n }\\n long place = (long) Math.ceil(digit - seq[power-1]);\\n place = (long)Math.ceil(place\\/power);\\n if((digit - seq[power-1])%power>0){\\n place++;\\n }\\n\\n long num = (long) (place + Math.pow(10,power-1)-1);\\n String num2 = Long.toString(num);\\n long end = seq[power-1] + place*power;\\n long answer = (long)(power-(end - digit));\\n \\/\\/System.out.println(\\\"Digit is at the \\\" + power + \\\" power\\\");\\n \\/\\/System.out.println(\\\"Digit is at the \\\" + place + \\\" number of the sequence\\\");\\n \\/\\/System.out.println(\\\"Number is \\\" + num);\\n \\/\\/System.out.println(\\\"Digit is at the \\\" + answer+ \\\" in that number\\\");\\n \\/\\/System.out.println(\\\"Answer is \\\" + num2.charAt((int)answer-1));\\n System.out.println(num2.charAt((int)answer-1));\\n\\n }\\n static class FastReader\\n {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastReader()\\n {\\n br = new BufferedReader(new\\n InputStreamReader(System.in));\\n }\\n\\n String next()\\n {\\n while (st == null || !st.hasMoreElements())\\n {\\n try\\n {\\n st = new StringTokenizer(br.readLine());\\n }\\n catch (IOException e)\\n {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.lang.reflect.Array;\\nimport java.util.Arrays;\\nimport java.util.HashSet;\\nimport java.util.Iterator;\\nimport java.util.Set;\\n\\npublic class Main {\\n\\n public static void main(String[] args) throws IOException {\\n new Main().run();\\n }\\n\\n\\n private void run() throws IOException {\\n\\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\\n\\n int n = Integer.parseInt(reader.readLine());\\n int[] arr = new int[n];\\n String[] line = reader.readLine().split(\\\"\\\\\\\\s\\\");\\n\\n for (int i = 0; i < n; i++) {\\n arr[i] = Integer.parseInt(line[i]);\\n }\\n\\n Arrays.sort(arr);\\n\\n Set numbers = new HashSet<>();\\n for (int i = 0; i < arr.length; i++) {\\n Iterator iter = numbers.iterator();\\n boolean contains = false;\\n while (iter.hasNext()){\\n int elem = iter.next();\\n if(gcd(elem, arr[i]) == elem){\\n contains = true;\\n }\\n\\n }\\n if(!contains)\\n numbers.add(arr[i]);\\n }\\n\\n\\n System.out.println(numbers.size());\\n\\n }\\n\\n private int gcd(int a, int b){\\n while (a != b){\\n if(a > b)\\n a -= b;\\n else\\n b -= a;\\n }\\n\\n return a;\\n }\\n\\n\\n\\n} Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n private static void solve(InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n\\n List> g = new ArrayList<>(n + 1);\\n for (int i = 0; i < n + 1; i++) {\\n g.add(new LinkedList<>());\\n }\\n\\n int degree1 = 0, degree2 = 0, root = 0;\\n for (int i = 0; i < n - 1; i++) {\\n int a = in.nextInt();\\n int b = in.nextInt();\\n\\n g.get(a).add(b);\\n g.get(b).add(a);\\n\\n if (g.get(a).size() > degree1) {\\n\\n if (a == root) {\\n degree1 = g.get(a).size();\\n } else {\\n degree2 = degree1;\\n degree1 = g.get(a).size();\\n root = a;\\n }\\n\\n } else if (g.get(a).size() > degree2) {\\n degree2 = g.get(a).size();\\n }\\n\\n if (g.get(b).size() > degree1) {\\n\\n if (b == root) {\\n degree1 = g.get(b).size();\\n } else {\\n degree2 = degree1;\\n degree1 = g.get(b).size();\\n root = b;\\n }\\n\\n } else if (g.get(b).size() > degree2) {\\n degree2 = g.get(b).size();\\n }\\n }\\n\\n if (degree2 > 2) {\\n out.print(\\\"No\\\");\\n } else {\\n out.println(\\\"Yes\\\");\\n\\n List leaves = new LinkedList<>();\\n for (int i = 1; i <= n; i++) {\\n if (i != root) {\\n if (g.get(i).size() == 1) {\\n leaves.add(i);\\n }\\n }\\n }\\n\\n out.println(leaves.size());\\n for (int i : leaves) {\\n out.println(root + \\\" \\\" + i);\\n }\\n }\\n }\\n\\n private static void shuffleArray(int[] array) {\\n int index;\\n Random random = new Random();\\n for (int i = array.length - 1; i > 0; i--) {\\n index =... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedWriter;\\nimport java.io.FileInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.OutputStreamWriter;\\nimport java.io.PrintWriter;\\nimport java.io.Writer;\\nimport java.math.BigInteger;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Comparator;\\nimport java.util.HashSet;\\nimport java.util.InputMismatchException;\\nimport java.util.List;\\nimport java.util.Random;\\nimport java.util.TreeSet;\\n\\n\\/**\\n * Actual solution is at the top, in class Solver\\n *\\/\\nfinal public class Main implements Runnable {\\n\\tprivate static String[] args;\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tMain.args = args;\\n\\t\\tnew Thread(null, new Main(), \\\"MyRunThread\\\", 1 << 27).start();\\n\\t}\\n\\n\\t\\/\\/@Override\\n\\tpublic void run() {\\n\\t\\tlong time_beg = -1;\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tif (args.length > 0 && args[0].equals(\\\"outside\\\")) {\\n\\t\\t\\ttime_beg = System.currentTimeMillis();\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tinputStream = new FileInputStream(\\\"IO\\/in.txt\\\");\\n\\/\\/\\t\\t\\t\\toutputStream = new FileOutputStream(\\\"IO\\/out.txt\\\");\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\tSystem.err.println(e);\\n\\t\\t\\t\\tSystem.exit(1);\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\ttry {\\n\\/\\/\\t\\t\\t\\tinputStream = new FileInputStream(\\\"IO\\/in.txt\\\");\\n\\/\\/\\t\\t\\t\\toutputStream = new FileOutputStream(\\\"IO\\/out.txt\\\");\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\tSystem.err.println(e);\\n\\t\\t\\t\\tSystem.exit(1);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tSolver s = new Solver();\\n\\t\\ts.in = new InputReader(inputStream);\\n\\t\\ts.out = new OutputWriter(outputStream);\\n\\t\\tif (args.length > 0 && args[0].equals(\\\"outside\\\")) {\\n\\t\\t\\ts.dout = new DebugWriter(s.out);\\n\\t\\t}\\n\\n\\t\\ts.solve();\\n\\n\\t\\tif (args.length > 0 && args[0].equals(\\\"outside\\\")) {\\n\\t\\t\\ts.dout.printFormat(\\\"*** Total time: %.3f ***\\\\n\\\", (System.currentTimeMillis() - time_beg) \\/ 1000.0);\\n\\t\\t}\\n\\n\\t\\ts.out.close();\\n\\t}\\n}\\n\\n\\nfinal class Solver {\\n\\tInputReader in;\\n\\tOutputWriter out;\\n\\tDebugWriter dout;\\n\\n\\tpublic void solve() {\\n\\t\\tint n = in.readInt();\\n\\t\\tint k = in.readInt();\\n\\n\\n\\t\\tTreeSet q = new TreeSet();\\n\\t\\tint[] mas = new int[n];\\n\\t\\tfor (int i = 0; i... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class TaskA {\\n\\n public static void main(String[] args) throws Exception {\\n Scanner scanner = new Scanner(System.in);\\n int n = scanner.nextInt();\\n scanner.nextLine();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = scanner.nextInt();\\n }\\n\\n Arrays.sort(a);\\n\\n int sum = 0;\\n for (int i = 0; i < n; i++) {\\n sum += a[i];\\n }\\n\\n int take = 0, num = 0;\\n\\n for (int i = n - 1; i > -1; i--) {\\n num++;\\n take += a[i];\\n sum -= a[i];\\n if (take > sum) {\\n break;\\n }\\n }\\n\\n System.out.println(num);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.util.Map.Entry;\\nimport java.io.*;\\npublic class Main {\\n\\tpublic static class node implements Comparable {\\n\\t\\tint l,r;\\n\\t\\tnode(){}\\n\\t\\tnode(int l,int r) {\\n\\t\\t\\tthis.l=l;\\n\\t\\t\\tthis.r=r;\\n\\t\\t}\\n\\t\\t@Override\\n\\t\\tpublic int compareTo(node rhs) {\\n\\t\\t\\treturn r-rhs.r;\\n\\t\\t}\\n\\t}\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader in=new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter out=new PrintWriter(System.out);\\n\\t\\tStringTokenizer sa=new StringTokenizer(in.readLine());\\n\\t\\tint n=Integer.parseInt(sa.nextToken());\\n\\t\\tsa=new StringTokenizer(in.readLine());\\n\\t\\tint[] a=new int[n];\\n\\t\\tTreeMap> mp=new TreeMap();\\n\\t\\tfor (int i=0;i t=mp.get(tmp);\\n\\t\\t\\t\\t\\tint left=0,right=t.size()-1,res=t.size();\\n\\t\\t\\t\\t\\twhile (left<=right) {\\n\\t\\t\\t\\t\\t\\tint mid=(left+right)>>1;\\n\\t\\t\\t\\t\\t\\tif (t.get(mid).r>=i) {\\n\\t\\t\\t\\t\\t\\t\\tres=mid;\\n\\t\\t\\t\\t\\t\\t\\tright=mid-1;\\n\\t\\t\\t\\t\\t\\t} else left=mid+1;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif (res==t.size()) t.add(new node(i,j));\\n\\t\\t\\t\\t\\telse if (t.get(res).r>j) t.set(res,new node(i,j));\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint res=0;\\n\\t\\tfor (Entry> entry:mp.entrySet())\\n\\t\\t\\tres=Math.max(res,entry.getValue().size());\\n\\t\\tout.println(res);\\n\\t\\tfor (Entry> entry:mp.entrySet())\\n\\t\\t\\tif (entry.getValue().size()==res) {\\n\\t\\t\\t\\tArrayList tmp=entry.getValue();\\n\\t\\t\\t\\tfor (int i=0;i 0) {\\n\\t\\t\\tint a = nxtInt();\\n\\t\\t\\tint b = nxtInt();\\n\\t\\t\\tint ans = 0;\\n\\t\\t\\twhile (a != b) {\\n\\t\\t\\t\\tif (a == 0 || b == 0)\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tif (a > b) {\\n\\t\\t\\t\\t\\tint div = a \\/ b;\\n\\t\\t\\t\\t\\ta -= b * div;\\n\\t\\t\\t\\t\\tans += div;\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tint div = b \\/ a;\\n\\t\\t\\t\\t\\tb -= a * div;\\n\\t\\t\\t\\t\\tans += div;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tout.println(ans + (a == b ? 1 : 0));\\n\\t\\t}\\n\\t\\tbr.close();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tstatic BufferedReader br = new BufferedReader(new InputStreamReader(\\n\\t\\t\\tSystem.in));\\n\\n\\tstatic StringTokenizer sc;\\n\\n\\tstatic String nxtTok() throws IOException {\\n\\t\\twhile (!sc.hasMoreTokens()) {\\n\\t\\t\\tString s = br.readLine();\\n\\t\\t\\tif (s == null)\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\tsc = new StringTokenizer(s.trim());\\n\\t\\t}\\n\\t\\treturn sc.nextToken();\\n\\t}\\n\\n\\tstatic int nxtInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nxtTok());\\n\\t}\\n\\n\\tstatic long nxtLng() throws IOException {\\n\\t\\treturn Long.parseLong(nxtTok());\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.HashMap;\\nimport java.util.PriorityQueue;\\nimport java.util.StringTokenizer;\\nimport java.io.*;\\n \\npublic class ExplorerSpace {\\n\\t\\n\\tprivate static class MyScanner {\\n\\t BufferedReader br;\\n\\t StringTokenizer st;\\n\\n\\t public MyScanner() {\\n\\t br = new BufferedReader(new InputStreamReader(System.in));\\n\\t }\\n\\n\\t String next() {\\n\\t while (st == null || !st.hasMoreElements()) {\\n\\t try {\\n\\t st = new StringTokenizer(br.readLine());\\n\\t } catch (IOException e) {\\n\\t e.printStackTrace();\\n\\t }\\n\\t }\\n\\t return st.nextToken();\\n\\t }\\n\\n\\t int nextInt() {\\n\\t return Integer.parseInt(next());\\n\\t }\\n\\n\\t long nextLong() {\\n\\t return Long.parseLong(next());\\n\\t }\\n\\n\\t double nextDouble() {\\n\\t return Double.parseDouble(next());\\n\\t }\\n\\n\\t String nextLine(){\\n\\t String str = \\\"\\\";\\n\\t\\t try {\\n\\t\\t str = br.readLine();\\n\\t\\t } catch (IOException e) {\\n\\t\\t e.printStackTrace();\\n\\t\\t }\\n\\t\\t return str;\\n\\t }\\n\\n\\t }\\n\\t\\n \\n\\tpublic static long[][][] dp; \\n\\t\\n\\tpublic static boolean valid(int i, int j, int n, int m)\\n\\t{\\n\\t\\treturn i>=0 && i=0 && j 0 && a[i] != a[i-1]){\\n\\t\\t\\t\\tp++;\\n\\t\\t\\t}\\n\\t\\t\\tf[p]++;\\n\\t\\t}\\n\\t\\tf = Arrays.copyOf(f, p+1);\\n\\t\\tint mod = 1000000007;\\n\\t\\t\\n\\t\\tint[][] fif = enumFIF(1000, mod);\\n\\t\\tlong[] res = countSameNeighborsSequence(f, fif, mod);\\n\\t\\tlong ans = res[0];\\n\\t\\tfor(int v : f){\\n\\t\\t\\tans = ans * fif[0][v] % mod;\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.println(ans);\\n\\t}\\n\\t\\n\\tpublic static int[][] enumFIF(int n, int mod) {\\n\\t\\tint[] f = new int[n + 1];\\n\\t\\tint[] invf = new int[n + 1];\\n\\t\\tf[0] = 1;\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tf[i] = (int) ((long) f[i - 1] * i % mod);\\n\\t\\t}\\n\\t\\tlong a = f[n];\\n\\t\\tlong b = mod;\\n\\t\\tlong p = 1, q = 0;\\n\\t\\twhile (b > 0) {\\n\\t\\t\\tlong c = a \\/ b;\\n\\t\\t\\tlong d;\\n\\t\\t\\td = a;\\n\\t\\t\\ta = b;\\n\\t\\t\\tb = d % b;\\n\\t\\t\\td = p;\\n\\t\\t\\tp = q;\\n\\t\\t\\tq = d - c * q;\\n\\t\\t}\\n\\t\\tinvf[n] = (int) (p < 0 ? p + mod : p);\\n\\t\\tfor (int i = n - 1; i >= 0; i--) {\\n\\t\\t\\tinvf[i] = (int) ((long) invf[i + 1] * (i + 1) % mod);\\n\\t\\t}\\n\\t\\treturn new int[][] { f, invf };\\n\\t}\\n\\n\\t\\n\\tpublic static long[] countSameNeighborsSequence(int[] a, int[][] fif, int mod)\\n\\t{\\n\\t\\tint n = a.length;\\n\\t\\t\\n\\t\\tint bef = a[0];\\n\\t\\tint aft = a[0];\\n\\t\\tlong[] dp = new long[bef];\\n\\t\\tdp[bef-1] = 1;\\n\\t\\tfor(int u = 1;u < n;u++){\\n\\t\\t\\tint v = a[u];\\n\\t\\t\\taft += v;\\n\\t\\t\\tlong[][] ldp = new long[bef][aft];\\n\\t\\t\\tfor(int i = 0;i < dp.length;i++){\\n\\t\\t\\t\\tldp[i][0] = dp[i];\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tfor(int i = 0;i < v;i++){\\n\\t\\t\\t\\tlong[][] ndp = new long[bef][aft];\\n\\t\\t\\t\\tfor(int j = 0;j < bef;j++){\\n\\t\\t\\t\\t\\tfor(int k = 0;j+k < aft;k++){\\n\\t\\t\\t\\t\\t\\tif(ldp[j][k] == 0)continue;\\n\\t\\t\\t\\t\\t\\t\\/\\/ XX -> XCX\\n\\t\\t\\t\\t\\t\\tif(j > 0){\\n\\t\\t\\t\\t\\t\\t\\tndp[j-1][k] += ldp[j][k] *... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Random;\\nimport java.util.StringTokenizer;\\n\\npublic class c {\\n class IO {\\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(System.out);\\n StringTokenizer st;\\n Random rnd = new Random();;\\n String nextToken() throws IOException {\\n while (st == null || !st.hasMoreTokens()) {\\n String line = in.readLine();\\n if (line == null)\\n return null;\\n st = new StringTokenizer(line);\\n }\\n return st.nextToken();\\n }\\n int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n double nextDouble() throws IOException {\\n return Double.parseDouble(nextToken());\\n }\\n }\\n \\n void run() throws IOException{\\n IO read=new IO();\\n int n=read.nextInt();\\n int a[]=new int[n],b[]=new int[n];\\n for(int i=0;iu) {\\n\\t\\t\\t\\tout.println(a[i]);\\n\\t\\t\\t\\tout.flush();\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\tout.println(\\\"NO\\\");\\n\\t\\tout.flush();\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.lang.*;\\nimport static java.lang.Math.*;\\n\\n\\/\\/ _ h _ r _ t r _\\n\\/\\/ _ t _ t _ s t _\\n\\n\\n\\n\\npublic class TaskA implements Runnable {\\n long m = (int)1e9+7;\\n PrintWriter w;\\n InputReader c;\\n final int MAXN = (int)1e6 + 100;\\n public void run() {\\n c = new InputReader(System.in);\\n w = new PrintWriter(System.out);\\n\\n int n = c.nextInt(), hamming_distance = 0;\\n char[] s = c.next().toCharArray(), t = c.next().toCharArray();\\n HashMap> replace = new HashMap<>();\\n HashMap map = new HashMap<>();\\n\\n for(int i=0;i temp;\\n if(replace.containsKey(s[i])){\\n temp = replace.get(s[i]);\\n temp.add(t[i]);\\n } else {\\n temp = new HashSet<>();\\n temp.add(t[i]);\\n }\\n map.put(s[i],i);\\n replace.put(s[i], temp);\\n hamming_distance++;\\n }\\n\\n int l = -1, r = -1;\\n boolean global_check = false;\\n for(int i=0;i indices = replace.get(t[i]);\\n int ind = map.get(t[i]);\\n l = i + 1;\\n r = ind + 1;\\n if (indices.contains(s[i])) {\\n hamming_distance -= 2;\\n global_check = true;\\n break;\\n }\\n }\\n if(global_check) break;\\n }\\n\\n if(!global_check && l!=-1) hamming_distance--;\\n else if(global_check){\\n for(int i=0;i map = new HashMap<>();\\n for (int i = 0; i < n; i++) {\\n String ch = in.next();\\n if (map.containsKey(ch)) {\\n map.put(ch, map.get(ch) + 1);\\n } else {\\n map.put(ch, 1);\\n }\\n }\\n int s = n;\\n for (int i = 0; i < n; i++) {\\n String ch = in.next();\\n if (map.containsKey(ch)) {\\n if (map.get(ch) == 1) {\\n map.remove(ch);\\n } else {\\n map.put(ch, map.get(ch) - 1);\\n }\\n s--;\\n }\\n }\\n out.println(s);\\n }\\n\\n }\\n\\n static class FastScanner {\\n private BufferedReader br;\\n private StringTokenizer st;\\n\\n public FastScanner(InputStream inputStream) {\\n br = new BufferedReader(new InputStreamReader(inputStream));\\n }\\n\\n public String next() {\\n while (st == null || !st.hasMoreElements())... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\npublic class LuckyDivision {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n \\n int n = in.nextInt();\\n \\n if( n % 4==0 ||\\n n % 7==0 ||\\n n % 47==0 ||\\n n % 74==0 ||\\n n % 447==0 ||\\n n % 474==0 ||\\n n % 477==0 ||\\n n % 744==0 ||\\n n % 774==0 ||\\n n % 777==0\\n )\\n System.out.println(\\\"YES\\\");\\n else\\n System.out.println(\\\"NO\\\");\\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class LectureSleep {\\n\\n static class InputReader {\\n BufferedReader reader;\\n StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\\n tokenizer = null;\\n }\\n\\n String next() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n try {\\n tokenizer = new StringTokenizer(reader.readLine());\\n } catch (IOException e) {\\n throw new RuntimeException(e);\\n }\\n }\\n return tokenizer.nextToken();\\n }\\n\\n public int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n public long nextLong() {\\n return Long.parseLong(next());\\n }\\n\\n public double nextDouble() {\\n return Double.parseDouble(next());\\n }\\n\\n public float nextFloat() {\\n return Float.parseFloat(next());\\n }\\n\\n }\\n\\n static InputReader r = new InputReader(System.in);\\n static PrintWriter pw = new PrintWriter(System.out);\\n\\n\\n public static void main(String[] args) {\\n int n = r.nextInt(); \\/\\/ duration of lecture\\n int k = r.nextInt(); \\/\\/ number of minutes keep mishka awake\\n int[] theorems = new int[n+1];\\n for(int i = 1; i <= n; i++){\\n theorems[i] = r.nextInt();\\n }\\n int[] mishka = new int[n+1];\\n for(int i = 1; i <= n; i++){\\n mishka[i] = r.nextInt();\\n }\\n int[] sums = new int[n+1];\\n for(int i = 1; i <= n; i++){\\n if(mishka[i] == 0){\\n sums[i] = sums[i-1] + theorems[i];\\n } else{\\n sums[i] = sums[i-1];\\n }\\n }\\n int max = 0;\\n for(int i = 1; i <= n-k+1; i++){\\n int sum = sums[i+k-1] - sums[i-1];\\n max = Math.max(max, sum);\\n }\\n int totalSum = 0;\\n for(int i = 1; i <= n;... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.Arrays;\\nimport java.util.Scanner;\\n\\npublic class A {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n int n = in.nextInt();\\n int m = in.nextInt();\\n int k = in.nextInt();\\n int[] A = new int[n];\\n for (int i = 0; i < n; i++)\\n A[i] = in.nextInt();\\n Arrays.sort(A);\\n int cnt = 0;\\n for (int i = n - 1; i >= 0; i--) {\\n if (k >= m) {\\n System.out.println(cnt);\\n return;\\n }\\n cnt++;\\n k += A[i] - 1;\\n }\\n if (k >= m)\\n System.out.println(cnt);\\n else\\n System.out.println(-1);\\n }\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.StringTokenizer;\\n\\npublic class C {\\n\\n\\tprivate static double r, EPS=1e-10;\\n\\t\\n\\tpublic static void solve(FastScanner fs) {\\t\\n\\t\\tint n=fs.nextInt();\\n\\t\\tr=fs.nextInt();\\n\\t\\tint[] xCoords=fs.readArray(n);\\n\\t\\t\\n\\t\\tArrayList placed=new ArrayList<>();\\n\\t\\tfor (int x:xCoords) {\\n\\t\\t\\tdouble maxY=r;\\n\\t\\t\\tfor (Point p:placed)\\n\\t\\t\\t\\tmaxY=Math.max(maxY, getNewY(p, x));\\n\\t\\t\\tplaced.add(new Point(x, maxY));\\n\\t\\t}\\n\\t\\tfor (Point p:placed) {\\n\\t\\t\\tSystem.out.printf(\\\"%.9f \\\", p.y);\\n\\t\\t}\\n\\t\\t\\n\\t}\\n\\t\\n\\tprivate static double getNewY(Point circleCenter, int x) {\\n\\t\\tdouble dx=Math.abs(x-circleCenter.x);\\n\\t\\tif (dx>r+r)\\n\\t\\t\\treturn 0;\\n\\t\\tif (dx= w) {\\n if (w*w >= 2*a*d) {\\n double x = Math.sqrt(2*a*d);\\n totalTime = x \\/ a;\\n if ((v*v-x*x) >= 2*a*(l-d))\\n totalTime += (-2*x+Math.sqrt(4*x*x+8*a*(l-d))) \\/ (2*a);\\n else\\n totalTime += (v-x)\\/(1.0*a) + (l-d-(v*v-x*x)\\/(2.0*a))\\/v;\\n } else {\\n\\/\\/ totalTime = (-2*w+Math.sqrt(4*w*w+8*a*(l-d))) \\/ (2*a);\\n if (2*v*v-w*w <= 2*a*d) {\\n totalTime = v \\/ (1.0*a) + (v-w) \\/ (1.0*a) + (d-(2*v*v-w*w)\\/(2.0*a)) \\/ v;\\n } else {\\n double x = Math.sqrt((2*a*d+w*w)\\/2.0);\\n totalTime = x \\/ a + (x-w) \\/ a;\\n }\\n if ((v*v-w*w) >= 2*a*(l-d))\\n totalTime += (-2*w+Math.sqrt(4*w*w+8*a*(l-d))) \\/ (2*a);\\n else\\n totalTime += (v-w)\\/(1.0*a) + (l-d-(v*v-w*w)\\/(2.0*a))\\/v;\\n }\\n } else {\\n if (v*v >= 2*a*l)\\n totalTime = Math.sqrt(l*2.0\\/a);\\n else\\n totalTime = v \\/ (1.0*a) + (l-v*v\\/(2.0*a)) \\/ v;\\n }\\n\\n out.printf(\\\"%.10f\\\", totalTime);\\n out.flush();\\n }\\n\\n void solve() throws IOException {\\n\\n }\\n\\n static class Reader {\\n BufferedReader reader;\\n StringTokenizer tokenizer;\\n\\n public Reader(InputStream input) {\\n reader = new BufferedReader(new... What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n \\n\\npublic class Main {\\n\\t\\n\\tpublic static void main(String[] args) throws java.lang.Exception {\\n\\t\\tBufferedReader kek = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\/\\/Scanner skek = new Scanner(System.in);\\n\\t\\tPrintWriter outkek = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tString[] input = kek.readLine().split(\\\" \\\");\\n\\t\\tint N = Integer.parseInt(input[0]), M = Integer.parseInt(input[1]);\\n\\t\\tboolean[][] connected = new boolean[N + 1][N];\\n\\t\\tlong[][] walks = new long[1 << N][N];\\n\\t\\tlong res = 0;\\n\\t\\t\\n\\t\\tfor(int i = 0; i < M; i++){\\n\\t\\t\\tinput = kek.readLine().split(\\\" \\\");\\n\\t\\t\\tint A = Integer.parseInt(input[0]) - 1, B = Integer.parseInt(input[1]) - 1;\\n\\t\\t\\tconnected[A][B] = connected[B][A] = true;\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int i = 0; i < N; i++){\\n\\t\\t\\twalks[1 << i][i] = 1;\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int i = 1; i < 1 << N; i++){\\n\\t\\t\\tint temp = (int) (Math.log(i & -(i)) \\/ 0.6931471805599453);\\n\\t\\t\\tfor(int j = 0; j < N; j++){\\n\\t\\t\\t\\tif(((1 << j) & i) > 0 && j != temp){\\n\\t\\t\\t\\t\\tfor(int k = 0; k < N; k++){\\n\\t\\t\\t\\t\\t\\tif(connected[k][j]){\\n\\t\\t\\t\\t\\t\\t\\twalks[i][j] += walks[i ^ (1 << j)][k];\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tint count = 0, track = i;\\n\\t\\t\\t\\t\\twhile(track > 0){\\n\\t\\t\\t\\t\\t\\tif(track % 2 == 1){\\n\\t\\t\\t\\t\\t\\t\\tcount++;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\ttrack \\/= 2;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tif(count >= 3 && connected[temp][j]){\\n\\t\\t\\t\\t\\t\\tres += walks[i][j];\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\toutkek.println(res \\/ 2);\\n\\t\\tkek.close();\\n\\t\\toutkek.close();\\n\\t}\\t\\n\\t\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class cf2 {\\n\\tstatic final double EPS = 1e-9;\\n\\n public static void main(String[] args) throws IOException {\\n\\t Scanner sc = new Scanner(System.in);\\n\\t\\n\\t \\/\\/rec\\n\\t int xr1=sc.nextInt(), yr1=sc.nextInt(), xr2=sc.nextInt(),yr2=sc.nextInt();\\n\\t int xr3=sc.nextInt(), yr3=sc.nextInt(), xr4=sc.nextInt(),yr4=sc.nextInt();\\n\\t\\n\\t Point pr1 = new Point(xr1, yr1);\\n\\t Point pr2 = new Point(xr2, yr2);\\n\\t Point pr3 = new Point(xr3, yr3);\\n\\t Point pr4 = new Point(xr4, yr4);\\n\\t \\n\\t LineSegment lr1 = new LineSegment(pr1, pr2);\\n\\t LineSegment lr2 = new LineSegment(pr2, pr3);\\n\\t LineSegment lr3 = new LineSegment(pr3, pr4);\\n\\t LineSegment lr4 = new LineSegment(pr4, pr1);\\n\\t \\n\\t \\/\\/diamond\\n\\t int xd1=sc.nextInt(), yd1=sc.nextInt(), xd2=sc.nextInt(),yd2=sc.nextInt();\\n\\t int xd3=sc.nextInt(), yd3=sc.nextInt(), xd4=sc.nextInt(),yd4=sc.nextInt();\\n\\t \\n\\t Point p1 = new Point(xd1, yd1);\\n\\t Point p2 = new Point(xd2, yd2);\\n\\t Point p3 = new Point(xd3, yd3);\\n\\t Point p4 = new Point(xd4, yd4);\\n\\t \\n\\t Point [] pt = new Point [5];\\n\\t pt[0]=p1; pt[1]=p2; pt[2]=p3; pt[3]=p4; pt[4]=p1;\\n\\t Polygon pg = new Polygon(pt);\\n\\t \\n\\t if(pg.inside(pr1)||pg.inside(pr2)||pg.inside(pr3)||pg.inside(pr4)) {\\n\\t\\t System.out.println(\\\"YES\\\");\\n\\t\\t return;\\n\\t }\\n\\t\\n\\t \\n\\t LineSegment ld1 = new LineSegment(p1, p2);\\n\\t LineSegment ld2 = new LineSegment(p2, p3);\\n\\t LineSegment ld3 = new LineSegment(p3, p4);\\n\\t LineSegment ld4 = new LineSegment(p4, p1);\\n\\t \\n\\t Rectangle rec = new Rectangle(new Point(Math.min(Math.min(xr3,xr4),Math.min(xr1,xr2)), Math.min(Math.min(yr3,yr4),Math.min(yr1,yr2))), \\n\\t\\t\\t new Point(Math.max(Math.max(xr3,xr4),Math.max(xr1,xr2)), Math.max(Math.max(yr3,yr4),Math.max(yr1,yr2))) );\\n\\t \\n\\t if(rec.contains(p1)||rec.contains(p2)||rec.contains(p3)||rec.contains(p4)) {\\n\\t\\t System.out.println(\\\"YES\\\");\\n\\t return;\\n\\t }\\n\\t \\n\\t... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\/*\\n * To change this template, choose Tools | Templates\\n * and open the template in the editor.\\n *\\/\\n\\/**\\n *\\n * @author pttrung\\n *\\/\\npublic class B {\\n\\n static Senator[] data;\\n\\n public static void main(String[] args) {\\n Scanner in = new Scanner(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(System.out);\\n int n = in.nextInt();\\n int k = in.nextInt();\\n int A = in.nextInt();\\n data = new Senator[n];\\n for (int i = 0; i < n; i++) {\\n data[i] = new Senator(in.nextInt(), in.nextInt());\\n }\\n out.println(cal(0, new int[n], A, k));\\n\\n out.close();\\n }\\n\\n public static double cal(int index, int[] num, int A, int left) {\\n if (index == data.length - 1) {\\n int dif = (100 - data[index].loyal)\\/10;\\n dif = left >= dif? dif:left;\\n num[index] = dif;\\n \\n double result = 0;\\n for (int k = 0; k < (1 << num.length); k++) {\\n double val = 1;\\n double total = 0;\\n for (int i = 0; i < num.length; i++) {\\n if (((1 << i) & k) != 0) {\\n val *= ((double)(data[i].loyal + 10*num[i])\\/100);\\n } else {\\n val *= ((double)(100 - (data[i].loyal + 10*num[i]))\\/100);\\n total += data[i].level;\\n }\\n }\\n if (countBit(k) > num.length \\/ 2) {\\n result += val;\\n } else {\\n result += val * ((double) A \\/ (A + total));\\n }\\n }\\n\\/\\/ \\/\\/ if(result >= 1){\\n\\/\\/ for(int i : num){\\n\\/\\/ System.out.print(i + \\\" \\\");\\n\\/\\/ }\\n\\/\\/ System.out.println(\\\"\\\\n\\\" + result);\\n\\/\\/ \\/\\/}\\n return result;\\n } else {\\n double result = 0;\\n ... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.HashSet;\\nimport java.util.Set;\\n\\npublic class ProblemA {\\n\\n public static void main(String[] args) throws IOException {\\n BufferedReader s = new BufferedReader(new InputStreamReader(System.in));\\n String[] data = s.readLine().split(\\\" \\\");\\n int n = Integer.valueOf(data[0]);\\n int a = Integer.valueOf(data[1]);\\n int b = Integer.valueOf(data[2]);\\n\\n long[] h = new long[n];\\n String[] line = s.readLine().split(\\\" \\\");\\n for (int i = 0 ; i < n ; i++) {\\n h[i] = Integer.valueOf(line[i]);\\n }\\n Arrays.sort(h);\\n \\n System.out.println(h[b] - h[b-1]);\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.BigDecimal;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.awt.Point;\\n\\npublic class CodeForces {\\n static boolean ONLINE_JUDGE = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n private final long MOD = 1000000009;\\n\\n long power(long a, long b)\\n {\\n long res = 1;\\n while (b > 0) {\\n if ((b & 1) == 1) {\\n res *= a;\\n if (res >= MOD)\\n res %= MOD;\\n }\\n a *= a;\\n if (a >= MOD)\\n a %= MOD;\\n b >>= 1;\\n }\\n return res;\\n }\\n\\n void runCase(int caseNum) throws IOException {\\n long n = nextLong();\\n long m = nextLong();\\n long k = nextLong();\\n\\n if (n - m >= n \\/ k) {\\n System.out.println(m);\\n return;\\n }\\n long res = 0;\\n long rem = (k - 1) * (n - m);\\n m -= rem;\\n long bound = m \\/ k;\\n res = (power(2, bound + 1) + MOD - 2) % MOD;\\n res *= k;\\n res %= MOD;\\n\\/\\/ for (long i = 0; i < bound; ++i) {\\n\\/\\/ res += k;\\n\\/\\/ res <<= 1;\\n\\/\\/ if (res >= MOD)\\n\\/\\/ res %= MOD;\\n\\/\\/ }\\n res += rem;\\n res += m % k;\\n res %= MOD;\\n System.out.println(res);\\n }\\n\\n\\n public static void main(String[] args) throws IOException {\\n if (ONLINE_JUDGE){\\n System.out.println();\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n }else{\\n in = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(System.out);\\n \\/\\/out = new PrintWriter(\\\"output.txt\\\");\\n }\\n new CodeForces().runIt();\\n out.flush();\\n out.close();\\n return;\\n }\\n\\n static BufferedReader in;\\n private StringTokenizer st;\\n static PrintWriter out;\\n\\n static int pos;\\n static String curInput = \\\"\\\";\\n\\n String next() throws IOException {\\n while... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.StringTokenizer;\\n\\npublic class TaskB {\\n\\n void run() {\\n FastReader in = new FastReader(System.in);\\n\\/\\/ FastReader in = new FastReader(new FileInputStream(\\\"input.txt\\\"));\\n PrintWriter out = new PrintWriter(System.out);\\n\\/\\/ PrintWriter out = new PrintWriter(new FileOutputStream(\\\"output.txt\\\"));\\n\\n\\n long n = in.nextLong();\\n long k = in.nextLong();\\n\\n long a = 1;\\n long b = -(2 * n + 3);\\n long c = n * n + n - 2 * k;\\n\\n long d = b * b - 4 * a * c;\\n long ans1 = (-b + (long) Math.sqrt(d)) \\/ 2;\\n long ans2 = (-b - (long) Math.sqrt(d)) \\/ 2;\\n\\n if (ans1 >= 0 && ans1 <= n) {\\n out.println(ans1);\\n } else {\\n out.println(ans2);\\n }\\n\\n\\n out.close();\\n }\\n\\n class FastReader {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n FastReader(InputStream is) {\\n br = new BufferedReader(new InputStreamReader(is));\\n }\\n\\n Integer nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n Long nextLong() {\\n return Long.parseLong(next());\\n }\\n\\n Double nextDouble() {\\n return Double.parseDouble(next());\\n }\\n\\n String next() {\\n while (st == null || !st.hasMoreTokens())\\n st = new StringTokenizer(nextLine());\\n\\n return st.nextToken();\\n }\\n\\n String nextLine() {\\n String s = \\\"\\\";\\n try {\\n s = br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return s;\\n }\\n }\\n\\n\\n public static void main(String[] args) {\\n new TaskB().run();\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.InputStream;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.util.LinkedList;\\n\\npublic class D {\\n static LinkedList[] E;\\n static int[] M;\\n static boolean[] visited;\\n static int n;\\n static int center;\\n\\n public static boolean match(int x) {\\n if (visited[x])\\n return false;\\n visited[x] = true;\\n for (int y : E[x])\\n if (y != center && (M[y] == -1 || match(M[y]))) {\\n M[y] = x;\\n return true;\\n }\\n return false;\\n }\\n\\n public static int maxMatch() {\\n int res = 0;\\n Arrays.fill(M, -1);\\n for (int i = 0; i < n; i++) {\\n Arrays.fill(visited, false);\\n if (i != center && match(i))\\n res++;\\n }\\n return res;\\n }\\n\\n public static void main(String[] args) {\\n InputReader in = new InputReader(System.in);\\n n = in.readInt();\\n int m = in.readInt();\\n E = new LinkedList[n];\\n M = new int[n];\\n boolean[][] C = new boolean[n][n];\\n visited = new boolean[n];\\n for (int i = 0; i < n; i++)\\n E[i] = new LinkedList();\\n for (int i = 0; i < m; i++) {\\n int x = in.readInt() - 1;\\n int y = in.readInt() - 1;\\n C[x][y] = true;\\n E[x].add(y);\\n }\\n int min = Integer.MAX_VALUE;\\n for (int i = 0; i < n; i++) {\\n int res = 0;\\n int all = 0;\\n for (int j = 0; j < n; j++)\\n if (j != i) {\\n all += E[j].size();\\n if (!C[i][j])\\n res++;\\n if (!C[j][i])\\n res++;\\n else\\n all--;\\n }\\n if (!C[i][i])\\n res++;\\n center = i;\\n int match = maxMatch();\\n res += (all - match) + (n - match - 1);\\n min = Math.min(min,... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n \\n \\npublic class Main {\\n \\n \\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tBufferedReader jk = new BufferedReader(new InputStreamReader( System.in)) ; \\n\\t\\tPrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)) ; \\n\\t\\tStringTokenizer ana = new StringTokenizer(jk.readLine()) ;\\n\\t\\tint n = Integer.parseInt(ana.nextToken()) ; \\n\\t\\t\\n\\t\\tint t[]= new int[101] ; \\n\\t\\tArrayList v = new ArrayList<>() ; \\n\\t\\tana = new StringTokenizer(jk.readLine()) ;\\n\\t\\tfor(int i=0 ; i= 0; i--) {\\n\\t\\t\\tiFact[i] = iFact[i + 1] * (i + 1) % MOD;\\n\\t\\t}\\n\\n\\t\\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\t\\tint len = Integer.parseInt(reader.readLine());\\n\\t\\tlong[] groups = new long[len + 1];\\n\\t\\tint[] gSizes = new int[len + 1];\\n\\t\\tint nG = 0;\\n\\n\\t\\tStringTokenizer inputData = new StringTokenizer(reader.readLine());\\n\\t\\tiLoop:\\n\\t\\tfor (int i = 0; i < len; i++) {\\n\\t\\t\\tlong nxt = Integer.parseInt(inputData.nextToken());\\n\\t\\t\\tfor (int j = 1; j <= nG; j++) {\\n\\t\\t\\t\\tif (isSquare(nxt * groups[j])) {\\n\\t\\t\\t\\t\\tgSizes[j]++;\\n\\t\\t\\t\\t\\tcontinue iLoop;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tgroups[++nG] = nxt;\\n\\t\\t\\tgSizes[nG] = 1;\\n\\t\\t}\\n\\n\\t\\tlong[][] dp = new long[nG + 1][len];\\n\\n\\t\\tdp[0][0] = 1;\\n\\n\\t\\tint fTotal = 0;\\n\\t\\tfor (int fG = 0; fG < nG; fG++) {\\n\\t\\t\\tfor (int fB = 0; fB < len; fB++) {\\n\\t\\t\\t\\tif (dp[fG][fB] == 0) {\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tint nGSize = gSizes[fG + 1];\\n\\t\\t\\t\\tfor (int nS = 1; nS <= Math.min(nGSize, fTotal + 1); nS++) {\\n\\t\\t\\t\\t\\tfor (int nBR = 0; nBR <= Math.min(fB, nS); nBR++) {\\n\\t\\t\\t\\t\\t\\tlong nW = dp[fG][fB] * fact[nGSize] % MOD * comb(nGSize - 1, nS - 1) % MOD * comb(fB, nBR) % MOD\\n\\t\\t\\t\\t\\t\\t\\t\\t* comb(fTotal + 1 - fB, nS - nBR) % MOD;\\n\\t\\t\\t\\t\\t\\tdp[fG + 1][fB - nBR + nGSize - nS] = (dp[fG + 1][fB - nBR + nGSize - nS] + nW) % MOD;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tfTotal += gSizes[fG + 1];\\n\\t\\t}\\n\\t\\tprinter.println(dp[nG][0]);\\n\\t\\tprinter.close();\\n\\t}\\n\\n\\tstatic long comb(int a, int b)... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Iterator;\\nimport java.io.BufferedWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.NoSuchElementException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Egor Kulikov (egor@egork.net)\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskE2 solver = new TaskE2();\\n int testCount = Integer.parseInt(in.next());\\n for (int i = 1; i <= testCount; i++) {\\n solver.solve(i, in, out);\\n }\\n out.close();\\n }\\n\\n static class TaskE2 {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.readInt();\\n int m = in.readInt();\\n int[][] a = in.readIntTable(n, m);\\n int[][] id = new int[n + 1][1 << n];\\n int[][] val = new int[n + 1][1 << n];\\n ArrayUtils.fill(id, m);\\n int[] sum = new int[1 << n];\\n int[] low = new int[1 << n];\\n boolean[] base = new boolean[1 << n];\\n int[] vv = new int[1 << n];\\n for (int i = 1; i < (1 << n); i++) {\\n low[i] = Integer.bitCount(Integer.lowestOneBit(i) - 1);\\n int current = i;\\n base[i] = true;\\n vv[i] = i;\\n for (int j = 0; j < n; j++) {\\n current = current << 1;\\n current += current >> n;\\n current -= (current >> n) << n;\\n if (current < i) {\\n base[i] = false;\\n ... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.HashMap;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.List;\\nimport java.util.StringTokenizer;\\nimport java.util.Map;\\nimport java.math.BigInteger;\\nimport java.io.BufferedReader;\\nimport java.util.Collections;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author darkhan imangaliyev\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n MyReader in = new MyReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskD solver = new TaskD();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskD {\\n public void solve(int testNumber, MyReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; ++i) {\\n a[i] = in.nextInt();\\n }\\n Map map = new HashMap<>();\\n for (int i = 0; i < n; ++i) {\\n if (map.containsKey(a[i])) {\\n map.put(a[i], map.get(a[i]) + 1);\\n } else {\\n map.put(a[i], 1);\\n }\\n }\\n List compressed = new ArrayList<>();\\n compressed.add(-1);\\n compressed.add(Integer.MAX_VALUE);\\n compressed.addAll(map.keySet());\\n Collections.sort(compressed);\\n \\/\\/ System.out.println(compressed);\\n int N = compressed.size() + 10;\\n BIT count = new BIT(N);\\n BIT sum = new BIT(N);\\n\\n BigInteger ret = BigInteger.ZERO;\\n for (int i = n - 1; i >= 0; --i) {\\n int l = findLeft(compressed, a[i] - 2);\\n int r = findRight(compressed, a[i] +... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\npublic class A {\\n public static void main(String[]args) {\\n Scanner in = new Scanner(System.in);\\n long l = in.nextLong();\\n long r = in.nextLong();\\n if(r - l < 2) System.out.println(-1);\\n else {\\n if(l % 2 == 0)\\n System.out.println(l + \\\" \\\" + (l+1) + \\\" \\\" + (l+2));\\n else {\\n if(r - l < 3) System.out.println(-1);\\n else\\n System.out.println((l+1) + \\\" \\\" + (l+2) + \\\" \\\" + (l+3));\\n }\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.HashSet;\\nimport java.util.Iterator;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\nimport java.util.TreeSet;\\n\\npublic class Main {\\n\\n FastScanner in = new FastScanner(System.in);\\n\\/\\/ FastScanner in = new FastScanner(new File(\\\"test.txt\\\"));\\n \\n PrintWriter out = new PrintWriter(System.out);\\n\\n public static void main (String[]args) {\\n Main task = new Main();\\n task.solve();\\n task.close();\\n }\\n\\n public void close () {\\n in.close();\\n out.close();\\n }\\n \\n public void solve() {\\n int n = in.nextInt();\\n int k = in.nextInt();\\n \\n Team[]teams = new Team[n];\\n \\n for (int i = 0; i < n; i++) {\\n Team t = new Team();\\n t.tasks = in.nextInt();\\n t.penalty = in.nextInt();\\n teams[i] = t;\\n }\\n \\n Arrays.sort(teams);\\n \\n Team t = teams[k - 1];\\n int ans = 0;\\n for (int i = 0; i < teams.length; i++) {\\n if (teams[i].equals(t)) ans++;\\n }\\n \\n System.out.println(ans);\\n \\n \\n }\\n class Team implements Comparable{\\n int tasks;\\n int penalty;\\n @Override\\n public int hashCode() {\\n final int prime = 31;\\n int result = 1;\\n result = prime * result + getOuterType().hashCode();\\n result = prime * result + penalty;\\n result = prime * result + tasks;\\n return result;\\n }\\n @Override\\n public boolean equals(Object obj) {\\n if (this == obj)\\n return true;\\n if (obj == null)\\n return false;\\n if (getClass() !=... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n \\/\\/~~~~~~~~~~~~~~~~~~~~~~~@@@@@@@@@@@@@@@_____________K_____S_____J__________@@@@@@@@@@@@@@@@@@@@@@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~~~\\n \\/\\/Date:00\\/00\\/17\\n \\/\\/-------------\\n\\n\\nimport java.util.*;\\nimport java.io.*;\\n\\n\\/*\\n\\n [[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]\\n [:::::::::::::: ::::::::::::::]\\n [:::::::::::::: ::::::::::::::]\\n [::::::[[[[[[[: :]]]]]]]::::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ CODE YOUR LIFE ]:::::]\\n [:::::[ Kripa Shankar jha ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [::::::[[[[[[[: :]]]]]]]::::::]\\n [:::::::::::::: ::::::::::::::]\\n [:::::::::::::: ::::::::::::::]\\n [[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]\\n*\\/\\n\\npublic class prob3{\\n \\n\\n static Parser sc=new Parser(System.in);\\n static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));\\n \\n static int p[]=new int[100005];\\n public static void main(String[] args) throws IOException {\\n \\/\\/ use ((((((( sc ............... for input\\n\\n \\n int n=sc.nextInt();\\n\\n int arr[]=new int[n];\\n\\n for(int i=0;i p = new ArrayList();\\n\\t\\tStringTokenizer st = tokens();\\n\\t\\tint n = nextInt(st), k = nextInt(st);\\n\\t\\tfor(int i = 2; i <= n; i++)\\n\\t\\t\\tif(prime(i)) p.add(i);\\n\\t\\t\\n\\t\\tint count = 0;\\n\\t\\tfor(int x = 2; x <= n; x++)\\n\\t\\t{\\n\\t\\t\\tif(!prime(x)) continue;\\n\\t\\t\\tfor(int i = 0; i + 1 < p.size(); i++)\\n\\t\\t\\t{\\n\\t\\t\\t\\tint p1 = p.get(i);\\n\\t\\t\\t\\tint p2 = p.get(i + 1);\\n\\t\\t\\t\\tint P = p1 + p2 + 1;\\n\\t\\t\\t\\tif(P == x) \\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tcount++;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(P > x) break;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(count >= k ? \\\"YES\\\" : \\\"NO\\\");\\n\\t\\t\\t\\t\\n\\t}\\n\\t\\n\\tboolean prime(int n)\\n\\t{\\n\\t\\tfor(int i = 2; i * i <= n; i++)\\n\\t\\t\\tif(n % i == 0) return false;\\n\\t\\treturn true;\\n\\t}\\n\\n\\tStringTokenizer tokens() throws IOException\\n\\t{\\n\\t\\treturn new StringTokenizer(input.readLine());\\n\\t}\\n\\t\\n\\tString next(StringTokenizer st)\\n\\t{\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\t\\n\\tint nextInt() throws IOException\\n\\t{\\n\\t\\treturn Integer.parseInt(input.readLine());\\n\\t}\\n\\t\\n\\tint nextInt(StringTokenizer st)\\n\\t{\\n\\t\\treturn Integer.parseInt(st.nextToken());\\n\\t}\\n\\t\\n\\tdouble nextDouble() throws IOException\\n\\t{\\n\\t\\treturn Double.parseDouble(input.readLine());\\n\\t}\\n\\t\\n\\tdouble nextDouble(StringTokenizer st)\\n\\t{\\n\\t\\treturn Double.parseDouble(st.nextToken());\\n\\t}\\n\\t\\n\\tvoid print(Object... o)\\n\\t{\\n\\t\\tout.println(deepToString(o));\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n FastScanner in = new FastScanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskE2 solver = new TaskE2();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskE2 {\\n public void solve(int testNumber, FastScanner in, PrintWriter out) {\\n int numTests = in.nextInt();\\n for (int test = 0; test < numTests; test++) {\\n int n = in.nextInt();\\n int m = in.nextInt();\\n int[][] a = new int[n][m];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < m; j++) {\\n a[i][j] = in.nextInt();\\n }\\n }\\n\\n if (m > n) {\\n int[] maxInColumn = new int[m];\\n for (int j = 0; j < m; j++) {\\n for (int i = 0; i < n; i++) {\\n maxInColumn[j] = Math.max(maxInColumn[j], a[i][j]);\\n }\\n }\\n Integer[] cols = new Integer[m];\\n for (int i = 0; i < m; i++) {\\n cols[i] = i;\\n }\\n Arrays.sort(cols, (u, v) -> -(maxInColumn[u] - maxInColumn[v]));\\n\\n int[][] na = new int[n][n];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) {\\n na[i][j] = a[i][cols[j]];\\n }\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class NewYearAndCurling {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tStringTokenizer t = new StringTokenizer(in.readLine());\\n\\t\\tint N = Integer.parseInt(t.nextToken());\\n\\t\\tint R = Integer.parseInt(t.nextToken());\\n\\t\\tint[] x = new int[N];\\n\\t\\tt = new StringTokenizer(in.readLine());\\n\\t\\tfor(int i = 0; i < N; ++i)\\n\\t\\t\\tx[i] = Integer.parseInt(t.nextToken());\\n\\t\\tdouble[] y = new double[N];\\n\\t\\tfor(int i = 0; i < N; ++i) {\\n\\t\\t\\tdouble max = R;\\n\\t\\t\\tfor(int j = 0; j < i; ++j ) {\\n\\t\\t\\t\\tint xDiff = Math.abs(x[i] - x[j]);\\n\\t\\t\\t\\tif(xDiff <= 2 * R)\\n\\t\\t\\t\\t\\tmax = Math.max(max, y[j] + Math.sqrt(4*R*R - xDiff*xDiff));\\n\\t\\t\\t}\\n\\t\\t\\ty[i] = max;\\n\\t\\t}\\n\\t\\tout.print(y[0]);\\n\\t\\tfor(int i = 1; i < N; ++i)\\n\\t\\t\\tout.print(\\\" \\\" + y[i]);\\n\\t\\tout.println();\\n\\t\\tin.close();\\n\\t\\tout.close();\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class cf {\\n\\n\\tstatic class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner() {\\n try {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n st = new StringTokenizer(br.readLine());\\n } catch (Exception e){e.printStackTrace();}\\n }\\n\\n public String next() {\\n if (st.hasMoreTokens()) return st.nextToken();\\n try {st = new StringTokenizer(br.readLine());}\\n catch (Exception e) {e.printStackTrace();}\\n return st.nextToken();\\n }\\n\\n public int nextInt() {return Integer.parseInt(next());}\\n\\n public long nextLong() {return Long.parseLong(next());}\\n\\n public double nextDouble() {return Double.parseDouble(next());}\\n\\n public String nextLine() {\\n String line = \\\"\\\";\\n if(st.hasMoreTokens()) line = st.nextToken();\\n else try {return br.readLine();}catch(IOException e){e.printStackTrace();}\\n while(st.hasMoreTokens()) line += \\\" \\\"+st.nextToken();\\n return line;\\n }\\n }\\n public static void main(String[] args) {\\n FastScanner sc = new FastScanner();\\n PrintWriter pw = new PrintWriter(System.out);\\n\\n int n = sc.nextInt();\\n pw.println(n\\/2+1);\\n pw.close();\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.BufferedWriter;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStreamWriter;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class Main {\\n\\n\\tstatic final int MAX_N = 1000010;\\n\\tstatic final int INF = 0x3f3f3f3f;\\n\\tstatic final int mod = 1000000007;\\n\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tinitReader(System.in);\\n\\n\\n\\/\\/\\t\\tint T = nextInt();\\n\\/\\/\\t\\tfor (int i = 1; i <= T; i++)\\n\\t\\t\\tsolve();\\n\\n\\t\\tpw.flush();\\n\\t}\\n\\n\\n\\t\\/*******************************************************************************************************************************\\/\\n\\n\\n\\tpublic static void solve() throws IOException {\\n\\t\\twhile (hasNext()) {\\n\\t\\t\\tlong n = nextLong() - 1;\\n\\n\\t\\t\\tlong k = 1, x = 9;\\n\\t\\t\\twhile (n - k * x >= 0) {\\n\\t\\t\\t\\tn -= k * x;\\n\\t\\t\\t\\tk += 1;\\n\\t\\t\\t\\tx *= 10;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif (n == 0)\\n\\t\\t\\t\\tpw.println(1);\\n\\t\\t\\telse {\\n\\t\\t\\t\\tlong num = x \\/ 9 + n \\/ k;\\n\\t\\t\\t\\tString s = String.valueOf(num);\\n\\t\\t\\t\\tpw.println(s.charAt((int) (n % k)));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\n\\n\\n\\t\\/*******************************************************************************************************************************\\/\\n\\n\\tstatic BufferedReader reader;\\n\\tstatic StringTokenizer tokenizer;\\n\\tstatic PrintWriter pw;\\n\\n\\tpublic static void initReader(InputStream input) throws IOException {\\n\\t\\treader = new BufferedReader(new InputStreamReader(input));\\n\\t\\ttokenizer = new StringTokenizer(\\\"\\\");\\n\\t\\tpw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\n\\/\\/\\t\\treader = new BufferedReader(new FileReader(\\\"ate.in\\\"));\\n\\/\\/\\t\\ttokenizer = new StringTokenizer(\\\"\\\");\\n\\/\\/\\t\\tprintWriter = new PrintWriter(new BufferedWriter(new FileWriter(\\\"ate.out\\\")));\\n\\t}\\n\\n\\tpublic static boolean hasNext() {\\n\\t\\ttry {\\n\\t\\t\\twhile (!tokenizer.hasMoreTokens()) {\\n\\t\\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\t\\t}\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t\\treturn true;\\n\\t}\\n\\n\\tpublic static String next() throws IOException {\\n\\t\\twhile (!tokenizer.hasMoreTokens()) {\\n\\t\\t\\ttokenizer = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.FileReader;\\nimport java.io.InputStreamReader;\\nimport java.io.FileNotFoundException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n FastScanner in = new FastScanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n public void solve(int testNumber, FastScanner in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] a = in.nextIntArray(n);\\n Arrays.sort(a);\\n int count = 0;\\n boolean[] used = new boolean[n];\\n for (int i = 0; i < n; i++) {\\n if (!used[i]) {\\n count++;\\n for (int j = i; j < n; j++) {\\n if (a[j] % a[i] == 0) {\\n used[j] = true;\\n }\\n }\\n }\\n }\\n out.println(count);\\n }\\n\\n }\\n\\n static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner(InputStream in) {\\n br = new BufferedReader(new InputStreamReader(in));\\n }\\n\\n public FastScanner(String fileName) {\\n try {\\n br = new BufferedReader(new FileReader(fileName));\\n } catch (FileNotFoundException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n public int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n public String next() {\\n while (st ==... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A {\\n public static void main(String[] args){\\n FastScanner sc = new FastScanner();\\n long a = sc.nextLong();\\n long b = sc.nextLong();\\n long result = 0L;\\n\\n while(a != 0 && b != 0) {\\n if(a > b) {\\n result += a\\/b;\\n a = a % b;\\n } else {\\n result += b\\/a;\\n b = b % a;\\n }\\n\\n long gcd = gcd(a, b);\\n a \\/= gcd;\\n b \\/= gcd;\\n }\\n\\n System.out.println(result);\\n }\\n\\n private static long gcd(long a, long b) {\\n while(a != 0 && b != 0) {\\n if(a < b) {\\n long tmp = a;\\n a = b;\\n b = tmp;\\n }\\n a%=b;\\n }\\n return a + b;\\n }\\n\\n public static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner(String s) {\\n try {\\n br = new BufferedReader(new FileReader(s));\\n } catch (FileNotFoundException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n public FastScanner() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n String nextToken() {\\n while (st == null || !st.hasMoreElements()) try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() {\\n return Double.parseDouble(nextToken());\\n }\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n Scanner in = new Scanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n DExplorerSpace solver = new DExplorerSpace();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class DExplorerSpace {\\n int n;\\n int m;\\n int k;\\n int[][] col;\\n int[][] row;\\n long[][][] memo;\\n\\n public void readInput(Scanner sc) {\\n n = sc.nextInt();\\n m = sc.nextInt();\\n k = sc.nextInt();\\n col = new int[n][m - 1];\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < m - 1; j++)\\n col[i][j] = sc.nextInt();\\n row = new int[n - 1][m];\\n for (int i = 0; i < n - 1; i++)\\n for (int j = 0; j < m; j++)\\n row[i][j] = sc.nextInt();\\n }\\n\\n public void solve(int testNumber, Scanner sc, PrintWriter pw) {\\n int q = 1;\\n while (q-- > 0) {\\n readInput(sc);\\n if (k % 2 == 1) {\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < m; j++)\\n pw.print(-1 + \\\" \\\");\\n pw.println();\\n }\\n return;\\n }\\n memo = new long[k + 1][n][m];\\n for (long[][] x : memo)\\n for (long[] y : x)\\n Arrays.fill(y, -1);\\n for (int i = 0; i < n; i++) {\\n for (int j =... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\n\\npublic class A {\\n public static void main(String[] args) throws IOException {\\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\\n int n = Integer.parseInt(reader.readLine());\\n String str[] = reader.readLine().split(\\\" \\\");\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = Integer.parseInt(str[i]);\\n }\\n Arrays.sort(a);\\n int k = 0;\\n for (int i = 0; i < n; i++) {\\n if (a[i] == 0){\\n continue;\\n }\\n for (int j = i + 1; j < n; j++) {\\n if (a[j] % a[i] == 0){\\n a[j] = 0;\\n }\\n }\\n k++;\\n }\\n System.out.println(k);\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\npublic class Task25a {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tint n = sc.nextInt();\\n\\t\\tint a1 = 0, a2 = 0;\\n\\t\\tint n1 = 0, n2 = 0;\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tint c = sc.nextInt();\\n\\t\\t\\tif (c % 2 == 1) {\\n\\t\\t\\t\\ta1 = i;\\n\\t\\t\\t\\tn1++;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\ta2 = i;\\n\\t\\t\\t\\tn2++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif (n1 == 1) {\\n\\t\\t\\tSystem.out.println(a1);\\n\\t\\t} else {\\n\\t\\t\\tSystem.out.println(a2);\\n\\t\\t}\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/package codeforces;\\n\\nimport java.io.BufferedReader;\\nimport java.io.BufferedWriter;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.FileWriter;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.StreamTokenizer;\\nimport java.util.Scanner;\\n\\npublic class CodeForces {\\n\\n \\/\\/private static MyScanner sc;\\n private static MyPrinter out;\\n\\n public static void solve() throws IOException {\\n Scanner sc = new Scanner(System.in);\\n long l = sc.nextLong();\\n long r = sc.nextLong();\\n String ls = Long.toBinaryString(l);\\n String rs = Long.toBinaryString(r);\\n while (ls.length() < rs.length()) {\\n ls = \\\"0\\\" + ls;\\n }\\n String res = \\\"\\\";\\n boolean ok = false;\\n for (int i = 0; i < ls.length(); i++) {\\n if (ok) {\\n res += \\\"1\\\";\\n } else {\\n if (ls.charAt(i) != rs.charAt(i)) {\\n res += \\\"1\\\";\\n ok = true;\\n }\\n }\\n }\\n long all = 0;\\n for (int i = 0; i < res.length(); i++) {\\n all += (long) Math.pow((long) 2, (long) res.length() - 1 - i);\\n }\\n System.out.println(all);\\n }\\n\\n public static void main(String[] args) throws IOException {\\n \\/\\/sc = new MyScanner(System.in);\\n out = new MyPrinter(System.out);\\n solve();\\n out.close();\\n }\\n}\\n\\nclass MyScanner {\\n\\n private StreamTokenizer st;\\n\\n public MyScanner(InputStream is) {\\n st = new StreamTokenizer(new BufferedReader(new InputStreamReader(is)));\\n }\\n\\n public MyScanner(File f) throws FileNotFoundException {\\n st = new StreamTokenizer(new BufferedReader(new FileReader(f)));\\n }\\n\\n public int nextInt() throws IOException {\\n st.nextToken();\\n return ((int) st.nval);\\n }\\n\\n public double nextDouble() throws IOException {\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in Actual solution is at the top\\n *\\n * @author ilyakor\\n *\\/\\npublic class Main {\\n\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n boolean[] a = new boolean[218];\\n for (int i = 0; i < n; ++i) {\\n a[in.nextInt()] = true;\\n }\\n int res = 0;\\n for (int i = 1; i < a.length; ++i) {\\n if (a[i]) {\\n ++res;\\n for (int j = i; j < a.length; j += i) {\\n a[j] = false;\\n }\\n }\\n }\\n out.printLine(res);\\n }\\n\\n }\\n\\n static class OutputWriter {\\n\\n private final PrintWriter writer;\\n\\n public OutputWriter(OutputStream outputStream) {\\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\\n }\\n\\n public OutputWriter(Writer writer) {\\n this.writer = new PrintWriter(writer);\\n }\\n\\n public void print(Object... objects) {\\n for (int i = 0; i < objects.length; i++) {\\n if (i != 0) {\\n writer.print(' ');\\n }\\n writer.print(objects[i]);\\n }\\n }\\n\\n public void printLine(Object... objects) {\\n print(objects);\\n writer.println();\\n }\\n\\n public void close() {\\n writer.close();\\n }\\n\\n }\\n\\n static class InputReader {\\n\\n private InputStream stream;\\n private byte[] buffer = new byte[10000];\\n private int... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class hackerearth {\\n\\n public static void main(String[] args) {\\n\\n Scanner sc=new Scanner(System.in);\\n int n=sc.nextInt();\\n\\n HashMap map=new HashMap<>();\\n HashMap map2=new HashMap<>();\\n for(int i=0;i entry:map.entrySet())\\n {\\n ans+=entry.getValue();\\n }\\n System.out.println(ans);\\n\\n\\n }\\n\\n\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\npublic class a {\\n\\tpublic static void main(String[] args){\\n\\t\\tScanner br = new Scanner(System.in);\\n\\t\\tlong n = br.nextLong();\\n\\t\\tSystem.out.println(\\\"25\\\");\\n\\t}\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Template implements Runnable {\\n private void solve() throws IOException {\\n int n = nextInt();\\n int m = nextInt();\\n boolean[][] g = new boolean[n][n];\\n for (int i = 0; i < m; ++i) {\\n int a = nextInt() - 1;\\n int b = nextInt() - 1;\\n g[a][b] = true;\\n g[b][a] = true;\\n }\\n \\/*for (int i = 0; i < n; ++i)\\n for (int j = 0; j < n; ++j)\\n g[i][j] = true;*\\/\\n long[] am = new long[n + 1];\\n long[][] ways = new long[1 << n][n];\\n for (int start = 0; start < n; ++start) {\\n for (int mask = 0; mask < (1 << (n - start)); ++mask)\\n for (int last = start; last < n; ++last) {\\n ways[mask][last - start] = 0;\\n }\\n ways[1][0] = 1;\\n for (int mask = 0; mask < (1 << (n - start)); ++mask) {\\n int cnt = 0;\\n int tmp = mask;\\n while (tmp > 0) {\\n ++cnt;\\n tmp = tmp & (tmp - 1);\\n }\\n for (int last = start; last < n; ++last)\\n if (ways[mask][last - start] > 0) {\\n long amm = ways[mask][last - start]; \\n for (int i = start; i < n; ++i)\\n if ((mask & (1 << (i - start))) == 0 && g[last][i]) {\\n ways[mask | (1 << (i - start))][i - start] += amm;\\n }\\n if (g[last][start])\\n am[cnt] += ways[mask][last - start];\\n }\\n }\\n }\\n long res = 0;\\n for (int cnt = 3; cnt <= n; ++cnt) {\\n if (am[cnt] % (2) != 0)\\n throw new RuntimeException();\\n res += am[cnt] \\/ (2);\\n }\\n writer.println(res);\\n }\\n\\n\\n public static void main(String[] args) {\\n new Template().run();\\n }\\n\\n BufferedReader reader;\\n ... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.Arrays;\\nimport java.util.Comparator;\\nimport java.util.HashMap;\\nimport java.util.LinkedList;\\nimport java.util.Locale;\\nimport java.util.Queue;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\nimport java.util.TreeSet;\\n\\npublic class Solution implements Runnable {\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\n\\tString nextToken() throws Exception {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tst = new StringTokenizer(in.readLine());\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws Exception {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tlong nextLong() throws Exception {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tdouble nextDouble() throws Exception {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n\\t\\n\\tint fu(int[] a, int l) {\\n\\t\\tfor (int i = l; i < a.length - 1; i++) {\\n\\t\\t\\tif (a[i] > a[i + 1]) return i;\\n\\t\\t}\\n\\t\\treturn a.length;\\n\\t}\\n\\t\\n\\tvoid swap(int[] a, int q, int w) {\\n\\t\\tint t = a[q]; a[q] = a[w]; a[w] = t;\\n\\t}\\n\\t\\n\\tvoid solve() throws Exception {\\n\\t\\tint n = nextInt();\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) a[i] = nextInt();\\n\\t\\tint q = fu(a, 0);\\n\\t\\tif (q == n) out.println(\\\"YES\\\"); else {\\n\\t\\t\\tint w = fu(a, q + 1);\\n\\t\\t\\tif (w < n) {\\n\\t\\t\\t\\tboolean ans = false;\\n\\t\\t\\t\\tswap(a, q, w);\\n\\t\\t\\t\\tans |= fu(a, 0) == n;\\n\\t\\t\\t\\tswap(a, q, w);\\n\\t\\t\\t\\tif (q < n - 1) {\\n\\t\\t\\t\\t\\tswap(a, q + 1, w);\\n\\t\\t\\t\\t\\tans |= fu(a, 0) == n;\\n\\t\\t\\t\\t\\tswap(a, q + 1, w);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (w < n - 1) {\\n\\t\\t\\t\\t\\tswap(a, q, w + 1);\\n\\t\\t\\t\\t\\tans |= fu(a, 0) == n;\\n\\t\\t\\t\\t\\tswap(a, q, w + 1);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (q < n - 1 && w < n - 1) {\\n\\t\\t\\t\\t\\tswap(a, q + 1, w + 1);\\n\\t\\t\\t\\t\\tans |= fu(a, 0) == n;\\n\\t\\t\\t\\t\\tswap(a, q + 1, w + 1);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (ans) out.println(\\\"YES\\\"); else out.println(\\\"NO\\\");\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tint j = q + 1;\\n\\t\\t\\t\\twhile (j < n && a[j] == a[q + 1]) j++;\\n\\t\\t\\t\\tj--;\\n\\t\\t\\t\\tswap(a, q, j);\\n\\t\\t\\t\\tif (fu(a, 0) == n) out.println(\\\"YES\\\"); else {\\n\\t\\t\\t\\t\\tswap(a, q, j);\\n\\t\\t\\t\\t\\tq++;\\n\\t\\t\\t\\t\\tj =... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package round15;\\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.StreamTokenizer;\\n\\npublic class A {\\n\\n\\tstatic StreamTokenizer in =\\n\\t\\tnew StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n\\t\\n\\tstatic int nextInt() throws IOException{\\n\\t\\tin.nextToken();\\n\\t\\treturn (int)in.nval;\\n\\t}\\n\\t\\n\\tstatic PrintWriter out = new PrintWriter(System.out);\\n\\t\\n\\tpublic static void main(String[] args) throws IOException{\\n\\t\\tint n = nextInt(),\\n\\t\\t\\tt = nextInt(),\\n\\t\\t\\tx[] = new int[n],\\n\\t\\t\\ta[] = new int[n];\\n\\t\\t\\n\\t\\tfor (int i=0; i x[j]){\\n\\t\\t\\t\\t\\tint p = x[i]; x[i] = x[j]; x[j] = p;\\n\\t\\t\\t\\t\\t\\tp = a[i]; a[i] = a[j]; a[j] = p;\\n\\t\\t\\t\\t}\\n\\t\\t\\n\\t\\tdouble l[] = new double[n];\\n\\t\\tdouble r[] = new double[n];\\n\\t\\tfor (int i=0; i t) res += 2;\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.println(res);\\n\\t\\tout.flush();\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class first\\n{\\n\\tint max(int a1,int a2,int a3)\\n\\t{\\n\\t\\tint max=a1;\\n\\t\\tif(a2>=max)\\n\\t\\t\\tmax=a2;\\n\\t\\tif(a3>=max)\\n\\t\\t\\tmax = a3;\\n\\t\\treturn max;\\t\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tint num=0;\\n\\t\\t\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tnum = sc.nextInt();\\n\\t\\tint num2 = num\\/10;\\n\\t\\tint num3 = num%10;\\n\\t\\tint num4 = (num2\\/10)*10+num3;\\n\\t\\tfirst fs = new first();\\n\\t\\tint result = fs.max(num,num2,num4);\\n\\t\\tSystem.out.println(result);\\n\\t}\\n}\\t\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\npublic class A23 {\\n\\n static int solve(String s) {\\n for(int i = s.length(); i > 0; --i) {\\n for(int start = 0; start < s.length() - i; ++start) {\\n String str = s.substring(start, start + i);\\n int firstIndex = s.indexOf(str);\\n int lastIndex = s.lastIndexOf(str);\\n if(firstIndex != lastIndex)\\n return i;\\n }\\n }\\n return 0;\\n }\\n\\n public static String[] EX = new String[] { \\\"abcd\\\", \\\"ababa\\\", \\\"zzz\\\", \\\"qwertyuiopasdfghjklzxcvbnmqwepriuwpoep\\\"};\\n public static int[] EX_A = new int[] { 0, 3, 2, 3};\\n \\n public static void main(String[] args) throws IOException {\\n if(true) {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n String s = br.readLine();\\n System.out.println(solve(s));\\n }\\n else {\\n for(int i = 0; i < EX.length; ++i) {\\n int result = solve(EX[i]);\\n System.out.println(i + \\\": \\\" + result + \\\" \\\" + (result == EX_A[i]? \\\"ja\\\" : \\\"NEJ\\\"));\\n }\\n }\\n }\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/ upsolve with rainboy\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class CF1187G extends PrintWriter {\\n\\tCF1187G() { super(System.out, true); }\\n\\tstatic class Scanner {\\n\\t\\tScanner(InputStream in) { this.in = in; } InputStream in;\\n\\t\\tint k, l; byte[] bb = new byte[1 << 15];\\n\\t\\tbyte getc() {\\n\\t\\t\\tif (k >= l) {\\n\\t\\t\\t\\tk = 0;\\n\\t\\t\\t\\ttry { l = in.read(bb); } catch (IOException e) { l = 0; }\\n\\t\\t\\t\\tif (l <= 0) return -1;\\n\\t\\t\\t}\\n\\t\\t\\treturn bb[k++];\\n\\t\\t}\\n\\t\\tint nextInt() {\\n\\t\\t\\tbyte c = 0; while (c <= 32) c = getc();\\n\\t\\t\\tint a = 0;\\n\\t\\t\\twhile (c > 32) { a = a * 10 + c - '0'; c = getc(); }\\n\\t\\t\\treturn a;\\n\\t\\t}\\n\\t}\\n\\tScanner sc = new Scanner(System.in);\\n\\tpublic static void main(String[] $) {\\n\\t\\tCF1187G o = new CF1187G(); o.main(); o.flush();\\n\\t}\\n\\n\\tstatic final int INF = 0x3f3f3f3f;\\n\\tArrayList[] aa_;\\n\\tint n_, m_;\\n\\tint[] pi, kk;\\n\\tint[] uu, vv, uv, cost, cost_;\\n\\tint[] cc;\\n\\tvoid init() {\\n\\t\\taa_ = new ArrayList[n_];\\n\\t\\tfor (int u = 0; u < n_; u++)\\n\\t\\t\\taa_[u] = new ArrayList();\\n\\t\\tpi = new int[n_];\\n\\t\\tkk = new int[n_];\\n\\t\\tuu = new int[m_];\\n\\t\\tvv = new int[m_];\\n\\t\\tuv = new int[m_];\\n\\t\\tcost = new int[m_];\\n\\t\\tcc = new int[m_ * 2];\\n\\t\\tm_ = 0;\\n\\t}\\n\\tvoid link(int u, int v, int cap, int cos) {\\n\\t\\tint h = m_++;\\n\\t\\tuu[h] = u;\\n\\t\\tvv[h] = v;\\n\\t\\tuv[h] = u ^ v;\\n\\t\\tcost[h] = cos;\\n\\t\\tcc[h << 1 ^ 0] = cap;\\n\\t\\taa_[u].add(h << 1 ^ 0);\\n\\t\\taa_[v].add(h << 1 ^ 1);\\n\\t}\\n\\tboolean dijkstra(int s, int t) {\\n\\t\\tArrays.fill(pi, INF);\\n\\t\\tpi[s] = 0;\\n\\t\\tTreeSet pq = new TreeSet<>((u, v) -> pi[u] != pi[v] ? pi[u] - pi[v] : kk[u] != kk[v] ? kk[u] - kk[v] : u - v);\\n\\t\\tpq.add(s);\\n\\t\\tInteger first;\\n\\t\\twhile ((first = pq.pollFirst()) != null) {\\n\\t\\t\\tint u = first;\\n\\t\\t\\tint k = kk[u] + 1;\\n\\t\\t\\tArrayList adj = aa_[u];\\n\\t\\t\\tfor (int h_ : adj)\\n\\t\\t\\t\\tif (cc[h_] > 0) {\\n\\t\\t\\t\\t\\tint h = h_ >> 1;\\n\\t\\t\\t\\t\\tint p = pi[u] + ((h_ & 1) == 0 ? cost_[h] : -cost_[h]);\\n\\t\\t\\t\\t\\tint v = u ^ uv[h];\\n\\t\\t\\t\\t\\tif (pi[v] > p || pi[v] == p && kk[v] > k) {\\n\\t\\t\\t\\t\\t\\tif (pi[v] != INF)\\n\\t\\t\\t\\t\\t\\t\\tpq.remove(v);\\n\\t\\t\\t\\t\\t\\tpi[v] = p;\\n\\t\\t\\t\\t\\t\\tkk[v] = k;\\n\\t\\t\\t\\t\\t\\tpq.add(v);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn pi[t] != INF;\\n\\t}\\n\\tint dfs(int u, int t, int c) {\\n\\t\\tif (u == t || c... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.util.HashSet;\\nimport java.util.Scanner;\\nimport java.util.Set;\\n\\n\\npublic class A {\\n\\n public static void main(String[] args) throws IOException{\\n Scanner sc = new Scanner(System.in);\\n String s = sc.next();\\n int n = s.length();\\n for (int i = n; i >= 1; i--) {\\n Set set = new HashSet();\\n for (int j = 0; j < n-i+1; j++) {\\n String t = s.substring(j, j+i);\\n if (set.contains(t)) {\\n System.out.println(i);\\n return;\\n }\\n set.add(t);\\n }\\n }\\n System.out.println(0);\\n }\\n \\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/* package codechef; \\/\\/ don't place package name! *\\/\\n\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\n\\n\\/* Name of the class has to be \\\"Main\\\" only if the class is public. *\\/\\npublic class Codechef\\n{\\n\\tpublic static void main (String[] args) throws java.lang.Exception\\n\\t{\\n\\t\\t\\/\\/ your code goes here\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint t = Integer.parseInt(br.readLine());\\n\\t\\tfor(int q=0;q=0;j--){\\n\\t\\t if(x-1==a[j]){\\n\\t\\t a[j]=x;\\n\\t\\t \\n\\t\\t for(int k=0;k> q;\\n\\n public void dfs(int u, int p) {\\n for (int i = 0; i < q.get(u).size(); i++) {\\n int v = q.get(u).get(i);\\n if (v != p) {\\n r[v] = r[u] + 1;\\n if (b[u]) {\\n b[v] = b[u];\\n }\\n dfs(v, u);\\n }\\n }\\n }\\n\\n public void solve() throws IOException {\\n long n = nextLong();\\n long s = nextLong();\\n long t = 0;\\n if(s + 200 < n){\\n t = n - s - 200;\\n }\\n for(long i = s; i <= Math.min(s + 200,n); i++){\\n long p = 0;\\n long u = i;\\n while (u > 0){\\n p += u % 10;\\n u \\/= 10;\\n }\\n if(i - p >= s){\\n t++;\\n }\\n }\\n out.print(t);\\n }\\n\\n BufferedReader br;\\n StringTokenizer sc;\\n PrintWriter out;\\n\\n public String nextToken() throws IOException {\\n while (sc == null || !sc.hasMoreTokens()) {\\n try {\\n sc = new StringTokenizer(br.readLine());\\n } catch (Exception e) {\\n return null;\\n }\\n }\\n return sc.nextToken();\\n }\\n\\n public Integer nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n public Long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n\\n public static void main(String[] args) throws IOException {\\n try {\\n Locale.setDefault(Locale.US);\\n } catch (Exception e) {\\n }\\n new Main().run();\\n }\\n\\n public void run() {\\n try {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n\\/\\/ br = new BufferedReader(new FileReader(\\\"lesson.in\\\"));\\n\\/\\/ out = new PrintWriter(new... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.security.SecureRandom;\\nimport java.util.*;\\nimport java.math.*;\\nimport java.awt.geom.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Solution implements Runnable {\\n \\n \\n \\n \\n public void solve() throws Exception {\\n int n = sc.nextInt();\\n int a[] = new int[n];\\n int s = 0;\\n for (int i = 0;i < n; ++ i) {\\n a[i] = sc.nextInt();\\n s += a[i];\\n }\\n Arrays.sort(a);\\n int s2 = 0;\\n for (int i = n - 1;i >= 0; -- i) {\\n s2 += a[i];\\n if (s2 > s - s2) {\\n out.println(n - i);\\n break;\\n }\\n }\\n \\n }\\n \\n class Pair implements Comparable {\\n \\n int x;\\n int y;\\n \\n public Pair() {\\n \\n }\\n \\n public Pair(int x, int y) {\\n this.x = x;\\n this.y = y;\\n }\\n\\n @Override\\n public int compareTo(Pair arg0) {\\n if (x == arg0.x)\\n return y - arg0.y;\\n return x - arg0.x;\\n }\\n }\\n \\n \\n \\n \\n \\/*--------------------------------------------------------------*\\/\\n \\n static String filename = \\\"\\\";\\n static boolean fromFile = false;\\n \\n BufferedReader in;\\n PrintWriter out;\\n FastScanner sc;\\n \\n public static void main(String[] args) {\\n new Thread(null, new Solution(), \\\"\\\", 1 << 25).start();\\n }\\n \\n public void run() {\\n try {\\n init();\\n solve();\\n } catch (Exception e) {\\n throw new RuntimeException(e);\\n } finally {\\n out.close();\\n }\\n }\\n \\n void init() throws Exception {\\n if (fromFile) {\\n in = new BufferedReader(new FileReader(filename+\\\".in\\\"));\\n out = new PrintWriter(new FileWriter(filename+\\\".out\\\"));\\n } else {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n }\\n sc = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in Actual solution is at the top\\n *\\n * @author MaxHeap\\n *\\/\\npublic class Main {\\n\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n CBanhMi solver = new CBanhMi();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class CBanhMi {\\n\\n long mod = (long) (1e9 + 7);\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int q = in.nextInt();\\n long[] two = new long[n + 1];\\n two[0] = 1;\\n for (int i = 1; i <= n; ++i) {\\n two[i] = (two[i - 1] * 2L);\\n two[i] %= mod;\\n }\\n\\n char[] s = in.nextCharArray();\\n int[] acc = new int[n + 1];\\n for (int i = 1; i <= n; ++i) {\\n acc[i] = s[i - 1] == '0' ? 0 : 1;\\n acc[i] += acc[i - 1];\\n }\\n \\/\\/ 0 0 1 1 | 1: 1 1 2| 2: 2 3| 4: 5| 9\\n \\/\\/ 0 1 1 1| 1: 1 2 2| 2: 3 3| 5: 6| 11\\n \\/\\/ 0 1 1 wwqwq| 1: 1 2 2| 3: 5 3| 8: 8| 16\\n \\/\\/ 0 0 1 1| 1: 1 1 2| 3: 3 3| 6: 6| 12\\n \\/\\/ 0 0 0 1| 1: 1 1 1| 2: 2 2| 4: 4| 8\\n while (q-- > 0) {\\n int f = in.nextInt();\\n int t = in.nextInt();\\n int ones = acc[t] - acc[f - 1];\\n int zeros = (t - f + 1) - ones;\\n if (ones == 0) {\\n out.println(0);\\n } else {\\n long ans = two[t - f + 1] - (zeros > 0 ? two[zeros] : 0);\\n if (zeros == 0) {\\n --ans;\\n }\\n ans = (ans + mod) % mod;\\n out.println(ans);\\n }\\n }\\n }\\n\\n }\\n\\n static class InputReader implements FastIO {\\n\\n private InputStream stream;\\n private static final int DEFAULT_BUFFER_SIZE = 1 << 16;\\n private static final int EOF = -1;\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\n\\/\\/****Use Integer Wrapper Class for Arrays.sort()****\\npublic class AG1 {\\n public static void main(String[] Args){\\n FastReader scan=new FastReader();\\n int n=scan.nextInt();\\n int[] arr=new int[n];\\n for (int i = 0; i = 1; l++, r--) {\\n ans[0][c] = l;\\n ans[1][c++] = left;\\n\\n ans[0][c] = r;\\n ans[1][c++] = right;\\n }\\n }\\n\\n if (m % 2 == 1) {\\n int x = m\\/2 + 1;\\n for(int l = 1, r = n;l < r;l++, r--){\\n ans[0][c] = l;\\n ans[1][c++] = x;\\n\\n ans[0][c] = r;\\n ans[1][c++] = x;\\n if(n % 2 == 1 && l + 2 == r){\\n ans[0][c] = l+1;\\n ans[1][c++] = x;\\n }\\n }\\n }\\n\\n if(n == 1 && m % 2 == 1){\\n ans[0][c] = 1;\\n ans[1][c] = m\\/2 + 1;\\n }\\n\\n return ans;\\n }\\n\\n void stress(){\\n\\n for(int i = 3;i<=5;i++){\\n for(int j = 2;j<=5;j++){\\n int[][] ans = new int[2][];\\n try{\\n ans = fast(i, j);\\n }catch(Exception e){\\n out.println(\\\"ошибка\\\");\\n out.print(i + \\\" \\\" + j);\\n return;\\n }\\n\\n boolean[][] check = new boolean[i][j];\\n for(int c = 0;c>k)&1;\\n\\t}\\n\\t\\n\\tstatic int TurnBit(int x,int k)\\n\\t{\\n\\t\\treturn x^(1<1)\\n\\t\\t\\t\\tfor(int i=0;i list = new ArrayList<>();\\n \\n for(int i = 1 ; i <= x ; ++i){\\n list.add(new Passengers(in.nextInt(), in.nextInt()));\\n }\\n \\n int sum = 0 ;\\n for(int i = list.size() - 1 ; i >= 0 ; --i)\\n {\\n int s = y - list.get(i).floor;\\n sum = sum + s ; \\n \\n if(sum < list.get(i).time)\\n {\\n sum = sum + ( list.get(i).time - sum);\\n }\\n \\n y = list.get(i).floor;\\n } \\n \\n \\n if( list.get(list.size() - 1).floor != 0){\\n sum = sum + (list.get(0).floor);\\n }\\n System.out.println(sum);\\n }\\n \\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class Main {\\n\\n \\/**\\n * @param args\\n *\\/\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n int[] nums = new int[n];\\n int kisu = 0;\\n int gusu = 0;\\n for(int i = 0 ; i < n ; i++){\\n nums[i] = sc.nextInt();\\n if(nums[i] % 2 == 0)gusu++;\\n if(nums[i] % 2 == 1)kisu++;\\n }\\n int ans = -1;\\n if(gusu == 1){\\n for(int i = 0 ; i < n ; i++){\\n if(nums[i]%2 == 0){\\n ans = i+1;\\n break;\\n }\\n }\\n }\\n else{\\n for(int i = 0 ; i < n ; i++){\\n if(nums[i]%2 == 1){\\n ans = i+1;\\n break;\\n }\\n }\\n \\n }\\n System.out.println(ans);\\n }\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigDecimal;\\nimport java.math.BigInteger;\\nimport java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\nimport java.util.TreeSet;\\n\\npublic class Main \\n{\\n\\tstatic ArrayList Unique(ArrayList x)\\n\\t{\\n\\t\\tTreeSet tmp=new TreeSet();\\n\\t\\ttmp.addAll(x);\\n\\t\\tx.clear();\\n\\t\\tx.addAll(tmp);\\n\\t\\treturn x;\\n\\t}\\n\\tpublic static void main(String[] args) \\n\\t{\\n\\t\\tInputReader in = new InputReader();\\n\\/\\/\\t\\tScanner in=new Scanner(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\twhile(in.hasNext())\\n\\t\\t{\\n\\t\\t\\tlong n=in.nextLong();\\n\\t\\t\\tout.println(\\\"25\\\");\\n\\t\\t}\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass node\\n{\\n\\tArrayList v=new ArrayList();\\n\\tnode(){}\\n\\tvoid push(Integer a)\\n\\t{\\n\\t\\tv.add(a);\\n\\t}\\n}\\n\\nclass InputReader \\n{\\n\\tBufferedReader buf;\\n\\tStringTokenizer tok;\\n\\tInputReader() \\n\\t{\\n\\t\\tbuf = new BufferedReader(new InputStreamReader(System.in));\\n\\t}\\n\\n\\tboolean hasNext() \\n\\t{\\n\\t\\twhile (tok == null || !tok.hasMoreElements()) \\n\\t\\t{\\n\\t\\t\\ttry \\n\\t\\t\\t{\\n\\t\\t\\t\\ttok = new StringTokenizer(buf.readLine());\\n\\t\\t\\t} \\n\\t\\t\\tcatch (Exception e) \\n\\t\\t\\t{\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn true;\\n\\t}\\n\\n\\tString next() \\n\\t{\\n\\t\\tif (hasNext())\\n\\t\\t\\treturn tok.nextToken();\\n\\t\\treturn null;\\n\\t}\\n\\n\\tint nextInt() \\n\\t{\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\n\\tlong nextLong() \\n\\t{\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\n\\tdouble nextDouble() \\n\\t{\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\n\\tBigInteger nextBigInteger() \\n\\t{\\n\\t\\treturn new BigInteger(next());\\n\\t}\\n\\n\\tBigDecimal nextBigDecimal() \\n\\t{\\n\\t\\treturn new BigDecimal(next());\\n\\t}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\/**\\n * Write a description of class lukno here.\\n * \\n * @author (your name) \\n * @version (a version number or a date)\\n *\\/\\npublic class lukno\\n{\\n public static void main (String args[])\\n {\\n Scanner i= new Scanner(System.in);\\n int n,p;\\n \\n n=i.nextInt(); int t=n;\\n if(t%4==0||t%7==0||t%47==0||t%74==0||t%44==0||t%447==0||t%474==0||t%477==0)\\n System.out.print(\\\"YES\\\");\\n else System.out.print(\\\"NO\\\");\\n\\n \\n \\n\\n\\n}\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class CDF22_A {\\n public static void main(String[] args) throws Exception {\\n Scanner sc = new Scanner(System.in);\\n int N = sc.nextInt();\\n int[] A = new int[N];\\n for (int i=0; i g[];\\n\\tstatic boolean visited[];\\n\\tstatic int ans[],p[],orig[];\\n\\tstatic int n,a,b;\\n\\t\\n\\t@SuppressWarnings(\\\"unchecked\\\")\\n\\tpublic static void main(String args[] ) throws Exception {\\n\\t\\t\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t PrintWriter w = new PrintWriter(System.out);\\n\\t \\n\\t StringTokenizer st1 = new StringTokenizer(br.readLine());\\n\\t n = ip(st1.nextToken());\\n\\t a = ip(st1.nextToken());\\n\\t b = ip(st1.nextToken());\\n\\t \\n\\t g = new ArrayList[n];\\n\\t visited = new boolean[n];\\n\\t ans = new int[n];\\n\\t p = new int[n];\\n\\t orig = new int[n];\\n\\t \\n\\t StringTokenizer st2 = new StringTokenizer(br.readLine());\\n\\t for(int i=0;i();\\n\\t }\\n\\t \\n\\t Arrays.sort(p);\\n\\t \\n\\t boolean impossible = false;\\n\\t \\n\\t for(int i=0;i= n)\\ti1 = -1;\\n\\t \\tif(i2 < 0 || i2 >= n)\\ti2 = -1;\\n\\t \\t\\n\\t \\tif(i1 == -1 && i2 != -1) \\/\\/if only (b-x) present then both must belong to set 1\\n\\t \\t\\tg[i].add(i2);\\n\\t \\t\\n\\t \\telse if(i1 != -1 && i2 == -1) \\/\\/if only (a-x) present then both must belong to set 0\\n\\t \\t\\tg[i].add(i1);\\n\\t \\t\\n\\t \\telse if(i1 != -1 && i2 != -1){ \\/\\/both present hence all 3 should be in same set,doesn't matter which\\n\\t \\t\\tg[i].add(i1);\\n\\t \\t\\tg[i].add(i2);\\n\\t \\t}\\n\\t \\telse{ \\/\\/if none present then not possible to be in any set\\n\\t \\t\\timpossible = true;\\n\\t \\t\\tbreak;\\n\\t \\t}\\n\\t }\\n\\t \\n\\t if(impossible){\\/\\/if any element without both a-x and b-x found\\n\\t \\tSystem.out.println(\\\"NO\\\");\\n\\t \\treturn;\\n\\t }\\n\\t \\n\\t \\/\\/Edge between a and b means... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class AnnoyingPresent {\\n\\n\\t\\n\\t\\/\\/UPSOLVED\\n\\tpublic static void main(String[] args) throws IOException {\\n\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tStringTokenizer st = new StringTokenizer(br.readLine());\\n long n = Long.parseLong(st.nextToken()) , m = Long.parseLong(st.nextToken());\\n \\n long sum = 0;\\n \\n for(int i=0;i Comparator = null;\\n\\tstatic LinkedList adj[];\\n\\tstatic ArrayList adj1[];\\n\\tstatic int[] color,visited1;\\n\\tstatic boolean b[],visited[],possible;\\n\\tstatic int level[];\\n\\tstatic Map> s;\\n\\tstatic int totalnodes,colored;\\n\\tstatic int count[];\\n\\tstatic long sum[];\\n\\tstatic int nodes;\\n\\tstatic long ans=0;\\n\\tstatic long[] as=new long[10001];\\n\\tstatic long c1=0,c2=0;\\n\\tstatic int[] a,d,k;\\n\\tstatic int max=100000000;\\n\\tstatic long MOD = 1000000007,sm=0,m=Long.MIN_VALUE;\\n\\tstatic boolean[] prime=new boolean[1000005];\\n\\tstatic int[] levl;\\n static int[] eat;\\n static int price[];\\n static int res[],par[],co[];\\n static int result=0;\\n static int[] root,size,du,dv;\\n static long p=Long.MAX_VALUE;\\n static int start,end,r=0;\\n static boolean[] vis1,vis2;\\n static int to;\\n static HashMap hs;\\n static boolean ns;\\n static Node head;\\n static String st,t;\\n static long n;\\n \\n\\t\\/\\/ --------------------My Code Starts Here----------------------\\n\\t\\n\\tpublic static void main(String[] args) throws IOException\\n\\t{\\n\\t\\tin=new InputReader(System.in);\\n\\t w=new PrintWriter(System.out);\\n\\n\\t int n=ni();\\n\\t HashMap hm=new HashMap();\\n\\t for(int i=0;i> horizontalEdgeWeights = new ArrayList>(rows);\\n for (int r = 0; r < rows; r++) {\\n horizontalEdgeWeights.add(new ArrayList(cols-1));\\n\\n for (int c = 0; c < cols - 1; c++) {\\n horizontalEdgeWeights.get(r).add(FR.nextInt());\\n }\\n }\\n\\n List> verticalEdgeWeights = new ArrayList>(rows-1);\\n for (int r = 0; r < rows - 1; r++) {\\n verticalEdgeWeights.add(new ArrayList(cols));\\n\\n for (int c = 0; c < cols; c++) {\\n verticalEdgeWeights.get(r).add(FR.nextInt());\\n }\\n }\\n \\n List> result = getResult(rows, cols, moves, horizontalEdgeWeights, verticalEdgeWeights);\\n for (int r = 0; r < rows; r++) {\\n for (int c = 0; c < cols; c++) {\\n int value = (result != null ? result.get(r).get(c) : -1);\\n solution.append(value + \\\" \\\");\\n }\\n solution.append(\\\"\\\\n\\\");\\n }\\n\\n\\t\\tPW.print(solution.toString());\\n PW.close();\\n }\\n\\n static List> getResult(int rows, int cols, int moves, List> horizontalEdgeWeights, List> verticalEdgeWeights) {\\n if ((moves & 1) == 1) {\\n return null;\\n }\\n\\n int mid = moves >> 1;\\n List>> minForDistance = new ArrayList>>(rows);\\n for (int r = 0; r < rows; r++) {\\n minForDistance.add(new ArrayList>(cols));\\n\\n for (int c = 0; c < cols; c++) {\\n minForDistance.get(r).add(new ArrayList(Collections.nCopies(mid+1, Integer.MAX_VALUE)));\\n minForDistance.get(r).get(c).set(0, 0);\\n }\\n }\\n\\n for (int m = 1; m <=... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.StringTokenizer;\\n\\n\\npublic class Main {\\n\\tpublic static String taskName = \\\"\\\";\\n\\n\\tpublic class Task {\\n\\t\\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\\n\\t\\t\\tint n = in.nextInt();\\n\\t\\t\\tint r = in.nextInt();\\n\\t\\t\\tint[] x = new int[n];\\n\\t\\t\\tfor(int i = 0; i < n; i++)\\n\\t\\t\\t\\tx[i] = in.nextInt();\\n\\n\\t\\t\\tdouble[] y = new double[n];\\n\\t\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\t\\ty[i] = r;\\n\\t\\t\\t\\tfor(int j = 0; j < i; j++) {\\n\\t\\t\\t\\t\\tint dx = Math.abs(x[i] - x[j]);\\n\\t\\t\\t\\t\\tif(dx <= 2 * r)\\n\\t\\t\\t\\t\\t\\ty[i] = Math.max(y[i], y[j] + Math.abs(Math.sqrt(4 * r * r - dx * dx)));\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tSystem.out.print(y[i] + \\\" \\\");\\n\\t\\t\\t}\\n\\n\\t\\t\\tSystem.out.println();\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws FileNotFoundException {\\n\\t\\tif(!taskName.isEmpty()) {\\n\\t\\t\\tSystem.setIn(new BufferedInputStream(new FileInputStream(taskName + \\\".in\\\")));\\n\\t\\t\\tSystem.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream(taskName + \\\".out\\\"))));\\n\\t\\t}\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tMain main = new Main();\\n\\t\\tmain.run(in, out);\\n\\t\\tout.close();\\n\\t}\\n\\n\\tpublic void run(InputReader in, PrintWriter out) {\\n\\t\\tTask solver = new Task();\\n\\t\\tsolver.solve(1, in, out);\\n\\t}\\n\\n\\tstatic class InputReader {\\n\\t\\tpublic BufferedReader reader;\\n\\t\\tpublic StringTokenizer tokenizer;\\n\\n\\t\\tpublic InputReader(InputStream stream) {\\n\\t\\t\\treader = new BufferedReader(new InputStreamReader(stream), 32768);\\n\\t\\t\\ttokenizer = null;\\n\\t\\t}\\n\\n\\t\\tpublic String next() {\\n\\t\\t\\twhile(tokenizer == null || !tokenizer.hasMoreTokens())\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\t\\t\\t} catch(IOException e) {\\n\\t\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t\\t}\\n\\t\\t\\treturn tokenizer.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic double nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tpublic double nextShort()... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class Solution{\\n public static void main(String[] args)throws IOException{\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n int t = Integer.parseInt(br.readLine());\\n StringTokenizer st;\\n for(int z=0;z((a[0]-a[1])-(b[0]-b[1])));\\n TreeMap tm = new TreeMap<>();\\n int ans = 0;\\n for(int i=n-1;i>=0;i--){\\n int x = point[i][0], w = point[i][1];\\n Map.Entry cur = tm.ceilingEntry(x+w);\\n int curRes;\\n if(cur==null) curRes = 1;\\n else curRes = cur.getValue()+1;\\n ans = Math.max(ans,curRes);\\n Map.Entry upper = tm.ceilingEntry(x-w);\\n if(upper==null||upper.getValue() 2) {\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tres += dp[to][st];\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tlen[Integer.bitCount(st)] += dp[to][st];\\n\\t\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\t\\t\\tdp[next][st | (1 << next)] += dp[to][st];\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(res \\/ 2);\\n\\t}\\n\\n\\tprivate class InputReader {\\n\\t\\tStringTokenizer st;\\n\\t\\tBufferedReader br;\\n\\n\\t\\tpublic InputReader(File f) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tbr = new BufferedReader(new FileReader(f));\\n\\t\\t\\t} catch (FileNotFoundException e) {\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tpublic InputReader(InputStream f) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(f));\\n\\t\\t}\\n\\n\\t\\tString next() {\\n\\t\\t\\twhile (st == null || !st.hasMoreElements()) {\\n\\t\\t\\t\\tString s;\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ts = br.readLine();\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\treturn null;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (s == null)\\n\\t\\t\\t\\t\\treturn null;\\n\\t\\t\\t\\tst = new StringTokenizer(s);\\n\\t\\t\\t}\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tint nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tboolean hasMoreElements() {\\n\\t\\t\\twhile (st == null || !st.hasMoreElements()) {\\n\\t\\t\\t\\tString s;\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ts = br.readLine();\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tst = new StringTokenizer(s);\\n\\t\\t\\t}\\n\\t\\t\\treturn st.hasMoreElements();\\n\\t\\t}\\n\\n\\t\\tlong... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class Main1\\n{\\n static class Reader \\n { \\n private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;} \\n 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++];} \\n 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() ;} \\n 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();} \\n 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;} \\n 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;} \\n public double d() throws IOException {return Double.parseDouble(s()) ;}\\n public boolean isSpaceChar(int c) { return c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1; } \\n public boolean isEndOfLine(int c) { return c == '\\\\n' || c == '\\\\r' || c == -1; } \\n }\\n \\n \\n \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n \\/\\/ RRRRRRRRR AAA HHH HHH IIIIIIIIIIIII LLL \\/\\/\\n \\/\\/ ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.StreamTokenizer;\\nimport java.util.ArrayList;\\nimport java.util.List;\\nimport java.util.Locale;\\nimport java.util.Scanner;\\n\\npublic class Main implements Runnable {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew Thread(new Main()).start();\\n\\t}\\n\\n\\tpublic void run() {\\n\\t\\tLocale.setDefault(Locale.US);\\n\\t\\ttry {\\n\\t\\t\\trun1();\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\tthrow new RuntimeException();\\n\\t\\t}\\n\\t}\\n\\n\\tint nextInt(StreamTokenizer st) throws IOException {\\n\\t\\tst.nextToken();\\n\\t\\treturn (int) st.nval;\\n\\t}\\n\\n\\tprivate List kmp(String x, String a) {\\n\\t\\tString s = a + \\\"$\\\" + x;\\n\\t\\tint[] oppa = new int[s.length()];\\n\\t\\toppa[0] = 0;\\n\\t\\tint tmp = 0;\\n\\t\\tList res = new ArrayList();\\n\\t\\tfor (int i = 1; i < s.length(); i++) {\\n\\t\\t\\twhile (tmp != 0 && s.charAt(tmp) != s.charAt(i)) {\\n\\t\\t\\t\\t\\/\\/ System.out.println(i + \\\" \\\" + tmp);\\n\\t\\t\\t\\ttmp = oppa[tmp - 1];\\n\\t\\t\\t}\\n\\t\\t\\tif (s.charAt(tmp) == s.charAt(i))\\n\\t\\t\\t\\ttmp++;\\n\\t\\t\\toppa[i] = tmp;\\n\\t\\t\\tif (tmp == a.length()) {\\n\\t\\t\\t\\tres.add(i - a.length() - a.length());\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n\\n\\tdouble nextDouble(StreamTokenizer st) throws IOException {\\n\\t\\tst.nextToken();\\n\\t\\treturn st.nval;\\n\\t}\\n\\n\\tString nextLine(StreamTokenizer st) throws IOException {\\n\\t\\tst.nextToken();\\n\\t\\treturn st.sval;\\n\\t}\\n\\n\\tint cnt = 0;\\n\\tint[] col;\\n\\n\\tvoid unite(int a, int b) {\\n\\t\\tif (cnt % 2 == 0)\\n\\t\\t\\tcol[getCol(a)] = getCol(b);\\n\\t\\telse\\n\\t\\t\\tcol[getCol(b)] = getCol(a);\\n\\t\\tcnt++;\\n\\t}\\n\\n\\tint getCol(int a) {\\n\\t\\treturn a == col[a] ? a : (col[a] = getCol(col[a]));\\n\\t}\\n\\n\\tpublic void run1() throws IOException {\\n\\/\\/\\t\\t Scanner sc = new Scanner(new FileReader(\\\"input.txt\\\"));\\n\\t\\tScanner sc = new Scanner(new InputStreamReader(System.in));\\n\\t\\t\\/\\/ BufferedReader br = new BufferedReader(new\\n\\t\\t\\/\\/ InputStreamReader(System.in));\\n\\t\\t\\/\\/ PrintWriter pw = new PrintWriter(new FileWriter(\\\"output.txt\\\"));\\n\\t\\tString s= sc.next();\\n\\t\\tint res = 0;\\n\\t\\tint n = s.length();\\n\\t\\tfor(int i = 0; i < n; i++)\\n\\t\\t\\tfor(int j = i + 1; j < n; j++) {\\n\\t\\t\\t\\tint k = 0;\\n\\t\\t\\t\\twhile(j + k < n && s.charAt(i + k) ==... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\tboolean eof;\\n\\n\\tpublic String nextToken() {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\teof = true;\\n\\t\\t\\t\\treturn \\\"-1\\\";\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tpublic int nextInt() {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tint NOD(int a, int b) {\\n\\t\\twhile (a * b > 0) {\\n\\t\\t\\tif (a > b) {\\n\\t\\t\\t\\ta %= b;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tb %= a;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn a + b;\\n\\t}\\n\\n\\tvoid solve() {\\n\\t\\tint n = nextInt(), k= nextInt();\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; ++i){\\n\\t\\t\\ta[i] = nextInt() - 1;\\n\\t\\t}\\n\\t\\tint[] b = new int[100000];\\n\\t\\tint p = 0;\\n\\t\\tfor (int i = 0; i < n; ++i){\\n\\t\\t\\t++b[a[i]];\\n\\t\\t\\tif (b[a[i]] == 1){\\n\\t\\t\\t\\t++p;\\n\\t\\t\\t}\\n\\t\\t\\tif (k == p){\\n\\t\\t\\t\\tint j;\\n\\t\\t\\t\\tfor (j = 0; j <= i; ++j){\\n\\t\\t\\t\\t\\tif (b[a[j]] > 1){\\n\\t\\t\\t\\t\\t\\t--b[a[j]];\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tout.print((j + 1) + \\\" \\\" + (i + 1));\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.print(\\\"-1 -1\\\");\\n\\t}\\n\\n\\tBufferedReader br;\\n\\tStringTokenizer st;\\n\\tPrintWriter out;\\n\\n\\tvoid run() {\\n\\t\\ttry {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(new OutputStreamWriter(System.out));\\n\\n\\t\\t\\t\\/\\/ br = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t\\t\\/\\/ out = new PrintWriter(new FileWriter(\\\"output.txt\\\"));\\n\\t\\t\\tsolve();\\n\\t\\t\\tbr.close();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Throwable e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(1);\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew Main().run();\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\/**\\n * User: serparamon\\n *\\/\\npublic class Codeforces_2012_08_31_A {\\n\\n public static void main(String[] args) throws IOException {\\n \\/\\/Scanner in = new Scanner(System.in);\\n StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n PrintWriter out = new PrintWriter(System.out);\\n in.nextToken();\\n int n = (int) in.nval;\\n int[] a = new int[n];\\n for (int i=0; i 0){\\n int n = in.nextInt();\\n int[] arr = in.nextIntArray(n);\\n ArrayList list = new ArrayList<>();\\n \\n for(int i = 1; i < n; i++){\\n int u = in.nextInt() - 1;\\n int v = in.nextInt() - 1;\\n list.add(new Pair(u, v, Math.max(arr[u],arr[v])));\\n }\\n list.sort((p1,p2) -> Integer.compare(p1.i, p2.i));\\n initialize(n);\\n long s1 = 0;\\n for(int i = 0; i < list.size(); i++){\\n s1 += union(list.get(i).x, list.get(i).y) * list.get(i).i;\\n }\\n for(int i = 0; i < list.size(); i++){\\n Pair p = list.get(i);\\n p.i = Math.min(arr[p.x],arr[p.y]);\\n }\\n list.sort((p1,p2) ->... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Jaynil\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n BSportMafia solver = new BSportMafia();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class BSportMafia {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n long n = in.nextLong();\\n long k = in.nextLong();\\n long b = 2 * n + 3;\\n long c = n * n - 2 * k + n;\\n long d = b * b - 4 * c;\\n long val = (b - (long) Math.sqrt(d)) \\/ 2;\\n\\n out.println(val);\\n }\\n\\n }\\n\\n static class InputReader {\\n public BufferedReader reader;\\n public StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\\n tokenizer = null;\\n }\\n\\n public String next() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n try {\\n tokenizer = new StringTokenizer(reader.readLine());\\n } catch (IOException e) {\\n throw new RuntimeException(e);\\n }\\n }\\n return tokenizer.nextToken();\\n }\\n\\n public long nextLong() {\\n return Long.parseLong(next());\\n }\\n\\n }\\n}\\n\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\n\\n\\/*************************************************************************\\n * Compilation: javac LRS.java\\n * Execution: java LRS < file.txt\\n * Dependencies: StdIn.java\\n * \\n * Reads a text corpus from stdin, replaces all consecutive blocks of\\n * whitespace with a single space, and then computes the longest\\n * repeated substring in that corpus. Suffix sorts the corpus using\\n * the system sort, then finds the longest repeated substring among \\n * consecutive suffixes in the sorted order.\\n * \\n * % java LRS < mobydick.txt\\n * ',- Such a funny, sporty, gamy, jesty, joky, hoky-poky lad, is the Ocean, oh! Th'\\n * \\n * % java LRS \\n * aaaaaaaaa\\n * 'aaaaaaaa'\\n *\\n * % java LRS\\n * abcdefg\\n * ''\\n *\\n *************************************************************************\\/\\n\\n\\nimport java.util.Arrays;\\n\\npublic class LRS {\\n\\n \\/\\/ return the longest common prefix of s and t\\n public static String lcp(String s, String t) {\\n int n = Math.min(s.length(), t.length());\\n for (int i = 0; i < n; i++) {\\n if (s.charAt(i) != t.charAt(i))\\n return s.substring(0, i);\\n }\\n return s.substring(0, n);\\n }\\n\\n\\n \\/\\/ return the longest repeated string in s\\n public static String lrs(String s) {\\n\\n \\/\\/ form the N suffixes\\n int N = s.length();\\n String[] suffixes = new String[N];\\n for (int i = 0; i < N; i++) {\\n suffixes[i] = s.substring(i, N);\\n }\\n\\n \\/\\/ sort them\\n Arrays.sort(suffixes);\\n\\n \\/\\/ find longest repeated substring by comparing adjacent sorted suffixes\\n String lrs = \\\"\\\";\\n for (int i = 0; i < N - 1; i++) {\\n String x = lcp(suffixes[i], suffixes[i+1]);\\n if (x.length() > lrs.length())\\n lrs = x;\\n }\\n return lrs;\\n }\\n\\n\\n\\n \\/\\/ read in text, replacing all consecutive whitespace with a single space\\n \\/\\/ then compute longest repeated substring\\n public static void main(String[] args) throws IOException {\\n\\n BufferedReader... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\n\\n\\npublic class Main{\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tpublic static void main(String[] args) {\\n\\t\\tParser p = new Parser(System.in);\\n\\t\\tPrintWriter pw= new PrintWriter(System.out);\\n\\n\\t\\tint n = p.nextInt();\\n\\t\\tint k = p.nextInt();\\n\\n\\t\\tint[] a = p.nextIntArray(n);\\n\\t\\tint [] pos = new int[100001];\\n\\t\\tArrays.fill(pos,-1);\\n\\t\\tint cnt = 0;\\n\\t\\tfor(int i=0; i max){\\n\\t\\t\\t\\tmax = pos[i];\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t++min;\\n\\t\\t++max;\\n\\n\\t\\tpw.println(min+\\\" \\\"+max);\\n\\t\\tpw.close();\\n\\t}\\n\\t\\n\\t\\n\\n\\n\\n\\n\\n\\tstatic class Parser{\\n\\t\\t\\n\\t\\tStringTokenizer st;\\n\\t\\tBufferedReader br;\\n\\n\\t\\tpublic Parser(InputStream is){\\n\\t\\t\\tthis.br = new BufferedReader( new InputStreamReader(is));\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic int nextInt(){\\n\\t\\t\\treturn Integer.parseInt(nextToken());\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic double nextDouble(){\\n\\t\\t\\treturn Double.parseDouble(nextToken());\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic String nextString(){\\n\\t\\t\\treturn nextToken();\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic int[] nextIntArray(int s){\\n\\t\\t\\tint[] a = new int[s];\\n\\t\\t\\tfor(int i=0; i ar[j]) {\\n dp[i][j]++;\\n ct++;\\n }\\n }\\n }\\n for (int i = n - 2; i >= 0; i--) {\\n for (int j = i + 1; j < n; j++) {\\n dp[i][j] += dp[i + 1][j];\\n }\\n }\\n int m = in.nextInt();\\n for (int i = 0; i < m; i++) {\\n int l = in.nextInt() - 1;\\n int r = in.nextInt() - 1;\\n long val = (r - l + 1);\\n long estimated = (val * (val - 1)) \\/ 2;\\n long change = estimated - dp[l][r];\\n \\/\\/System.out.println(ct);\\n ct = ct - dp[l][r];\\n dp[l][r] = change;\\n ct += dp[l][r];\\n if (ct % 2 == 0) {\\n out.println(\\\"even\\\");\\n } else {\\n out.println(\\\"odd\\\");\\n }\\n \\/\\/ System.out.println(ct);\\n\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\npublic class CC {\\n\\tpublic static void main(String[] args)throws Throwable {\\n\\t\\tMyScanner sc=new MyScanner();\\n\\t\\tPrintWriter pw=new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tint n=sc.nextInt();\\n\\t\\tint r=sc.nextInt();\\n\\t\\tint [] x=new int [n];\\n\\t\\tfor(int i=0;i2*r)\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\tdouble y=Math.sqrt((4*r*r)-(dx*dx));\\n\\t\\t\\t\\tans[i]=Math.max(ans[i], ans[j]+y);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\n\\t\\tfor(double z : ans)\\n\\t\\t\\tpw.print(z+\\\" \\\");\\n\\t\\tpw.flush();\\n\\t\\tpw.close();\\n\\t}\\n\\t\\n\\tstatic class MyScanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\t\\tpublic MyScanner() {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\t\\tString next() {while (st == null || !st.hasMoreElements()) {\\n\\t\\t\\ttry {st = new StringTokenizer(br.readLine());}\\n\\t\\t\\tcatch (IOException e) {e.printStackTrace();}}\\n\\t\\treturn st.nextToken();}\\n\\t\\tint nextInt() {return Integer.parseInt(next());}\\n\\t\\tlong nextLong() {return Long.parseLong(next());}\\n\\t\\tdouble nextDouble() {return Double.parseDouble(next());}\\n\\t\\tString nextLine(){String str = \\\"\\\";\\n\\t\\ttry {str = br.readLine();}\\n\\t\\tcatch (IOException e) {e.printStackTrace();}\\n\\t\\treturn str;}\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.awt.*;\\nimport java.awt.geom.*;\\nimport java.math.*;\\nimport java.text.*;\\nimport java.math.BigInteger.*;\\nimport java.util.Arrays; \\n\\npublic class CF111111\\n{\\n BufferedReader in;\\n StringTokenizer as;\\n int nums[],nums2[];\\n int[] nums1[];\\n boolean con = true;\\n \\n ArrayList < Integer > ar = new ArrayList < Integer >();\\n ArrayList < Integer > fi = new ArrayList < Integer >();\\n Map map = new HashMap();\\n public static void main (String[] args)\\n {\\n new CF111111 ();\\n }\\n \\n public int GCD(int a, int b) {\\n if (b==0) return a;\\n return GCD(b,a%b);\\n }\\n \\n public int LIS(int arr[])\\n {\\n int n = arr.length;\\n int sun[] = new int [n];\\n int cur = 0;\\n for(int x = 0;x= max)\\n {\\n max2 = max;\\n max = nums[x];\\n }\\n else if(nums[x] >= max2)\\n max2 = nums[x];\\n }\\n System.out.println(Math.min(max2, b-1)-1);\\n }\\n }\\n catch(IOException e)\\n {\\n\\n }\\n }\\n \\n \\n \\n \\n \\n \\n \\n String next () throws IOException\\n {\\n while (as == null || !as.hasMoreTokens ())\\n {\\n as = new StringTokenizer (in.readLine ().trim ());\\n }\\n \\n \\n return as.nextToken ();\\n }\\n \\n \\n \\n long nextLong () throws IOException\\n {\\n return Long.parseLong (next ());\\n }\\n \\n \\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class K603 {\\n\\n public static void main(String[] args) {\\n Scanner sc=new Scanner(System.in);\\n \\n long a=sc.nextLong();\\n long b=sc.nextLong();\\n \\n if(b-a<2){\\n System.out.println(-1);\\n }else if(b-a==2 && a%2==1){\\n System.out.println(-1);\\n }else if(b-a==2 && a%2==0){\\n System.out.println(a+\\\" \\\"+(a+1)+\\\" \\\"+(a+2));\\n }else{\\n if(a%2==0){\\n System.out.println(a+\\\" \\\"+(a+1)+\\\" \\\"+(a+2));\\n }else{\\n System.out.println((a+1)+\\\" \\\"+(a+2)+\\\" \\\"+(a+3));\\n }\\n }\\n }\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n static final int MODULO = (int) (1e9 + 7);\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; ++i) a[i] = removeSquares(in.nextInt());\\n Arrays.sort(a);\\n\\n int[][] c = new int[n + 1][n + 1];\\n c[0][0] = 1;\\n for (int i = 1; i < c.length; ++i) {\\n c[i][0] = 1;\\n for (int j = 1; j < c.length; ++j) {\\n c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MODULO;\\n }\\n }\\n\\n int[] fact = new int[n + 1];\\n fact[0] = 1;\\n for (int i = 1; i < fact.length; ++i) {\\n fact[i] = (int) (i * (long) fact[i - 1] % MODULO);\\n }\\n\\n int i = 0;\\n int[] ways = new int[]{1};\\n\\n while (i < n) {\\n int j = i;\\n while (j < n && a[j] == a[i]) ++j;\\n\\n int m = j - i;\\n\\n int[] nways = new int[j + 1];\\n for (int old = 0; old < ways.length; ++old) {\\n long w = ways[old];\\n for (int blocks = 1; blocks <= m; ++blocks) {\\n for (int intoOld = 0; intoOld <=... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/package round97;\\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\npublic class A {\\n\\n\\tstatic BufferedReader bf = new BufferedReader(new InputStreamReader(\\n\\t\\t\\tSystem.in));\\n\\tstatic StringTokenizer st;\\n\\tstatic PrintWriter out = new PrintWriter(System.out);\\n\\n\\tstatic String nextToken() throws IOException {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tString s = bf.readLine();\\n\\t\\t\\tif (s == null)\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\tst = new StringTokenizer(s);\\n\\t\\t}\\n\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tstatic int nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tstatic long nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tstatic String nextStr() throws IOException {\\n\\t\\treturn nextToken();\\n\\t}\\n\\n\\tstatic double nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tint n = nextInt();\\n\\t\\tint a[] = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\ta[i] = nextInt();\\n\\t\\t}\\n\\t\\tArrays.sort(a);\\n\\t\\t\\n\\t\\tfor (int q = 0; q < n; q++) {\\n\\t\\t\\tif (a[q] != 1) {\\n\\t\\t\\t\\tout.print(\\\"1\\\");\\n\\t\\t\\t\\tfor (int i = 1; i < n; i++) {\\n\\t\\t\\t\\t\\tout.print(\\\" \\\" + a[i - 1]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tout.flush();\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor (int i = 0; i < n - 1; i++) {\\n\\t\\t\\tout.print(\\\"1 \\\");\\n\\t\\t}\\n\\t\\tout.println(\\\"2\\\");\\n\\t\\tout.flush();\\n\\t\\t\\n\\t\\t\\n\\t}\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Map;\\nimport java.util.Scanner;\\nimport java.util.TreeMap;\\n\\npublic class CottageVillage {\\n \\n public static void main(String... args) {\\n Scanner sc = new Scanner(System.in);\\n \\n int n = sc.nextInt();\\n int k = sc.nextInt();\\n \\n TreeMap tm = new TreeMap();\\n while (n-->0) {\\n tm.put(sc.nextInt(), sc.nextInt());\\n }\\n \\n int cnt=2, x=0, a=0; \\n double diff=0;\\n for(Map.Entry e : tm.entrySet()) {\\n if (x!=0 || a!=0) {\\n diff = Math.abs(e.getKey()-x-e.getValue()*0.5-a*0.5); \\n if (diff-k>0) cnt+=2;\\n else if (diff-k==0) cnt++;\\n }\\n x=e.getKey();\\n a=e.getValue();\\n }\\n System.out.println(cnt);\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n public class New_Year_and_Curling {\\n static final double E = 0.00001;\\n \\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n \\n int n = sc.nextInt();\\n int r = sc.nextInt();\\n double[] y = new double[n];\\n int arr[] = new int[n];\\n \\n for (int i = 0; i < n; i++) {\\n arr[i] =sc.nextInt();\\n double top = r; \\/\\/ if we make it 0 and subtract from the result will get WA (do not know why!!!)\\n int x = arr[i];\\n for(int j =0 ;j0;tc--) {\\n long n=ni();\\n long q=1;\\n long p=1;\\n boolean f=false;\\n while (true) {\\n if (p*2==n || p*4==n) { f=true; break; }\\n q++;\\n p=q*q;\\n if (p>n) break;\\n }\\n if (f) out.println(\\\"YES\\\");\\n else out.println(\\\"NO\\\");\\n }\\n out.flush();\\n }\\n \\n int gcd(int a,int b) { return(b==0?a:gcd(b,a%b)); }\\n long gcd(long a,long b) { return(b==0?a:gcd(b,a%b)); }\\n long mp(long a,long p) { long r=1; while(p>0) { if ((p&1)==1) r=(r*a)%mod; p>>=1; a=(a*a)%mod; } return r; }\\n \\n public static void main(String[] args) throws IOException {\\n new Main().solve();\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\n\\n\\/**\\n * @author piuspratik (Piyush Das)\\n *\\/\\npublic class TaskA {\\n\\n class Contest implements Comparable\\n\\n {\\n int problems;\\n int penalty;\\n\\n Contest (int problems, int penalty) {\\n this.problems = problems;\\n this.penalty = penalty;\\n }\\n\\n public int compareTo(Contest contest) {\\n if(problems != contest.problems) return contest.problems - problems;\\n return penalty - contest.penalty;\\n\\n\\n }\\n }\\n\\n void run(){\\n int n = nextInt(), k = nextInt();\\n Contest[] c = new Contest[n];\\n for(int i = 0; i < n; i++) {\\n c[i] = new Contest(nextInt(), nextInt());\\n }\\n\\n Arrays.sort(c);\\n int cproblem = c[k - 1].problems, cpenalty = c[k - 1].penalty;\\n\\n int ans = 0;\\n for(int i = 0; i < n; i++) {\\n if(c[i].problems == cproblem && c[i].penalty == cpenalty) ans++;\\n }\\n\\n System.out.println(ans);\\n }\\n\\n int nextInt(){\\n try{\\n int c = System.in.read();\\n if(c == -1) return c;\\n while(c != '-' && (c < '0' || '9' < c)){\\n c = System.in.read();\\n if(c == -1) return c;\\n }\\n if(c == '-') return -nextInt();\\n int res = 0;\\n do{\\n res *= 10;\\n res += c - '0';\\n c = System.in.read();\\n }while('0' <= c && c <= '9');\\n return res;\\n }catch(Exception e){\\n return -1;\\n }\\n }\\n\\n long nextLong(){\\n try{\\n int c = System.in.read();\\n if(c == -1) return -1;\\n while(c != '-' && (c < '0' || '9' < c)){\\n c = System.in.read();\\n if(c == -1) return -1;\\n }\\n if(c == '-') return -nextLong();\\n long res = 0;\\n do{\\n res *= 10;\\n res += c-'0';\\n c = System.in.read();\\n }while('0' <= c && c <= '9');\\n ... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport static java.lang.Math.*; \\nimport static java.util.Arrays.*;\\nimport static java.lang.Character.*;\\nimport static java.lang.Double.*;\\n\\n\\npublic class A {\\n\\n\\tScanner scan = new Scanner(System.in);\\n\\t\\n\\t\\n\\tvoid solve() {\\n\\t\\tint n = scan.nextInt();\\n\\t\\tString[]A = new String[n];\\n\\t\\tString[]B = new String[n];\\n\\t\\tint res =0;\\n\\t\\tfor(int i=0;i r*2) continue;\\n\\t\\t\\t\\tdouble yy = Math.sqrt(4*r*r-dx*dx);\\n\\t\\t\\t\\tminy = Math.max(miny, yy+y[j]);\\n\\t\\t\\t}\\n\\t\\t\\ty[i] = miny;\\n\\t\\t}\\n\\t\\tfor(int i = 0; i < n; i++){\\n\\t\\t\\tSystem.out.print(y[i]+\\\" \\\");\\n\\t\\t}\\n\\t\\t\\n\\n\\t}\\n\\n\\t\\n\\t\\n\\tstatic class FastScanner{\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\t\\tpublic FastScanner(String s) {\\n\\t\\t\\ttry{\\n\\t\\t\\t\\tbr = new BufferedReader(new FileReader(s));\\n\\t\\t\\t}\\n\\t\\t\\tcatch(FileNotFoundException e) {\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tpublic FastScanner(){\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\t\\t\\n\\t\\tString nextToken()\\t{\\n\\t\\t\\twhile(st == null ||!st.hasMoreElements()){\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());}\\n\\t\\t\\t\\tcatch(IOException e) {\\n\\t\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t\\t}\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\t\\t\\n\\t\\tint nextInt() {\\n\\t\\t\\treturn Integer.parseInt(nextToken());\\n\\t\\t}\\n\\t\\tlong nextLong() {\\n\\t\\t\\treturn Long.parseLong(nextToken());\\n\\t\\t}\\n\\t\\tdouble nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(nextToken());\\n\\t\\t}\\n\\t\\tString next() {\\n\\t\\t\\treturn nextToken();\\n\\t\\t}\\n\\t\\t\\n\\t}\\n}\\n Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.FileNotFoundException;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n public static void main(String[] args) throws FileNotFoundException {\\n Scanner in = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n\\n int n = in.nextInt();\\n if (n%2==0) {\\n System.out.println(4+\\\" \\\"+(n-4));\\n } else {\\n System.out.println(9+\\\" \\\"+(n-9));\\n }\\n\\n in.close();\\n out.close();\\n }\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class C\\n{\\t\\n\\tstatic long mod=(long)(1e9+7);\\n\\tpublic static long powMod(long e,long b)\\n\\t{\\n\\t\\t\\/*e=e%mod;*\\/\\n\\t\\tlong res=1;\\n\\t\\t\\n\\t\\twhile(e>0)\\n\\t\\t{\\n\\t\\t\\tif(e%2==1)\\n\\t\\t\\t\\tres=res*b%mod;\\n\\t\\t\\te\\/=2;\\n\\t\\t\\tb=b*b%mod;\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n\\n\\t\\tpublic static void main(String[] args) throws IOException \\n\\t\\t{\\n\\t\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\t\\tPrintWriter pw=new PrintWriter(System.out);\\n\\t\\t\\tlong x=sc.nextLong(),k=sc.nextLong();\\n\\t\\t\\tif(x==0)\\n\\t\\t\\t{\\n\\t\\t\\t\\tSystem.out.println(0);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tif(k==0)\\n\\t\\t\\t{\\n\\t\\t\\t\\tpw.println((2*x)%mod);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tpw.close();return;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tlong ans=2*x-1;\\n\\t\\t\\tans=ans%mod;\\n\\t\\t\\t\\n\\t\\t\\tlong b=powMod(k,2);\\n\\t\\t\\tans=((ans*b)+1)%mod;\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\tpw.println(ans);\\n\\t\\t\\t\\n\\t\\t\\tpw.close();\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\n\\tstatic class Scanner\\n\\t{\\n\\t\\tStringTokenizer st;\\n\\t\\tBufferedReader br;\\n\\n\\t\\tpublic Scanner(InputStream s) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(s));\\n\\t\\t}\\n\\t\\tpublic String next() throws IOException {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\t\\tpublic double nextDouble() throws IOException {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() throws IOException {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic String nextLine() throws IOException {\\n\\t\\t\\treturn br.readLine();\\n\\t\\t}\\n\\n\\t\\tpublic boolean ready() throws IOException {\\n\\t\\t\\treturn br.ready();\\n\\t\\t}\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.readInt();\\n boolean[] isF = new boolean[n];\\n for (int i = 0; i < n; i++) {\\n isF[i] = in.readCharacter() == 'f';\\n }\\n FenwickTree[] fenwickTrees = new FenwickTree[n + 1];\\n for (int i = 0; i < fenwickTrees.length; i++) {\\n fenwickTrees[i] = new FenwickTree(n + 1);\\n }\\n fenwickTrees[n].add(0, 1);\\n for (int idx = n - 1; idx >= 0; idx--) {\\n for (int indentLevel = 0; indentLevel < n; indentLevel++) {\\n long fenwickRes;\\n if (isF[idx]) {\\n fenwickRes = fenwickTrees[idx + 1].get(indentLevel + 1, indentLevel + 1);\\n } else {\\n fenwickRes = fenwickTrees[idx + 1].get(0, indentLevel);\\n }\\n fenwickTrees[idx].add(indentLevel, fenwickRes % MiscUtils.MOD7);\\n }\\n }\\n out.printLine(fenwickTrees[0].get(0, 0));\\n }\\n }\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.awt.geom.*;\\nimport java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\nimport java.util.regex.*;\\nimport static java.lang.Math.*;\\npublic class A {\\n\\n public A() throws Exception {\\n int n = in.nextInt();\\n int[] arr = new int[n];\\n for (int i=0; i= n-i; j--){\\n\\t\\t\\t\\tcurR += a[j];\\n\\t\\t\\t}\\n\\t\\t\\tcurR -= i;\\n\\t\\t\\tif(curR >= m){\\n\\t\\t\\t\\tout.println(i);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(-1);\\n\\t}\\n\\n\\tvoid init() throws FileNotFoundException {\\n\\t\\tif (ONLINE_JUDGE) {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t} else {\\n\\t\\t\\tin = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t\\tout = new PrintWriter(\\\"output.txt\\\");\\n\\t\\t}\\n\\t}\\n\\n\\tString readString() throws IOException {\\n\\t\\twhile (!tok.hasMoreTokens()) {\\n\\t\\t\\ttok = new StringTokenizer(in.readLine());\\n\\t\\t}\\n\\t\\treturn tok.nextToken();\\n\\t}\\n\\n\\tint readInt() throws IOException {\\n\\t\\treturn Integer.parseInt(readString());\\n\\t}\\n\\n\\tlong readLong() throws IOException {\\n\\t\\treturn Long.parseLong(readString());\\n\\t}\\n\\n\\tdouble readDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(readString());\\n\\t}\\n\\n\\tint[] readArr(int n) throws IOException {\\n\\t\\tint[] res = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tres[i] = readInt();\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n\\n\\tlong[] readArrL(int n) throws IOException {\\n\\t\\tlong[] res = new long[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tres[i] = readLong();\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew A().run();\\n\\t}\\n\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tlong t1 = System.currentTimeMillis();\\n\\t\\t\\tinit();\\n\\t\\t\\tsolve();\\n\\t\\t\\tout.close();\\n\\t\\t\\tlong t2 = System.currentTimeMillis();\\n\\t\\t\\tSystem.err.println(\\\"Time = \\\" + (t2 - t1));\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\te.printStackTrace(System.err);\\n\\t\\t\\tSystem.exit(-1);\\n\\t\\t}\\n\\t}\\n} Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.util.StringTokenizer;\\n\\npublic class GeorgeAndInterestingGraph {\\n public static void main(String[] args) {\\n MyScanner sc = new MyScanner();\\n \\n int N = sc.nextInt();\\n int M = sc.nextInt();\\n \\n int[] edgeFrom = new int[M];\\n int[] edgeTo = new int[M];\\n for (int i = 0; i < M; i++) {\\n \\tedgeFrom[i] = sc.nextInt();\\n \\tedgeTo[i] = sc.nextInt();\\n }\\n \\n int best = Integer.MAX_VALUE;\\n \\tboolean[][] adjMat = makeAdjMat(N, edgeFrom, edgeTo);\\n for (int i = 0; i < N; i++) {\\n \\tboolean[][] mat = copyOfArray2d(adjMat);\\n \\tbest = Math.min(best, count(mat, M, i));\\n }\\n \\n System.out.println(best);\\n }\\n \\n public static boolean[][] copyOfArray2d(boolean[][] arr) {\\n \\tint N = arr.length;\\n \\tint M = arr[0].length;\\n \\tboolean[][] copy = new boolean[N][M];\\n \\tfor (int i = 0; i < N; i++) {\\n \\t\\tSystem.arraycopy(arr[i], 0, copy[i], 0, M);\\n \\t}\\n \\treturn copy;\\n }\\n \\n public static int count(boolean[][] mat, int M, int center) {\\n \\tint N = mat.length;\\n \\t\\n \\tint centerCount = (mat[center][center]) ? 1 : 0;\\n \\tfor (int i = 0; i < N; i++) {\\n \\t\\tif (i != center) {\\n \\t\\t\\tif (mat[i][center]) {\\n \\t\\t\\t\\tcenterCount++;\\n \\t\\t\\t}\\n \\t\\t\\tif (mat[center][i]) {\\n \\t\\t\\t\\tcenterCount++;\\n \\t\\t\\t}\\n \\t\\t}\\n \\tmat[i][center] = false;\\n \\tmat[center][i] = false;\\n \\t}\\n \\tint other = M - centerCount;\\n \\t\\n \\tint matches = bipartiteMatching(mat);\\n \\t\\n \\treturn (2 * N - 1 - centerCount + other - matches + N - 1 - matches);\\n }\\n \\n public static boolean[][] makeAdjMat(int N, int[] edgeFrom, int[] edgeTo) {\\n \\tboolean[][] mat = new boolean[N][N];\\n \\tfor (int i = 0; i < edgeFrom.length; i++) {\\n \\t\\tint from = edgeFrom[i] - 1;\\n \\t\\tint to = edgeTo[i] - 1;\\n \\t\\tmat[from][to] = true;\\n \\t}\\n \\treturn mat;\\n }\\n \\n \\/**\\n * Returns true if a matching for... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class E2\\n{\\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n \\/\\/ BufferedReader in;\\n StringTokenizer tok;\\n\\n public void go() throws IOException\\n {\\n \\/\\/ long start = System.nanoTime();\\n \\/\\/ in = new BufferedReader(new FileReader(new File(\\\"input.txt\\\")));\\n StringTokenizer tok = new StringTokenizer(in.readLine());\\n int zzz = Integer.parseInt(tok.nextToken());\\n for (int zz = 0; zz < zzz; zz++)\\n {\\n ntok();\\n int n = ipar();\\n int m = ipar();\\n int[][] mat = new int[m][n+1];\\n for (int i = 0; i < n; i++)\\n {\\n ntok();\\n for (int e = 0; e < m; e++)\\n {\\n mat[e][i] = ipar();\\n }\\n }\\n for (int i = 0; i < m; i++)\\n {\\n for (int e = 0; e < n; e++)\\n {\\n mat[i][n] = Math.max(mat[i][n], mat[i][e]);\\n }\\n }\\n ArrayList list = new ArrayList<>();\\n for (int i = 0; i < m; i++)\\n {\\n list.add(mat[i]);\\n }\\n Collections.sort(list, (a, b) -> {\\n return -Integer.compare(a[n], b[n]);\\n });\\n for (int i = 0; i < m; i++)\\n {\\n mat[i] = list.get(i);\\n }\\n m = Math.min(m, n);\\n\\n int[][] dp = new int[1 << n][m+1];\\n for (int i = m-1; i >= 0; i--)\\n {\\n int[] temp = new int[1 << n];\\n for (int r = 0; r < n; r++)\\n {\\n for (int j = 0; j < 1 << n; j++)\\n {\\n temp[j] = dp[j][i+1];\\n }\\n for (int j = 0; j < n; j++)\\n {\\n int val =... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author kessido\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskG solver = new TaskG();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskG {\\n static int[][] g;\\n static int n;\\n static int[] a;\\n static int[][] edges;\\n static long[] dp;\\n static long[] dpPathToRootWithDetours;\\n static int time = 0;\\n static int[] appearance;\\n static int[] firstAppearance;\\n static int[] depth;\\n\\n public static void dfs(int i, int parE) {\\n firstAppearance[i] = time;\\n appearance[time++] = i;\\n dp[i] = a[i];\\n for (int eIndex : g[i]) {\\n if (eIndex == parE) continue;\\n int child = i ^ edges[eIndex][0] ^ edges[eIndex][1];\\n dfs(child, eIndex);\\n appearance[time++] = i;\\n dp[i] += Math.max(dp[child] - edges[eIndex][2] * 2, 0);\\n }\\n }\\n\\n public static void dfs2(int i, int parE) {\\n if (i == 0) {\\n dpPathToRootWithDetours[i] = dp[i];\\n } else {\\n int par = i ^ edges[parE][0] ^ edges[parE][1];\\n depth[i] = depth[par] + 1;\\n dpPathToRootWithDetours[i] = dpPathToRootWithDetours[par] - Math.max(0, dp[i] - edges[parE][2] * 2);\\n dpPathToRootWithDetours[i] -= edges[parE][2];\\n dpPathToRootWithDetours[i] += dp[i];\\n\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\n\\npublic class ToyArmy {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t * @throws IOException \\n\\t * @throws NumberFormatException \\n\\t *\\/\\n\\tpublic static void main(String[] args) throws NumberFormatException, IOException \\n\\t{\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint n = Integer.parseInt(br.readLine());\\n\\t\\tSystem.out.println(n \\/ 2 * 3);\\n\\t}\\n\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.text.*;\\nimport java.math.*;\\nimport java.util.*;\\n\\npublic class Hexadec implements Runnable {\\n\\n final static String taskname = \\\"filename\\\";\\n\\n public void solve() throws Exception {\\n \\/\\/\\tint n = iread();\\t\\n \\tint n = Integer.parseInt(in.readLine());\\n \\t\\n \\t\\n \\t\\n \\tout.write(n + \\\" \\\"+0+\\\" \\\"+0);\\n \\/\\/ out.write(ans_path + \\\"\\\\n\\\");\\n }\\n\\n public void run() {\\n try {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new BufferedWriter(new OutputStreamWriter(System.out));\\n\\/\\/ in = new BufferedReader(new FileReader(taskname + \\\".in\\\"));\\n\\/\\/ out = new BufferedWriter(new FileWriter(taskname + \\\".out\\\"));\\n solve();\\n out.flush();\\n } catch (Exception e) {\\n e.printStackTrace();\\n System.exit(1);\\n }\\n }\\n\\n public int iread() throws Exception {\\n return Integer.parseInt(readword());\\n }\\n\\n public double dread() throws Exception {\\n return Double.parseDouble(readword());\\n }\\n\\n public long lread() throws Exception {\\n return Long.parseLong(readword());\\n }\\n\\n BufferedReader in;\\n\\n BufferedWriter out;\\n\\n public String readword() throws IOException {\\n StringBuilder b = new StringBuilder();\\n int c;\\n c = in.read();\\n while (c >= 0 && c <= ' ')\\n c = in.read();\\n if (c < 0)\\n return \\\"\\\";\\n while (c > ' ') {\\n b.append((char) c);\\n c = in.read();\\n }\\n return b.toString();\\n }\\n\\n public static void main(String[] args) {\\n \\/\\/ Locale.setDefault(Locale.US);\\n new Thread(new Hexadec()).start();\\n }\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.BufferedWriter;\\nimport java.io.FileWriter;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\n\\npublic class ProblemB {\\n \\n public static void main(String[] args) throws IOException {\\n BufferedReader s = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(System.out);\\n\\n String[] line = s.readLine().split(\\\" \\\");\\n long n = Long.valueOf(line[0]);\\n long y = Long.valueOf(line[1]);\\n long x = Long.valueOf(line[2]);\\n long c = Long.valueOf(line[3]);\\n \\n long min = 0;\\n long max = n*2L+20;\\n for (int cnt = 0 ; cnt < 300 ; cnt++) {\\n long med = (min+max) \\/ 2L;\\n long ct = isok(med, n, x, y, c); \\n if (ct >= c) {\\n max = med;\\n } else {\\n min = med+1;\\n }\\n }\\n \\n long lst = max;\\n for (long d = -2 ; d <= 2 ; d++) {\\n if (max+d >= 0 && isok(max+d, n, x, y, c) >= c) {\\n lst = Math.min(lst, max+d);\\n }\\n }\\n \\n out.println(lst);\\n out.flush();\\n }\\n \\n\\n private static long isok(long time, long n, long x, long y, long c) {\\n long total = time * 2 * (time + 1) + 1;\\n long top = y - time;\\n if (top <= 0) {\\n long dy = Math.abs(top)+1;\\n total -= dy*dy;\\n long over = dy - x;\\n if (over >= 1) {\\n total += (1L + over) * over \\/ 2; \\n }\\n over = dy - ((n + 1) - x);\\n if (over >= 1) {\\n total += (1L + over) * over \\/ 2; \\n }\\n }\\n \\n long bottom = y + time;\\n if (bottom > n) {\\n long dy = Math.abs(bottom-n);\\n total -= dy*dy;\\n long over = dy - x;\\n if (over >= 1) {\\n total += (1L + over) * over \\/ 2; \\n }\\n over = dy - ((n + 1) -... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.HashMap;\\nimport java.util.List;\\nimport java.util.Map;\\n\\npublic class F1141 {\\n\\t\\n\\tprivate static class Interval {\\n\\t\\tpublic int l;\\n\\t\\tpublic int r;\\n\\t\\t\\n\\t\\tpublic Interval(int l,int r) {\\n\\t\\t\\tthis.l = l;\\n\\t\\t\\tthis.r = r;\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\/\\/\\t\\tBufferedReader br = new BufferedReader(new FileReader(\\\"F:\\/books\\/input.txt\\\"));\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tString s = br.readLine();\\n\\t\\tint n = Integer.parseInt(s);\\n\\t\\tlong[] a = new long[n];\\n\\t\\tString[] as = br.readLine().split(\\\" \\\");\\n\\t\\tfor(int i=0;i> mp = new HashMap>();\\n\\t\\tlong max = 0,maxId = -1;\\n\\t\\tfor(int i=n-1;i>=0;i--) {\\n\\t\\t\\tlong s=0;\\n\\t\\t\\tlong prev = 1;\\n\\t\\t\\tfor(int j=i;j ints = mp.get(s);\\n\\t\\t\\t\\t\\tif(ints==null) ints = new ArrayList();\\n\\t\\t\\t\\t\\tif(ints.size()==0 || ints.get(0).l>j) {\\n\\t\\t\\t\\t\\t\\tints.add(0,inter);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif(ints.size()>max) {\\n\\t\\t\\t\\t\\t\\tmax = ints.size();\\n\\t\\t\\t\\t\\t\\tmaxId = s;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tmp.put(s, ints);\\n\\/\\/\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(j l = mp.get(maxId);\\n\\t\\tret.append(l.size()+ \\\"\\\\n\\\");\\n\\t\\tfor(Interval inter : l) {\\n\\t\\t\\tret.append((inter.l+1) + \\\" \\\" + (inter.r+1) + \\\"\\\\n\\\");\\n\\t\\t}\\n\\t\\treturn ret;\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.StringTokenizer;\\n\\npublic class Round364C {\\n\\tpublic static void main(String[] args) throws NumberFormatException, IOException {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tn = sc.nextInt();\\n\\t\\tk = 0;\\n\\t\\t\\n\\t\\tString line = sc.nextLine();\\n\\t\\t\\n\\t\\tArrayList poks = new ArrayList();\\n\\t\\tboolean ex[] = new boolean[256];\\n\\t\\t\\n\\t\\tfor(int i=0; i {\\n\\t\\tpublic int start , end;\\n\\t\\tpublic Interval(int start , int end) {\\n\\t\\t\\tthis.start = start;\\n\\t\\t\\tthis.end = end;\\t\\t\\t\\n\\t\\t}\\n\\t\\t@Override\\n\\t\\tpublic int compareTo(Interval interval) {\\n\\t\\t\\treturn this.end - interval.end;\\t\\t\\t\\n\\t\\t}\\t\\t\\n\\t}\\n\\t\\n\\tprivate static int getTotal(List list) {\\n\\t\\tint ans = 0 , i , n = list.size();\\n\\t\\tfor (i = 0;i < n;i ++) {\\n\\t\\t\\tint end = list.get(i).end;\\n\\t\\t\\twhile (i < n && list.get(i).start <= end) {\\n\\t\\t\\t\\ti ++;\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t\\ti --;\\n\\t\\t\\tans ++;\\n\\t\\t}\\t\\t\\n\\t\\treturn ans;\\n\\t}\\n\\t\\n\\tprivate static void solve(List list) {\\n\\t\\tList ans = new ArrayList<>();\\n\\t\\tint i , n = list.size();\\n\\t\\tfor (i = 0;i < n;i ++) {\\n\\t\\t\\tint start = list.get(i).start , end = list.get(i).end;\\n\\t\\t\\twhile (i < n && list.get(i).start <= end) {\\n\\t\\t\\t\\ti ++;\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t\\ti --;\\n\\t\\t\\tans.add(new int[] {start , end});\\n\\t\\t}\\n\\t\\tSystem.out.println(ans.size());\\n\\t\\tfor (int[] array : ans) {\\n\\t\\t\\tSystem.out.println(array[0] + \\\" \\\" + array[1]);\\n\\t\\t}\\n\\t}\\n\\t\\n\\tprivate static long[] a = new long[2000];\\t\\n\\t\\n\\tpublic static void main(String[] args) {\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\n\\t\\tScanner scan = new Scanner(System.in);\\t\\t\\t\\t\\n\\n\\t\\tMap> map = new HashMap<>();\\t\\t\\n\\t\\tint i , j , n = scan.nextInt() , max = 0;\\n\\t\\tlong ans = 0;\\n\\t\\tfor (i = 1;i <= n;i ++) {\\n\\t\\t\\ta[i] = scan.nextLong();\\n\\t\\t}\\n\\t\\tfor (i = 1;i <= n;i ++) {\\n\\t\\t\\tlong sum = 0;\\n\\t\\t\\tfor (j = i;j <= n;j ++) {\\t\\t\\t\\t\\n\\t\\t\\t\\tsum += a[j];\\n\\t\\t\\t\\tif (!map.containsKey(sum)) {\\n\\t\\t\\t\\t\\tmap.put(sum , new ArrayList<>());\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tmap.get(sum).add(new Interval(i , j));\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor (List list : map.values()) {\\n\\t\\t\\tCollections.sort(list);\\t\\t\\t\\n\\t\\t}\\t\\t\\n\\t\\tfor (Map.Entry> entry : map.entrySet()) {\\n\\t\\t\\tint total = getTotal(entry.getValue());\\n\\t\\t\\tif (total > max) {\\n\\t\\t\\t\\tmax = total;\\n\\t\\t\\t\\tans = entry.getKey();\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tsolve(map.get(ans));\\t\\t\\n\\t\\n\\t}\\n \\n}\\n\\n\\n Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.util.concurrent.ThreadLocalRandom;\\nimport java.util.stream.Collectors;\\nimport java.util.stream.IntStream;\\n\\npublic class Main2 {\\n\\n static int mod = 1000000007;\\n static FastScanner scanner;\\n\\n public static void main(String[] args) {\\n scanner = new FastScanner();\\n long n = scanner.nextInt();\\n long k = scanner.nextInt();\\n\\n if (sum(n) == k) {\\n System.out.println(0);\\n return;\\n }\\n\\n long s = 0;\\n long e = n + 1;\\n while (s < e - 1) {\\n long m = (s + e) \\/ 2;\\n long put = sum(n - m);\\n long candiesLeft = put - m;\\n if (candiesLeft == k) {\\n System.out.println(m);\\n return;\\n }\\n if (candiesLeft > k) {\\n s = m;\\n } else {\\n e = m;\\n }\\n }\\n }\\n\\n static long sum(long n) {\\n long last = 1 + n - 1;\\n return ((1 + last) * n) \\/ 2;\\n }\\n\\n static class WithIdx {\\n int val, idx;\\n\\n public WithIdx(int val, int idx) {\\n this.val = val;\\n this.idx = idx;\\n }\\n }\\n\\n public static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n String nextToken() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n String nextLine() {\\n try {\\n return br.readLine();\\n } catch (Exception e) {\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class Task1 {\\n\\n public static void main(String[] args) {\\n int n = new Scanner(System.in).nextInt();\\n System.out.println(n*3\\/2);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.text.*;\\n\\npublic class CF_1523_C{\\n \\/\\/SOLUTION BEGIN\\n void pre() throws Exception{}\\n void solve(int TC) throws Exception{\\n int N = ni();\\n int[] A = new int[N];\\n for(int i = 0; i< N; i++)A[i] = ni();\\n\\n\\/\\/ Stack stack = new Stack<>();\\n int[] stack = new int[2*N];\\n int sz = 0;\\n for(int i = 0; i< N; i++){\\n if(A[i] == 1)stack[sz++] = 1;\\n else{\\n while (sz > 0 && stack[sz-1]+1 != A[i])sz--;\\/\\/!stack.isEmpty() && stack.peek()+1 != A[i])stack.pop();\\n hold(sz != 0);\\n stack[sz-1]++;\\n hold(stack[sz-1] == A[i]);\\n }\\n hold(sz != 0);\\n StringBuilder st = new StringBuilder();\\n for(int s = 0; s< sz; s++){\\n st.append(stack[s]);\\n if(s+1 < sz)st.append(\\\".\\\");\\n }\\n pn(st.toString());\\n }\\n }\\n \\/\\/SOLUTION END\\n void hold(boolean b)throws Exception{if(!b)throw new Exception(\\\"Hold right there, Sparky!\\\");}\\n void exit(boolean b){if(!b)System.exit(0);}\\n static void dbg(Object... o){System.err.println(Arrays.deepToString(o));}\\n final long IINF = (long)1e17;\\n final int INF = (int)1e9+2;\\n DecimalFormat df = new DecimalFormat(\\\"0.00000000000\\\");\\n double PI = 3.141592653589793238462643383279502884197169399, eps = 1e-8;\\n static boolean multipleTC = true, memory = true, fileIO = false;\\n FastReader in;PrintWriter out;\\n void run() throws Exception{\\n long ct = System.currentTimeMillis();\\n if (fileIO) {\\n in = new FastReader(\\\"\\\");\\n out = new PrintWriter(\\\"\\\");\\n } else {\\n in = new FastReader();\\n out = new PrintWriter(System.out);\\n }\\n \\/\\/Solution Credits: Taranpreet Singh\\n int T = multipleTC? ni():1;\\n pre();\\n for (int t = 1; t <= T; t++) solve(t);\\n out.flush();\\n out.close();\\n ... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class E implements Runnable {\\n\\tpublic static void main (String[] args) {new Thread(null, new E(), \\\"_cf\\\", 1 << 28).start();}\\n\\n\\tint n, m;\\n\\tchar[] str;\\n\\tint[][] occs, cost;\\n\\tint[] dp;\\n\\t\\n\\tpublic void run() {\\n\\t\\tFastScanner fs = new FastScanner();\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tSystem.err.println(\\\"\\\");\\n\\n\\t\\t\\/\\/where's my 420???? :(\\n\\t\\t\\n\\t\\tn = fs.nextInt(); m = fs.nextInt();\\n\\t\\tbyte[] str = fs.next().getBytes();\\n\\t\\tint[] occs = new int[1< 0) continue;\\n\\t\\t\\t\\tint lb = mask & (-mask);\\n\\t\\t\\t\\tint trail = Integer.numberOfTrailingZeros(lb);\\n\\t\\t\\t\\tint nmask = mask ^ lb;\\n\\t\\t\\t\\tcost[i][mask] = cost[i][nmask]+occs[1<= 0; mask--) {\\n\\t\\t\\tint addOn = 0;\\n\\t\\t\\tfor(int nxt = 0; nxt < m; nxt++) {\\n\\t\\t\\t\\tif(((1< 0) continue;\\n\\t\\t\\t\\taddOn += cost[nxt][mask];\\n\\t\\t\\t}\\n\\t\\t\\tint res = oo;\\n\\t\\t\\tfor(int nxt = 0; nxt < m; nxt++) {\\n\\t\\t\\t\\tif(((1< 0) continue;\\n\\t\\t\\t\\tint ret = addOn+dp[mask | (1<>1);\\n\\t\\t\\n\\t\\tout.close();\\n\\t}\\n\\t\\n\\tint oo = (int)1e9;\\n\\tint min(int a, int b) {\\n\\t\\tif(a < b) return a;\\n\\t\\treturn b;\\n\\t}\\n\\t\\n\\tclass FastScanner {\\n\\t\\tpublic int BS = 1<<16;\\n\\t\\tpublic char NC = (char)0;\\n\\t\\tbyte[] buf = new byte[BS];\\n\\t\\tint bId = 0, size = 0;\\n\\t\\tchar c = NC;\\n\\t\\tdouble num = 1;\\n\\t\\tBufferedInputStream in;\\n\\n\\t\\tpublic FastScanner() {\\n\\t\\t\\tin = new BufferedInputStream(System.in, BS);\\n\\t\\t}\\n\\n\\t\\tpublic FastScanner(String s) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tin = new BufferedInputStream(new FileInputStream(new File(s)), BS);\\n\\t\\t\\t}\\n\\t\\t\\tcatch (Exception e) {\\n\\t\\t\\t\\tin = 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/**\\n * @author derrick20\\n *\\/\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class SameSumBlocks {\\n public static void main(String[] args) throws Exception {\\n FastScanner sc = new FastScanner();\\n PrintWriter out = new PrintWriter(System.out);\\n\\n int N = sc.nextInt();\\n int[] pre = new int[N + 1];\\n for (int i = 1; i <= N; i++) {\\n pre[i] = pre[i - 1] + sc.nextInt();\\n }\\n\\/\\/ var sumMap = new HashMap>();\\n var sums = new ArrayList();\\n for (int i = 1; i <= N; i++) {\\n for (int j = i; j <= N; j++) {\\n int sum = pre[j] - pre[i - 1];\\n\\/\\/ sumMap.computeIfAbsent(sum, val -> new ArrayList<>()).add(new Pair(i, j, sum));\\n sums.add(new Pair(i, j, sum));\\n }\\n }\\n Collections.sort(sums, (p1, p2) -> p1.sum - p2.sum != 0 ? p1.sum - p2.sum : p1.r - p2.r);\\n var ans = new ArrayList();\\n int i = 0;\\n while (i < sums.size()) {\\n int j = i;\\n var group = new ArrayList(List.of(sums.get(i)));\\n int last = sums.get(i).r;\\n while (j + 1 < sums.size() && sums.get(j + 1).sum == sums.get(j).sum) {\\n if (sums.get(j + 1).l > last) {\\n group.add(sums.get(j + 1));\\n last = sums.get(j + 1).r;\\n }\\n j++;\\n }\\n\\/\\/ System.out.println(group);\\n if (group.size() > ans.size()) {\\n ans = group;\\n }\\n i = j + 1;\\n }\\n out.println(ans.size());\\n for (Pair p : ans) {\\n out.println(p);\\n }\\n out.close();\\n }\\n\\n static class Pair {\\n int l, r, sum;\\n public Pair(int ll, int rr, int ss) {\\n l = ll; r = rr; sum = ss;\\n }\\n public String toString() {\\n return l + \\\" \\\" + r;\\n }\\n }\\n\\n static class FastScanner {\\n private int BS = 1<<16;\\n private char NC = (char)0;\\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class Solution implements Runnable {\\n\\tprivate BufferedReader in;\\n\\tprivate PrintWriter out;\\n\\tprivate StringTokenizer st;\\n\\tprivate Random rnd;\\n\\t\\n\\tdouble Vend;\\n\\t\\n\\tprivate double calcFirstSegment(double a, double Vmax, double Vend, double l) {\\n\\t\\tdouble Vl = 0, Vr = Vmax;\\n\\t\\t\\n\\t\\tfor(int it = 0; it < 256; it++) {\\n\\t\\t\\tdouble Vm = (Vl + Vr) \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tdouble tFirst = Vm \\/ a;\\n\\t\\t\\t\\n\\t\\t\\tdouble tSecond = 0;\\n\\t\\t\\tif(Vend < Vm) tSecond = (Vm - Vend) \\/ a;\\n\\t\\t\\t\\n\\t\\t\\tdouble firstPart = a * tFirst * tFirst \\/ 2.0;\\n\\t\\t\\tdouble secondPart = Vm * tSecond - a * tSecond * tSecond \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tdouble res = firstPart + secondPart;\\n\\t\\t\\t\\n\\t\\t\\tif(res < l) Vl = Vm;\\n\\t\\t\\telse Vr = Vm;\\n\\t\\t}\\n\\t\\t\\n\\t\\tthis.Vend = Math.min(Vl, Vend);\\n\\t\\t\\n\\t\\tdouble res = 0.0;\\n\\t\\t\\n\\t\\t{\\n\\t\\t\\tdouble Vm = Vl;\\n\\t\\t\\t\\n\\t\\t\\tdouble tFirst = Vm \\/ a;\\n\\t\\t\\tdouble tSecond = 0;\\n\\t\\t\\tif(Vend < Vm) tSecond = (Vm - Vend) \\/ a;\\n\\t\\t\\t\\n\\t\\t\\t\\/\\/out.println(tSecond);\\n\\t\\t\\t\\n\\t\\t\\tdouble firstPart = a * tFirst * tFirst \\/ 2.0;\\n\\t\\t\\tdouble secondPart = Vm * tSecond - a * tSecond * tSecond \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tdouble remain = l - firstPart - secondPart;\\n\\t\\t\\t\\n\\t\\t\\tres = tFirst + tSecond + (remain \\/ Vm);\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn res;\\n\\t}\\n\\t\\n\\tprivate double calcSecondPart(double a, double Vmax, double Vstart, double l) {\\n\\t\\tdouble Vl = Vstart, Vr = Vmax;\\n\\t\\t\\n\\t\\t\\/\\/out.println(Vstart);\\n\\t\\t\\n\\t\\tfor(int it = 0; it < 256; it++) {\\n\\t\\t\\tdouble Vm = (Vl + Vr) \\/ 2.0;\\n\\t\\t\\tdouble t = (Vm - Vstart) \\/ a;\\n\\t\\t\\t\\n\\t\\t\\tdouble s = Vstart * t + a * t * t \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tif(s < l) Vl = Vm;\\n\\t\\t\\telse Vr = Vm;\\n\\t\\t}\\n\\t\\t\\n\\t\\tdouble res = 0.0;\\n\\t\\t\\n\\t\\t{\\n\\t\\t\\tdouble Vm = (Vl + Vr) \\/ 2.0;\\n\\t\\t\\tdouble t = (Vm - Vstart) \\/ a;\\n\\t\\t\\t\\n\\t\\t\\tdouble s = Vstart * t + a * t * t \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tdouble remain = l - s;\\n\\t\\t\\t\\n\\t\\t\\tres = t + (remain \\/ Vmax);\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn res;\\n\\t}\\n\\t\\n\\tpublic void solve() throws IOException {\\n\\t\\tdouble a = nextDouble(), v = nextDouble(), l = nextDouble(), d = nextDouble(), w = nextDouble();\\n\\t\\t\\n\\t\\tdouble res = calcFirstSegment(a, v, w, d);\\n\\t\\tres += calcSecondPart(a, v, Vend, l - d);\\n\\t\\t\\n\\t\\tout.println(res);\\n\\t}\\n\\t\\t\\n\\tpublic static void... Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class SimpleTask {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tint n = scan.nextInt();\\n\\t\\tint m = scan.nextInt();\\n\\n\\t\\tboolean[][] graph = new boolean[n][n];\\n\\t\\tfor (int i = 0; i < m; i++) {\\n\\t\\t\\tint u = scan.nextInt() - 1;\\n\\t\\t\\tint v = scan.nextInt() - 1;\\n\\t\\t\\tgraph[u][v] = true;\\n\\t\\t\\tgraph[v][u] = true;\\n\\t\\t}\\n\\n\\t\\tlong[][] dp = new long[1 << n][n];\\n\\t\\tlong sum = 0;\\n\\n\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\tdp[1 << i][i] = 1;\\n\\n\\t\\tfor (int mask = 1; mask < (1 << n); mask++) {\\n\\n\\t\\t\\tint first = Integer.numberOfTrailingZeros(mask);\\n\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tif ((mask & (1 << i)) == 0 || first == i)\\n\\t\\t\\t\\t\\tcontinue;\\n\\n\\t\\t\\t\\tfor (int j = 0; j < n; j++) {\\n\\t\\t\\t\\t\\tif (graph[i][j] && (mask & (1 << j)) != 0)\\n\\t\\t\\t\\t\\t\\tdp[mask][i] += dp[mask ^ 1 << i][j];\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tif (Integer.bitCount(mask) >= 3 && graph[i][first])\\n\\t\\t\\t\\t\\tsum += dp[mask][i];\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\n\\t\\tSystem.out.println(sum \\/ 2);\\n\\t\\tscan.close();\\n\\t}\\n}\\n Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class ErrorCorrectSystem\\n{\\n\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tint n = scan.nextInt();\\n\\t\\tString a = scan.next();\\n\\t\\tString b = scan.next();\\n\\t\\t\\n\\t\\tint[][] mismatch = new int[26][26];\\n\\t\\tfor(int i = 0; i < 26; i++) Arrays.fill(mismatch[i], -1);\\n\\t\\tint[][] pair = new int[2][26];\\n\\t\\tfor(int i = 0; i < 2; i++) Arrays.fill(pair[i], -1);\\n\\t\\tint hd = 0;\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\tif(a.charAt(i) != b.charAt(i)) {\\n\\t\\t\\t\\thd++;\\n\\t\\t\\t\\tmismatch[a.charAt(i)-'a'][b.charAt(i)-'a'] = i;\\n\\t\\t\\t\\tpair[0][a.charAt(i)-'a'] = i;\\n\\t\\t\\t\\tpair[1][b.charAt(i)-'a'] = i;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor(int i = 0; i < 26; i++) {\\n\\t\\t\\tfor(int j = i+1; j < 26; j++) {\\n\\t\\t\\t\\tif(mismatch[i][j] > -1 && mismatch[j][i] > -1) {\\n\\t\\t\\t\\t\\tSystem.out.println(hd-2);\\n\\t\\t\\t\\t\\tSystem.out.println((mismatch[i][j]+1)+\\\" \\\"+(mismatch[j][i]+1));\\n\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\tif(a.charAt(i) != b.charAt(i)) {\\n\\t\\t\\t\\t\\/\\/try a gets b's letter\\n\\t\\t\\t\\tif(pair[0][b.charAt(i)-'a'] > -1) {\\n\\t\\t\\t\\t\\tSystem.out.println(hd-1);\\n\\t\\t\\t\\t\\tSystem.out.println((i+1)+\\\" \\\"+(pair[0][b.charAt(i)-'a']+1));\\n\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(hd);\\n\\t\\tSystem.out.println(\\\"-1 -1\\\");\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class A {\\n static MyScanner sc;\\n static PrintWriter pw;\\n\\n public static void main(String[] args) throws Throwable {\\n sc = new MyScanner();\\n pw = new PrintWriter(System.out);\\n\\n n = sc.nextInt();\\n int m = sc.nextInt();\\n int[][] a = new int[n][m];\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < m; j++)\\n a[i][j] = sc.nextInt();\\n val = new int[n][n];\\n for (int i = 0; i < n; i++)\\n Arrays.fill(val[i], Integer.MAX_VALUE);\\n for (int i = 0; i < n; i++)\\n for (int j = i; j < n; j++) {\\n for (int k = 0; k < m; k++)\\n val[i][j] = val[j][i] = Math.min(val[i][j], Math.abs(a[i][k] - a[j][k]));\\n }\\n\\n val2 = new int[n][n];\\n for (int i = 0; i < n; i++)\\n Arrays.fill(val2[i], Integer.MAX_VALUE);\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < n; j++) {\\n for (int k = 0; k < m - 1; k++)\\n val2[i][j] = Math.min(val2[i][j], Math.abs(a[i][k] - a[j][k + 1]));\\n }\\n mem = new Integer[n][n][1 << n];\\n int ans = 0;\\n for (int i = 0; i < n; i++) {\\n ans = Math.max(ans, dp(i, i, 1 << i));\\n }\\n if (n == 1)\\n pw.println(val2[0][0]);\\n else\\n pw.println(ans);\\n\\n\\n pw.flush();\\n pw.close();\\n }\\n\\n static int n;\\n static int[][] val, val2;\\n static Integer[][][] mem;\\n\\n static int dp(int st, int lst, int msk) {\\n int bits = Integer.bitCount(msk);\\n if (mem[st][lst][msk] != null)\\n return mem[st][lst][msk];\\n int ans = 0;\\n for (int i = 0; i < n; i++)\\n if ((msk & (1 << i)) == 0) {\\n int newMsk = (msk | (1 << i));\\n if (bits < n - 1)\\n ans = Math.max(ans, Math.min(val[lst][i], dp(st, i, newMsk)));\\n else\\n ans =... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.lang.*;\\nimport java.math.*;\\nimport java.io.*;\\nimport static java.lang.Math.*;\\nimport static java.util.Arrays.*;\\nimport static java.util.Collections.*;\\n\\npublic class P111C{\\n\\tScanner sc=new Scanner(System.in);\\n\\n\\tint INF=1<<28;\\n\\tdouble EPS=1e-9;\\n\\n\\tint h, w;\\n\\n\\tvoid run(){\\n\\t\\th=sc.nextInt();\\n\\t\\tw=sc.nextInt();\\n\\t\\tsolve();\\n\\t}\\n\\n\\tvoid shuffle(int[] is){\\n\\t\\tRandom rand=new Random();\\n\\t\\tfor(int i=is.length-1; i>=1; i--){\\n\\t\\t\\tint j=rand.nextInt(i+1);\\n\\t\\t\\tint t=is[i];\\n\\t\\t\\tis[i]=is[j];\\n\\t\\t\\tis[j]=t;\\n\\t\\t}\\n\\t}\\n\\n\\tvoid solve(){\\n\\t\\tn=w*h;\\n\\t\\tg=new long[n];\\n\\t\\tint[] dx={0, 0, -1, 1};\\n\\t\\tint[] dy={-1, 1, 0, 0};\\n\\t\\tfor(int y=0; y=0&&x2=0&&y2=Long.bitCount(mds))\\n\\t\\t\\treturn;\\n\\n\\t\\tif(covered==((1L<>>i&1)==1){\\n\\t\\t\\t\\tif(Long.bitCount(g[i]&~covered)==0){\\n\\t\\t\\t\\t\\tmds(choosed, removed|(1L<= 0 && x < n && y >= 0 && y < m;\\n\\t}\\n\\tstatic int[][] bfs(int[] xs, int[] ys) {\\n\\t\\tint[][] dist = new int[n][m];\\n\\t\\tfor(int i = 0; i < n; i++)\\n\\t\\t\\tArrays.fill(dist[i], inf);\\n\\t\\tQueue q = new LinkedList<>();\\n\\t\\tfor(int i = 0; i < k; i++) {\\n\\t\\t\\tdist[xs[i]][ys[i]] = 0;\\n\\t\\t\\tq.add(new Pair(xs[i], ys[i]));\\n\\t\\t}\\n\\n\\t\\twhile(!q.isEmpty()) {\\n\\t\\t\\tPair p = q.remove();\\n\\t\\t\\tfor(int d = 0; d < 4; d++) {\\n\\t\\t\\t\\tint nx = p.x + dx[d], ny = p.y + dy[d];\\n\\t\\t\\t\\tif(valid(nx, ny) && dist[nx][ny] == inf) {\\n\\t\\t\\t\\t\\tdist[nx][ny] = dist[p.x][p.y] + 1;\\n\\t\\t\\t\\t\\tq.add(new Pair(nx, ny));\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\treturn dist;\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner in = new Scanner();\\n\\t\\tint n = in.nextInt() ; \\n\\t\\tint m = in.nextInt(); \\n\\t\\tint k = in.nextInt(); \\n\\t\\tint x[] = new int[k] ; \\n\\t\\tint y[] = new int[k] ; \\n\\t\\tint trees [][] = new int [n][m] ;\\n\\n\\n\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\tfor (int j = 0; j < m; j++)\\n\\t\\t\\t\\ttrees[i][j]=Integer.MAX_VALUE ;\\n\\n\\t\\tfor (int i = 0; i < k; i++)\\n\\t\\t{\\n\\t\\t\\tx[i]=in.nextInt()-1; \\n\\t\\t\\ty[i]=in.nextInt()-1;\\n\\t\\t\\ttrees[x[i]][y[i]]=0 ;\\n\\t\\t}\\n\\n\\t\\tint dis = Integer.MIN_VALUE ; ;\\n\\t\\tint xp=0; ;\\n\\t\\tint yp=0;\\n\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\tfor (int j = 0; j < m; j++)\\n\\t\\t\\t\\tif(trees[i][j] != 0)\\n\\t\\t\\t\\t\\tfor (int j2 = 0; j2 < k; j2++)\\n\\t\\t\\t\\t\\t\\ttrees[i][j]=Math.min(trees[i][j], Math.abs(i-x[j2])+Math.abs(j-y[j2]));\\n\\n\\t\\tfor (int i = 0; i dis)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tdis=trees[i][j];\\n\\t\\t\\t\\t\\txp=i+1;\\n\\t\\t\\t\\t\\typ=j+1;\\n\\t\\t\\t\\t}\\n\\t\\tPrintWriter out = new PrintWriter(\\\"output.txt\\\");\\n\\t\\tout.printf(\\\"%d... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.HashSet;\\nimport java.util.Set;\\n\\npublic class ProblemD {\\n\\t\\n\\n\\t\\n\\tstatic int N;\\n\\tstatic boolean[][] graph;\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader s = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tString[] data = s.readLine().split(\\\" \\\");\\n\\t\\tint n = Integer.valueOf(data[0]);\\n\\t\\tN = n;\\n\\t\\tint m = Integer.valueOf(data[1]);\\n\\t\\tgraph = new boolean[n][n];\\n\\t\\tfor (int i = 0 ; i < m ; i++) {\\n\\t\\t\\tString[] line = s.readLine().split(\\\" \\\");\\n\\t\\t\\tint a = Integer.valueOf(line[0])-1;\\n\\t\\t\\tint b = Integer.valueOf(line[1])-1;\\n\\t\\t\\tgraph[a][b] = true;\\n\\t\\t\\tgraph[b][a] = true;\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong ans = 0;\\n\\t\\tfor (int i = 0 ; i < n ; i++) {\\n\\t\\t\\tans += doit(i);\\n\\t\\t}\\n\\t\\tans \\/= 2;\\n\\t\\t\\n\\t\\tout.println(ans);\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tstatic long doit(int n) {\\n\\t\\tlong[][] dp = new long[1<= 1) {\\n\\t\\t\\t\\t\\tfor (int k = 0 ; k < n ; k++) {\\n\\t\\t\\t\\t\\t\\tif (graph[j][k] && (i & (1<= 2) {\\n\\t\\t\\t\\tfor (int j = 0 ; j < n ; j++) {\\n\\t\\t\\t\\t\\tif (graph[j][n]) {\\n\\t\\t\\t\\t\\t\\tret += dp[i][j];\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn ret;\\n\\t}\\n\\t\\n\\t\\n\\tstatic void generateLarge() {\\n\\t\\tSystem.out.println(\\\"19 171\\\");\\n\\t\\tfor (int i = 1 ; i <= 19 ; i++) {\\n\\t\\t\\tfor (int j = i+1 ; j <= 19 ; j++) {\\n\\t\\t\\t\\tSystem.out.println(i + \\\" \\\" + j);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\n\\tpublic static void debug(Object... os){\\n\\t\\tSystem.err.println(Arrays.deepToString(os));\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class CF1497E2 extends PrintWriter {\\n\\tCF1497E2() { super(System.out); }\\n\\tstatic class Scanner {\\n\\t\\tScanner(InputStream in) { this.in = in; } InputStream in;\\n\\t\\tbyte[] bb = new byte[1 << 15]; int i, n;\\n\\t\\tbyte getc() {\\n\\t\\t\\tif (i == n) {\\n\\t\\t\\t\\ti = n = 0;\\n\\t\\t\\t\\ttry { n = in.read(bb); } catch (IOException e) {}\\n\\t\\t\\t}\\n\\t\\t\\treturn i < n ? bb[i++] : 0;\\n\\t\\t}\\n\\t\\tint nextInt() {\\n\\t\\t\\tbyte c = 0; while (c <= ' ') c = getc();\\n\\t\\t\\tint a = 0; while (c > ' ') { a = a * 10 + c - '0'; c = getc(); }\\n\\t\\t\\treturn a;\\n\\t\\t}\\n\\t}\\n\\tScanner sc = new Scanner(System.in);\\n\\tpublic static void main(String[] $) {\\n\\t\\tCF1497E2 o = new CF1497E2(); o.main(); o.flush();\\n\\t}\\n\\n\\tstatic final int A = 10000000, K = 20;\\n\\tint[] cc = new int[A + 1]; {\\n\\t\\tboolean[] composite = new boolean[A + 1];\\n\\t\\tfor (int a = 1; a <= A; a++)\\n\\t\\t\\tcc[a] = a;\\n\\t\\tfor (int a = 2; a <= A; a++) {\\n\\t\\t\\tif (composite[a])\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\tfor (int b = a + a; b <= A; b += a)\\n\\t\\t\\t\\tcomposite[b] = true;\\n\\t\\t\\tif (a <= A \\/ a) {\\n\\t\\t\\t\\tint a2 = a * a;\\n\\t\\t\\t\\tfor (int b = a2; b <= A; b += a2) {\\n\\t\\t\\t\\t\\tint c = cc[b];\\n\\t\\t\\t\\t\\twhile (c % a2 == 0)\\n\\t\\t\\t\\t\\t\\tc \\/= a2;\\n\\t\\t\\t\\t\\tcc[b] = c;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\tvoid main() {\\n\\t\\tint[] pp = new int[A + 1]; Arrays.fill(pp, -1);\\n\\t\\tint t = sc.nextInt();\\n\\t\\twhile (t-- > 0) {\\n\\t\\t\\tint n = sc.nextInt();\\n\\t\\t\\tint k = sc.nextInt();\\n\\t\\t\\tint[] aa = new int[n];\\n\\t\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\t\\taa[i] = cc[sc.nextInt()];\\n\\t\\t\\tint[] mp = new int[k + 1];\\n\\t\\t\\tint[] ip = new int[k + 1];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tint a = aa[i];\\n\\t\\t\\t\\tfor (int h = k; h >= 0; h--) {\\n\\t\\t\\t\\t\\tif (pp[a] >= ip[h]) {\\n\\t\\t\\t\\t\\t\\tmp[h]++;\\n\\t\\t\\t\\t\\t\\tip[h] = i;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif (h > 0 && (mp[h - 1] < mp[h] || mp[h - 1] == mp[h] && ip[h - 1] > ip[h])) {\\n\\t\\t\\t\\t\\t\\tmp[h] = mp[h - 1];\\n\\t\\t\\t\\t\\t\\tip[h] = ip[h - 1];\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tpp[a] = i;\\n\\t\\t\\t}\\n\\t\\t\\tprintln(mp[k] + 1);\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tint a = aa[i];\\n\\t\\t\\t\\tpp[a] = -1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Main implements Runnable {\\n\\tprivate BufferedReader in;\\n\\tprivate PrintWriter out;\\n\\tprivate StringTokenizer st;\\n\\t\\n\\tprivate void eat(String line)\\n\\t{\\n\\t\\tst = new StringTokenizer(line);\\n\\t}\\n\\t\\n\\tprivate String next() throws IOException\\n\\t{\\n\\t\\twhile(!st.hasMoreTokens()) {\\n\\t\\t\\tString line = in.readLine();\\n\\t\\t\\tif(line == null)\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\teat(line);\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\t\\n\\tprivate int nextInt() throws IOException\\n\\t{\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\t\\n\\tpublic void run()\\n\\t{\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(new OutputStreamWriter(System.out));\\n\\t\\t\\teat(\\\"\\\");\\n\\t\\t\\t\\n\\t\\t\\tgo();\\n\\t\\t\\t\\n\\t\\t\\tout.close();\\n\\t\\t} catch(Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(-1);\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tnew Thread(new Main()).start();\\n\\t}\\n\\t\\n\\tpublic void go() throws IOException\\n\\t{\\n\\t\\tint n = nextInt();\\n\\t\\tint[] v = new int[n], count = new int[2];\\n\\t\\tfor(int i = 0; i < n; ++i) {\\n\\t\\t\\tv[i] = nextInt();\\n\\t\\t\\t++count[v[i] % 2];\\n\\t\\t}\\n\\t\\tint residue = count[0] == 1 ? 0 : 1;\\n\\t\\tfor(int i = 0; i < n; ++i)\\n\\t\\t\\tif(v[i] % 2 == residue)\\n\\t\\t\\t\\tout.println(i + 1);\\n\\t}\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/**\\n * Created by IntelliJ IDEA.\\n * User: Taras_Brzezinsky\\n * Date: 8\\/13\\/11\\n * Time: 6:10 PM\\n * To change this template use File | Settings | File Templates.\\n *\\/\\n\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.*;\\nimport java.io.IOException;\\n\\npublic class DarkAssembly extends Thread {\\n\\n public DarkAssembly() {\\n this.input = new BufferedReader(new InputStreamReader(System.in));\\n this.output = new PrintWriter(System.out);\\n this.setPriority(Thread.MAX_PRIORITY);\\n }\\n\\n static class Senator {\\n int loyalty;\\n int level;\\n\\n public Senator(int level, int loyalty) {\\n this.level = level;\\n this.loyalty = loyalty;\\n }\\n }\\n\\n private static double doIt(Senator[] senators, int A) {\\n double probability = .0;\\n for (int mask = 0; mask < (1 << senators.length); ++mask) {\\n int sum = A;\\n double current = 1.0;\\n for (int i = 0; i < senators.length; ++i) {\\n if ((mask & (1 << i)) != 0) {\\n current *= .01 * senators[i].loyalty;\\n } else {\\n current *= .01 * (100 - senators[i].loyalty);\\n sum += senators[i].level;\\n }\\n }\\n if (getOnes(mask) > senators.length \\/ 2) {\\n probability += current;\\n } else {\\n probability += current * (double)A \\/ sum;\\n }\\n }\\n return probability;\\n }\\n\\n private static double go(Senator []senators, int candies, int A, int current) {\\n if (current == senators.length) {\\n return doIt(senators, A);\\n } else {\\n double result = go(senators, candies, A, current + 1);\\n if (candies > 0 && senators[current].loyalty < 100) {\\n senators[current].loyalty += 10;\\n result = Math.max(result, go(senators, candies - 1, A, current));\\n senators[current].loyalty -= 10;\\n ... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\tprivate void run() throws IOException {\\n\\t\\tint cx = in.nextInt();\\n\\t\\tint cy = in.nextInt();\\n\\t\\tint n = in.nextInt();\\n\\t\\tint[] x = new int[n];\\n\\t\\tint[] y = new int[n];\\n\\t\\tfor (int i = 0; i < n; ++i) {\\n\\t\\t\\tx[i] = in.nextInt() - cx;\\n\\t\\t\\ty[i] = in.nextInt() - cy;\\n\\t\\t}\\n\\t\\tint[] dp = new int[1 << n];\\n\\t\\tArrays.fill(dp, Integer.MAX_VALUE);\\n\\t\\tdp[0] = 0;\\n\\t\\tint[] prev = new int[1 << n];\\n\\t\\tfor (int mask = 0; mask < (1 << n); ++mask) {\\n\\t\\t\\tif (dp[mask] == Integer.MAX_VALUE) {\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\t}\\n\\t\\t\\tfor (int i = 0; i < n; ++i) {\\n\\t\\t\\t\\tif (((mask >> i) & 1) == 0) {\\n\\t\\t\\t\\t\\tif (dp[mask | (1 << i)] > dp[mask] + dist(x[i], y[i])) {\\n\\t\\t\\t\\t\\t\\tdp[mask | (1 << i)] = dp[mask] + dist(x[i], y[i]);\\n\\t\\t\\t\\t\\t\\tprev[mask | (1 << i)] = mask;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tfor (int j = i + 1; j < n; ++j) {\\n\\t\\t\\t\\t\\t\\tif (((mask >> j) & 1) == 0) {\\n\\t\\t\\t\\t\\t\\t\\tif (dp[mask | (1 << i) | (1 << j)] > dp[mask] + dist(x[i], y[i], x[j], y[j])) {\\n\\t\\t\\t\\t\\t\\t\\t\\tdp[mask | (1 << i) | (1 << j)] = dp[mask] + dist(x[i], y[i], x[j], y[j]);\\n\\t\\t\\t\\t\\t\\t\\t\\tprev[mask | (1 << i) | (1 << j)] = mask;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(dp[(1 << n) - 1]);\\n\\t\\tint mask = (1 << n) - 1;\\n\\t\\tout.print(0);\\n\\t\\twhile (mask != 0) {\\n\\t\\t\\tint p = prev[mask];\\n\\t\\t\\tint cur = p ^ mask;\\n\\t\\t\\tList who = new ArrayList();\\n\\t\\t\\tfor (int i = 0; i < n; ++i) {\\n\\t\\t\\t\\tif (((cur >> i) & 1) != 0) {\\n\\t\\t\\t\\t\\twho.add(i + 1);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tfor (int t : who) {\\n\\t\\t\\t\\tout.print(\\\" \\\" + t);\\n\\t\\t\\t}\\n\\t\\t\\tout.print(\\\" \\\" + 0);\\n\\t\\t\\tmask = p;\\n\\t\\t}\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tprivate int dist(int x, int y, int x2, int y2) {\\n\\t\\treturn x * x + y * y + x2 * x2 + y2 * y2 + (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y);\\n\\t}\\n\\n\\tprivate int dist(int x, int y) {\\n\\t\\treturn 2 * (x * x + y * y);\\n\\t}\\n\\n\\tprivate class Scanner {\\n\\t\\tprivate StringTokenizer tokenizer;\\n\\t\\tprivate BufferedReader reader;\\n\\n\\t\\tpublic Scanner(Reader in) {\\n\\t\\t\\treader = new BufferedReader(in);\\n\\t\\t\\ttokenizer = new StringTokenizer(\\\"\\\");\\n\\t\\t}\\n\\n\\t\\tpublic double nextDouble() throws IOException {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tpublic boolean... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\tboolean eof;\\n\\n\\tpublic String nextToken() {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\teof = true;\\n\\t\\t\\t\\treturn \\\"-1\\\";\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tpublic int nextInt() {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tint NOD(int a, int b) {\\n\\t\\twhile (a * b > 0) {\\n\\t\\t\\tif (a > b) {\\n\\t\\t\\t\\ta %= b;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tb %= a;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn a + b;\\n\\t}\\n\\n\\tvoid solve() {\\n\\t\\tint n = nextInt(), k= nextInt();\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; ++i){\\n\\t\\t\\ta[i] = nextInt() - 1;\\n\\t\\t}\\n\\t\\tint[] b = new int[100000];\\n\\t\\tint p = 0;\\n\\t\\tfor (int i = 0; i < n; ++i){\\n\\t\\t\\t++b[a[i]];\\n\\t\\t\\tif (b[a[i]] == 1){\\n\\t\\t\\t\\t++p;\\n\\t\\t\\t}\\n\\t\\t\\tif (k == p){\\n\\t\\t\\t\\tint j;\\n\\t\\t\\t\\tfor (j = 0; j <= i; ++j){\\n\\t\\t\\t\\t\\tif (b[a[j]] > 1){\\n\\t\\t\\t\\t\\t\\t--b[a[j]];\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tout.print((j + 1) + \\\" \\\" + (i + 1));\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.print(\\\"-1 -1\\\");\\n\\t}\\n\\n\\tBufferedReader br;\\n\\tStringTokenizer st;\\n\\tPrintWriter out;\\n\\n\\tvoid run() {\\n\\t\\ttry {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(new OutputStreamWriter(System.out));\\n\\n\\t\\t\\t\\/\\/ br = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t\\t\\/\\/ out = new PrintWriter(new FileWriter(\\\"output.txt\\\"));\\n\\t\\t\\tsolve();\\n\\t\\t\\tbr.close();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Throwable e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(1);\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew Main().run();\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.Scanner;\\npublic class Test {\\n\\tpublic static int digit(long number){\\n\\t\\tint i = 1;\\n\\t\\tlong exp = 1;\\n\\t\\twhile(number > i * 9 * exp){\\n\\t\\t\\tnumber -= i * 9 * exp;\\n\\t\\t\\ti++;\\n\\t\\t\\texp *= 10;\\n\\t\\t}\\n\\t\\treturn i;\\n\\t}\\n\\tpublic static int result(long number){\\n\\t\\tint digit = digit(number);\\n\\t\\tlong exp = 1;\\n\\t\\tfor(int i = 0; i < (digit - 1); i++){\\n\\t\\t\\tnumber -= (i+1) * 9 * exp;\\n\\t\\t\\texp *= 10;\\n\\t\\t}\\n\\t\\tlong b = number \\/ digit;\\n\\t\\tint c = (int)(number % digit);\\n\\t\\tif(c > 0){\\n\\t\\t\\tString d = Long.toString(exp + b);\\n\\t\\t\\treturn d.charAt(c - 1) - '0';\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tString d = Long.toString(exp + b - 1);\\n\\t\\t\\treturn d.charAt(d.length() - 1) - '0';\\n\\t\\t}\\n\\n\\t}\\n\\tpublic static void main(String[] args){\\n\\t\\tScanner input = new Scanner(System.in);\\n\\t\\tlong k = input.nextLong();\\n\\t\\tSystem.out.println(result(k));\\n\\t}\\n}\\n\\n\\n\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.lang.*;\\nimport java.util.*;\\nimport static java.lang.Integer.*;\\nimport static java.lang.Long.*;\\nimport static java.lang.Math.*;\\nimport static java.lang.System.*;\\nimport static java.util.Arrays.*;\\nimport static java.util.Collections.*;\\n\\npublic class Main {\\n\\n Main() throws IOException {\\n String a = nextLine();\\n String b = nextLine();\\n long ans = 0;\\n int s = 0;\\n for (int i = 0; i < b.length() - a.length(); ++i) {\\n s += b.charAt(i) == '1' ? 1 : 0;\\n }\\n\\n for (int i = 0; i < a.length(); ++i) {\\n s += b.charAt(i + b.length() - a.length()) == '1' ? 1 : 0;\\n ans += a.charAt(i) == '1' ? b.length() - a.length() + 1 - s : s;\\n s -= b.charAt(i) == '1' ? 1 : 0;\\n }\\n out.println(ans);\\n }\\n\\n\\n \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n PrintWriter out = new PrintWriter(System.out, false);\\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer stok = null;\\n String nextLine() throws IOException {\\n while (stok == null || !stok.hasMoreTokens()) {\\n stok = new StringTokenizer(in.readLine());\\n }\\n return stok.nextToken();\\n }\\n\\n\\n public static void main(String args[]) throws IOException {\\n if (args.length > 0) {\\n setIn(new FileInputStream(args[0] + \\\".inp\\\"));\\n setOut(new PrintStream(args[0] + \\\".out\\\"));\\n }\\n Main solver = new Main();\\n solver.out.flush(); \\/\\/ could be replace with a method, but nah, this is just competitive programming :p\\n }\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n public void solve() throws IOException {\\n int n = nextInt();\\n output.println(n \\/ 2 * 3);\\n }\\n\\n public void run() throws IOException {\\n input = new BufferedReader(new InputStreamReader(System.in));\\n output = new PrintWriter(System.out);\\n solve();\\n input.close();\\n output.close();\\n }\\n\\n BufferedReader input;\\n PrintWriter output;\\n StringTokenizer tok;\\n\\n String nextToken() throws IOException {\\n while(tok == null || !tok.hasMoreTokens())\\n tok = new StringTokenizer(input.readLine());\\n\\n return tok.nextToken();\\n }\\n\\n int nextInt() throws IOException {\\n return Integer.valueOf(nextToken());\\n }\\n\\n long nextLong() throws IOException {\\n return Long.valueOf(nextToken());\\n }\\n\\n double nextDouble() throws IOException {\\n return Double.valueOf(nextToken());\\n }\\n\\n public static void main(String[] args) throws IOException {\\n new Main().run();\\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/make sure to make new file!\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class B713{\\n \\n public static BufferedReader f;\\n public static PrintWriter out; \\n \\n public static void main(String[] args)throws IOException{\\n f = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n \\n int n = Integer.parseInt(f.readLine());\\n \\n \\n int l;\\n int r;\\n int mid;\\n int ans;\\n \\n \\n l = 1;\\n r = n;\\n ans = -1;\\n \\/\\/see if you can draw vertical line between them\\n \\n while(l <= r){\\n mid = l + (r-l)\\/2;\\n if(mid == n) break;\\n \\n int il = query(1,1,n,mid);\\n int ir = query(1,mid+1,n,n);\\n \\n if(il == 1 && ir == 1){\\n ans = mid;\\n break;\\n }\\n \\n if(il > ir){\\n r = mid-1;\\n } else {\\n l = mid+1;\\n }\\n }\\n \\n int x11 = -1;\\n int y11 = -1;\\n int x12 = -1;\\n int y12 = -1;\\n int x21 = -1;\\n int y21 = -1;\\n int x22 = -1;\\n int y22 = -1;\\n if(ans == -1){\\n \\/\\/find horizontal line\\n l = 1;\\n r = n;\\n ans = -1;\\n \\n while(l <= r){\\n mid = l + (r-l)\\/2;\\n \\n \\n int il = query(1,1,mid,n);\\n int ir = query(mid+1,1,n,n);\\n \\n if(il == 1 && ir == 1){\\n ans = mid;\\n break;\\n }\\n \\n if(il > ir){\\n r = mid-1;\\n } else {\\n l = mid+1;\\n }\\n }\\n \\n int bar = ans;\\n \\n \\/\\/find top line of top block\\n l = 1;\\n r = bar;\\n ans = -1;\\n while(l <= r){\\n mid = l + (r-l)\\/2;\\n \\n int i = query(mid,1,bar,n);\\n if(i == 1){\\n ans = mid;\\n l = mid+1;\\n } else {\\n r = mid-1;\\n }\\n }\\n \\n x11 =... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.HashMap;\\nimport java.io.IOException;\\nimport java.util.InputMismatchException;\\nimport java.io.PrintWriter;\\nimport java.io.OutputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Alex\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n static class TaskC {\\n int BAD = 11111;\\n int rows;\\n int cols;\\n HashMap[] mem;\\n\\n boolean contains(int mem, int index) {\\n if(index < 0) return false;\\n return ((mem >> index) & 1) == 1;\\n }\\n\\n int add(int mem, int index) {\\n if(((mem >> index) & 1) == 0) {\\n mem += (1 << index);\\n }\\n return mem;\\n }\\n\\n int size(int mem) {\\n int res = 0;\\n while(mem > 0) {\\n if(mem % 2 == 1) res++;\\n mem \\/= 2;\\n }\\n return res;\\n }\\n\\n void test() {\\n if(contains(5, 0) == false) throw new RuntimeException();\\n if(contains(5, 1) == true) throw new RuntimeException();\\n if(contains(5, -1) == true) throw new RuntimeException();\\n if(contains(5, 2) == false) throw new RuntimeException();\\n if(contains(5, 3) == true) throw new RuntimeException();\\n if(add(0, 2) != 4) throw new RuntimeException();\\n if(add(4, 0) != 5) throw new RuntimeException();\\n if(add(5, 0) != 5) throw new RuntimeException();\\n if(size(5) != 2) throw... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.HashSet;\\nimport java.util.Iterator;\\nimport java.util.Scanner;\\n\\npublic class Main {\\n\\n public static void main(String[] args) {\\n Scanner scan = new Scanner(System.in);\\n int n = scan.nextInt();\\n int[] nums = new int[n];\\n for(int i = 0; i < n; i++){\\n nums[i] = scan.nextInt();\\n }\\n Arrays.sort(nums);\\n boolean[] div = new boolean[n];\\n int count = 0;\\n for(int i = 0; i < n; i++) {\\n if (!div[i]) {\\n\\n count++;\\n div[i] = true;\\n for(int j = i+1; j < n; j++) {\\n if (nums[j] % nums[i] == 0) {\\n div[j] = true;\\n }\\n }\\n }\\n }\\n System.out.println(count);\\n\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\n\\n\\npublic class BankAccount {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t * @throws IOException \\n\\t *\\/\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n\\n\\t\\tString s = in.readLine();\\n\\t\\tint n = Integer.parseInt(s);\\n\\n\\t\\tif (s.charAt(0) == '-')\\n\\t\\t\\tif (Integer.parseInt(s.substring(0, s.length()-1))>Integer.parseInt(s.substring(0, s.length()-2)+s.charAt(s.length()-1)))\\n\\t\\t\\t\\ts=s.substring(0, s.length()-1);\\n\\t\\t\\telse\\n\\t\\t\\t\\ts=s.substring(0, s.length()-2)+s.charAt(s.length()-1);\\n\\n\\t\\tSystem.out.println(Integer.parseInt(s));\\n\\t\\tin.close();\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Subtractions {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner kb = new Scanner(System.in);\\n\\t\\tint count = kb.nextInt();\\n\\t\\twhile(count > 0) {\\n\\t\\t\\tint smaller = kb.nextInt();\\n\\t\\t\\tint larger = kb.nextInt();\\n\\t\\t\\tint ops = 0;\\n\\t\\t\\t\\n\\t\\t\\twhile(smaller > 0 && larger > 0) {\\n\\t\\t\\t\\tif(smaller > larger) {\\n\\t\\t\\t\\t\\tint temp = smaller;\\n\\t\\t\\t\\t\\tsmaller = larger;\\n\\t\\t\\t\\t\\tlarger = temp;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\tops += larger\\/smaller;\\n\\t\\t\\t\\tlarger = larger % smaller;\\n\\t\\t\\t}\\n\\t\\t\\tSystem.out.println(ops);\\n\\t\\t\\tcount--;\\n\\t\\t}\\n\\n\\t}\\n\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.BigInteger;\\npublic class template {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tFastScanner sc = new FastScanner();\\n\\t\\tPrintWriter pw = new PrintWriter(System.out);\\n\\t\\tint n = sc.nextInt();\\n\\t\\tInteger[] arr = new Integer[n];\\n\\t\\tfor(int i=0;i size=new HashSet<>();\\n\\t\\tfor(int i=0;i hm=new HashMap<>();\\n\\t\\tint ans=Integer.MAX_VALUE;\\n\\t\\twhile(l {\\n\\t\\tint u;\\n\\t\\tint v;\\n \\n\\t\\tpublic Pair(int u, int v) {\\n\\t\\t\\tthis.u = u;\\n\\t\\t\\tthis.v = v;\\n\\t\\t}\\n \\n\\t\\tpublic int hashCode() {\\n\\t\\t\\tint hu = (int) (u ^ (u >>> 32));\\n\\t\\t\\tint hv = (int) (v ^ (v >>> 32));\\n\\t\\t\\treturn 31 * hu + hv;\\n\\t\\t}\\n \\n\\t\\tpublic boolean equals(Object o) {\\n\\t\\t\\tPair other = (Pair) o;\\n\\t\\t\\treturn u == other.u && v == other.v;\\n\\t\\t}\\n \\n\\t\\tpublic int compareTo(Pair other) {\\n\\t\\t\\treturn Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);\\n\\t\\t}\\n \\n\\t\\tpublic String toString() {\\n\\t\\t\\treturn \\\"[u=\\\" + u + \\\", v=\\\" + v + \\\"]\\\";\\n\\t\\t}\\n\\t}\\n\\tpublic static void debug(Object... o) {\\n\\t\\tSystem.out.println(Arrays.deepToString(o));\\n\\t}\\n\\tstatic long modulo(long a,long b,long c) {\\n\\t\\tlong x=1;\\n\\t\\tlong y=a;\\n\\t\\twhile(b > 0){\\n\\t\\t\\tif(b%2 == 1){\\n\\t\\t\\t\\tx=(x*y)%c;\\n\\t\\t\\t}\\n\\t\\t\\ty = (y*y)%c; \\/\\/ squaring the base\\n\\t\\t\\tb \\/= 2;\\n\\t\\t}\\n\\t\\treturn x%c;\\n\\t}\\n\\tstatic long... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\n\\npublic class test {\\n static boolean DEBUG_FLAG = false;\\n int INF = (int)1e9;\\n long MOD = 1000000007;\\n \\n static void debug(String s) {\\n if(DEBUG_FLAG) {\\n System.out.print(s);\\n }\\n }\\n \\n long pow(long a, long n, long mod) {\\n if (n == 0) {\\n return 1;\\n }\\n long rs = 1;\\n while (n != 0) {\\n if (n % 2 == 1) {\\n rs *= a;\\n }\\n rs %= mod;\\n n >>= 1;\\n a *= a;\\n a %= mod;\\n }\\n return rs;\\n }\\n \\n void solve(InputReader in, PrintWriter out) throws IOException {\\n long x = in.nextLong();\\n long k = in.nextLong();\\n if(x==0) {\\n out.println(0);\\n return;\\n }\\n long a = (2 * x - 1) % MOD;\\n long b = pow(2, k, MOD);\\n a = (a * b) % MOD;\\n a += 1;\\n a %= MOD;\\n out.println(a);\\n }\\n \\n \\n public static void main(String[] args) throws IOException {\\n if(args.length>0 && args[0].equalsIgnoreCase(\\\"d\\\")) {\\n DEBUG_FLAG = true;\\n }\\n InputReader in = new InputReader();\\n PrintWriter out = new PrintWriter(System.out);\\n int t = 1;\\/\\/in.nextInt();\\n long start = System.nanoTime();\\n while(t-- >0) {\\n new test().solve(in, out);\\n }\\n long end = System.nanoTime();\\n debug(\\\"\\\\nTime: \\\" + (end-start)\\/1e6 + \\\" \\\\n\\\\n\\\");\\n out.close();\\n }\\n \\n static class InputReader {\\n static BufferedReader br;\\n static StringTokenizer st;\\n \\n public InputReader() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n \\n String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\npublic class CF911D {\\n public static void main(String[] args){\\n Scanner sc = new Scanner(System.in);\\n \\n int n = sc.nextInt();\\n int[] array = new int[n];\\n for(int i = 0; i < n; i++){\\n array[i] = sc.nextInt();\\n }\\n int count = 0;\\n for(int i = 0; i < array.length; i++){\\n for(int j = i+1; j < array.length; j++){\\n if(array[i] > array[j]){\\n count++;\\n }\\n }\\n }\\n count%=2;\\n int q = sc.nextInt();\\n for(int i = 0; i < q; i++){\\n int l = sc.nextInt();\\n int r = sc.nextInt();\\n int sz = r - l + 1;\\n count += (sz*(sz-1))\\/2;\\n count %= 2;\\n if(count == 1) \\n System.out.println(\\\"odd\\\");\\n else \\n System.out.println(\\\"even\\\");\\n }\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class A912 {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\t\\n\\t\\tint A = scan.nextInt();\\n\\t\\tint B = scan.nextInt();\\n\\t\\tlong x = scan.nextInt();\\n\\t\\tlong y = scan.nextInt();\\n\\t\\tlong z = scan.nextInt();\\n\\t\\t\\n\\t\\tlong requiredA = x * 2 + y;\\n\\t\\tlong requiredB = y + z * 3;\\n\\t\\t\\n\\t\\tlong neededA = Math.max(0, requiredA - A);\\n\\t\\tlong neededB = Math.max(0, requiredB - B);\\n\\t\\tSystem.out.print(neededA + neededB);\\n\\t}\\n\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.util.function.BiConsumer;\\nimport java.util.function.Consumer;\\nimport java.util.function.Function;\\nimport java.util.function.Supplier;\\nimport java.util.stream.Stream;\\n\\npublic class C_455\\n{\\n\\tpublic static final long[] POWER2 = generatePOWER2();\\n\\tpublic static final IteratorBuffer ITERATOR_BUFFER_PRIME = new IteratorBuffer<>(streamPrime(1000000).iterator());\\n\\tprivate static BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\\n\\tprivate static StringTokenizer stringTokenizer = null;\\n\\tprivate static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));\\n\\n\\tstatic class Array implements Iterable\\n\\t{\\n\\t\\tprivate final Object[] array;\\n\\n\\t\\tpublic Array(int size)\\n\\t\\t{\\n\\t\\t\\tthis.array = new Object[size];\\n\\t\\t}\\n\\n\\t\\tpublic Array(int size, Type element)\\n\\t\\t{\\n\\t\\t\\tthis(size);\\n\\t\\t\\tArrays.fill(this.array, element);\\n\\t\\t}\\n\\n\\t\\tpublic Array(Array array, Type element)\\n\\t\\t{\\n\\t\\t\\tthis(array.size() + 1);\\n\\t\\t\\tfor (int index = 0; index < array.size(); index++)\\n\\t\\t\\t{\\n\\t\\t\\t\\tset(index, array.get(index));\\n\\t\\t\\t}\\n\\t\\t\\tset(size() - 1, element);\\n\\t\\t}\\n\\n\\t\\tpublic Array(List list)\\n\\t\\t{\\n\\t\\t\\tthis(list.size());\\n\\t\\t\\tint index = 0;\\n\\t\\t\\tfor (Type element : list)\\n\\t\\t\\t{\\n\\t\\t\\t\\tset(index, element);\\n\\t\\t\\t\\tindex += 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tpublic Type get(int index)\\n\\t\\t{\\n\\t\\t\\treturn (Type) this.array[index];\\n\\t\\t}\\n\\n\\t\\t@Override\\n\\t\\tpublic Iterator iterator()\\n\\t\\t{\\n\\t\\t\\treturn new Iterator()\\n\\t\\t\\t{\\n\\t\\t\\t\\tint index = 0;\\n\\n\\t\\t\\t\\t@Override\\n\\t\\t\\t\\tpublic boolean hasNext()\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\treturn this.index < size();\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@Override\\n\\t\\t\\t\\tpublic Type next()\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tType result = Array.this.get(index);\\n\\t\\t\\t\\t\\tindex += 1;\\n\\t\\t\\t\\t\\treturn result;\\n\\t\\t\\t\\t}\\n\\t\\t\\t};\\n\\t\\t}\\n\\n\\t\\tpublic Array set(int index, Type value)\\n\\t\\t{\\n\\t\\t\\tthis.array[index] = value;\\n\\t\\t\\treturn this;\\n\\t\\t}\\n\\n\\t\\tpublic int size()\\n\\t\\t{\\n\\t\\t\\treturn this.array.length;\\n\\t\\t}\\n\\n\\t\\tpublic List toList()\\n\\t\\t{\\n\\t\\t\\tList result = new ArrayList<>();\\n\\t\\t\\tfor (Type element : this)\\n\\t\\t\\t{\\n\\t\\t\\t\\tresult.add(element);\\n\\t\\t\\t}\\n\\t\\t\\treturn... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Scanner;\\n\\npublic class test {\\n\\n public static void main(String[] args) {\\n Scanner kb = new Scanner(System.in);\\n int n = kb.nextInt();\\n int a = kb.nextInt();\\n int b = kb.nextInt();\\n int array[] = new int[n];\\n for (int i = 0; i < n; i++) {\\n array[i] = kb.nextInt();\\n }\\n Arrays.sort(array);\\n int k = 0;\\n int t1 = 0;\\n int t2 = 0;\\n for (int i = 0; i < b; i++) {\\n t1= array[i];\\n if(i=coord[i][0]-2*r) {\\n if (coord[j][1]+Math.sqrt(4*r*r-(coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0]))>y) {\\n y=coord[j][1]+Math.sqrt(4*r*r-(coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0]));\\n }\\n }\\n }\\n coord[i][1]=y;\\n }\\n for (int i=0;i[] arrayLists = new ArrayList[5];\\n ArrayList[] arrayLists1 = new ArrayList[5];\\n for (int i = 0; i < 5; i++) {\\n arrayLists[i] = new ArrayList<>();\\n arrayLists1[i] = new ArrayList<>();\\n }\\n for (int i = 0; i < n; i++) {\\n String s = in.scanString();\\n arrayLists[s.length()].add(s);\\n }\\n for (int i = 0; i < n; i++) {\\n String s = in.scanString();\\n arrayLists1[s.length()].add(s);\\n }\\n long ans = 0;\\n for (int i = 0; i < 5; i++) {\\n for (int diff = 0; diff < 5; diff++) {\\n\\n for (int j = 0; j < arrayLists[i].size(); j++) {\\n int min = Integer.MAX_VALUE;\\n int index = -1;\\n for (int k = 0; k < arrayLists1[i].size(); k++) {\\n int tt = 0;\\n for (int l = 0; l < i; l++)\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.awt.*;\\nimport java.awt.event.*;\\nimport java.awt.geom.*;\\nimport java.io.*;\\nimport java.math.*;\\nimport java.security.*;\\nimport java.text.*; \\nimport java.util.*;\\nimport java.util.regex.*;\\n\\/*\\n\\t br = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t pw = new PrintWriter(new BufferedWriter(new FileWriter(\\\"output.txt\\\")));\\n\\t br = new BufferedReader(new InputStreamReader(System.in));\\n\\t pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n *\\/\\n\\n\\npublic class Main {\\n\\tprivate static BufferedReader br;\\n\\tprivate static StringTokenizer st;\\n\\tprivate static PrintWriter pw;\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tbr = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\tpw = new PrintWriter(new BufferedWriter(new FileWriter(\\\"output.txt\\\")));\\n\\t\\t\\/\\/int qq = 1;\\n\\t\\tint qq = Integer.MAX_VALUE;\\n\\t\\t\\/\\/int qq = readInt();\\n\\t\\tfor(int casenum = 1; casenum <= qq; casenum++)\\t{\\n\\t\\t\\tint r = readInt();\\n\\t\\t\\tint c = readInt();\\n\\t\\t\\tint n = readInt();\\n\\t\\t\\tint[][] dist = new int[r][c];\\n\\t\\t\\tfor(int i = 0; i < r; i++) {\\n\\t\\t\\t\\tArrays.fill(dist[i], 1 << 25);\\n\\t\\t\\t}\\n\\t\\t\\tLinkedList q = new LinkedList();\\n\\t\\t\\twhile(n-- > 0) {\\n\\t\\t\\t\\tq.add(new State(readInt()-1, readInt()-1));\\n\\t\\t\\t\\tdist[q.peekLast().x][q.peekLast().y] = 0;\\n\\t\\t\\t}\\n\\t\\t\\tint[] dx = new int[]{-1,1,0,0};\\n\\t\\t\\tint[] dy = new int[]{0,0,-1,1};\\n\\t\\t\\tState ret = q.peekLast();\\n\\t\\t\\twhile(!q.isEmpty()) {\\n\\t\\t\\t\\tState curr = q.removeFirst();\\n\\t\\t\\t\\tret = curr;\\n\\t\\t\\t\\tfor(int k = 0; k < dx.length; k++) {\\n\\t\\t\\t\\t\\tint nx = curr.x + dx[k];\\n\\t\\t\\t\\t\\tint ny = curr.y + dy[k];\\n\\t\\t\\t\\t\\tif(nx >= 0 && nx < r && ny >= 0 && ny < c && dist[nx][ny] > 1 + dist[curr.x][curr.y]) {\\n\\t\\t\\t\\t\\t\\tdist[nx][ny] = 1 + dist[curr.x][curr.y];\\n\\t\\t\\t\\t\\t\\tq.add(new State(nx, ny));\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tpw.println(ret.x+1 + \\\" \\\" + (ret.y+1));\\n\\t\\t}\\n\\t\\texitImmediately();\\n\\t}\\n\\n\\tstatic class State {\\n\\t\\tpublic int x,y;\\n\\n\\t\\tpublic State(int x, int y) {\\n\\t\\t\\tsuper();\\n\\t\\t\\tthis.x = x;\\n\\t\\t\\tthis.y = y;\\n\\t\\t}\\n\\t\\t\\n\\t}\\n\\t\\n\\tprivate static void exitImmediately() {\\n\\t\\tpw.close();\\n\\t\\tSystem.exit(0);\\n\\t}\\n\\n\\tprivate static long readLong() throws IOException... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.util.HashSet;\\nimport java.util.StringTokenizer;\\n\\npublic class Array {\\n\\n void run() {\\n try {\\n BufferedReader bfd = new BufferedReader(new InputStreamReader(\\n System.in));\\n StringTokenizer tk = new StringTokenizer(bfd.readLine());\\n int n = Integer.parseInt(tk.nextToken());\\n int k = Integer.parseInt(tk.nextToken()), i;\\n int arr[] = new int[n];\\n tk = new StringTokenizer(bfd.readLine());\\n for(i=0;i hs = new HashSet();\\n for(i=0; i=1 && r>l && arr[r]==arr[r-1])\\n --r;\\n for(i=l;i<=r;++i)\\n freq[arr[i]]++;\\n while(freq[arr[l]]>1){\\n freq[arr[l]]--;\\n l++;\\n }\\n while(freq[arr[r]]>1){\\n freq[arr[r]]--;\\n r--;\\n }\\n System.out.println((l+1)+\\\" \\\" +(r+1));\\n }\\n } catch (Exception e) {\\n\\n }\\n }\\n public static void main(String[] args) {\\n new Array().run();\\n }\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.util.Scanner;\\n\\n\\npublic class A113 {\\n\\n public static void main(String[] args) {\\n new A113().run();\\n }\\n \\n public void run() {\\n Scanner in = new Scanner(System.in);\\n int n = in.nextInt();\\n int k = in.nextInt();\\n Team[] teams = new Team[n];\\n for (int i = 0; i < teams.length; i++) {\\n teams[i] = new Team(in.nextInt(), in.nextInt());\\n }\\n Arrays.sort(teams);\\n int counter = 1;\\n int index = k-2;\\n while (index >= 0 && teams[index].p == teams[k-1].p && teams[index].t == teams[k-1].t) {\\n index--;\\n counter++;\\n }\\n index = k;\\n while (index < n && teams[index].p == teams[k-1].p && teams[index].t == teams[k-1].t) {\\n index++;\\n counter++;\\n }\\n System.out.println(counter);\\n }\\n \\n private class Team implements Comparable {\\n int p;\\n int t;\\n \\n public Team(int pp, int tt) {\\n p = pp; t = tt;\\n }\\n\\n @Override\\n public int compareTo(Team o) {\\n if (o.p - this.p == 0)\\n return this.t - o.t;\\n return o.p - this.p;\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class Main {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tstatic long[] dx = new long[]{0, 1, 0, -1};\\n\\tstatic long[] dy = new long[]{-1, 0, 1, 0};\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner r = new Scanner(System.in);\\n\\t\\t\\n\\t\\tlong N = r.nextLong();\\n\\t\\tlong X = r.nextLong();\\n\\t\\tlong Y = r.nextLong();\\n\\t\\tlong C = r.nextLong();\\n\\t\\t\\n\\t\\tlong lo = 0, hi = N * 2;\\n\\t\\t\\n\\t\\twhile(lo < hi){\\n\\t\\t\\tlong T = (lo + hi) \\/ 2;\\n\\t\\t\\t\\n\\t\\t\\tlong[] NX = new long[4];\\n\\t\\t\\tlong[] NY = new long[4];\\n\\t\\t\\t\\n\\t\\t\\tfor(int d = 0; d < 4; d++){\\n\\t\\t\\t\\tNX[d] = X + dx[d] * T;\\n\\t\\t\\t\\tNY[d] = Y + dy[d] * T;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tlong ret = (T + 1) * (T + 1) + T * T;\\n\\t\\t\\t\\n\\t\\t\\tret -= half(1 - NY[0]);\\n\\t\\t\\tret -= half(NY[2] - N);\\n\\t\\t\\tret -= half(NX[1] - N);\\n\\t\\t\\tret -= half(1 - NX[3]);\\n\\t\\t\\t\\n\\t\\t\\tret += quarter(1 - NY[0] - (N - X + 1));\\n\\t\\t\\tret += quarter(1 - NY[0] - (X));\\n\\t\\t\\tret += quarter(NY[2] - N - (N - X + 1));\\n\\t\\t\\tret += quarter(NY[2] - N - (X));\\n\\t\\t\\t\\n\\t\\t\\tif(ret < C)lo = T + 1;\\n\\t\\t\\telse hi = T;\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(lo);\\n\\t\\t\\n\\t}\\n\\tprivate static long half(long x) {\\n\\t\\tif(x <= 0)return 0;\\n\\t\\telse return 2 * quarter(x) - x;\\n\\t}\\n\\tprivate static long quarter(long x){\\n\\t\\tif(x <= 0)return 0;\\n\\t\\treturn x * (x + 1) \\/ 2;\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.FileReader;\\nimport java.io.InputStreamReader;\\nimport java.io.FileNotFoundException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n FastScanner in = new FastScanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskE2 solver = new TaskE2();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskE2 {\\n public void solve(int testNumber, FastScanner in, PrintWriter out) {\\n int t = in.nextInt();\\n while (t-- > 0) {\\n int n = in.nextInt(), m = in.nextInt();\\n int[][] a = new int[m][n];\\n int[] bestMask = new int[1 << n];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < m; j++) {\\n a[j][i] = in.nextInt();\\n }\\n }\\n int[] dp = new int[1 << n];\\n for (int i = 0; i < m; i++) {\\n int[] array = a[i];\\n for (int j = 0; j < n; j++) {\\n int val = array[j];\\n for (int mask = 0; mask < 1 << n; mask++) {\\n if ((mask & (1 << j)) == 0) {\\n dp[mask | (1 << j)] = Math.max(dp[mask | (1 << j)], dp[mask] + val);\\n }\\n }\\n }\\n for (int mask = 0; mask < 1 << n; mask++) {\\n int best = 0;\\n int cur = mask;\\n for (int j = 0; j < n; j++) {\\n best =... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import static java.lang.Integer.parseInt;\\nimport static java.lang.Long.parseLong;\\nimport static java.lang.Math.min;\\nimport static java.lang.System.exit;\\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class F {\\n\\n\\tstatic void solve() throws Exception {\\n\\t\\tint n = scanInt();\\n\\t\\tlong l[] = new long[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tl[i] = scanLong();\\n\\t\\t}\\n\\t\\tlong e1 = 0, e2 = 0, ans = 0;\\n\\t\\tboolean water = false;\\n\\t\\tString types = scanString();\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tlong li = l[i], cur;\\n\\t\\t\\tswitch (types.charAt(i)) {\\n\\t\\t\\tcase 'G':\\n\\t\\t\\t\\tcur = min(e1, li);\\n\\t\\t\\t\\te1 -= cur;\\n\\t\\t\\t\\tli -= cur;\\n\\t\\t\\t\\te2 += 2 * cur;\\n\\t\\t\\t\\tans += 2 * cur;\\n\\t\\t\\t\\te2 += li;\\n\\t\\t\\t\\tans += 3 * li;\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase 'W':\\n\\t\\t\\t\\twater = true;\\n\\t\\t\\t\\te1 += li;\\n\\t\\t\\t\\tans += 2 * li;\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tcase 'L':\\n\\t\\t\\t\\tcur = min(e1, li);\\n\\t\\t\\t\\te1 -= cur;\\n\\t\\t\\t\\tli -= cur;\\n\\t\\t\\t\\tans += 2 * cur;\\n\\t\\t\\t\\tcur = min(e2, li);\\n\\t\\t\\t\\te2 -= cur;\\n\\t\\t\\t\\tli -= cur;\\n\\t\\t\\t\\tans += 3 * cur;\\n\\t\\t\\t\\tans += (water ? 4 : 6) * li;\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tdefault:\\n\\t\\t\\t\\tthrow new AssertionError();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.print(ans);\\n\\t}\\n\\n\\tstatic int scanInt() throws IOException {\\n\\t\\treturn parseInt(scanString());\\n\\t}\\n\\n\\tstatic long scanLong() throws IOException {\\n\\t\\treturn parseLong(scanString());\\n\\t}\\n\\n\\tstatic String scanString() throws IOException {\\n\\t\\twhile (tok == null || !tok.hasMoreTokens()) {\\n\\t\\t\\ttok = new StringTokenizer(in.readLine());\\n\\t\\t}\\n\\t\\treturn tok.nextToken();\\n\\t}\\n\\n\\tstatic BufferedReader in;\\n\\tstatic PrintWriter out;\\n\\tstatic StringTokenizer tok;\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\tsolve();\\n\\t\\t\\tin.close();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Throwable e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\texit(1);\\n\\t\\t}\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport static java.lang.Math.*;\\nimport static java.util.Arrays.fill;\\nimport static java.util.Arrays.binarySearch;\\nimport static java.util.Arrays.sort;\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\ttry {\\n\\t\\t\\tif (new File(\\\"input.txt\\\").exists()) {\\n\\t\\t\\t\\tSystem.setIn(new FileInputStream(\\\"input.txt\\\"));\\n\\t\\t\\t}\\n\\t\\t} catch (SecurityException e) {\\n\\t\\t}\\n\\t\\t\\n\\t\\tnew Main().run();\\n\\t}\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st = new StringTokenizer(\\\"\\\");\\n\\t\\n\\tvoid run() throws IOException {\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tint N = nextInt();\\n\\t\\tdouble[][] a = new double [N][N];\\n\\t\\t\\n\\t\\tfor (int i = 0; i < N; i++)\\n\\t\\t\\tfor (int j = 0; j < N; j++)\\n\\t\\t\\t\\ta[i][j] = nextDouble();\\n\\t\\t\\n\\t\\tint NN = 1 << N;\\n\\t\\t\\n\\t\\tdouble[] dp = new double [NN];\\n\\t\\tdp[NN - 1] = 1.0;\\n\\t\\t\\n\\t\\tfor (int mask = NN - 1; mask > 0; mask--) {\\n\\t\\t\\tint b = Integer.bitCount(mask);\\n\\t\\t\\tif (b <= 1)\\n\\t\\t\\t\\tcontinue;\\n\\n\\t\\t\\tdouble k = 2.0 \\/ (b * (b - 1));\\n\\t\\t\\t\\n\\t\\t\\tfor (int i = 0; i < N; i++) {\\n\\t\\t\\t\\tif ((mask & (1 << i)) == 0)\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tfor (int j = i + 1; j < N; j++) {\\n\\t\\t\\t\\t\\tif ((mask & (1 << j)) == 0)\\n\\t\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tdouble p = a[i][j];\\n\\t\\t\\t\\t\\tdp[mask & (~(1 << j))] += k * p * dp[mask];\\n\\t\\t\\t\\t\\tdp[mask & (~(1 << i))] += k * (1.0 - p) * dp[mask];\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.printf(Locale.US, \\\"%.8f\\\", dp[1]);\\n\\t\\t\\n\\t\\tfor (int i = 1, ind = 2; i < N; ind <<= 1, i++)\\n\\t\\t\\tout.printf(Locale.US, \\\" %.8f\\\", dp[ind]);\\n\\t\\tout.println();\\n\\t\\tout.close();\\n\\t}\\n\\t\\n\\tString nextToken() throws IOException {\\n\\t\\twhile (!st.hasMoreTokens()) {\\n\\t\\t\\tst = new StringTokenizer(in.readLine());\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\t\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\t\\n\\tlong nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\t\\n\\tdouble nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n\\t\\n\\tString nextLine() throws IOException {\\n\\t\\tst = new StringTokenizer(\\\"\\\");\\n\\t\\treturn... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.lang.reflect.Array;\\nimport java.math.BigInteger;\\nimport java.net.Inet4Address;\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.util.HashMap;\\nimport java.util.PriorityQueue;\\npublic class templ implements Runnable{\\n static class pair implements Comparable\\n {\\n int f;\\n int s;\\n pair(int fi,int se)\\n {\\n f=fi;\\n s=se;\\n }\\n public int compareTo(Object o)\\/\\/ascending order\\n {\\n pair pr=(pair)o;\\n if(s>pr.s)\\n return 1;\\n if(s==pr.s)\\n {\\n if(f>pr.f)\\n return 1;\\n else\\n return -1;\\n }\\n else\\n return -1;\\n }\\n public boolean equals(Object o)\\n {\\n pair ob=(pair)o;\\n int ff;\\n int ss;\\n if(o!=null)\\n {\\n ff=ob.f;\\n ss=ob.s;\\n if((ff==this.f)&&(ss==this.s))\\n return true;\\n }\\n return false;\\n }\\n public int hashCode()\\n {\\n return (this.f+\\\" \\\"+this.s).hashCode();\\n }\\n }\\n public class triplet implements Comparable\\n {\\n int f,t;\\n int s;\\n triplet(int f,int s,int t)\\n {\\n this.f=f;\\n this.s=s;\\n this.t=t;\\n }\\n public boolean equals(Object o)\\n {\\n triplet ob=(triplet)o;\\n int ff;\\n int ss;\\n int tt;\\n if(o!=null)\\n {\\n ff=ob.f;\\n ss=ob.s;\\n tt=ob.t;\\n if((ff==this.f)&&(ss==this.s)&&(tt==this.t))\\n return true;\\n }\\n return false;\\n }\\n public int hashCode()\\n {\\n return (this.f+\\\" \\\"+this.s+\\\" \\\"+this.t).hashCode();\\n }\\n public int compareTo(Object o)\\/\\/ascending order\\n {\\n triplet tr=(triplet)o;\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/*\\n⠀⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀\\n⠀⠀⠀⣴⠿⠏⠀⠀⠀⠀⠀⠀⢳⡀⠀⡏⠀⠀Y⠀⠀⢷\\n⠀⠀⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀A⠀⠀ ⡇\\n⠀⠀⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿⠀⣸⠀⠀S⠀ ⡇\\n⠀⠀⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀⠀⣿⠀⢹⠀⠀H⠀⠀ ⡇\\n⠀⠀⠙⢿⣯⠄⠀⠀⠀⢀⡀⠀⠀⡿⠀⠀⡇⠀⠀⠀⠀⡼\\n⠀⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀⠀⠘⠤⣄⣠⠞⠀\\n⠀⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\\n⠀⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀\\n⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀\\n⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀⠀⣄⢸⠀⠀⠀⠀⠀⠀\\n⣿⣿⣧⣀⣿………⣀⣰⣏⣘⣆⣀⠀⠀\\n *\\/\\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter; \\/\\/ System.out is a PrintStream\\n\\/\\/ import java.util.Arrays;\\nimport java.util.ArrayDeque;\\n\\/\\/ import java.util.ArrayList;\\n\\/\\/ import java.util.Collections; \\/\\/ for sorting ArrayList mainly\\n\\/\\/ import java.util.HashMap;\\n\\/\\/ import java.util.HashSet;\\n\\/\\/ import java.util.Random;\\nimport java.util.StringTokenizer;\\n\\npublic class C {\\n public static void main(String[] args) throws IOException {\\n FastScanner scn = new FastScanner();\\n PrintWriter out = new PrintWriter(System.out);\\n for (int tc = scn.nextInt(); tc > 0; tc--) {\\n int N = scn.nextInt();\\n int[] arr = new int[N];\\n for (int i = 0; i < N; i++) {\\n arr[i] = scn.nextInt();\\n }\\n StringBuilder[] ans = new StringBuilder[N];\\n ans[0] = new StringBuilder(\\\"1\\\");\\n ArrayDeque st = new ArrayDeque<>();\\n st.addLast(0);\\n for (int i = 1; i < N; i++) {\\n \\/\\/ System.out.println(st);\\n ans[i] = new StringBuilder();\\n if (arr[i] == 1) {\\n st.addLast(i);\\n ans[i].append(ans[i - 1].toString() + \\\".1\\\");\\n } else {\\n while (arr[st.getLast()] != arr[i] - 1) {\\n st.removeLast();\\n }\\n int pos = st.removeLast();\\n String[] prev = ans[pos].toString().split(\\\"[.]\\\");\\n for (int j = 0, sz = prev.length - 1; j < sz; j++) {\\n ans[i].append(prev[j] + \\\".\\\");\\n }\\n ans[i].append(arr[i] + \\\"\\\");\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import static java.util.Arrays.*;\\nimport static java.lang.Math.*;\\nimport static java.math.BigInteger.*;\\nimport java.util.*;\\nimport java.math.*;\\nimport java.io.*;\\n\\npublic class A implements Runnable\\n{\\n String file = \\\"input\\\";\\n \\n void init() throws IOException\\n {\\n \\/\\/input = new BufferedReader(new FileReader(file + \\\".in\\\"));\\n input = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(new BufferedOutputStream(System.out));\\n }\\n \\n void solve() throws IOException\\n {\\n String s = next();\\n int res = 0;\\n int L = s.length();\\n for(int i = 0; i < L; i++)\\n for(int j = i + 1; j <= L; j++)\\n {\\n String ss = s.substring(i, j);\\n int k = s.indexOf(ss);\\n \\/\\/print(ss, k);\\n if(k >= 0)\\n {\\n if(s.substring(k + 1).indexOf(ss) >= 0) res = max(res, j - i);\\n }\\n }\\n System.out.println(res);\\n }\\n \\n String next() throws IOException\\n {\\n if(st == null || !st.hasMoreTokens()) st = new StringTokenizer(input.readLine());\\n return st.nextToken();\\n }\\n \\n int nextInt() throws IOException\\n {\\n return Integer.parseInt(next());\\n }\\n \\n long nextLong() throws IOException\\n {\\n return Long.parseLong(next());\\n }\\n \\n double nextDouble() throws IOException\\n {\\n return Double.parseDouble(next());\\n }\\n \\n void print(Object... o)\\n {\\n System.out.println(deepToString(o));\\n }\\n \\n void gcj(Object o)\\n {\\n String s = String.valueOf(o);\\n out.println(\\\"Case #\\\" + test + \\\": \\\" + s);\\n System.out.println(\\\"Case #\\\" + test + \\\": \\\" + s);\\n }\\n \\n BufferedReader input;\\n PrintWriter out;\\n StringTokenizer st;\\n int test;\\n \\n public static void main(String[] args) throws IOException\\n {\\n new Thread(null, new A(), \\\"\\\", 1 << 20).start();\\n }\\n \\n public void run()\\n {\\n try\\n {\\n ... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.BufferedWriter;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStreamWriter;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\n\\npublic class TaskA implements Runnable {\\n\\t\\n\\t@Override\\n\\tpublic void run() {\\n\\t\\tInputReader in = new InputReader(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\t\\tint n = in.readInt();\\n\\t\\tif (n > 0) {\\n\\t\\t\\tout.println(n);\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tint nn = -n;\\n\\t\\t\\tint x = nn\\/10;\\n\\t\\t\\tint lastDigit = nn%10;\\n\\t\\t\\tint y = 10*(x\\/10) + lastDigit;\\n\\t\\t\\tx = -x;\\n\\t\\t\\ty = -y;\\n\\t\\t\\tout.println(x > y ? x : y);\\n\\t\\t}\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew TaskA().run();\\n\\t}\\n\\t\\n\\tprivate class InputReader {\\n\\t\\t\\n\\t public BufferedReader reader;\\n\\t public StringTokenizer tokenizer;\\n\\n\\t public InputReader(InputStream stream) {\\n\\t reader = new BufferedReader(new InputStreamReader(stream));\\n\\t tokenizer = null;\\n\\t }\\n\\n\\t public String next() {\\n\\t while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t try {\\n\\t tokenizer = new StringTokenizer(reader.readLine());\\n\\t } catch (IOException e) {\\n\\t throw new RuntimeException(e);\\n\\t }\\n\\t }\\n\\t return tokenizer.nextToken();\\n\\t }\\n\\t \\n\\t public int readInt() {\\n\\t \\treturn Integer.parseInt(next());\\n\\t }\\n\\t \\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.IOException;\\nimport java.io.OutputStreamWriter;\\nimport java.util.Arrays;\\nimport java.io.BufferedWriter;\\nimport java.util.Set;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.Writer;\\nimport java.util.HashSet;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Mahmoud Aladdin \\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tOutputWriter out = new OutputWriter(outputStream);\\n\\t\\tTaskD solver = new TaskD();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskD {\\n public void solve(int testNumber, InputReader jin, OutputWriter jout) {\\n int n = jin.int32();\\n int a = jin.int32();\\n int b = jin.int32();\\n\\n\\n\\n Set present = new HashSet();\\n int[] arr = new int[n];\\n int[] sarr = new int[n];\\n for(int i = 0; i < n; i++) {\\n sarr[i] = arr[i] = jin.int32();\\n present.add(arr[i]);\\n }\\n\\n boolean rev = b < a;\\n if(b < a) {b ^= a; a ^= b; b ^= a; }\\n\\n Arrays.sort(sarr);\\n\\n Set set1 = new HashSet();\\n Set set2 = new HashSet();\\n\\n for(int i = 0; i < n; i++) {\\n if(set1.contains(sarr)) continue;\\n if(set2.contains(sarr)) continue;\\n int comp1 = b - sarr[i];\\n if(present.contains(comp1)) {\\n set2.add(sarr[i]);\\n set2.add(comp1);\\n present.remove(comp1);\\n } else {\\n int comp2 = a - sarr[i];\\n if(present.contains(comp2)) {\\n set1.add(sarr[i]);\\n set1.add(comp2);\\n present.remove(comp2);\\n } else {\\n jout.println(\\\"NO\\\");\\n return;\\n }\\n }\\n }\\n\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n \\n\\n public class SolutionC{\\n public static void main(String[] args) throws Exception{\\n Scanner sc=new Scanner(System.in);\\n PrintWriter out=new PrintWriter(System.out);\\n int t=sc.nextInt();\\n int[] arr=new int[10000002];\\n for(int i=0;i0){\\n \\n int n=sc.nextInt();\\n int k=sc.nextInt();\\n int[] aa=new int[n];\\n for(int i=0;i= 0; h--) {\\n\\t\\t\\t\\t\\tif (pp[a] >= ip[h]) {\\n\\t\\t\\t\\t\\t\\tmp[h]++;\\n\\t\\t\\t\\t\\t\\tip[h] = i;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif (h > 0 && (mp[h - 1] < mp[h] || mp[h - 1] == mp[h] && ip[h - 1] > ip[h])) {\\n\\t\\t\\t\\t\\t\\tmp[h] = mp[h - 1];\\n\\t\\t\\t\\t\\t\\tip[h] = ip[h - 1];\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tpp[a] = i;\\n\\t\\t\\t}\\n \\n \\n out.println(mp[k]+1);\\n \\n for (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tpp[aa[i]] = -1;\\n\\t\\t\\t}\\n \\n }\\n \\n out.close();\\n}\\n\\n} What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\n\\npublic class Solution{\\n \\n\\tpublic static Integer INT(String s){\\n\\t\\treturn Integer.parseInt(s);\\n\\t}\\n \\n\\tpublic static Long LONG(String s){\\n\\t\\treturn Long.parseLong(s);\\n\\t}\\n \\n\\t\\/\\/====================================================================================================================\\n \\n \\n \\t\\n\\n\\tpublic static void main(String args[])throws IOException{\\n \\n\\t\\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\tScanner in=new Scanner(System.in);\\tStringBuilder out=new StringBuilder();\\n \\n\\t\\tlong n=in.nextLong(),\\n\\t\\t\\t k=in.nextLong();\\n\\n\\t\\tlong a=1,\\n\\t\\t\\t b=3,\\n\\t\\t\\t c=-2*(n+k);\\n\\t\\t\\n\\t\\tlong r1=(-b+(long)Math.sqrt(b*b-4*a*c))\\/(2*a);\\n\\t\\tlong r2=(-b-(long)Math.sqrt(b*b-4*a*c))\\/(2*a);\\n\\n\\t\\tSystem.out.println(n-Math.max(r1, r2));\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\nimport java.util.StringTokenizer;\\n\\npublic class C {\\n\\tBufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\\n\\tStringTokenizer st = null;\\n\\n\\tprivate void solution() throws IOException {\\n\\t\\tint n = nextInt();\\n\\t\\tint[] mas = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tmas[i] = nextInt();\\n\\t\\t}\\n\\n\\t\\tArrays.sort(mas);\\n\\n\\t\\tif (mas[n - 1] == 1) {\\n\\t\\t\\tmas[n - 1] = 2;\\n\\t\\t} else {\\n\\t\\t\\tmas[n - 1] = 1;\\n\\t\\t}\\n\\t\\tArrays.sort(mas);\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tSystem.out.print(mas[i] + \\\" \\\");\\n\\t\\t}\\n\\n\\t}\\n\\n\\tString nextToken() throws IOException {\\n\\t\\tif (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tst = new StringTokenizer(bf.readLine());\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tlong nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tdouble nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n\\n\\tpublic static void main(String args[]) throws IOException {\\n\\t\\tnew C().solution();\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.HashMap;\\nimport java.util.Map;\\nimport java.util.Scanner;\\n\\n\\npublic class A23 {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tString s = sc.next();\\n\\t\\tMap map = new HashMap();\\n\\t\\tfor (int i = s.length(); i >= 1; i--) {\\n\\t\\t\\tmap.clear();\\n\\t\\t\\tfor (int j = 0; j < s.length()-i+1; j++) {\\n\\t\\t\\t\\tString temp = s.substring(j, j+i);\\n\\t\\t\\t\\tif (map.containsKey(temp)) {\\n\\t\\t\\t\\t\\tSystem.out.println(i);\\n\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tmap.put(temp, true);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(0);\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\npublic class B {\\n static FastScanner fs;\\n public static void main(String[] args) {\\n fs=new FastScanner();\\n int t = fs.nextInt();\\n while (t-->0)\\n solve();\\n }\\n public static void solve() {\\n int n = fs.nextInt()*2;\\n int sq = (int)Math.sqrt(n);\\n int sq2 = (int)Math.sqrt(n\\/2);\\n if (sq*sq==n) System.out.println(\\\"YES\\\");\\n else if (sq2*sq2==n\\/2.0 && sq2%2==0) System.out.println(\\\"YES\\\");\\n else System.out.println(\\\"NO\\\");\\n }\\n static int gcd(int a, int b) {\\n if (a==0) return b;\\n return gcd(b%a, a);\\n }\\n static void ruffleSort(int[] a) {\\n int n=a.length;\\/\\/shuffle, then sort\\n for (int i=0; i 0) {\\n if (exponent % 2 == 1) {\\n result = (result * base) % modulus;\\n }\\n exponent >>= 1;\\n base = (base * base) % modulus;\\n }\\n return result;\\n }\\n\\n public static void main(String[] args) throws FileNotFoundException {\\n long beginTime = System.nanoTime();\\n InputStream is = DEBUG ? new FileInputStream(\\\"resources\\/codeforcesedu43\\/ProblemC-1.in\\\") : System.in;\\n try (Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(is)))) {\\n long x = scanner.nextLong();\\n long k = scanner.nextLong();\\n if (x != 0) {\\n x = (2 * x - 1) % MODULUS;\\n long twoPowK = modularPow(2, k, MODULUS);\\n x = (x * twoPowK + 1) % MODULUS;\\n }\\n System.out.println(x % 1000000007);\\n }\\n System.err.println( \\\"Done in \\\" + ((System.nanoTime() - beginTime) \\/ 1e9) + \\\" seconds.\\\");\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\npublic class D {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tlong L = sc.nextLong();\\n\\t\\tlong R = sc.nextLong();\\n\\t\\tlong res = Math.max(2 * Long.highestOneBit(L ^ R) - 1, 0);\\n\\t\\tSystem.out.println(res);\\n\\t}\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Solution {\\n public void doMain() throws Exception {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt(), m = sc.nextInt();\\n boolean[][] adj = new boolean[n][n];\\n for (int i=0; i list = new TreeList<>();\\n PairII[] a = new PairII[n + 1];\\n for (int i = 1; i <= n; i++) {\\n a[i] = (new PairII(in.nextInt(), in.nextInt()));\\n list.add(a[i]);\\n }\\n PairII pos1 = new PairII(INF, INF);\\n PairII pos2 = new PairII(INF, INF);\\n for (int i = 1; i <= 5; i++) {\\n for (int j = i + 1; j <= 5; j++) {\\n for (int k = j + 1; k <= 5; k++) {\\n int x1 = a[i].first;\\n int y1 = a[i].second;\\n int x2 = a[j].first;\\n int y2 =... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.io.*;\\n\\n\\/**\\n * Generated by Contest helper plug-in\\n * Actual solution is at the bottom\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputReader in = new StreamInputReader(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n run(in, out);\\n }\\n\\n public static void run(InputReader in, PrintWriter out) {\\n Solver solver = new TaskB();\\n solver.solve(1, in, out);\\n Exit.exit(in, out);\\n }\\n}\\n\\nabstract class InputReader {\\n private boolean finished = false;\\n\\n public abstract int read();\\n\\n public int readInt() {\\n int c = read();\\n while (isSpaceChar(c))\\n c = read();\\n int sgn = 1;\\n if (c == '-') {\\n sgn = -1;\\n c = read();\\n }\\n int res = 0;\\n do {\\n if (c < '0' || c > '9')\\n throw new InputMismatchException();\\n res *= 10;\\n res += c - '0';\\n c = read();\\n } while (!isSpaceChar(c));\\n return res * sgn;\\n }\\n\\n public String readString() {\\n int c = read();\\n while (isSpaceChar(c))\\n c = read();\\n StringBuffer res = new StringBuffer();\\n do {\\n res.appendCodePoint(c);\\n c = read();\\n } while (!isSpaceChar(c));\\n return res.toString();\\n }\\n\\n private boolean isSpaceChar(int c) {\\n return c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1;\\n }\\n\\n public void setFinished(boolean finished) {\\n this.finished = finished;\\n }\\n\\n public abstract void close();\\n}\\n\\nclass StreamInputReader extends InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar, numChars;\\n\\n public StreamInputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n if (curChar >=... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class cf1497_Div2_E2 {\\n\\tstatic int[] spf;\\n\\t\\n\\tpublic static int factor(int n) {\\n\\t\\tint val = 1;\\n\\t\\twhile (n > 1) {\\n\\t\\t\\tint cnt = 0;\\n\\t\\t\\tint p = spf[n];\\n\\t\\t\\twhile (n % p == 0) {\\n\\t\\t\\t\\tcnt++;\\n\\t\\t\\t\\tn \\/= p;\\n\\t\\t\\t}\\n\\t\\t\\tif (cnt % 2 == 1)\\n\\t\\t\\t\\tval *= p;\\n\\t\\t}\\n\\t\\treturn val;\\n\\t}\\n\\t\\n\\tpublic static void main(String args[]) throws IOException {\\n\\t\\tFastScanner in = new FastScanner(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tint t = in.nextInt();\\n\\t\\tint max = (int)(1e7) + 1;\\n\\t\\t\\n\\t\\tboolean[] prime = new boolean[max + 1]; \\n\\t\\tArrays.fill(prime, true);\\n\\t\\tprime[0] = prime[1] = false;\\n\\t\\tspf = new int[max];\\n\\t\\tfor (int i = 2; i < max; i++) spf[i] = i;\\n\\t\\tfor (int i = 2; i * i < max; i++) {\\n\\t\\t\\tif (prime[i]) {\\n\\t\\t\\t\\tspf[i] = i;\\n\\t\\t\\t\\tfor (int j = i * i; j < max; j += i) {\\n\\t\\t\\t\\t\\tprime[j] = false;\\n\\t\\t\\t\\t\\tspf[j] = i;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tint[] cnts = new int[max];\\n\\t\\t\\n\\t\\tfor ( ; t > 0; t--) {\\n\\t\\t\\tint n = in.nextInt();\\n\\t\\t\\tint k = in.nextInt();\\n\\t\\t\\tint[] vals = new int[n];\\n\\t\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\t\\tvals[i] = factor(in.nextInt());\\n\\t\\t\\t\\n\\t\\t\\t\\/\\/ left[i][x] = l where al ... ai such that in x moves it is valid subsequence\\n\\t\\t\\tint[][] left = new int[n + 1][k + 1];\\n\\t\\t\\t\\/\\/ x y z w a b c\\n\\t\\t\\t\\n\\t\\t\\tfor (int x = 0; x <= k; x++) {\\n\\t\\t\\t\\tint l = n;\\n\\t\\t\\t\\tint now = 0;\\n\\t\\t\\t\\tfor (int i = n - 1; i >= 0; i--) {\\n\\t\\t\\t\\t\\twhile (l - 1 >= 0 && now + ((cnts[vals[l - 1]] > 0) ? 1 : 0) <= x) {\\n\\t\\t\\t\\t\\t\\tl--;\\n\\t\\t\\t\\t\\t\\tnow += ((cnts[vals[l]] > 0) ? 1 : 0);\\n\\t\\t\\t\\t\\t\\t\\/\\/ System.out.println(now);\\n\\t\\t\\t\\t\\t\\tcnts[vals[l]]++;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\/\\/ System.out.println(i + \\\" \\\" + x + \\\" \\\" + l + \\\" \\\" + now);\\n\\t\\t\\t\\t\\tleft[i][x] = l;\\n\\t\\t\\t\\t\\tif (cnts[vals[i]] > 1) now--;\\n\\t\\t\\t\\t\\tcnts[vals[i]]--;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\t\\/\\/ for (int[] x: left)\\n\\t\\t\\t\\t\\/\\/ System.out.println(Arrays.toString(x));\\n\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\tint oo = (int)(1e9);\\n\\t\\t\\t\\n\\t\\t\\tint[][] dp = new int[n + 1][k + 1];\\n\\t\\t\\t\\n\\t\\t\\tfor (int i = 1; i <= n; i++)\\n\\t\\t\\t\\tArrays.fill(dp[i], oo);\\n\\t\\t\\t\\n\\t\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\t\\tfor (int j = 0; j <= k; j++) {\\n\\t\\t\\t\\t\\tif (j > 0) dp[i][j] = dp[i][j - 1];\\n\\t\\t\\t\\t\\tfor (int x = 0; x <= j; x++) {\\n\\t\\t\\t\\t\\t\\tint l =... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tString[] in = br.readLine().split(\\\" \\\");\\n\\t\\t\\n\\t\\tint n=Integer.parseInt(in[0]),m=Integer.parseInt(in[1]),k=Integer.parseInt(in[2]);\\n\\t\\t\\n\\t\\tStringTokenizer st = new StringTokenizer(br.readLine());\\n\\t\\tint[] caps = new int[n];\\n\\t\\tfor (int i = 0; i < caps.length; i++) {\\n\\t\\t\\tcaps[i] = Integer.parseInt(st.nextToken());\\n\\t\\t}\\n\\t\\tArrays.sort(caps);\\n\\t\\t\\n\\t\\tint curSockets=k, neededLines=0;\\n\\t\\tint i = n-1;\\n\\t\\twhile(curSockets=0){\\n\\t\\t\\tcurSockets+=caps[i]-1;\\n\\t\\t\\tneededLines++;\\n\\t\\t\\ti--;\\n\\t\\t}\\n\\t\\tif(curSockets>=m)\\n\\t\\t\\tSystem.out.println(neededLines);\\n\\t\\telse\\n\\t\\t\\tSystem.out.println(-1);\\n\\t}\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\n\\npublic class java2 {\\n public static void main(String[] args) {\\n Scanner r = new Scanner(System.in);\\n int n=r.nextInt();\\n int []l=new int[1005];\\n int []ri=new int[1005];\\n int []candy=new int[1005];\\n for(int i=1;i<=n;++i)\\n {\\n l[i]=r.nextInt();\\n }\\n for(int i=1;i<=n;++i)\\n {\\n ri[i]=r.nextInt();\\n }\\n for(int i=1;i<=n;++i)\\n {\\n if(l[i]>i-1||ri[i]>n-i)\\n {\\n System.out.println(\\\"NO\\\");\\n System.exit(0);\\n }\\n candy[i]=n-l[i]-ri[i];\\n }\\n for(int i=1;i<=n;++i)\\n {\\n int left=0,right=0;\\n for(int j=1;j<=i-1;++j)\\n {\\n if(candy[j]>candy[i])\\n {\\n ++left;\\n }\\n }\\n for(int j=i+1;j<=n;++j)\\n {\\n if(candy[j]>candy[i])\\n {\\n ++right;\\n }\\n }\\n if(left!=l[i]||right!=ri[i])\\n {\\n System.out.println(\\\"NO\\\");\\n System.exit(0);\\n }\\n }\\n System.out.println(\\\"YES\\\");\\n for(int i=1;i<=n;++i)\\n {\\n System.out.print(candy[i]+\\\" \\\");\\n }\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\/**\\n *\\n * @author saurabh\\n *\\/\\npublic class myTemplate {\\n\\n \\/**\\n * @param args the command line arguments\\n *\\/\\n public static void main(String[] args) throws Exception{\\n \\/\\/ TODO code application logic here\\n java.io.BufferedReader br = new java.io.BufferedReader(new \\n java.io.InputStreamReader(System.in));\\n \\n int ch[],arr[];\\n int x,i,j,k,t,n=Integer.parseInt(br.readLine());\\n \\/\\/System.out.println(n);\\n \\n if(n>0)\\n System.out.println(n);\\n else\\n {\\n \\/\\/n= -n;\\n \\/\\/n=-n;\\n x= n\\/100;\\n \\n x = x*10 + n%10;\\n \\/\\/ System.out.println(x);\\n if(n\\/10 > x)\\n System.out.println(n\\/10);\\n else\\n System.out.println(x);\\n \\n }\\n \\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/*\\n\\t \\t\\t * Author- Priyam Vora\\n\\t \\t\\t * BTech 2nd Year DAIICT\\n\\t \\t\\t *\\/\\n\\t \\n\\t \\n\\t \\t\\t import java.awt.Checkbox;\\n\\timport java.awt.Point;\\n\\timport java.io.*;\\n\\t \\t\\t import java.math.*;\\n\\t \\t\\t import java.util.*;\\n\\timport java.util.Map.Entry;\\n\\t\\n\\timport javax.print.attribute.SetOfIntegerSyntax;\\n\\t\\n\\t \\n\\t \\t\\t public class Main{\\n\\t \\t\\t \\tprivate static InputStream stream;\\n\\t \\t\\t \\tprivate static byte[] buf = new byte[1024];\\n\\t \\t\\t \\tprivate static int curChar;\\n\\t \\t\\t \\tprivate static int numChars;\\n\\t \\t\\t \\tprivate static SpaceCharFilter filter;\\n\\t \\t\\t \\tprivate static PrintWriter pw;\\n\\t \\t\\t \\tprivate static long count = 0,mod=1000000007;\\n\\t \\t\\t \\/\\/\\tprivate static TreeSet ts=new TreeSet[200000];\\n\\t \\t\\t \\tpublic final static int INF = (int) 1E9;\\n\\t\\n\\t \\t\\t \\n\\t \\t\\t public static void main(String[] args) {\\n\\t \\t\\t \\tInputReader(System.in);\\n\\t \\t\\t \\t\\tpw = new PrintWriter(System.out); \\n\\t \\t\\t new Thread(null ,new Runnable(){\\n\\t \\t\\t public void run(){\\n\\t \\t\\t try{\\n\\t \\t\\t solve();\\n\\t \\t\\t pw.close();\\n\\t \\t\\t } catch(Exception e){\\n\\t \\t\\t e.printStackTrace();\\n\\t \\t\\t }\\n\\t \\t\\t }\\n\\t \\t\\t },\\\"1\\\",1<<26).start();\\n\\t \\t\\t }\\n\\t \\t\\t public static void test(){\\n\\t \\t\\t \\tint t=nextInt();\\n\\t \\t\\t \\twhile(t-->0){\\n\\t \\t\\t \\t\\tsolve();\\n\\t \\t\\t \\t}\\n\\t \\t\\t }\\n\\t \\t\\t public static long pow(long n, long p,long mod) {\\n\\t \\t\\t\\t\\t\\tif(p==0)\\n\\t \\t\\t\\t\\t\\t\\treturn 1;\\n\\t \\t\\t\\t\\t\\tif(p==1)\\n\\t \\t\\t\\t\\t\\t\\treturn n%mod;\\n\\t \\t\\t\\t\\t\\tif(p%2==0){\\n\\t \\t\\t\\t\\t\\t\\tlong temp=pow(n, p\\/2,mod);\\n\\t \\t\\t\\t\\t\\treturn (temp*temp)%mod;\\n\\t \\t\\t\\t\\t\\t}else{\\n\\t \\t\\t\\t\\t\\t\\t \\tlong... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/*\\n * To change this template, choose Tools | Templates\\n * and open the template in the editor.\\n *\\/\\n\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.text.*;\\n\\npublic class cf276d {\\n\\n static BufferedReader br;\\n static Scanner sc;\\n static PrintWriter out;\\n\\n public static void initA() {\\n try {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n \\/\\/br = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n sc = new Scanner(System.in);\\n \\/\\/out = new PrintWriter(\\\"output.txt\\\");\\n out = new PrintWriter(System.out);\\n } catch (Exception e) {\\n }\\n }\\n\\n public static void initB() {\\n try {\\n\\n br = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n sc = new Scanner(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(\\\"output.txt\\\");\\n\\n } catch (Exception e) {\\n }\\n }\\n\\n public static String getString() {\\n try {\\n return br.readLine();\\n } catch (Exception e) {\\n }\\n return \\\"\\\";\\n }\\n\\n public static Integer getInt() {\\n try {\\n return Integer.parseInt(br.readLine());\\n } catch (Exception e) {\\n }\\n return 0;\\n }\\n\\n public static Integer[] getIntArr() {\\n try {\\n StringTokenizer temp = new StringTokenizer(br.readLine());\\n int n = temp.countTokens();\\n Integer temp2[] = new Integer[n];\\n for (int i = 0; i < n; i++) {\\n temp2[i] = Integer.parseInt(temp.nextToken());\\n }\\n return temp2;\\n } catch (Exception e) {\\n }\\n return null;\\n }\\n\\n public static Long[] getLongArr() {\\n try {\\n StringTokenizer temp = new StringTokenizer(br.readLine());\\n int n = temp.countTokens();\\n Long temp2[] = new Long[n];\\n for (int i = 0; i < n; i++) {\\n temp2[i] = Long.parseLong(temp.nextToken());\\n }\\n return temp2;\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class A {\\n\\tFastScanner in;\\n\\tPrintWriter out;\\n\\tboolean systemIO = true;\\n\\n\\tpublic static void quickSort(int[] a, int from, int to) {\\n\\t\\tif (to - from <= 1) {\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tint i = from;\\n\\t\\tint j = to - 1;\\n\\t\\tint x = a[from + (new Random()).nextInt(to - from)];\\n\\t\\twhile (i <= j) {\\n\\t\\t\\twhile (a[i] < x) {\\n\\t\\t\\t\\ti++;\\n\\t\\t\\t}\\n\\t\\t\\twhile (a[j] > x) {\\n\\t\\t\\t\\tj--;\\n\\t\\t\\t}\\n\\t\\t\\tif (i <= j) {\\n\\t\\t\\t\\tint t = a[i];\\n\\t\\t\\t\\ta[i] = a[j];\\n\\t\\t\\t\\ta[j] = t;\\n\\t\\t\\t\\ti++;\\n\\t\\t\\t\\tj--;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tquickSort(a, from, j + 1);\\n\\t\\tquickSort(a, j + 1, to);\\n\\t}\\n\\n\\t\\n\\n\\tpublic void solve() {\\n\\t\\tint n = in.nextInt();\\n\\t\\tHashSet ans = new HashSet<>();\\n\\t\\tLong d = in.nextLong();\\n\\t\\tlong[] a = new long[n];\\n\\t\\tfor (int i = 0; i < a.length; i++) {\\n\\t\\t\\ta[i] = in.nextInt();\\n\\t\\t}\\n\\t\\tfor (int i = 0; i < a.length; i++) {\\n\\t\\t\\tlong x = a[i] - d;\\n\\t\\t\\tboolean flag = true;\\n\\t\\t\\tfor (int j = 0; j < a.length; j++) {\\n\\t\\t\\t\\tif (Math.abs(a[j] - x) < d) {\\n\\t\\t\\t\\t\\tflag = false;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif (flag) {\\n\\t\\t\\t\\tans.add(x);\\n\\t\\t\\t}\\n\\t\\t\\tx = a[i] + d;\\n\\t\\t\\tflag = true;\\n\\t\\t\\tfor (int j = 0; j < a.length; j++) {\\n\\t\\t\\t\\tif (Math.abs(a[j] - x) < d) {\\n\\t\\t\\t\\t\\tflag = false;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif (flag) {\\n\\t\\t\\t\\tans.add(x);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(ans.size());\\n\\t}\\n\\n\\tpublic void run() {\\n\\n\\t\\ttry {\\n\\t\\t\\tif (systemIO) {\\n\\t\\t\\t\\tin = new FastScanner(System.in);\\n\\t\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tin = new FastScanner(new File(\\\"input.txt\\\"));\\n\\t\\t\\t\\tout = new PrintWriter(new File(\\\"output.txt\\\"));\\n\\t\\t\\t}\\n\\t\\t\\tsolve();\\n\\n\\t\\t\\tout.close();\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t}\\n\\t}\\n\\n\\tclass FastScanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tFastScanner(File f) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tbr = new BufferedReader(new FileReader(f));\\n\\t\\t\\t} catch (FileNotFoundException e) {\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tFastScanner(InputStream f) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(f));\\n\\t\\t}\\n\\n\\t\\tString nextLine() {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\treturn br.readLine();\\n\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tString next() {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\t\\ttry... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import static java.lang.Math.max;\\nimport static java.lang.Math.min;\\n\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class B {\\n\\n\\tprivate void solve() throws IOException {\\n\\t\\tint senators = nextInt();\\n\\t\\tint candies = nextInt();\\n\\t\\tscoreA = nextInt();\\n\\t\\tlvl = new int[senators];\\n\\t\\tunloyal = new int[senators];\\n\\t\\tfor (int i = 0; i < senators; i++) {\\n\\t\\t\\tlvl[i] = nextInt();\\n\\t\\t\\tunloyal[i] = 10 - nextInt() \\/ 10;\\n\\t\\t}\\n\\t\\tn = senators;\\n\\t\\tgive = new int[n];\\n\\t\\tres = 0;\\n\\t\\tgo(0, candies);\\n\\t\\tout.println(res);\\n\\t}\\n\\n\\tstatic double res;\\n\\tstatic int[] lvl;\\n\\tstatic int[] unloyal;\\n\\tstatic int[] give;\\n\\tstatic int n;\\n\\tstatic int scoreA;\\n\\n\\tstatic double probability() {\\n\\t\\tdouble res = 0;\\n\\t\\tfor (int mask = 0; mask < 1 << n; mask++) {\\n\\t\\t\\tdouble p = 1;\\n\\t\\t\\tint scoreB = 0;\\n\\t\\t\\tint cntGood = Integer.bitCount(mask);\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tint cnt = unloyal[i] - give[i];\\n\\t\\t\\t\\tif ((mask & (1 << i)) == 0) {\\n\\t\\t\\t\\t\\tscoreB += lvl[i];\\n\\t\\t\\t\\t\\tp *= cnt * .1;\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tp *= (10 - cnt) * .1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif (2 * cntGood > n) {\\n\\t\\t\\t\\tres += p;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tres += p * scoreA \\/ (scoreA + scoreB);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n\\n\\tstatic void go(int man, int candies) {\\n\\t\\tif (man == n) {\\n\\t\\t\\tres = max(res, probability());\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tgive[man] = 0;\\n\\t\\tgo(man + 1, candies);\\n\\t\\tfor (int i = 1; i <= min(unloyal[man], candies); i++) {\\n\\t\\t\\tgive[man] = i;\\n\\t\\t\\tgo(man + 1, candies - i);\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\ttry {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\tnew B().solve();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Throwable e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(239);\\n\\t\\t}\\n\\t}\\n\\n\\tstatic BufferedReader br;\\n\\tstatic StringTokenizer st;\\n\\tstatic PrintWriter out;\\n\\n\\tstatic String nextToken() throws IOException {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tString line = br.readLine();\\n\\t\\t\\tif (line == null) {\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t\\tst = new StringTokenizer(line);\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tstatic int nextInt() throws IOException {\\n\\t\\treturn... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\n\\npublic class LuckyDivision\\n{\\n public LuckyDivision(Scanner in)\\n {\\n int n;\\n\\n n = in.nextInt();\\n\\n if ( (n % 4 == 0) ||\\n (n % 7 == 0) ||\\n (n % 44 == 0) ||\\n (n % 47 == 0) ||\\n (n % 74 == 0) ||\\n (n % 77 == 0) ||\\n (n % 444 == 0) ||\\n (n % 447 == 0) ||\\n (n % 474 == 0) ||\\n (n % 477 == 0) ||\\n (n % 744 == 0) ||\\n (n % 747 == 0) ||\\n (n % 774 == 0) ||\\n (n % 777 == 0) )\\n System.out.printf(\\\"YES%n\\\");\\n else\\n System.out.printf(\\\"NO%n\\\");\\n }\\n\\n\\n public static void main(String[] args)\\n {\\n new LuckyDivision(new Scanner(System.in));\\n }\\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n private static void solve(InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n\\n if (n < 6) {\\n out.println(-1);\\n } else {\\n int m = (n - 2);\\n for (int i = 2; i <= m; i++) {\\n out.println(\\\"1 \\\" + i);\\n }\\n out.println(m + \\\" \\\" + (m + 1));\\n out.println(m + \\\" \\\" + (m + 2));\\n }\\n\\n for (int i = 2; i <= n; i++) {\\n out.println(\\\"1 \\\" + i);\\n }\\n }\\n\\n private static void shuffleArray(int[] array) {\\n int index;\\n Random random = new Random();\\n for (int i = array.length - 1; i > 0; i--) {\\n index = random.nextInt(i + 1);\\n if (index != i) {\\n array[index] ^= array[i];\\n array[i] ^= array[index];\\n array[index] ^= array[i];\\n }\\n }\\n }\\n\\n public static void main(String[] args) {\\n InputReader in = new InputReader(System.in);\\n OutputWriter out = new OutputWriter(System.out);\\n solve(in, out);\\n in.close();\\n out.close();\\n }\\n\\n private static class InputReader {\\n private BufferedReader br;\\n private StringTokenizer st;\\n\\n InputReader(InputStream is) {\\n br = new BufferedReader(new InputStreamReader(is));\\n st = null;\\n }\\n\\n String nextLine() {\\n String line = null;\\n try {\\n line = br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return line;\\n }\\n\\n String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n String line = nextLine();\\n if (line == null) return null;\\n st = new StringTokenizer(line);\\n }\\n return st.nextToken();\\n }\\n\\n byte nextByte() {\\n return Byte.parseByte(next());\\n }\\n\\n short nextShort() {\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.StreamTokenizer;\\n\\npublic class D11 {\\n\\n\\tstatic StreamTokenizer in;\\n\\tstatic PrintWriter out;\\n\\t\\n\\tstatic int nextInt() throws IOException {\\n\\t\\tin.nextToken();\\n\\t\\treturn (int)in.nval;\\n\\t}\\n\\t\\n\\tstatic String nextString() throws IOException {\\n\\t\\tin.nextToken();\\n\\t\\treturn in.sval;\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n\\t\\tout = new PrintWriter(System.out);\\n\\n\\t\\tn = nextInt();\\n\\t\\tm = nextInt();\\n\\t\\t\\n\\t\\tg = new boolean[n][n];\\n\\t\\tfor (int i = 0; i < m; i++) {\\n\\t\\t\\tint a = nextInt()-1, b = nextInt()-1;\\n\\t\\t\\tg[a][b] = g[b][a] = true;\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong ans = 0;\\n\\t\\tfor (int i = n-1; i >= 0; i--) {\\n\\t\\t\\tlong cur = solve(i);\\n\\t\\t\\tans += cur;\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.println(ans\\/2);\\n\\t\\t\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tstatic int n, m;\\n\\tstatic boolean[][] g;\\n\\t\\n\\tstatic long solve(int v) {\\n\\t\\tlong[][] memo = new long[v][1 << v];\\n\\t\\t\\n\\t\\tfor (int i = 0; i < v; i++)\\n\\t\\t\\tif (g[v][i])\\n\\t\\t\\t\\tmemo[i][1 << i] = 1;\\n\\t\\t\\n\\t\\tfor (int mask = 1; mask < (1 << v); mask++)\\n\\t\\t\\tfor (int i = 0; i < v; i++) if ((mask&(1 << i)) != 0)\\n\\t\\t\\t\\tfor (int j = 0; j < v; j++) if (g[i][j] && (mask&(1 << j)) == 0)\\n\\t\\t\\t\\t\\tmemo[j][mask|(1 << j)] += memo[i][mask];\\n\\t\\t\\n\\t\\tlong res = 0;\\n\\t\\tfor (int mask = 1; mask < (1 << v); mask++)\\n\\t\\t\\tfor (int i = 0; i < v; i++)\\n\\t\\t\\t\\tif (Integer.bitCount(mask) > 1 && g[v][i]) res += memo[i][mask];\\n\\t\\treturn res;\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\npublic class A {\\n\\t@SuppressWarnings(\\\"unchecked\\\")\\n\\tprivate static void solve() throws IOException {\\n\\t\\tArrayList c = new ArrayList();\\n\\t\\tn = nextInt();\\n\\t\\ta = nextInt();\\n\\t\\tb = nextInt();\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\tint next = nextInt();\\n\\t\\t\\tboolean found = false;\\n\\t\\t\\tfor(int j = 0; j < c.size(); j++) {\\n\\t\\t\\t\\tif(c.get(j).num == next) {\\n\\t\\t\\t\\t\\tc.get(j).freq++;\\n\\t\\t\\t\\t\\tfound = true;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(!found)\\n\\t\\t\\t\\tc.add(new Num(next));\\n\\t\\t}\\n\\t\\tCollections.sort(c);\\n\\t\\tint below = 0;\\n\\t\\tint above = n;\\n\\t\\tboolean f = false;\\n\\t\\tfor(int i = 0; i < c.size(); i++) {\\n\\t\\t\\tbelow += c.get(i).freq;\\n\\t\\t\\tabove -= c.get(i).freq;\\n\\t\\t\\tif(below == b && above == a) {\\n\\t\\t\\t\\tif(i == c.size())\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tSystem.out.println(c.get(i+1).num - c.get(i).num);\\n\\t\\t\\t\\tf = true;\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif(!f)\\n\\t\\t\\tSystem.out.println(0);\\n\\t}\\n\\t\\n\\tstatic int n;\\n\\tstatic int a;\\n\\tstatic int b;\\n\\tpublic static void main(String[] args) {\\n\\t\\ttry {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\tsolve();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Throwable e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(239);\\n\\t\\t}\\n\\t}\\n\\n\\tstatic BufferedReader br;\\n\\tstatic StringTokenizer st;\\n\\tstatic PrintWriter out;\\n\\n\\tstatic String nextToken() throws IOException {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tString line = br.readLine();\\n\\t\\t\\tif (line == null) {\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t\\tst = new StringTokenizer(line);\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tstatic int nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tstatic long nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tstatic double nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n}\\nclass Num implements Comparable {\\n\\tint num;\\n\\tint freq;\\n\\tNum(int n) {\\n\\t\\tnum = n;\\n\\t\\tfreq = 1;\\n\\t}\\n\\tpublic int compareTo(Num other) {\\n\\t\\treturn this.num - other.num;\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/* Codeforces Template *\\/\\n\\nimport java.io.*;\\nimport java.util.*;\\n\\nimport static java.lang.Math.*;\\nimport static java.util.Arrays.fill;\\nimport static java.util.Arrays.binarySearch;\\nimport static java.util.Arrays.sort;\\n\\npublic class Main {\\n\\t\\n\\tstatic long initTime;\\n\\tstatic final Random rnd = new Random(7777L);\\n\\tstatic boolean writeLog = false;\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tinitTime = System.currentTimeMillis();\\n\\t\\ttry {\\n\\t\\t\\twriteLog = \\\"true\\\".equals(System.getProperty(\\\"LOCAL_RUN_7777\\\"));\\n\\t\\t} catch (SecurityException e) {}\\n\\t\\tnew Thread(null, new Runnable() {\\n\\t\\t\\tpublic void run() {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\t\\tif (new File(\\\"input.txt\\\").exists())\\n\\t\\t\\t\\t\\t\\t\\tSystem.setIn(new FileInputStream(\\\"input.txt\\\"));\\n\\t\\t\\t\\t\\t} catch (SecurityException e) {}\\n\\t\\t\\t\\t\\tlong prevTime = System.currentTimeMillis();\\n\\t\\t\\t\\t\\tnew Main().run();\\n\\t\\t\\t\\t\\tlog(\\\"Total time: \\\" + (System.currentTimeMillis() - prevTime) + \\\" ms\\\");\\n\\t\\t\\t\\t\\tlog(\\\"Memory status: \\\" + memoryStatus());\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}, \\\"1\\\", 1L << 24).start(); \\n\\t}\\n\\n\\tvoid run() throws IOException {\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tsolve();\\n\\t\\tout.close();\\n\\t\\tin.close();\\n\\t}\\n\\t\\n\\t\\/*************************************************************** \\n\\t * Solution\\n\\t **************************************************************\\/\\n\\n\\tvoid solve() throws IOException {\\n\\t\\t\\n\\t\\tint n = nextInt();\\n\\t\\tlong k = nextLong();\\n\\t\\tint[] a = nextIntArray(n);\\n\\n\\t\\tSet bad = new TreeSet();\\n\\t\\t\\n\\t\\tsort(a);\\n\\t\\t\\n\\t\\tint ans = 0;\\n\\t\\t\\n\\t\\tfor (int x : a) {\\n\\t\\t\\tif (!bad.contains((long) x)) {\\n\\t\\t\\t\\tbad.add(x * k);\\n\\t\\t\\t\\tans++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.println(ans);\\n\\t\\t\\n\\t}\\n\\t\\n\\t\\/*************************************************************** \\n\\t * Input \\n\\t **************************************************************\\/\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st = new StringTokenizer(\\\"\\\");\\n\\t\\n\\tString nextToken() throws IOException {\\n\\t\\twhile (!st.hasMoreTokens())\\n\\t\\t\\tst = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Main\\n{\\n\\tstatic int MAX = 1000;\\n\\t\\n\\tstatic BitSet P = new BitSet(MAX + 1);\\n\\t\\t\\n\\tpublic static boolean Noldbach(int n)\\n\\t{\\n\\t\\tn--;\\n\\t\\t\\n\\t\\tint j;\\n\\t\\t\\n\\t\\tfor(int i=2; i<=n; i++)\\n\\t\\t{\\n\\t\\t\\tif(!P.get(i))\\n\\t\\t\\t{\\n\\t\\t\\t\\tj = i + 1;\\n\\t\\t\\t\\t\\n\\t\\t\\t\\twhile(P.get(j))\\n\\t\\t\\t\\t\\tj++;\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif(i+j == n)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tif(!P.get(i+j+1))\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\/\\/System.out.println((n+1)+\\\" = \\\"+i+\\\" + \\\"+(n-i)+\\\" + 1\\\");\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\treturn true;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn false;\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tScanner lee = new Scanner(System.in);\\t\\n\\n\\t\\tfor(int i=2; i*i<=MAX; i++)\\n\\t\\t{\\n\\t\\t if(!P.get(i))\\n\\t\\t {\\n\\t\\t \\tfor(int j=i+i; j<=MAX; j+=i)\\n\\t\\t \\t\\tP.set(j);\\n\\t\\t }\\n\\t\\t}\\n\\t\\t\\n\\t\\tint n, k, c;\\n\\t\\t\\n\\t\\tn = lee.nextInt();\\n\\t\\tk = lee.nextInt();\\n\\t\\t\\n\\t\\tc = 0;\\n\\t\\t\\n\\t\\tfor(int i=2; i<=n; i++)\\n\\t\\t{\\n\\t\\t\\tif(Noldbach(i))\\n\\t\\t\\t\\tc++;\\n\\t\\t\\t\\n\\t\\t\\tif(c == k)\\n\\t\\t\\t\\tbreak;\\n\\t\\t}\\n\\t\\t\\n\\t\\tif(c == k)\\n\\t\\t\\tSystem.out.println(\\\"YES\\\");\\n\\t\\telse\\n\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.awt.Point;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.PrintWriter;\\nimport java.util.Scanner;\\n\\npublic class C {\\n public static void main(String[] args) throws FileNotFoundException {\\n Scanner in = new Scanner(new FileReader(new File(\\\"input.txt\\\")));\\n PrintWriter out = new PrintWriter(new File(\\\"output.txt\\\"));\\n int n = in.nextInt();\\n int m = in.nextInt();\\n int[][] T = new int[n][m];\\n int k = in.nextInt();\\n int[] X = new int[k];\\n int[] Y = new int[k];\\n for (int i = 0; i < k; i++) {\\n X[i] = in.nextInt() - 1;\\n Y[i] = in.nextInt() - 1;\\n }\\n int max = 0;\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < m; j++) {\\n int min = Integer.MAX_VALUE;\\n for (int ii = 0; ii < k; ii++)\\n min = Math.min(min,\\n Math.abs(i - X[ii]) + Math.abs(j - Y[ii]));\\n max = Math.max(max, T[i][j] = min);\\n }\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < m; j++)\\n if (T[i][j] == max) {\\n out.println((i + 1) + \\\" \\\" + (j + 1));\\n out.flush();\\n return;\\n }\\n\\n }\\n} Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.BufferedWriter;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStreamWriter;\\nimport java.io.PrintWriter;\\n\\npublic class Div1_503B {\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\t\\tint N = Integer.parseInt(reader.readLine());\\n\\t\\tprinter.println(\\\"? 1\\\");\\n\\t\\tprinter.flush();\\n\\t\\tint v1 = Integer.parseInt(reader.readLine());\\n\\n\\t\\tprinter.println(\\\"? \\\" + (1 + N \\/ 2));\\n\\t\\tprinter.flush();\\n\\t\\tint v2 = Integer.parseInt(reader.readLine());\\n\\n\\t\\tif ((v1 + v2) % 2 != 0) {\\n\\t\\t\\tprinter.println(\\\"! -1\\\");\\n\\t\\t\\tprinter.close();\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tif (v1 == v2) {\\n\\t\\t\\tprinter.println(\\\"! 1\\\");\\n\\t\\t\\tprinter.close();\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tboolean less = v1 < v2;\\n\\n\\t\\tint low = 1;\\n\\t\\tint high = (1 + N \\/ 2);\\n\\n\\t\\twhile (low != high) {\\n\\t\\t\\tint mid = (low + high) >> 1;\\n\\n\\t\\t\\tprinter.println(\\\"? \\\" + mid);\\n\\t\\t\\tprinter.flush();\\n\\t\\t\\tint r1 = Integer.parseInt(reader.readLine());\\n\\n\\t\\t\\tint q2 = (mid + N \\/ 2);\\n\\t\\t\\tif (q2 > N) {\\n\\t\\t\\t\\tq2 -= N;\\n\\t\\t\\t}\\n\\t\\t\\tprinter.println(\\\"? \\\" + q2);\\n\\t\\t\\tprinter.flush();\\n\\t\\t\\tint r2 = Integer.parseInt(reader.readLine());\\n\\n\\t\\t\\tif (r1 == r2) {\\n\\t\\t\\t\\tprinter.println(\\\"! \\\" + mid);\\n\\t\\t\\t\\tprinter.close();\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\n\\t\\t\\tif (r1 < r2 == less) {\\n\\t\\t\\t\\tlow = mid + 1;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\thigh = mid - 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tprinter.println(\\\"! \\\" + low);\\n\\t\\tprinter.close();\\n\\t\\treturn;\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package que_a;\\n\\nimport java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class utkarsh {\\n\\n InputStream is;\\n PrintWriter out;\\n \\n long mod = (long) (1e9 + 7);\\n boolean SHOW_TIME;\\n \\n void solve() {\\n \\/\\/Enter code here utkarsh\\n \\/\\/SHOW_TIME = true;\\n int n = ni();\\n HashMap mp = new HashMap<>();\\n mp.put(\\\"M\\\", 0);\\n mp.put(\\\"S\\\", 1); mp.put(\\\"XS\\\", 2); mp.put(\\\"XXS\\\", 3); mp.put(\\\"XXXS\\\", 4);\\n mp.put(\\\"L\\\", 5); mp.put(\\\"XL\\\", 6); mp.put(\\\"XXL\\\", 7); mp.put(\\\"XXXL\\\", 8);\\n int a[] = new int[10];\\n for(int i = 0; i < n; i++) {\\n int j = mp.get(ns());\\n a[j]++;\\n }\\n for(int i = 0; i < n; i++) {\\n int j = mp.get(ns());\\n a[j]--;\\n }\\n int ans = 0;\\n for(int i = 0; i < 10; i++) {\\n if(a[i] > 0) ans += a[i];\\n }\\n out.println(ans);\\n }\\n\\n \\/\\/---------- I\\/O Template ----------\\n \\n public static void main(String[] args) { new utkarsh().run(); }\\n void run() { \\n is = System.in; \\n out = new PrintWriter(System.out);\\n long start = System.currentTimeMillis(); \\n solve(); \\n long end = System.currentTimeMillis();\\n if(SHOW_TIME) out.println(\\\"\\\\n\\\" + (end - start) + \\\" ms\\\");\\n out.flush();\\n }\\n \\n byte input[] = new byte[1024];\\n int len = 0, ptr = 0;\\n \\n int readByte() { \\n if(ptr >= len) { ptr = 0; \\n try { len = is.read(input); } \\n catch(IOException e) { throw new InputMismatchException(); } \\n if(len <= 0) { return -1; } \\n } return input[ptr++];\\n }\\n boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }\\n int skip() { \\n int b = readByte(); \\n while(b != -1 && isSpaceChar(b)) { b = readByte(); } \\n return b;\\n }\\n \\n char nc() { return (char)skip(); }\\n String ns() { \\n int b = skip(); \\n StringBuilder sb = new StringBuilder(); \\n while(!isSpaceChar(b)) {... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import static java.util.Arrays.deepToString;\\n\\nimport java.awt.datatransfer.StringSelection;\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.StringTokenizer;\\n\\npublic class Main {\\n\\n static void solve() throws IOException {\\n int n = nextInt();\\n if (n >= 0) {\\n System.out.println(n);\\n } else {\\n String string = String.valueOf(n);\\n int v1 = Integer.valueOf(string.substring(0, string.length() - 1));\\n int v2 = Integer.valueOf(string.substring(0, string.length() - 2)\\n + string.charAt(string.length() - 1));\\n if (v1 >= v2) {\\n System.out.println(v1);\\n } else {\\n System.out.println(v2);\\n }\\n }\\n \\n }\\n\\n public static void main(String[] args) throws Exception {\\n reader = new BufferedReader(new InputStreamReader(System.in));\\n writer = new PrintWriter(System.out);\\n\\n setTime();\\n solve();\\n printTime();\\n printMemory();\\n\\n writer.close();\\n }\\n\\n static BufferedReader reader;\\n static PrintWriter writer;\\n static StringTokenizer tok = new StringTokenizer(\\\"\\\");\\n static long systemTime;\\n\\n static void debug(Object... o) {\\n System.err.println(deepToString(o));\\n }\\n\\n static void setTime() {\\n systemTime = System.currentTimeMillis();\\n }\\n\\n static void printTime() {\\n System.err.println(\\\"Time consumed: \\\"\\n + (System.currentTimeMillis() - systemTime));\\n }\\n\\n static void printMemory() {\\n System.err.println(\\\"Memory consumed: \\\"\\n + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime()\\n .freeMemory()) \\/ 1000 + \\\"kb\\\");\\n }\\n\\n static String next() {\\n while (!tok.hasMoreTokens()) {\\n String w = null;\\n try {\\n w = reader.readLine();\\n } catch (Exception e) {\\n... What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.math.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tlong n = scan.nextLong();\\n\\t\\tlong k = scan.nextLong();\\n\\t\\tlong total = k * (k - 1) \\/ 2 + 1;\\n\\t\\tif (total < n) {\\n\\t\\t\\tSystem.out.println(-1);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong left = total - n;\\n\\t\\tlong low = 1;\\n\\t\\tlong high = k - 1;\\n\\t\\twhile (low < high) {\\n\\t\\t\\tlong mid = (low + high) \\/ 2;\\n\\t\\t\\tlong temp = mid * (mid + 1) \\/ 2;\\n\\t\\t\\tif (temp < left) {\\n\\t\\t\\t\\tlow = mid + 1;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\thigh = mid;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tlong temp = low * (low + 1) \\/ 2;\\n\\t\\tif (temp == left) {\\n\\t\\t\\tSystem.out.println(k - 1 - low);\\n\\t\\t} else {\\n\\t\\t\\tSystem.out.println(k - low);\\n\\t\\t}\\n\\t}\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\npublic class Paint {\\n public static void main (String srgs[] ){\\n \\n Scanner sc=new Scanner(System.in);\\n int n=sc.nextInt();\\n TreeSet ts=new TreeSet<>();\\n for(int i=0;i vals = new HashSet();\\n vals.add(b[0]);\\n int valval = 0;\\n for(int i=1; i 0)) {\\n if(sum%2 == 0) out.println(\\\"cslnb\\\"); else out.println(\\\"sjfnb\\\");\\n }\\n else out.println(\\\"cslnb\\\");\\n }\\n else if(diff2) out.println(\\\"cslnb\\\");\\n else if(sum%2 == 0) out.println(\\\"cslnb\\\"); else out.println(\\\"sjfnb\\\");\\n \\/\\/ int n = Integer.parseInt(st.nextToken());\\n \\n \\n out.close(); System.exit(0);\\n }\\n } What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class A {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner s = new Scanner(System.in);\\n\\t\\tlong l = s.nextLong();\\n\\t\\tlong r = s.nextLong();\\n\\t\\ts.close();\\n\\t\\t\\n\\t\\tif (r-l<2 || (r-l==2 && l%2==1)) {\\n\\t\\t\\tSystem.out.print(\\\"-1\\\");\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong beg = l%2==0 ? l : l+1;\\n\\t\\tif (beg+2>r) System.out.print(\\\"-1\\\");\\n\\t\\telse System.out.print(beg+\\\" \\\"+(beg+1)+\\\" \\\"+(beg+2));\\n\\t}\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\nimport java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.PrintWriter;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Dzmitry Paulenka\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n Scanner in = new Scanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskB solver = new TaskB();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n}\\n\\nclass TaskB {\\n public void solve(int testNumber, Scanner in, PrintWriter out) {\\n long n = in.nextLong();\\n long k = in.nextLong();\\n if (n == 1) {\\n out.println(0);\\n return;\\n }\\n if (k * (k - 1) < 2 * (n - 1)) {\\n out.println(-1);\\n return;\\n }\\n\\n long sq2 = 4 * k * k - 4 * k + 1 - 4 * (2 * n - 2);\\n double sqrt = Math.sqrt(sq2);\\n long sq = (long) sqrt;\\n if ((sq + 1) * (sq + 1) == sq2) {\\n sq = sq + 1;\\n } else if ((sq - 1) * (sq - 1) == sq2) {\\n sq = sq - 1;\\n }\\n\\n if (sq*sq == sq2) {\\n long kmin = (sq + 3) \\/ 2;\\n out.println(k - kmin + 1);\\n } else {\\n long km = Math.max(2, (long) ((sqrt + 3) \\/ 2.0) - 2);\\n while (((km + k - 2)*(k - km + 1) >= 2*(n-1))) {\\n ++km;\\n }\\n out.println(k - km + 2);\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Temppp {\\n\\n public static void main(String[] args) {\\n \\n Scanner sc = new Scanner(System.in);\\n long n = sc.nextLong();\\n long k = sc.nextLong();\\n \\n long ans = (long) ((java.lang.Math.sqrt((9+(8*(n+k))))-3)\\/2);\\n System.out.println(n-ans);\\n \\n }\\n \\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.awt.Rectangle;\\nimport java.awt.geom.Rectangle2D;\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class C\\n{\\n\\tString line;\\n\\tStringTokenizer inputParser;\\n\\tBufferedReader is;\\n\\tFileInputStream fstream;\\n\\tDataInputStream in;\\n\\tString FInput=\\\"\\\";\\n\\t\\n\\t\\n\\tvoid openInput(String file)\\n\\t{\\n\\n\\t\\tif(file==null)is = new BufferedReader(new InputStreamReader(System.in));\\/\\/stdin\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\ttry{\\n\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\tfstream = new FileInputStream(file);\\n\\t\\t\\tin = new DataInputStream(fstream);\\n\\t\\t\\tis = new BufferedReader(new InputStreamReader(in));\\n\\t\\t\\t}catch(Exception e)\\n\\t\\t\\t{\\n\\t\\t\\t\\tSystem.err.println(e);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n\\t\\n\\tvoid readNextLine()\\n\\t{\\n\\t\\ttry {\\n\\t\\t\\tline = is.readLine();\\n\\t\\t\\tinputParser = new StringTokenizer(line, \\\" \\\");\\n\\t\\t\\t\\/\\/System.err.println(\\\"Input: \\\" + line);\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\tSystem.err.println(\\\"Unexpected IO ERROR: \\\" + e);\\n\\t\\t}\\t\\n\\t\\t\\n\\t}\\n\\t\\n\\tint NextInt()\\n\\t{\\n\\t\\tString n = inputParser.nextToken();\\n\\t\\tint val = Integer.parseInt(n);\\n\\t\\t\\n\\t\\t\\/\\/System.out.println(\\\"I read this number: \\\" + val);\\n\\t\\treturn val;\\n\\t}\\n\\t\\n\\tString NextString()\\n\\t{\\n\\t\\tString n = inputParser.nextToken();\\n\\t\\treturn n;\\n\\t}\\n\\t\\n\\tvoid closeInput()\\n\\t{\\n\\t\\ttry {\\n\\t\\t\\tis.close();\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\tSystem.err.println(\\\"Unexpected IO ERROR: \\\" + e);\\n\\t\\t}\\n\\t\\t\\t\\n\\t}\\n\\t\\n\\tpublic void readFInput()\\n\\t{\\n\\t\\tfor(;;)\\n\\t\\t{\\n\\t\\t\\ttry\\n\\t\\t\\t{\\n\\t\\t\\t\\treadNextLine();\\n\\t\\t\\t\\tFInput+=line+\\\" \\\";\\n\\t\\t\\t}\\n\\t\\t\\tcatch(Exception e)\\n\\t\\t\\t{\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tinputParser = new StringTokenizer(FInput, \\\" \\\");\\n\\t}\\n\\t\\n\\tlong NextLong()\\n {\\n String n = inputParser.nextToken();\\n \\n long val = Long.parseLong(n);\\n \\n return val;\\n }\\n\\t\\n\\tpublic static void main(String [] argv)\\n\\t{\\n\\t\\t\\/\\/String filePath=\\\"input.txt\\\";\\n String filePath=null;\\n if(argv.length>0)filePath=argv[0];\\n\\t\\tnew C(filePath);\\n\\t}\\n\\tfinal int MOD = 1000000009;\\n\\tpublic C(String inputFile)\\n\\t{\\n\\t\\topenInput(inputFile);\\n\\t\\tStringBuilder sb = new StringBuilder();\\n\\t\\treadNextLine();\\n \\tint N=NextInt(), M=NextInt(), K=NextInt();\\n \\t\\n \\tif((N\\/K)<=(N-M))\\n \\t{\\n \\t\\tsb.append(M);\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\nimport java.io.PrintWriter;\\nimport java.util.*;\\n\\n\\npublic class Order8C implements Runnable {\\n private Scanner in = new Scanner(System.in);\\n private PrintWriter out = new PrintWriter(System.out);\\n\\n int mintime;\\n String path;\\n\\n int xs;\\n int ys;\\n int n;\\n int[] obx;\\n int[] oby;\\n\\n\\n public static void main(String[] args) {\\n\\tnew Thread(new Order8C()).start();\\n }\\n\\n private void read() {\\n\\txs = in.nextInt();\\n\\tys = in.nextInt();\\n\\tn = in.nextInt();\\n\\tobx = new int[n];\\n\\toby = new int[n];\\n\\tfor(int i = 0; i o2.max - o1.max);\\n if (columns.length > n)\\n columns = Arrays.copyOf(columns, n);\\n\\n long[] dp = new long[1 << n];\\n for (E2RotateColumnsHardVersion.Column c : columns) {\\n long[] ndp = new long[1 << n];\\n System.arraycopy(dp, 0, ndp, 0, dp.length);\\n\\n for (int rot = 0; rot < n; ++rot) {\\n long[] temp = new long[1 << n];\\n System.arraycopy(dp, 0, temp, 0, dp.length);\\n for (int i = 0, pos = rot; i <... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/Utilities\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\tstatic int n, m, k;\\n\\tstatic int[][] horW, verW;\\n\\tstatic int[][][] dp = new int[505][505][15];\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tfor (int i = 0; i < 505; i++) {\\n\\t\\t\\tfor (int j = 0; j < 505; j++) {\\n\\t\\t\\t\\tfor (int k = 0; k < 15; k++) {\\n\\t\\t\\t\\t\\tdp[i][j][k] = -1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tn = in.iscan(); m = in.iscan(); k =in.iscan();\\n\\t\\thorW = new int[n+1][m]; verW = new int[n][m+1];\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tfor (int j = 1; j <= m-1; j++) {\\n\\t\\t\\t\\thorW[i][j] = in.iscan();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor (int i = 1; i <= n-1; i++) {\\n\\t\\t\\tfor (int j = 1; j <= m; j++) {\\n\\t\\t\\t\\tverW[i][j] = in.iscan();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint min = Integer.MAX_VALUE;\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tfor (int j = 1; j <= m; j++) {\\n\\t\\t\\t\\tif (k % 2 == 1) {\\n\\t\\t\\t\\t\\tout.print(-1 + \\\" \\\");\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tout.print(dfs(i, j, k\\/2) * 2 + \\\" \\\");\\n\\t\\t\\t}\\n\\t\\t\\tout.println();\\n\\t\\t}\\n\\t\\tout.close();\\n\\t} \\n\\t\\n\\tstatic int dfs(int r, int c, int k) {\\n\\t\\tif (dp[r][c][k] != -1) {\\n\\t\\t\\treturn dp[r][c][k];\\n\\t\\t}\\n\\t\\tif (k == 0) {\\n\\t\\t\\treturn dp[r][c][k] = 0;\\n\\t\\t}\\n\\t\\tint min = Integer.MAX_VALUE;\\n\\t\\tif (r - 1 >= 1) {\\n\\t\\t\\tmin = Math.min(min, verW[r-1][c] + dfs(r-1, c, k-1));\\n\\t\\t}\\n\\t\\tif (r + 1 <= n) {\\n\\t\\t\\tmin = Math.min(min, verW[r][c] + dfs(r+1, c, k-1));\\n\\t\\t}\\n\\t\\tif (c - 1 >= 1) {\\n\\t\\t\\tmin = Math.min(min, horW[r][c-1] + dfs(r, c-1, k-1));\\n\\t\\t}\\n\\t\\tif (c + 1 <= m) {\\n\\t\\t\\tmin = Math.min(min, horW[r][c] + dfs(r, c+1, k-1));\\n\\t\\t}\\n\\t\\treturn dp[r][c][k] = min;\\n\\t}\\n\\t\\n\\tstatic INPUT in = new INPUT(System.in);\\n\\tstatic PrintWriter out = new PrintWriter(System.out);\\n\\tprivate static class INPUT {\\n\\n\\t\\tprivate InputStream stream;\\n\\t\\tprivate byte[] buf = new byte[1024];\\n\\t\\tprivate int curChar, numChars;\\n\\n\\t\\tpublic INPUT (InputStream stream) {\\n\\t\\t\\tthis.stream = stream;\\n\\t\\t}\\n\\n\\t\\tpublic INPUT (String file) throws IOException {\\n\\t\\t\\tthis.stream = new FileInputStream (file);\\n\\t\\t}\\n\\n\\t\\tpublic int cscan () throws IOException {\\n\\t\\t\\tif (curChar >= numChars) {\\n\\t\\t\\t\\tcurChar = 0;\\n\\t\\t\\t\\tnumChars = stream.read (buf);\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tif (numChars == -1)\\n\\t\\t\\t\\treturn... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Comparator;\\nimport java.util.Scanner;\\n\\npublic class CottageVillage {\\n \\n class cl {\\n int x=0;\\n int a=0;\\n \\n cl(int x, int a){\\n this.x=x; \\n this.a=a;\\n }\\n }\\n \\n class cmp implements Comparator {\\n public int compare(cl d1, cl d2) {\\n return d1.x0) cnt+=2;\\n else if (diff==0) cnt++;\\n }\\n System.out.println(cnt);\\n }\\n \\n public static void main(String... args) {\\n new CottageVillage();\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.*;\\nimport java.security.*;\\nimport java.text.*;\\nimport java.util.*;\\nimport java.util.concurrent.*;\\nimport java.util.function.*;\\nimport java.util.regex.*;\\nimport java.util.stream.*;\\nimport static java.util.stream.Collectors.joining;\\nimport static java.util.stream.Collectors.toList;\\n\\n\\npublic class Main{\\n\\n static long MOD = 1_000_000_007L;\\n \\/\\/static long MOD = 998_244_353L;\\n \\/\\/static long MOD = 1_000_000_033L;\\n static long inv2 = (MOD + 1) \\/ 2;\\n\\n static int[][] dir = new int[][]{{1, 0}, {0, 1}, {-1, 0}, {0, -1}};\\n static long lMax = 0x3f3f3f3f3f3f3f3fL;\\n static int iMax = 0x3f3f3f3f;\\n static HashMap memo = new HashMap();\\n static MyScanner sc = new MyScanner();\\n \\/\\/static ArrayList primes;\\n\\n static int nn = 300000;\\n static long[] pow2;\\n static long [] fac;\\n static long [] pow;\\n static long [] inv;\\n static long [] facInv;\\n static int[] base;\\n static int[] numOfDiffDiv;\\n static int[] numOfDiv;\\n static ArrayList primes;\\n \\/\\/static int[] primes;\\n static int ptr = 0;\\n static boolean[] isPrime;\\n\\n \\/\\/-----------PrintWriter for faster output---------------------------------\\n public static PrintWriter out;\\n public static void main(String[] args) {\\n out = new PrintWriter(new BufferedOutputStream(System.out));\\n \\/\\/ Start writing your solution here. -------------------------------------\\n\\n\\n\\n \\/*fac = new long[nn + 1];\\n fac[1] = 1;\\n for(int i = 2; i <= nn; i++)\\n fac[i] = fac[i - 1] * i % MOD;*\\/\\n\\n\\n \\/*pow2 = new long[nn + 1];\\n pow2[0] = 1L;\\n for(int i = 1; i <= nn; i++)\\n pow2[i] = pow2[i - 1] * 2L;*\\/\\n\\n\\n \\/*inv = new long[nn + 1];\\n inv[1] = 1;\\n for (int i = 2; i <= nn; ++i)\\n inv[i] = (MOD - MOD \\/ i) * inv[(int)(MOD % i)] % MOD;*\\/\\n\\n \\/*facInv = new long[nn + 1];\\n facInv[0] = facInv[1] = 1;\\n for (int i = 2; i <= nn; ++i)\\n facInv[i] = facInv[i - 1] * inv[i]... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport static java.lang.Math.*;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collections;\\nimport java.util.Map.Entry;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\n\\n\\/**\\n *\\n * @author pttrung\\n *\\/\\npublic class C {\\n\\n public static double Epsilon = 1e-6;\\n public static long x, y, d;\\n public static long MOD = 1000000007;\\n public static int[][][] dp;\\n public static int min, max, need;\\n\\n public static void main(String[] args) {\\n\\n Scanner in = new Scanner();\\n PrintWriter out = new PrintWriter(System.out);\\n\\n int n = in.nextInt();\\n int m = in.nextInt();\\n min = Math.min(n, m);\\n max = (m + n) - min;\\n dp = new int[max][1 << min][1 << min];\\n\\n for (int[][] temp : dp) {\\n for (int[] val : temp) {\\n Arrays.fill(val, -1);\\n }\\n }\\n need = (1 << min) - 1;\\n \\/\\/System.out.println(add + total);\\n \\/\\/ System.out.println(min + \\\" \\\" + max);\\n\\n out.println(cal(0, 0, 0));\\n\\n out.close();\\n\\n }\\n\\n public static int cal(int index, int last, int lastHold) {\\n\\n if (index == max) {\\n return 0;\\n }\\n if (dp[index][lastHold][last] != -1) {\\n return dp[index][lastHold][last];\\n }\\n int result = 0;\\n\\n for (int i = 0; i < 1 << min; i++) {\\n if ((i | last) == need || (index == 0)) {\\n \\/\\/ System.out.println(\\\"PREV \\\" + index + \\\" \\\" + i + \\\" \\\" + last + \\\" \\\" + lastHold);\\n \\/\\/ System.out.println(\\\"NEXT \\\" + index + \\\" \\\" + i + \\\" \\\" + (i | lastHold) + \\\" \\\" + i);\\n \\/\\/ System.out.println(Integer.bitCount(i) + \\\" \\\" + i);\\n\\n\\/\\/ if (index == 3) {\\n\\/\\/ System.out.println(last + \\\" \\\" + i + \\\" \\\" + match(i, last) + \\\" \\\" + next);\\n\\/\\/ }\\n if(index + 1 == max && match(i,lastHold)!= need){\\n continue;\\n }\\n ... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.util.Map;\\nimport java.util.HashMap;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n ReaderFastIO in = new ReaderFastIO(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n DConcatenatedMultiples solver = new DConcatenatedMultiples();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class DConcatenatedMultiples {\\n public void solve(int testNumber, ReaderFastIO in, PrintWriter out) {\\n\\n Map[] mapMods = new HashMap[11];\\n\\n int n = in.nextInt();\\n int k = in.nextInt();\\n int[] a = in.readArrayInt(n);\\n\\n for (int i = 0; i < 11; i++) {\\n mapMods[i] = new HashMap<>();\\n }\\n\\n for (int i = 0; i < n; i++) {\\n int pot = getPot(a[i]);\\n mapMods[pot].put(a[i] % k, mapMods[pot].getOrDefault(a[i] % k, 0) + 1);\\n }\\n\\n long ct = 0;\\n\\n for (int i = 0; i < n; i++) {\\n\\n int ownPot = getPot(a[i]);\\n long suffix = a[i] * 10L;\\n for (int j = 1; j <= 10; j++) {\\n\\n int mod = (int) (suffix % k);\\n int comMod = (k - mod) % k;\\n int qt = mapMods[j].getOrDefault(comMod, 0);\\n\\n if (j == ownPot && (a[i] % k) == comMod) {\\n qt--;\\n }\\n\\n ct += qt;\\n\\n suffix = (suffix * 10L) % k;\\n }\\n\\n }\\n\\n out.println(ct);\\n }\\n\\n public int getPot(int... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\nimport static java.lang.System.out;\\n\\npublic class Main {\\n\\n private FastScanner scanner = new FastScanner();\\n\\n public static void main(String[] args) {\\n new Main().solve();\\n }\\n\\n private List[] gr = new ArrayList[1000_000+5];\\n private int dp[][] = new int[21][1000_000+5];\\n private boolean used[] = new boolean[1000_000+5];\\n\\n void init(int v, int p) {\\n Stack st = new Stack<>();\\n st.push(v);\\n st.push(p);\\n while (!st.isEmpty()) {\\n p = st.pop();\\n v = st.pop();\\n used[v] = true;\\n\\n dp[0][v] = p;\\n for (int i = 1; i <= 20; i++) {\\n if (dp[i - 1][v] != -1) {\\n dp[i][v] = dp[i - 1][dp[i - 1][v]];\\n }\\n }\\n\\n for (int next : gr[v]) {\\n if (!used[next]) {\\n st.push(next);\\n st.push(v);\\n }\\n }\\n\\n }\\n }\\n\\n\\n private void solve() {\\n int n = scanner.nextInt(), k = scanner.nextInt();\\n boolean[] ans = new boolean[1000_000 + 5];\\n\\n for (int i = 0; i < n; i++) {\\n gr[i] = new ArrayList<>();\\n }\\n\\n for (int i = 0; i < n - 1; i ++) {\\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1;\\n gr[u].add(v);\\n gr[v].add(u);\\n }\\n\\n k = n - k - 1;\\n ans[n - 1] = true;\\n\\n init(n - 1 , n - 1);\\n\\n int t, d, next;\\n for (int i = n - 2; i >= 0; i--) {\\n t = i;\\n d = 1;\\n if (ans[i]) {\\n continue;\\n }\\n for (int j = 20; j >= 0; j--){\\n next = dp[j][t];\\n if (next != -1 && !ans[next]) {\\n t = next;\\n d += 1 << j;\\n }\\n }\\n\\n if (d <= k) {\\n k -=d;\\n t = i;\\n\\n while (!ans[t]) {\\n ans[t] = true;\\n ... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.awt.Point;\\nimport java.util.Scanner;\\n\\npublic class p105b {\\n static int[] b, l;\\n static int n;\\n static int A;\\n static boolean[] masks;\\n static double max;\\n\\n public static double work(int index, int k, int mask) {\\n if (index == n) {\\n if (Integer.bitCount(mask) * 2 <= n) {\\n int sum = 0;\\n for (int i = 0; i < n; i++) {\\n if (((1 << i) & mask) == 0) {\\n sum += b[i];\\n }\\n }\\n return (A * 1.0) \\/ (A * 1.0 + sum);\\n }\\n return 1;\\n }\\n double max = 0;\\n int to = Math.min(k, (100 - l[index]) \\/ 10);\\n\\n for (int i = to; i >= 0; i--) {\\n double loy = l[index] + i * 10;\\n\\n double b = ((100.0 - loy) \\/ 100.0) * work(index + 1, k - i, mask);\\n\\n double a = (loy \\/ 100.0)\\n * work(index + 1, k - i, (mask | (1 << index)));\\n\\n max = Math.max(max, a + b);\\n }\\n return max;\\n }\\n\\n public static void rec(int index, int k) {\\n if (k == -1)\\n return;\\n if (index == n) {\\n double tot = 0;\\n for (int i = 0; i < 1 << n; i++) {\\n double temp = 1.0;\\n int bb = 0;\\n for (int j = 0; j < n; j++) {\\n if(l[j]>100)\\n return;\\n if (((1 << j) & i) != 0) {\\n temp *= (l[j] * 1.0 \\/ 100.0);\\n } else {\\n bb += b[j];\\n temp *= ((100.0 - l[j]) \\/ 100.0);\\n }\\n }\\n if (Integer.bitCount(i) * 2 <= n) {\\n temp *= (A * 1.0) \\/ (A * 1.0 + bb);\\n }\\n tot += temp;\\n }\\n max = Math.max(max, tot);\\n return;\\n }\\n l[index] += 10;\\n rec(index, k - 1);\\n l[index] -= 10;\\n rec(index + 1, k);\\n }\\n\\n public static void... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/package Educational35;\\n\\n\\/\\/import FastScanner.Competitive;\\n\\nimport java.io.ByteArrayInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\n\\npublic class D {\\n String INPUT = \\\"4\\\\n\\\" +\\n \\\"1 2 4 3\\\\n\\\" +\\n \\\"4\\\\n\\\" +\\n \\\"1 1\\\\n\\\" +\\n \\\"1 4\\\\n\\\" +\\n \\\"1 4\\\\n\\\" +\\n \\\"2 3\\\";\\n\\n void solve()\\n {\\n final int n = i();\\n final int[] a = ia(n);\\n int count = 0 ;\\n for(int i = 0 ; i0)\\tsolve();\\n out.flush();\\n }\\n public static void main(String[] args)throws Exception {\\n new D().run();\\n }\\n InputStream is;\\n PrintWriter out;\\n private... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\n\\/\\/import java.util.Scanner;\\n\\n\\n\\n\\npublic class SingleWildcard {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\n\\t\\tScanner input =new Scanner(System.in);\\n\\t\\tint a = input.nextInt();\\n\\t\\tint b = input.nextInt();\\n\\t\\tchar[] s1 =new char[a];\\n\\t\\ts1 = input.next().toCharArray();\\n\\t\\t\\n\\t\\tchar[] s2 = new char[b];\\n\\t\\ts2 = input.next().toCharArray();\\n\\t boolean condition = false;\\n\\t for(int i=0; is2.length){\\n\\t \\t\\tSystem.out.println(\\\"NO\\\");\\n\\t \\t\\treturn;\\n\\t \\t}\\n\\t \\twhile(i=0 && k>=0 && s1[k]==s2[j] && i<=j){\\n\\t \\t\\tj--;\\n\\t \\t\\tk--;\\n\\t \\t}\\n\\t \\t\\/\\/System.out.println(i);\\n\\t \\tif(i==k && i>=0 && i su)\\n {\\n System.out.println(i+1);\\n return;\\n }\\n }\\n \\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\npublic class DD {\\n public static void main(String args[]) throws IOException {\\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n long k=Long.parseLong(br.readLine());\\n long ans=9*(int)Math.pow(10,0);\\n int c=0;\\n long start=0;\\n while(k>ans) {\\n c++;\\n start=ans;\\n ans+=9*(long)Math.pow(10,c)*(c+1);\\n\\n }\\n long ms=(k-start-1)%(c+1);\\n long a=(long)Math.pow(10,c)+(k-start-1)\\/(c+1);\\n System.out.println((a+\\\"\\\").charAt((int)ms));\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author pandusonu\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public int mod = (int) Math.pow(10, 9) + 7;\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n \\/\\/ out.print(\\\"Case #\\\" + testNumber + \\\": \\\");\\n int n = in.readInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = in.readString().charAt(0) == 'f' ? 1 : 0;\\n }\\n long[][] ans = new long[n][n + 2];\\n ans[0][0] = 1;\\n int indent = 0;\\n if (a[0] == 1) indent++;\\n for (int i = 1; i < n; i++) {\\n if (a[i - 1] == 1) {\\n for (int j = indent - 1; j >= 1; j--) {\\n ans[i][j] = ans[i - 1][j - 1];\\n }\\n ans[i][indent] = 1;\\n } else {\\n for (int j = indent; j >= 0; j--) {\\n ans[i][j] = (ans[i][j + 1] + ans[i - 1][j]) % mod;\\n }\\n }\\n indent += a[i];\\n }\\/*\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) {\\n out.print(ans[i][j]+\\\" \\\");\\n }\\n out.println();\\n }*\\/\\n long aa = 0;\\n for (int i = 0; i < n + 2; i++) {\\n aa = (aa + ans[n - 1][i]) % mod;\\n }\\n ... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class C {\\n\\n static int MOD = 1_000_000_007;\\n\\n public static void main(String[] args) {\\n\\n MyScanner in = new MyScanner();\\n PrintWriter out = new PrintWriter(System.out);\\n\\n int n = in.nextInt();\\n char prev = ' ';\\n\\n \\/\\/ index, maxNumOfIntents -> count\\n int[][] dp = new int[n+1][n+2];\\n\\n dp[0][0] = 1;\\n for(int i=0;i=0;--j){\\n sum = (sum + dp[i-1][j]) % MOD;\\n dp[i][j] = sum;\\n }\\n }else if(prev == 'f'){\\n for(int j=0;j 0;T--)go();\\n\\t}\\n\\n\\tint[] lpf = enumLowestPrimeFactors(10000000);\\n\\n\\tvoid go()\\n\\t{\\n\\t\\tint n = ni(), K = ni();\\n\\t\\tint[] a = na(n);\\n\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\ta[i] = factorFast(a[i], lpf);\\n\\t\\t}\\n\\t\\ta = shrink(a);\\n\\n\\t\\tint[][] dp = new int[K+1][n+1];\\n\\t\\tfor(int i = 0;i <= K;i++){\\n\\t\\t\\tArrays.fill(dp[i], 999999999);\\n\\t\\t}\\n\\t\\tfor(int i = 0;i <= K;i++)dp[i][0] = 0;\\n\\n\\t\\tint[] prev = makePrev(a, n+1);\\n\\n\\t\\tint[] imos = new int[n+5];\\n\\t\\tint[] pp = new int[K+1];\\n\\t\\tint[] vs = new int[K+1];\\n\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\tint p = prev[i];\\n\\t\\t\\timos[p+1]--;\\n\\n\\t\\t\\tfor(int j = 0;j <= K;j++){\\n\\t\\t\\t\\tvs[j]++;\\n\\t\\t\\t\\tif(pp[j] >= p+1){\\n\\t\\t\\t\\t\\tvs[j]--;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\twhile(vs[j] > j){\\n\\t\\t\\t\\t\\tpp[j]++;\\n\\t\\t\\t\\t\\tvs[j] += imos[pp[j]];\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tfor(int k = 0;k+j <= K;k++){\\n\\t\\t\\t\\t\\tdp[k+j][i+1] = Math.min(dp[k+j][i+1], dp[k][pp[j]] + 1);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(dp[K][n]);\\n\\t}\\n\\n\\tpublic static int[] shrink(int[] a) {\\n\\t\\tint n = a.length;\\n\\t\\tlong[] b = new long[n];\\n\\t\\tfor (int i = 0; i < n; i++) b[i] = (long) a[i] << 32 | i;\\n\\t\\tArrays.sort(b);\\n\\t\\tint[] ret = new int[n];\\n\\t\\tint p = 0;\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tif (i > 0 && (b[i] ^ b[i - 1]) >> 32 != 0) p++;\\n\\t\\t\\tret[(int) b[i]] = p;\\n\\t\\t}\\n\\t\\treturn ret;\\n\\t}\\n\\n\\n\\tpublic static int[] makePrev(int[] a, int sup)\\n\\t{\\n\\t\\tint n = a.length;\\n\\t\\tint[] mnext = new int[sup];\\n\\t\\tArrays.fill(mnext, -1);\\n\\t\\tint[] next = new int[n];\\n\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\tnext[i] = mnext[a[i]];\\n\\t\\t\\tmnext[a[i]] = i;\\n\\t\\t}\\n\\t\\treturn next;\\n\\t}\\n\\n\\tpublic static int factorFast(int n, int[] lpf)\\n\\t{\\n\\t\\tint ret = 1;\\n\\t\\tint e = 0;\\n\\t\\tint last = -1;\\n\\t\\twhile(lpf[n] > 0) {\\n\\t\\t\\tint p = lpf[n];\\n\\t\\t\\tif (last != p) {\\n\\t\\t\\t\\tif (last > 0 && e % 2 == 1) {\\n\\t\\t\\t\\t\\tret = ret * last;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tlast = p;\\n\\t\\t\\t\\te = 1;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\te++;\\n\\t\\t\\t}\\n\\t\\t\\tn \\/= p;\\n\\t\\t}\\n\\n\\t\\tif(last > 0 && e % 2 == 1){\\n\\t\\t\\tret *= last;\\n\\t\\t}\\n\\t\\treturn ret;\\n\\t}\\n\\n\\n\\tpublic static int[]... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.lang.*;\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.*;\\n \\npublic class Main {\\n \\n public static void main(String[] args) throws Exception{\\n FastReader sc=new FastReader(); \\n OutputStream outputStream = System.out;\\n PrintWriter out = new PrintWriter(outputStream);\\n Main mm=new Main();\\n long n=sc.nextLong();\\n long k=sc.nextLong();\\n long l=0;\\n long r=1000000000;\\n long ans=-1;\\n while(l<=r) {\\n long mid=(l+r)\\/2;\\n if(n-mid<=0) {\\n r=mid-1;\\n }\\n else {\\n long temp=(n-mid)*(n-mid+1)-(2*mid);\\n if(temp==2*k) {\\n ans=mid;\\n break;\\n }\\n else if(temp<2*k) {\\n r=mid-1;\\n }\\n else if(temp>2*k) {\\n l=mid+1;\\n }\\n }\\n }\\n System.out.println(ans);\\n } \\n}\\n\\n\\nclass FastReader \\n{ \\n BufferedReader br; \\n StringTokenizer st; \\n \\n public FastReader() \\n { \\n br = new BufferedReader(new\\n InputStreamReader(System.in)); \\n } \\n \\n String next() \\n { \\n while (st == null || !st.hasMoreElements()) \\n { \\n try\\n { \\n st = new StringTokenizer(br.readLine()); \\n } \\n catch (IOException e) \\n { \\n e.printStackTrace(); \\n } \\n } \\n return st.nextToken(); \\n } \\n \\n int nextInt() \\n { \\n return Integer.parseInt(next()); \\n } \\n \\n long nextLong() \\n { \\n return Long.parseLong(next()); \\n } \\n \\n double nextDouble() \\n { \\n return Double.parseDouble(next()); \\n } \\n \\n String nextLine() \\n { \\n String str = \\\"\\\"; \\n try\\n { \\n str = br.readLine(); \\n } \\n catch (IOException e) \\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.HashMap;\\nimport java.util.InputMismatchException;\\npublic class Solution1 implements Runnable\\n{\\n\\tstatic final int MAX = 1000000007;\\n\\tstatic class InputReader\\n\\t{\\n\\t\\tprivate InputStream stream;\\n\\t\\tprivate byte[] buf = new byte[1024];\\n\\t\\tprivate int curChar;\\n\\t\\tprivate int numChars;\\n\\t\\tprivate SpaceCharFilter filter;\\n\\t\\tprivate BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n\\n\\t\\tpublic InputReader(InputStream stream)\\n\\t\\t{\\n\\t\\t\\tthis.stream = stream;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic int read()\\n\\t\\t{\\n\\t\\t\\tif (numChars==-1) \\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\n\\t\\t\\tif (curChar >= numChars)\\n\\t\\t\\t{\\n\\t\\t\\t\\tcurChar = 0;\\n\\t\\t\\t\\ttry \\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tnumChars = stream.read(buf);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tcatch (IOException e)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif(numChars <= 0)\\t\\t\\t\\t\\n\\t\\t\\t\\t\\treturn -1;\\n\\t\\t\\t}\\n\\t\\t\\treturn buf[curChar++];\\n\\t\\t}\\n\\t \\n\\t\\tpublic String nextLine()\\n\\t\\t{\\n\\t\\t\\tString str = \\\"\\\";\\n try\\n {\\n str = br.readLine();\\n }\\n catch (IOException e)\\n {\\n e.printStackTrace();\\n }\\n return str;\\n\\t\\t}\\n\\t\\tpublic int nextInt()\\n\\t\\t{\\n\\t\\t\\tint c = read();\\n\\t\\t\\t\\n\\t\\t\\twhile(isSpaceChar(c)) \\n\\t\\t\\t\\tc = read();\\n\\t\\t\\t\\n\\t\\t\\tint sgn = 1;\\n\\t\\t\\t\\n\\t\\t\\tif (c == '-') \\n\\t\\t\\t{\\n\\t\\t\\t\\tsgn = -1;\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tint res = 0;\\n\\t\\t\\tdo \\n\\t\\t\\t{\\n\\t\\t\\t\\tif(c<'0'||c>'9') \\n\\t\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\tres *= 10;\\n\\t\\t\\t\\tres += c - '0';\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\t}\\n\\t\\t\\twhile (!isSpaceChar(c)); \\n\\t\\t\\t\\n\\t\\t\\treturn res * sgn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic long nextLong() \\n\\t\\t{\\n\\t\\t\\tint c = read();\\n\\t\\t\\twhile (isSpaceChar(c))\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\tint sgn = 1;\\n\\t\\t\\tif (c == '-') \\n\\t\\t\\t{\\n\\t\\t\\t\\tsgn = -1;\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\t}\\n\\t\\t\\tlong res = 0;\\n\\t\\t\\t\\n\\t\\t\\tdo \\n\\t\\t\\t{\\n\\t\\t\\t\\tif (c < '0' || c > '9')\\n\\t\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\tres *= 10;\\n\\t\\t\\t\\tres += c - '0';\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\t}\\n\\t\\t\\twhile (!isSpaceChar(c));\\n\\t\\t\\t\\treturn res * sgn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic double... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.ArrayList;\\nimport java.util.Scanner;\\n\\npublic class PaintTheNumber {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\n\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\tint n=sc.nextInt();\\n\\t\\t\\n\\t\\tArrayList l=new ArrayList();\\n\\t\\t\\n\\t\\tfor(int i=0; i set = new HashSet();\\n\\t\\tfor (int i = 0; i < a.length; i++) {\\n\\t\\t\\tset.add(a[i]);\\n\\t\\t\\tif(set.size()==k){\\n\\t\\t\\t\\tSet set2 = new HashSet();\\n\\t\\t\\t\\tfor (int j = i; j >= 0; j--) {\\n\\t\\t\\t\\t\\tset2.add(a[j]);\\n\\t\\t\\t\\t\\tif(set2.size()==k){\\n\\t\\t\\t\\t\\t\\tout.print((j+1)+\\\" \\\"+(i+1));\\n\\t\\t\\t\\t\\t\\tout.close();\\n\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.print(\\\"-1 -1\\\");\\t\\t\\n\\t\\tout.close();\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\n\\npublic class A {\\n\\tpublic static BufferedReader in;\\n\\tpublic static PrintWriter out;\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\n\\t\\tboolean showLineError = true;\\n\\t\\tif (showLineError) {\\n\\t\\t\\tsolve();\\n\\t\\t\\tout.close();\\n\\t\\t} else {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tsolve();\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t} finally {\\n\\t\\t\\t\\tout.close();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic void debug(Object... os) {\\n\\t\\tout.println(Arrays.deepToString(os));\\n\\t}\\n\\n\\tprivate static void solve() throws IOException {\\n\\t\\tString[] line = in.readLine().split(\\\" \\\");\\n\\t\\tString l = Long.toBinaryString(Long.parseLong(line[0]));\\n\\t\\tString r = Long.toBinaryString(Long.parseLong(line[1]));\\n\\t\\tif(l.equals(r)){\\n\\t\\t\\tout.println(0);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tint dif = r.length()-l.length();\\n\\t\\tfor(int i =0;i arr[j]){\\n\\t\\t\\t\\t\\tans^=1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint m=ni();\\n\\t\\twhile(m-->0){\\n\\t\\t\\tint a=ni(), b=ni();\\n\\t\\t\\tint diff=Math.abs(a-b)+1;\\n\\t\\t\\tans = ans ^ ((((diff-1)*diff)\\/2)%2);\\n\\t\\t\\tout.println(ans==0 ? \\\"even\\\" : \\\"odd\\\");\\n\\t\\t}\\n\\t}\\n\\n\\tvoid print(int n, long[][] memo){\\n\\t\\tfor(int i=0;i0)solve();\\n\\t\\tout.flush();\\n\\t}\\n\\tpublic static void main(String[] args)throws Exception{new A().run();}\\n\\t\\/\\/Fast I\\/O code is copied from uwi code.\\n\\tprivate byte[] inbuf = new byte[1024];\\n\\tpublic int lenbuf = 0, ptrbuf = 0;\\n\\tprivate int readByte(){\\n\\t\\tif(lenbuf == -1)throw new InputMismatchException();\\n\\t\\tif(ptrbuf >= lenbuf){\\n\\t\\t\\tptrbuf = 0;\\n\\t\\t\\ttry { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }\\n\\t\\t\\tif(lenbuf <= 0)return -1;\\n\\t\\t}\\n\\t\\treturn inbuf[ptrbuf++];\\n\\t}\\n\\tprivate boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }\\n\\tprivate int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }\\n\\tprivate double nd() { return Double.parseDouble(ns()); }\\n\\tprivate char nc() { return (char)skip(); }\\n\\tprivate String ns(){\\n\\t\\tint b = skip();\\n\\t\\tStringBuilder sb = new StringBuilder();\\n\\t\\twhile(!(isSpaceChar(b))){ \\/\\/ when nextLine, (isSpaceChar(b) && b != ' ')\\n\\t\\t\\tsb.appendCodePoint(b);\\n\\t\\t\\tb = readByte();\\n\\t\\t}\\n\\t\\treturn sb.toString();\\n\\t}\\n\\tprivate char[] ns(int n){\\n\\t\\tchar[] buf = new char[n];\\n\\t\\tint b = skip(), p = 0;\\n\\t\\twhile(p < n && !(isSpaceChar(b))){\\n\\t\\t\\tbuf[p++] = (char)b;\\n\\t\\t\\tb = readByte();\\n\\t\\t}\\n\\t\\treturn n == p ? buf : Arrays.copyOf(buf, p);\\n\\t}\\n\\tprivate char[][] nm(int n, int m){\\n\\t\\tchar[][] map = new char[n][];\\n\\t\\tfor(int i = 0;i < n;i++)map[i] = ns(m);\\n\\t\\treturn... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class Solve4 {\\n\\n public static void main(String[] args) throws IOException {\\n FastReader sc = new FastReader();\\n int x= sc.nextInt();\\n int y= sc.nextInt();\\n int z= sc.nextInt();\\n int t1= sc.nextInt();\\n int t2= sc.nextInt();\\n int t3= sc.nextInt();\\n if(Math.abs(x-y)*t1 < (Math.abs(x-z)+Math.abs(x-y))*t2+3*t3 ) System.out.println(\\\"NO\\\");\\n else System.out.println(\\\"YES\\\");\\n }\\n\\n static class FastReader {\\n\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastReader() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n public String next() throws IOException {\\n if (st == null || !st.hasMoreTokens()) {\\n st = new StringTokenizer(br.readLine());\\n }\\n return st.nextToken();\\n }\\n\\n public int nextInt() throws IOException {\\n return Integer.parseInt(next());\\n }\\n\\n public long nextLong() throws IOException {\\n return Long.parseLong(next());\\n }\\n\\n public double nextDouble() throws IOException {\\n return Double.parseDouble(next());\\n }\\n\\n public String nextLine() {\\n String s = \\\"\\\";\\n try {\\n s = br.readLine();\\n } catch (IOException ex) {\\n }\\n return s;\\n }\\n }\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Scanner;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n Scanner in = new Scanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public void solve(int testNumber, Scanner in, PrintWriter out) {\\n long n = in.nextLong();\\n long s = in.nextLong();\\n long ans = 0;\\n long i = 0;\\n for (i = s; i <= n; i++) {\\n long t = i - sum(i);\\n if (t >= s) {\\n if (i % 10 == 9) {\\n break;\\n }\\n ans++;\\n }\\n }\\n if (n >= s) {\\n out.println(ans - i + n + 1);\\n } else {\\n out.println(0);\\n }\\n }\\n\\n static long sum(long a) {\\n long sum = 0;\\n while (a != 0) {\\n sum += (a % 10);\\n a \\/= 10;\\n }\\n return sum;\\n }\\n\\n }\\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\nimport javax.script.*;\\n\\npublic class Noldbach {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tint n=sc.nextInt();\\n\\t\\tint k=sc.nextInt();\\n\\t\\tboolean[] sieve=new boolean[1001];\\n\\t\\tsieve[2]=false;\\n\\t\\tArrayList primes=new ArrayList();\\n\\t\\tfor(int x=2;x<1001;x++)\\n\\t\\t\\tif(!sieve[x])\\n\\t\\t\\t{\\n\\t\\t\\t\\tprimes.add(x);\\n\\t\\t\\t\\tfor(int y=x;y<1001;y+=x)\\n\\t\\t\\t\\t\\tsieve[y]=true;\\n\\t\\t\\t}\\n\\t\\tint sum=0;\\n\\t\\tfor(int x=2;x<=n;x++)\\n\\t\\t{\\n\\t\\t\\tif(primes.contains(x))\\n\\t\\t\\t{\\n\\t\\t\\tint need=x-1;\\n\\t\\t\\tfor(int y=0;y 1){\\n\\t\\t\\tString second = cur.substring(0,cur.length()-1);\\n\\t\\t\\tif(Character.isDigit(second.charAt(second.length()-1))){\\n\\t\\t\\t\\tfirst = Math.max(first, Integer.parseInt(second));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tif(cur.length() > 2){\\n\\t\\t\\tString third = cur.substring(0,cur.length()-2) + cur.charAt(cur.length()-1);\\n\\t\\t\\tif(Character.isDigit(cur.charAt(cur.length()-2))){\\n\\t\\t\\t\\tfirst = Math.max(first, Integer.parseInt(third));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(first);\\n\\t\\tout.close();\\n\\t}\\n\\n\\tpublic static class FastScanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic FastScanner(String s) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tbr = new BufferedReader(new FileReader(s));\\n\\t\\t\\t} catch (FileNotFoundException e) {\\n\\t\\t\\t\\t\\/\\/ TODO Auto-generated catch block\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tpublic FastScanner() {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\n\\t\\tString nextToken() {\\n\\t\\t\\twhile (st == null || !st.hasMoreElements()) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\t\\/\\/ TODO Auto-generated catch block\\n\\t\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tint nextInt() {\\n\\t\\t\\treturn Integer.parseInt(nextToken());\\n\\t\\t}\\n\\n\\t\\tlong nextLong() {\\n\\t\\t\\treturn Long.parseLong(nextToken());\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(nextToken());\\n\\t\\t}\\n\\t}\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.lang.reflect.Array;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n \\n \\npublic class q5 {\\n\\t\\n\\t\\n\\t\\n \\n \\n\\t\\n \\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\n\\tReader.init(System.in);\\n\\tPrintWriter out=new PrintWriter(System.out);\\n\\tlong n=Reader.nextInt();\\n\\tlong k=Reader.nextLong();\\n\\tlong v=8*n+8*k+4;\\n\\tlong v2=(long) Math.sqrt(v);\\n\\tlong v3=2*n+2;\\n\\t\\/\\/long v4=(v3+v2)\\/2;\\n\\tlong v5=(v3-v2)\\/2;\\n\\tout.println(v5);\\n\\t\\n\\t\\n\\t\\n\\t\\n\\t\\n\\tout.flush();\\n\\t}\\n}\\n\\n\\n\\n\\n \\n \\n \\nclass Reader {\\n static BufferedReader reader;\\n static StringTokenizer tokenizer;\\n \\/** call this method to initialize reader for InputStream *\\/\\n static void init() throws IOException {\\n \\t reader = new BufferedReader(\\n new FileReader(\\\"detect.in\\\"));\\n tokenizer = new StringTokenizer(\\\"\\\");\\n }\\n static void init(InputStream input) {\\n reader = new BufferedReader(\\n new InputStreamReader(input) );\\n tokenizer = new StringTokenizer(\\\"\\\");\\n }\\n \\/** get next word *\\/\\n static String nextLine() throws IOException{\\n \\treturn reader.readLine();\\n }\\n static String next() throws IOException {\\n while ( ! tokenizer.hasMoreTokens() ) {\\n \\/\\/TODO add check for eof if necessary\\n tokenizer = new StringTokenizer(\\n reader.readLine() );\\n }\\n return tokenizer.nextToken();\\n }\\n static int nextInt() throws IOException {\\n return Integer.parseInt( next() );\\n }\\n static long nextLong() throws IOException {\\n return Long.parseLong( next() );\\n }\\n static double nextDouble() throws IOException {\\n return Double.parseDouble( next() );\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class B {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tpublic static void main(String[] args) {\\n\\t\\tPipes pipes = new Pipes();\\n\\t\\tpipes.solve();\\n\\t\\tpipes.print();\\n\\t}\\n\\n}\\n\\nclass Pipes {\\n\\t\\n\\tPipes() {\\n\\t\\tScanner scr = new Scanner(System.in);\\n\\t\\tn = scr.nextLong();\\n\\t\\tk = scr.nextLong();\\n\\t}\\n\\t\\n\\tlong bs(long nb, long nk) {\\n\\t\\t\\n\\t\\tlong left = 2;\\n\\t\\tlong ls = (nk - left + 1) * (nk + left) \\/ 2 - (nk - left);\\n\\t\\tlong right = nk;\\n\\t\\tlong rs = nk;\\n\\t\\t\\n\\t\\tif (nb > ls) {\\n\\t\\t\\treturn -1;\\n\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\tlong mid = left;\\n\\t\\t\\n\\t\\twhile (rs < ls){\\n\\t\\t\\tmid = (left + right)\\/2;\\n\\t\\t\\tlong ms = (nk - mid + 1) * (nk + mid) \\/ 2 - (nk - mid);\\n\\t\\t\\tif (nb > ms) {\\n\\t\\t\\t\\tright = mid;\\n\\t\\t\\t\\trs = ms;\\n\\t\\t\\t}\\n\\t\\t\\telse if (nb < ms){\\n\\t\\t\\t\\tleft = mid+1;\\n\\t\\t\\t\\tls = (nk - left + 1) * (nk + left) \\/ 2 - (nk - left);\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tleft = mid;\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t} \\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn left;\\n\\t\\t\\n\\t}\\n\\t\\n\\tvoid solve() {\\n\\t\\tlong nn = n;\\n\\t\\tlong kk = k; \\n\\t\\tans = 0;\\n\\t\\tlong ps = 1;\\n\\t\\tlong add;\\n\\t\\t\\n\\t\\tif (n == 1) {\\n\\t\\t\\tans = 0;\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tnn = n - (ps - 1);\\n\\t\\twhile (nn > kk){\\n\\t\\t\\tadd = bs(nn, kk);\\n\\t\\t\\tif (add == -1) {\\n\\t\\t\\t\\tans = -1;\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tans = ans + (kk - add + 1);\\n\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\tlong addn = (kk - add + 1) * (kk + add) \\/ 2 - (kk - add); \\n\\t\\t\\tps = ps - 1 + addn;\\n\\t\\t\\tif (ps == n)\\n\\t\\t\\t\\treturn;\\n\\t\\t\\tnn = nn - (ps - 1);\\n\\t\\t\\tkk = add - 1;\\n\\t\\t}\\n\\t\\t\\n\\t\\tif (nn > 0) {\\n\\t\\t\\tans++;\\n\\t\\t}\\n\\t\\t\\n\\t}\\n\\t\\n\\t\\n\\tvoid print() {\\n\\t\\tSystem.out.println(ans);\\n\\t}\\n\\t\\n\\tlong ans;\\n\\tlong n;\\n\\tlong k;\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.lang.*;\\nimport java.math.*;\\nimport java.io.*;\\n\\nimport static java.lang.Math.*;\\nimport static java.util.Arrays.*;\\n\\npublic class _P015A{\\n Scanner sc=new Scanner(System.in);\\n\\n int INF=1<<28;\\n double EPS=1e-9;\\n\\n int n, t;\\n int[][] a;\\n\\n void run(){\\n n=sc.nextInt();\\n t=sc.nextInt();\\n a=new int[n][2];\\n for(int i=0; i(){\\n @Override\\n public int compare(int[] a0, int[] a1){\\n return a0[0]-a1[0];\\n }\\n });\\n int ans=2;\\n for(int i=0; it*2){\\n ans+=2;\\n }else if(s==t*2){\\n ans++;\\n }\\n }\\n println(ans+\\\"\\\");\\n }\\n\\n void println(String s){\\n System.out.println(s);\\n }\\n\\n void print(String s){\\n System.out.print(s);\\n }\\n\\n void debug(Object... os){\\n System.err.println(Arrays.deepToString(os));\\n }\\n\\n public static void main(String[] args){\\n new _P015A().run();\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A {\\n\\n BufferedReader br;\\n PrintWriter out;\\n StringTokenizer st;\\n boolean eof;\\n\\n void solve() throws IOException {\\n int n = nextInt();\\n int[] a = new int[n];\\n\\n boolean onlyOnes = true;\\n\\n for (int i = 0; i < n; i++) {\\n a[i] = nextInt();\\n if (a[i] != 1)\\n onlyOnes = false;\\n }\\n\\n Arrays.sort(a);\\n if (onlyOnes) {\\n for (int i = 0; i < n - 1; i++)\\n out.print(\\\"1 \\\");\\n out.print(2);\\n } else {\\n out.print(\\\"1 \\\");\\n for (int i = 0; i < n - 1; i++)\\n out.print(a[i] + \\\" \\\");\\n }\\n\\n }\\n\\n void inp() throws IOException {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n solve();\\n out.close();\\n }\\n\\n public static void main(String[] args) throws IOException {\\n new A().inp();\\n }\\n\\n String nextToken() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (Exception e) {\\n eof = true;\\n return \\\"0\\\";\\n }\\n }\\n return st.nextToken();\\n }\\n\\n String nextString() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (Exception e) {\\n eof = true;\\n return \\\"0\\\";\\n }\\n }\\n return st.nextToken(\\\"\\\\n\\\");\\n }\\n\\n int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() throws IOException {\\n return Double.parseDouble(nextToken());\\n }\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\npublic class Main {\\n\\n public static void main(String[] args) {\\n Scanner s = new Scanner(System.in);\\n \\n int n = s.nextInt();\\n int m = s.nextInt();\\n int k = s.nextInt();\\n \\n int a[] = new int [n];\\n for (int i = 0; i < a.length; i++) {\\n a[i] = s.nextInt();\\n }\\n int ans = 0;\\n \\n while(k < m){\\n k--;\\n int max = -1;\\n int ix = -1;\\n for (int i = 0; i < a.length; i++) {\\n if(a[i] > max){\\n max = a[i];\\n ix = i;\\n }\\n }\\n if(ix == -1){\\n System.out.println(\\\"-1\\\");\\n return ;\\n }\\n k += a[ix];\\n a[ix] = -1;\\n ans++;\\n }\\n System.out.println(ans);\\n }\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class C\\n{\\t\\n\\tstatic long mod=(long)(1e9+7);\\n\\tpublic static long powMod(long e,long b)\\n\\t{\\n\\t\\t\\/*e=e%mod;*\\/\\n\\t\\tlong res=1;\\n\\t\\t\\n\\t\\twhile(e>0)\\n\\t\\t{\\n\\t\\t\\tif(e%2==1)\\n\\t\\t\\t\\tres=res*b%mod;\\n\\t\\t\\te\\/=2;\\n\\t\\t\\tb=b*b%mod;\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n\\n\\t\\tpublic static void main(String[] args) throws IOException \\n\\t\\t{\\n\\t\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\t\\tPrintWriter pw=new PrintWriter(System.out);\\n\\t\\t\\tlong x=sc.nextLong(),k=sc.nextLong();\\n\\t\\t\\tif(x==0)\\n\\t\\t\\t{\\n\\t\\t\\t\\tSystem.out.println(0);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tif(k==0)\\n\\t\\t\\t{\\n\\t\\t\\t\\tpw.println((2*x)%mod);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tpw.close();return;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tlong ans=2*x-1;\\n\\t\\t\\tans=ans%mod;\\n\\t\\t\\t\\n\\t\\t\\tlong b=powMod(k,2);\\n\\t\\t\\tans=((ans*b)+1)%mod;\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\tpw.println(ans);\\n\\t\\t\\t\\n\\t\\t\\tpw.close();\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\n\\tstatic class Scanner\\n\\t{\\n\\t\\tStringTokenizer st;\\n\\t\\tBufferedReader br;\\n\\n\\t\\tpublic Scanner(InputStream s) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(s));\\n\\t\\t}\\n\\t\\tpublic String next() throws IOException {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\t\\tpublic double nextDouble() throws IOException {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() throws IOException {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic String nextLine() throws IOException {\\n\\t\\t\\treturn br.readLine();\\n\\t\\t}\\n\\n\\t\\tpublic boolean ready() throws IOException {\\n\\t\\t\\treturn br.ready();\\n\\t\\t}\\n\\t}\\n} Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.File;\\nimport java.io.FileInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintStream;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.StringTokenizer;\\n\\n\\/**\\n * Created by timur on 28.03.15.\\n *\\/\\n\\npublic class TaskD {\\n boolean eof;\\n BufferedReader br;\\n StringTokenizer st;\\n PrintWriter out;\\n\\n public static void main(String[] args) throws IOException {\\n new TaskD().run();\\n }\\n\\n public String nextToken() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (Exception e) {\\n eof = true;\\n return \\\"-1\\\";\\n }\\n }\\n return st.nextToken();\\n }\\n\\n public int nextInt() {\\n return Integer.parseInt(nextToken());\\n }\\n\\n public long nextLong() {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() {\\n return Double.parseDouble(nextToken());\\n }\\n\\n String nextLine() throws IOException {\\n return br.readLine();\\n }\\n\\n\\n void run() throws IOException {\\n InputStream input = System.in;\\n PrintStream output = System.out;\\n try {\\n File f = new File(\\\"a.in\\\");\\n if (f.exists() && f.canRead()) {\\n input = new FileInputStream(f);\\n output = new PrintStream(\\\"a.out\\\");\\n }\\n } catch (Throwable e) {\\n }\\n br = new BufferedReader(new InputStreamReader(input));\\n out = new PrintWriter(output);\\n solve();\\n br.close();\\n out.close();\\n }\\n\\n long md(long x, long y, long x1, long y1) {\\n return Math.abs(x - x1) + Math.abs(y - y1);\\n }\\n \\n double md(double x, double y, double x1, double y1) {\\n return Math.abs(x - x1) + Math.abs(y - y1);\\n }\\n\\n double ed(double x, double y, double x1, double y1) {\\n return Math.sqrt((x - x1) * (x - x1) +... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\npublic class Solution {\\n\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n long n = sc.nextLong();\\n long itrIdx = 0;\\n long itr = 0;\\n long num = 0;\\n while(itrIdx < n){\\n itrIdx += (itr+1)*(Math.pow(10,itr+1) - Math.pow(10,itr));\\n num+= (Math.pow(10,itr+1) - Math.pow(10,itr));\\n itr++;\\n }\\n\\n itrIdx -= itr*(Math.pow(10,itr)-Math.pow(10,itr-1));\\n num -= (Math.pow(10,itr)-Math.pow(10,itr-1));\\n long lastNum = num + ((n-itrIdx)\\/itr);\\n long lastNumIndex = itrIdx + (itr* (lastNum-num));\\n\\n if(lastNumIndex == n){\\n lastNumIndex = lastNumIndex-itr;\\n lastNum -=1;\\n }\\n\\n String nextNum = String.valueOf(lastNum+=1);\\n System.out.println(nextNum.charAt((int) (n-lastNumIndex-1)));\\n\\n }\\n}\\n\\n\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.nio.CharBuffer;\\nimport java.util.NoSuchElementException;\\n\\npublic class P1195B {\\n\\n public static void main(String[] args) {\\n SimpleScanner scanner = new SimpleScanner(System.in);\\n PrintWriter writer = new PrintWriter(System.out);\\n\\n int n = scanner.nextInt();\\n int k = scanner.nextInt();\\n int l = 0;\\n int r = n;\\n int ans = 0;\\n while (l <= r) {\\n int eat = (l + r) >> 1;\\n int lastPut = n - eat;\\n long totalPut = (long) (lastPut + 1) * lastPut \\/ 2;\\n long remain = totalPut - eat;\\n if (remain == k) {\\n ans = eat;\\n break;\\n } else if (remain > k)\\n l = eat + 1;\\n else\\n r = eat - 1;\\n }\\n writer.println(ans);\\n\\n writer.close();\\n }\\n\\n private static class SimpleScanner {\\n\\n private static final int BUFFER_SIZE = 10240;\\n\\n private Readable in;\\n private CharBuffer buffer;\\n private boolean eof;\\n\\n SimpleScanner(InputStream in) {\\n this.in = new BufferedReader(new InputStreamReader(in));\\n buffer = CharBuffer.allocate(BUFFER_SIZE);\\n buffer.limit(0);\\n eof = false;\\n }\\n\\n\\n private char read() {\\n if (!buffer.hasRemaining()) {\\n buffer.clear();\\n int n;\\n try {\\n n = in.read(buffer);\\n } catch (IOException e) {\\n n = -1;\\n }\\n if (n <= 0) {\\n eof = true;\\n return '\\\\0';\\n }\\n buffer.flip();\\n }\\n return buffer.get();\\n }\\n\\n void checkEof() {\\n if (eof)\\n throw new NoSuchElementException();\\n }\\n\\n char nextChar() {\\n checkEof();\\n char b = read();\\n checkEof();\\n return b;\\n }\\n\\n String next() {\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class Main {\\n static int MOD = 1000000007;\\n\\n \\/\\/ After writing solution, quick scan for:\\n \\/\\/ array out of bounds\\n \\/\\/ special cases e.g. n=1?\\n \\/\\/ npe, particularly in maps\\n \\/\\/\\n \\/\\/ Big numbers arithmetic bugs:\\n \\/\\/ int overflow\\n \\/\\/ sorting, or taking max, after MOD\\n void solve() throws IOException {\\n int T = ri();\\n for (int Ti = 0; Ti < T; Ti++) {\\n int n = ri();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) a[i] = ri();\\n Deque stack = new ArrayDeque<>();\\n stack.addLast(new int[]{1});\\n pw.println(\\\"1\\\");\\n for (int i = 1; i < n; i++) {\\n if (a[i] == 1) {\\n int[] prev = stack.peekLast();\\n int[] curr = new int[prev.length+1];\\n System.arraycopy(prev, 0, curr, 0, prev.length);\\n curr[curr.length-1] = 1;\\n printArr(curr);\\n stack.addLast(curr);\\n continue;\\n }\\n while (!stack.isEmpty()) {\\n int[] prev = stack.removeLast();\\n if (a[i] == prev[prev.length-1] + 1) {\\n prev[prev.length-1]++;\\n printArr(prev);\\n stack.addLast(prev);\\n break;\\n } else {\\n continue;\\n }\\n }\\n }\\n }\\n }\\n \\/\\/ IMPORTANT\\n \\/\\/ DID YOU CHECK THE COMMON MISTAKES ABOVE?\\n\\n void printArr(int[] a) {\\n pw.print(a[0]);\\n for (int j = 1; j < a.length; j++) pw.print(\\\".\\\" + a[j]);\\n pw.println();\\n }\\n\\n \\/\\/ Template code below\\n\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter pw = new PrintWriter(System.out);\\n\\n public static void main(String[] args) throws IOException {\\n Main m = new... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.Comparator;\\nimport java.util.List;\\nimport java.util.Scanner;\\n\\npublic class A {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tint n = scan.nextInt();\\n\\t\\tList list = new ArrayList(), list2;\\n\\t\\tfor (; n-- > 0;) {\\n\\t\\t\\tlist.add(scan.nextInt());\\n\\t\\t}\\n\\t\\tlist2 = new ArrayList(list);\\n\\t\\tCollections.sort(list2, new Comparator() {\\n\\t\\t\\tpublic int compare(Integer o1, Integer o2) {\\n\\t\\t\\t\\treturn o1 % 2 - o2 % 2;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tSystem.out.println(list.indexOf(list2.get(list2.get(1) % 2 > 0 ? 0\\n\\t\\t\\t\\t: list2.size() - 1)) + 1);\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/Author: Patel Rag\\n\\/\\/Java version \\\"1.8.0_211\\\"\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class Main\\n{\\n static class FastReader\\n {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastReader(){ br = new BufferedReader(new InputStreamReader(System.in)); }\\n\\n String next()\\n {\\n while (st == null || !st.hasMoreElements())\\n {\\n try\\n {\\n st = new StringTokenizer(br.readLine());\\n }\\n catch (IOException e)\\n {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() { return Integer.parseInt(next()); }\\n\\n long nextLong(){ return Long.parseLong(next()); }\\n\\n double nextDouble(){ return Double.parseDouble(next()); }\\n\\n float nextFloat() { return Float.parseFloat(next()); }\\n\\n boolean nextBoolean() { return Boolean.parseBoolean(next()); }\\n\\n String nextLine()\\n {\\n String str = \\\"\\\";\\n try\\n {\\n str = br.readLine();\\n }\\n catch (IOException e)\\n {\\n e.printStackTrace();\\n }\\n return str;\\n }\\n }\\n static long modExp(long x, long n, long mod) \\/\\/binary Modular exponentiation\\n {\\n long result = 1;\\n while(n > 0)\\n {\\n if(n % 2 == 1)\\n result = (result%mod * x%mod)%mod;\\n x = (x%mod * x%mod)%mod;\\n n=n\\/2;\\n }\\n return result;\\n }\\n static long gcd(long a, long b)\\n {\\n if(a==0) return b;\\n return gcd(b%a,a);\\n }\\n public static void main(String[] args)\\n throws IOException\\n {\\n FastReader fr = new FastReader();\\n int n = fr.nextInt();\\n int q = fr.nextInt();\\n long[] a = new long[n];\\n long[] k = new long[q];\\n for(int i = 0; i < n; i++) a[i] = fr.nextLong();\\n for(int i = 0; i < q; i++) k[i] = fr.nextLong();\\n long[] pre = new long[n];\\n pre[0] = a[0];\\n for(int i = 1; i < n; i++) pre[i] = pre[i-1] + a[i];\\n long pd = 0;\\n for(int i = 0; i < q; i++)\\n {\\n int l = 0;\\n int r = n - 1;\\n while(r > l)\\n {\\n int mid = (l + r) >> 1;\\n\\n if(pre[mid] - pd <... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class MinimumDiameterTree{\\n public static void main(String[] args) {\\n\\tInputReader in = new InputReader (System.in);\\n\\tPrintWriter out = new PrintWriter (System.out);\\n\\n\\tint n = in.nextInt();\\n\\tint s = in.nextInt();\\n\\tint deg[] = new int [n];\\n\\t\\n\\tfor (int i = 1; i < n; ++i) {\\n\\t deg[in.nextInt() - 1] ++;\\n\\t deg[in.nextInt() - 1] ++;\\n\\t}\\n\\n\\tint l = 0;\\n\\tfor (int i = 0; i < n; ++i)\\n\\t if (deg[i] == 1) l ++;\\n\\n\\tout.println((double) 2 * s \\/ l);\\n\\tout.close();\\n }\\n\\n public static class InputReader {\\n\\tpublic BufferedReader reader;\\n\\tpublic StringTokenizer tokenizer;\\n\\n\\tpublic InputReader(InputStream stream) {\\n\\t reader = new BufferedReader(new InputStreamReader(stream), 32768);\\n\\t tokenizer = null;\\n\\t}\\n\\n\\tpublic String next() {\\n\\t while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t\\ttry {\\n\\t\\t tokenizer = new StringTokenizer(reader.readLine());\\n\\t\\t} catch(IOException e) {\\n\\t\\t throw new RuntimeException(e);\\n\\t\\t}\\n\\t }\\n\\t return tokenizer.nextToken();\\n\\t}\\n\\n\\tpublic int nextInt() {\\n\\t return Integer.parseInt(next());\\n\\t}\\n\\n\\tpublic long nextLong() {\\n return Long.parseLong(next());\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\/\\/ import java.awt.Point;\\n \\npublic class Main {\\n InputStream is;\\n PrintWriter out;\\n String INPUT = \\\"\\\";\\n \\n long MOD = 1_000_000_007;\\n int inf = Integer.MAX_VALUE;\\n\\n void solve()\\n {\\n int n = ni();\\n int[] a = new int[n];\\n for(int i = 0; i < n; i++){\\n a[i] = ni();\\n }\\n long ans = 0;\\n for(int i = 0; i < n; i++){\\n for(int j = i+1; j < n; j++){\\n if(a[j]= lenbuf){\\n ptrbuf = 0;\\n try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }\\n if(lenbuf <= 0)return -1;\\n }\\n return inbuf[ptrbuf++];\\n }\\n \\n private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }\\n private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }\\n \\n private double nd() { return Double.parseDouble(ns()); }\\n private char nc() {... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\npublic class test{\\npublic static void main(String args[])\\n{\\nScanner s=new Scanner(System.in);\\nint n=s.nextInt();\\nint m=s.nextInt();\\nint arr[]=new int[n];\\nint max = Integer.MIN_VALUE;\\n long sum = 0;\\n for(int i=0;i d)\\n {\\n count++;\\n d++;\\n }\\n else if(arr[i] == d && arr[i] > 0)\\n {\\n count++;\\n }\\n }\\n \\/\\/System.out.println(count + \\\" \\\" + max);\\n if(max - d > 0)\\n {\\n count = count + max - d;\\n }\\n System.out.println(sum - count);}} Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = sc.nextInt();\\n }\\n Arrays.sort(a);\\n\\n Set div = new HashSet<>();\\n boolean[] d = new boolean[n];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0 ; j < n; j++) {\\n if (d[j]) {\\n continue;\\n }\\n if (a[j]%a[i] == 0) {\\n d[j] = true;\\n div.add(a[i]);\\n }\\n }\\n }\\n\\n System.out.println(div.size());\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] ar = new int[n];\\n for (int i = 0; i < n; i++)\\n ar[i] = in.nextInt();\\n Arrays.sort(ar);\\n boolean[] u = new boolean[n];\\n int ans = 0;\\n for (int i = 0; i < n; i++) {\\n if (!u[i]) {\\n u[i] = true;\\n ans++;\\n for (int j = 0; j < n; j++) {\\n if (!u[j] && ar[j] % ar[i] == 0) {\\n u[j] = true;\\n }\\n }\\n }\\n }\\n out.println(ans);\\n }\\n\\n }\\n\\n static class InputReader {\\n public BufferedReader reader;\\n public StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\\n tokenizer = null;\\n }\\n\\n public String next() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n try {\\n tokenizer = new StringTokenizer(reader.readLine());\\n } catch (IOException e) {\\n throw new... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class cf_contest_1177_problem_B {\\n public static void main(String[] args) {\\n\\n Scanner s = new Scanner(System.in);\\n long k = s.nextLong();\\n if (k<=9)\\n System.out.println(k);\\n else\\n {\\n\\n int c = 1;\\n while(k>c*((Math.pow(10,c)) - Math.pow(10,c-1)))\\n {\\n k-=c*((Math.pow(10,c)) - Math.pow(10,c-1));\\n\\/\\/ System.out.println(k + \\\" hello \\\" + c);\\n c++;\\n }\\n\\/\\/ System.out.println(\\\"k is \\\" + k);\\n long mo = k%c;\\n\\n\\/\\/ System.out.println(\\\"mo is \\\" + mo);\\n k = k\\/c;\\n\\n if (mo == 0) {\\n mo = c;\\n k--;\\n }\\n mo--;\\n\\/\\/ k = Math.max(k-1,0);\\n\\/\\/ System.out.println(\\\"k\\/c is \\\" + k);\\n long j = (long) (Math.pow(10,c-1) + k);\\n\\n String j1 = \\\"\\\" + j;\\n\\/\\/ System.out.println(\\\"j1 is \\\" + j1);\\n\\/\\/ System.out.println(\\\"final ans= \\\" + j1.charAt((int)mo));\\n\\/\\/ System.out.println();\\n System.out.println(j1.charAt((int)mo));\\n }\\n\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.io.PrintWriter;\\nimport java.util.Scanner;\\n\\n\\/*\\n * To change this template, choose Tools | Templates\\n * and open the template in the editor.\\n *\\/\\n\\/**\\n *\\n * @author madis\\n *\\/\\npublic class Pjar {\\n\\n static int a[][];\\n\\n public static void main(String[] args) throws FileNotFoundException {\\n Scanner in = new Scanner(new File(\\\"input.txt\\\"));\\n PrintWriter out = new PrintWriter(\\\"output.txt\\\");\\n\\n int N = in.nextInt();\\n int M = in.nextInt();\\n\\n a = new int[N][M];\\n for (int i = 0; i < N; i++) {\\n for (int j = 0; j < M; j++) {\\n a[i][j] = Integer.MAX_VALUE;\\n }\\n }\\n int k = in.nextInt();\\n in.nextLine();\\n for (int i = 0; i < k; i++) {\\n int x = in.nextInt();\\n int y = in.nextInt();\\n a[x - 1][y - 1] = 1;\\n burn(x - 1, y - 1);\\n }\\n int max = Integer.MIN_VALUE;\\n int x = 0;\\n int y = 0;\\n for (int i = 0; i < N; i++) {\\n for (int j = 0; j < M; j++) {\\n if(a[i][j]>max){\\n max = a[i][j];\\n x = i+1;\\n y = j+1;\\n }\\n }\\n }\\n out.printf(\\\"%d %d\\\",x,y);\\n out.close();\\n in.close();\\n }\\n\\n static void burn(int i, int j) {\\n for(int k = 0;kMath.abs(k-i) + Math.abs(l-j)){\\n a[k][l]=Math.abs(k-i) + Math.abs(l-j);\\n }\\n }\\n }\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\n\\/**\\n * Created with IntelliJ IDEA.\\n * User: Alexey\\n * Date: 16.09.12\\n * Time: 19:29\\n * To change this template use File | Settings | File Templates.\\n *\\/\\npublic class stub implements Runnable {\\n public static void main(String[] args) {\\n new stub().run();\\n }\\n\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(System.out);\\n StringTokenizer st;\\n\\n public String nextToken() throws IOException {\\n while (st == null || !st.hasMoreTokens()) {\\n st = new StringTokenizer(br.readLine());\\n }\\n return st.nextToken();\\n }\\n\\n public int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n private void solve() throws IOException {\\n int[] cnt = new int[(int) 1e6];\\n int n = nextInt();\\n int k = nextInt();\\n int[] a = new int[n];\\n\\n for (int i = 0; i < n; i++) {\\n a[i] = nextInt();\\n }\\n\\n int cur = 0;\\n int left = 0;\\n int i = left;\\n while (i < n && cur != k) {\\n if (cnt[a[i]] == 0) {\\n cur++;\\n }\\n cnt[a[i]]++;\\n i++;\\n }\\n i--;\\n if (cur != k) {\\n out.println(\\\"-1 -1\\\");\\n return;\\n }\\n int right = i;\\n while (cnt[a[left]] > 1) {\\n cnt[a[left]]--;\\n left++;\\n }\\n out.println((left + 1) + \\\" \\\" + (right + 1));\\n }\\n\\n public void run() {\\n try {\\n solve();\\n out.close();\\n br.close();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.HashSet;\\nimport java.util.Set;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in Actual solution is at the top\\n *\\n * @author MaxHeap\\n *\\/\\npublic class Main {\\n\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int d = in.nextInt();\\n Set pts = new HashSet<>();\\n int[] x = in.nextIntArray(n);\\n for (int i = 0; i < n; i++) {\\n pts.add(x[i] - d);\\n pts.add(x[i] + d);\\n }\\n Set ans = new HashSet<>();\\n for (int pt : pts) {\\n int min = (int) (1e9 + 10);\\n for (int i = 0; i < n; i++) {\\n min = Math.min(Math.abs(x[i] - pt), min);\\n }\\n if (min >= d) {\\n ans.add(pt);\\n }\\n }\\n out.println(ans.size());\\n }\\n\\n }\\n\\n static class InputReader {\\n\\n private InputStream stream;\\n private byte[] buf = new byte[1 << 13];\\n private int curChar;\\n private int numChars;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (this.numChars == -1) {\\n throw new UnknownError();\\n } else {\\n if (this.curChar >= this.numChars) {\\n this.curChar = 0;\\n\\n try {\\n this.numChars = this.stream.read(this.buf);\\n } catch (IOException ex) {\\n throw new InputMismatchException();\\n }\\n\\n if (this.numChars <= 0) {\\n return -1;\\n }\\n }\\n\\n return this.buf[this.curChar++];\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/* package whatever; \\/\\/ don't place package name! *\\/\\n\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\n\\n\\/* Name of the class has to be \\\"Main\\\" only if the class is public. *\\/\\npublic class Ideone\\n{\\n public static void main (String[] args) throws java.lang.Exception\\n {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n if(n%2==0){\\n System.out.println(4 + \\\" \\\" + (n-4));\\n }\\n else{\\n int a = Math.min(9,n-9);\\n int b = Math.max(9,n-9);\\n System.out.println(a + \\\" \\\" + b);\\n }\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\npublic class A{\\n\\tpublic static BufferedReader k;\\n\\tpublic static BufferedWriter z;\\n\\t\\n\\n\\t\\n\\tpublic static void main(String [] args)throws IOException{\\n\\t\\tk = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tz = new BufferedWriter(new OutputStreamWriter(System.out));\\n\\t\\t\\n\\t\\t\\n\\t String[] dat = k.readLine().split(\\\" \\\");\\n\\n\\t long l = Long.parseLong(dat[0]);\\n\\t long r = Long.parseLong(dat[1]);\\n\\t\\t\\t\\n\\t\\t\\tif(r-l<=1){\\n\\t\\t\\t\\tz.write(-1+\\\"\\\\n\\\");\\n\\t\\t\\t}\\n\\t\\t\\telse if(r-l == 2){\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif((l&1)!=0){\\n\\t\\t\\t\\t\\tz.write(-1+\\\"\\\\n\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse{\\n\\t\\t\\t\\t\\tz.write(l+\\\" \\\"+(l+1)+\\\" \\\"+r+\\\"\\\\n\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t\\telse{\\n\\t\\t\\t\\tif(l%2==0){\\n\\t\\t\\t\\t\\tz.write(l+\\\" \\\"+(l+1)+\\\" \\\"+(l+2)+\\\"\\\\n\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse{\\n\\t\\t\\t\\t\\tz.write((l+1)+\\\" \\\"+(l+2)+\\\" \\\"+(l+3)+\\\"\\\\n\\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\n\\t\\tz.flush();\\n\\n\\t}\\n\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class PhoenixAndComputers {\\n\\n public static void main(String[] args) throws IOException {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer st = new StringTokenizer(br.readLine());\\n int n = Integer.parseInt(st.nextToken());\\n int mod = Integer.parseInt(st.nextToken());\\n long[][] dp = new long[n+2][n+1];\\n long[] pow = new long[n+1];\\n pow[0] = 1;\\n for (int i=1; i <= n; i++){\\n pow[i] = pow[i-1]*2;\\n pow[i] %= mod;\\n }\\n long[][] choose = new long[n*2+1][n+1];\\n for (int i=0; i <= n; i++){\\n choose[i][i] = 1;\\n }\\n for (int i=1; i <= n*2; i++){\\n for (int j=0; j <= n; j++){\\n choose[i][j] = choose[i-1][j];\\n if (j > 0){\\n choose[i][j] += choose[i-1][j-1];\\n }\\n choose[i][j] %= mod;\\n }\\n }\\n dp[0][0] = 1;\\n for (int i=0; i < n; i++){ \\/\\/ number of computers on\\n for (int j=0; j <= i; j++){ \\/\\/ number manually turned on\\n for (int k=1; k+i <= n; k++){ \\/\\/ number of computers manually turned on in next \\\"block\\\"\\n dp[i+k+1][j+k] += (pow[k-1] * choose[j+k][k])%mod * dp[i][j];\\n dp[i+k+1][j+k] %= mod;\\n }\\n }\\n }\\n long ans = 0;\\n for (int j=0; j <= n; j++){\\n ans += dp[n+1][j];\\n ans %= mod;\\n }\\n System.out.println(ans);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class Main1\\n{\\n static class Reader \\n { \\n private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;} \\n 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++];} \\n 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() ;} \\n 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();} \\n 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;} \\n 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;} \\n public double d() throws IOException {return Double.parseDouble(s()) ;}\\n public boolean isSpaceChar(int c) { return c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1; } \\n public boolean isEndOfLine(int c) { return c == '\\\\n' || c == '\\\\r' || c == -1; } \\n }\\n \\n \\n \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n \\/\\/ RRRRRRRRR AAA HHH HHH IIIIIIIIIIIII LLL \\/\\/\\n \\/\\/ ... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n private static HashMap nodes;\\n private static void dfs(String cur, PrintWriter out) {\\n if(cur.length() > 0) {\\n out.println(cur.substring(1));\\n }\\n int children = nodes.get(cur);\\n for(int i = 1; i <= children; i++) {\\n dfs(cur+\\\".\\\"+i, out);\\n }\\n }\\n public static void main(String[] args) throws IOException {\\n \\/\\/Scanner f = new Scanner(new File(\\\"uva.in\\\"));\\n \\/\\/Scanner f = new Scanner(System.in);\\n \\/\\/BufferedReader f = new BufferedReader(new FileReader(\\\"uva.in\\\"));\\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n int t = Integer.parseInt(f.readLine());\\n while(t-- > 0) {\\n int n = Integer.parseInt(f.readLine());\\n nodes = new HashMap<>();\\n nodes.put(\\\"\\\", 0);\\n String cur = \\\"\\\";\\n for(int i = 0; i < n; i++) {\\n int a = Integer.parseInt(f.readLine());\\n while(nodes.get(cur) != a-1) {\\n cur = cur.substring(0, cur.lastIndexOf(\\\".\\\"));\\n }\\n nodes.put(cur, a);\\n cur = cur+\\\".\\\"+a;\\n nodes.put(cur, 0);\\n }\\n dfs(\\\"\\\", out);\\n }\\n f.close();\\n out.close();\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class virtual1{\\n\\n static InputReader in = new InputReader();\\n static PrintWriter out = new PrintWriter(System.out);\\n \\n public static void main(String[] args) {\\n long x = in.nextLong();\\n long k = in.nextLong();\\n long mod = (long)1e9+7l;\\n \\/\\/out.println(mod);\\n long mul1 = 1;\\n long mul2 = 2*x-1;\\n mul2 = mul2%mod;\\n long pow = k;\\n long to = 2;\\n while(pow>0l){\\n if(pow%2l==1l){\\n mul1 = mul1*to;\\n mul1%=mod;\\n }\\n to=to*to;\\n to%=mod;\\n pow = pow\\/2l;\\n }\\n mul1 = mul1*mul2;\\n mul1%=mod;\\n mul1+=1;\\n if(x!=0)\\n out.println(mul1%mod);\\n else\\n out.println(0);\\n \\n out.close(); \\n }\\n\\n static class InputReader\\n {\\n BufferedReader br;\\n StringTokenizer st;\\n \\n public InputReader()\\n {\\n br = new BufferedReader(new\\n InputStreamReader(System.in));\\n }\\n \\n String next()\\n {\\n while (st == null || !st.hasMoreElements())\\n {\\n try\\n {\\n st = new StringTokenizer(br.readLine());\\n }\\n catch (IOException e)\\n {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n \\n int nextInt()\\n {\\n return Integer.parseInt(next());\\n }\\n \\n long nextLong()\\n {\\n return Long.parseLong(next());\\n }\\n \\n double nextDouble()\\n {\\n return Double.parseDouble(next());\\n }\\n \\n String nextLine()\\n {\\n String str = \\\"\\\";\\n try\\n {\\n str = br.readLine();\\n }\\n catch (IOException e)\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.InputMismatchException;\\nimport java.io.*;\\nimport java.util.HashMap;\\n\\n\\/**\\n * Generated by Contest helper plug-in\\n * Actual solution is at the bottom\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputReader in = new StreamInputReader(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n run(in, out);\\n }\\n\\n public static void run(InputReader in, PrintWriter out) {\\n Solver solver = new SimpleCycles();\\n solver.solve(1, in, out);\\n Exit.exit(in, out);\\n }\\n}\\n\\nclass StreamInputReader extends InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar, numChars;\\n\\n public StreamInputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n if (numChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n @Override\\n public void close() {\\n try {\\n stream.close();\\n } catch (IOException ignored) {\\n }\\n }\\n}\\n\\nabstract class InputReader {\\n private boolean finished = false;\\n\\n public abstract int read();\\n\\n public int nextInt() {\\n return Integer.parseInt(nextToken());\\n }\\n\\n\\n public String nextToken() {\\n int c = read();\\n while (isSpaceChar(c))\\n c = read();\\n StringBuffer res = new StringBuffer();\\n do {\\n res.appendCodePoint(c);\\n c = read();\\n } while (!isSpaceChar(c));\\n return res.toString();\\n }\\n private boolean isSpaceChar(int c) {\\n return c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1;\\n }\\n\\n public void setFinished(boolean finished) {\\n ... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class SonyaExhibition {\\n\\tstatic BufferedReader br;\\n\\tstatic StringTokenizer tokenizer;\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint n = nextInt();\\n\\t\\tint[] arr = {0,1};\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\tSystem.out.print(arr[i % 2]);\\n\\t\\t}\\n\\t\\tSystem.out.println();\\n\\t}\\n\\n\\tpublic static String next() throws IOException {\\n\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t\\t\\tString line = br.readLine();\\n\\t\\t\\tif (line == null)\\n\\t\\t\\t\\tthrow new IOException();\\n\\t\\t\\ttokenizer = new StringTokenizer(line);\\n\\t\\t}\\n\\t\\treturn tokenizer.nextToken();\\n\\t}\\n\\n\\tpublic static int nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.HashSet;\\nimport java.util.Scanner;\\n\\n\\npublic class Solution {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n HashSet set = new HashSet<>();\\n for(int i = 0; i list = new ArrayList();\\n \\n \\n boolean valid(int n) {\\n Queue q = new LinkedList();\\n q.add(4);\\n q.add(7);\\n int crnt;\\n while(!q.isEmpty()) {\\n crnt = q.poll();\\n if(n%crnt == 0) return true;\\n if ( crnt*10 + 4 <= 1000 ) q.add(crnt*10 + 4);\\n if ( crnt*10 + 7 <= 1000 ) q.add(crnt*10 + 7);\\n }\\n return false;\\n }\\n \\n void dfs(int n){\\n if(n>1000)return;\\n if(n!=0)list.add(n);\\n n = n*10;\\n dfs(n+4);\\n dfs(n+7);\\n }\\n\\n void run() {\\n Scanner s = new Scanner(System.in);\\n int n = s.nextInt();\\n if (valid(n)) {\\n System.out.println(\\\"YES\\\");\\n } else {\\n System.out.println(\\\"NO\\\");\\n }\\n }\\n\\n public static void main(String[] args) {\\n new A().run();\\n }\\n\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Main{\\n public static void main(String[] args){\\n try {\\n new Main().solve();\\n } catch (Exception e) {\\n e.printStackTrace();\\n }\\n }\\n ArrayList[]edge;\\n int n,m,cnt=0;\\n int ord;\\n int[]order;int[]vis;\\n Edge[] e;\\n private void solve() throws Exception{\\n InputReader in = new InputReader(System.in);\\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n n=in.nextInt();m=in.nextInt();\\n edge=new ArrayList[n+1];\\n e=new Edge[m];\\n vis=new int[n+1];\\n order=new int[n+1];\\n for(int i=1;i<=n;i++){\\n edge[i]=new ArrayList<>();\\n }\\n for(int i=1;i<=m;i++){\\n int s=in.nextInt(),t=in.nextInt(),c=in.nextInt();\\n edge[s].add(new Edge(s,t,c,i));\\n }\\n int l=0,r=1000000000;\\n while (l>>1;\\n if(judge(mid,false))r=mid;\\n else l=mid+1;\\n }\\n out.print(l+\\\" \\\");\\n judge(l,true);\\n Arrays.sort(e,0,cnt,Comparator.comparingInt(x->x.id));\\n int ans=0;\\n int[]a=new int[m];\\n for(int i=0;i costs = new HashMap<>();\\n\\n public static void main(String[] args) throws IOException {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n int[] params = Arrays.stream(br.readLine().split(\\\" \\\"))\\n .mapToInt(x -> Integer.parseInt(x)).toArray();\\n n = params[0];\\n int m = params[1];\\n int[][] matrix = new int[n][m];\\n for (int i = 0; i < n; i++) {\\n matrix[i] = Arrays.stream(br.readLine().split(\\\" \\\"))\\n .mapToInt(x -> Integer.parseInt(x)).toArray();\\n }\\n minCost = new int[n][n];\\n minCostEndpoints = new int[n][n];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) {\\n if (i > j) {\\n minCost[i][j] = Integer.MAX_VALUE;\\n for (int k = 0; k < m; k++) {\\n int diff = Math.abs(matrix[i][k] - matrix[j][k]);\\n if (diff < minCost[i][j]) {\\n minCost[i][j] = diff;\\n }\\n }\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Locale;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\nimport java.util.Map.Entry;\\n\\npublic class Solution implements Runnable {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\t(new Thread(new Solution())).start();\\n\\t}\\n\\t\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\t\\n\\tString nextToken() throws IOException {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tString r = in.readLine();\\n\\t\\t\\tif (r == null) return null;\\n\\t\\t\\tst = new StringTokenizer(r);\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tlong nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tdouble nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n\\t\\n\\tint n;\\n\\tint[] b, l;\\n\\tdouble ans;\\n\\tint[] sw;\\n\\tint a;\\n\\t\\n\\tvoid sol() {\\n\\t\\tfor (int i = 0; i < n; i++) l[i] += sw[i] * 10;\\n\\t\\tdouble yes = 0;\\n\\t\\tfor (int q = 0; q < (1 << n); q++) {\\n\\t\\t\\tdouble p = 1;\\n\\t\\t\\tint bb = 0;\\n\\t\\t\\tint cnt = 0;\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tif ((q & (1 << i)) == 0) {\\n\\t\\t\\t\\t\\tp *= (1.0 - (double)l[i] \\/ 100);\\n\\t\\t\\t\\t\\tbb += b[i];\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tp *= 1.0 * (double)l[i] \\/ 100;\\n\\t\\t\\t\\t\\tcnt++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif (cnt > n \\/ 2) {\\n\\t\\t\\t\\tyes += p;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tyes += p * (double)a \\/ (double)(a + bb); \\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif (ans < yes) ans = yes;\\n\\t\\tfor (int i = 0; i < n; i++) l[i] -= sw[i] * 10;\\n\\t}\\n\\t\\n\\tvoid rek(int i, int k) {\\n\\t\\tif (i == n) sol(); else {\\n\\t\\t\\tfor (int q = 0; q <= k && l[i] + q * 10 <= 100; q++) {\\n\\t\\t\\t\\tsw[i] = q;\\n\\t\\t\\t\\trek(i + 1, k - q);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\tvoid solve() throws Exception {\\n\\t\\tn = nextInt();\\n\\t\\tint k = nextInt();\\n\\t\\ta = nextInt();\\n\\t\\tb = new int[n];\\n\\t\\tl = new int[n];\\n\\t\\tsw = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tb[i] = nextInt();\\n\\t\\t\\tl[i] = nextInt();\\n\\t\\t}\\n\\t\\trek(0, k);\\n\\t\\tout.printf(\\\"%.10f\\\", ans);\\n\\t}\\n\\n\\tpublic void run() {\\n\\t\\tLocale.setDefault(Locale.UK);\\n\\t\\ttry {\\n\\t\\t\\tin = new... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A implements Runnable {\\n private MyScanner in;\\n private PrintWriter out;\\n\\n private void solve() {\\n int n = in.nextInt();\\n int[] a = new int[n];\\n int all = 0;\\n for (int i = 0; i < n; ++i) {\\n a[i] = in.nextInt();\\n all += a[i];\\n }\\n Arrays.sort(a);\\n int sum = 0, ans = 0;\\n for (int i = n - 1; i >= 0; --i) {\\n sum += a[i];\\n ++ans;\\n if (sum > all - sum) {\\n break;\\n }\\n }\\n out.println(ans);\\n }\\n\\n @Override\\n public void run() {\\n in = new MyScanner();\\n out = new PrintWriter(System.out);\\n solve();\\n in.close();\\n out.close();\\n }\\n\\n public static void main(String[] args) {\\n new A().run();\\n }\\n\\n static class MyScanner {\\n private BufferedReader br;\\n private StringTokenizer st;\\n\\n public MyScanner() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n public void close() {\\n try {\\n br.close();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n public String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n return null;\\n }\\n }\\n return st.nextToken();\\n }\\n\\n public String nextLine() {\\n try {\\n st = null;\\n return br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n return null;\\n }\\n }\\n\\n public int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n public long nextLong() {\\n return Long.parseLong(next());\\n }\\n\\n public... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class Main3 implements Runnable {\\n\\n public static void main(String[] args) {\\n new Thread(null, new Main3(), \\\"\\\", 128 * 1024 * 1024).start();\\n }\\n\\n private static Scanner in = new Scanner(System.in);\\n\\n public void run() {\\n int n = in.nextInt();\\n int m = 1_000_000_007;\\n boolean[] state = new boolean[n];\\n for (int i = 0; i < n; i++) {\\n state[i] = in.next().equals(\\\"f\\\");\\n }\\n \\/\\/ 使うのは[n][n]だけど、j+1==nのときif分岐せずに済むようにn+1にしてる\\n long[][] dp = new long[n][n + 1];\\n dp[0][0] = 1;\\n \\/\\/ iは既に埋まっていてi+1に書き込んでいくから、i= 0; j--) {\\n \\/\\/ 足していくと大きくなるからこの時点でもう%mしておく\\n dp[i + 1][j] = (dp[i][j] + dp[i + 1][j + 1]) % m;\\n }\\n }\\n }\\n long sum = 0;\\n for (int i = 0; i < n; i++) {\\n sum += dp[n - 1][i] % m;\\n }\\n System.out.println(sum % m);\\n }\\n} Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.util.HashSet;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Lokesh Khandelwal aka (codeKNIGHT | phantom11)\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tTaskB solver = new TaskB();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskB {\\n\\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n=in.nextInt(),k=in.nextInt();\\n int a[]=new int[n];\\n int i;\\n for(i=0;i hs=new HashSet();\\n boolean status=false;\\n int index=-1;\\n for(i=0;i hash=new HashSet();\\n for(i=index;i>=0;i--)\\n {\\n\\n hash.add(a[i]);\\n if(hash.size()==k)\\n {\\n break;\\n }\\n }\\n out.println((i+1)+\\\" \\\"+(index+1));\\n }\\n}\\n\\nclass InputReader\\n{\\n BufferedReader in;\\n StringTokenizer tokenizer=null;\\n\\n public InputReader(InputStream inputStream)\\n {\\n in=new BufferedReader(new InputStreamReader(inputStream));\\n }\\n public String next()\\n {\\n try{\\n while (tokenizer==null||!tokenizer.hasMoreTokens())\\n {\\n tokenizer=new StringTokenizer(in.readLine());\\n }\\n return... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import static java.util.Arrays.*;\\nimport static java.lang.Math.*;\\nimport static java.math.BigInteger.*;\\nimport java.util.*;\\nimport java.math.*;\\nimport java.io.*;\\n\\npublic class A implements Runnable\\n{\\n String file = \\\"input\\\";\\n \\n boolean TEST = System.getProperty(\\\"ONLINE_JUDGE\\\") == null;\\n \\n void solve() throws IOException\\n {\\n int n = nextInt();\\n int[] a = new int[n];\\n for(int i = 0; i < n; i++) a[i] = nextInt();\\n int[] b = a.clone();\\n qsort(b);\\n \\/\\/sortInt(b);\\n int count = 0;\\n for(int i = 0; i < a.length; i++)\\n if(a[i] != b[i]) count++;\\n if(count == 0 || count == 2) out.println(\\\"YES\\\");\\n else out.println(\\\"NO\\\");\\n }\\n \\n void qsort(int[] a)\\n {\\n List as = new ArrayList();\\n for(int x : a) as.add(x);\\n Collections.shuffle(as);\\n for(int i = 0; i < a.length; i++) a[i] = as.get(i);\\n sort(a);\\n }\\n \\n Random rnd = new Random();\\n \\n void sortInt(int[] a)\\n {\\n sortInt(a, 0, a.length - 1);\\n }\\n \\n void sortInt(int[] a, int from, int to)\\n {\\n if(from >= to) return;\\n int i = from - 1;\\n int p = rnd.nextInt(to - from + 1) + from;\\n int t = a[p]; a[p] = a[to]; a[to] = t;\\n for(int j = from; j < to; j++)\\n if(a[j] <= a[to])\\n {\\n i++;\\n t = a[i]; a[i] = a[j]; a[j] = t;\\n }\\n t = a[i + 1]; a[i + 1] = a[to]; a[to] = t;\\n sortInt(a, i + 2, to);\\n while(i >= 0 && a[i] == a[i + 1]) i--;\\n sortInt(a, from, i);\\n \\n }\\n \\n String next() throws IOException\\n {\\n while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(input.readLine());\\n return st.nextToken();\\n }\\n \\n int nextInt() throws IOException\\n {\\n return Integer.parseInt(next());\\n }\\n \\n long nextLong() throws IOException\\n {\\n return Long.parseLong(next());\\n }\\n \\n double nextDouble() throws IOException\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class Main{\\n final int mod = 1000000007;\\n final int maxn = -1;\\n final double eps = 1e-9;\\n\\n long digits(long n){\\n if(n == 0) return 0;\\n int p = (int)Math.log10(n);\\n return (p + 1) * (n - (long)Math.pow(10, p) + 1) + digits((long)Math.pow(10, p) - 1);\\n }\\n\\n void solve(){\\n \\/\\/ freopen(\\\"in\\\");\\n String s = \\\"\\\";\\n long k = nextLong();\\n long i = 1;\\n long j = k;\\n while(i < j){\\n long m = (i + j) \\/ 2;\\n if(digits(m) < k){\\n i = m + 1;\\n }\\n else{\\n j = m;\\n }\\n }\\n if(digits(i) >= k) --i;\\n printf(\\\"%c\\\\n\\\", String.valueOf(i + 1).charAt((int)(k - digits(i) - 1)));\\n }\\n\\n final double pi = Math.acos(-1.0);\\n final long infl = 0x3f3f3f3f3f3f3f3fl;\\n final int inf = 0x3f3f3f3f;\\n final boolean ONLINE_JUDGE = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n\\n boolean zero(double x){ return x < eps; }\\n\\n \\/** io **\\/\\n PrintWriter out;\\n BufferedReader reader;\\n StringTokenizer tokens;\\n\\n Main(){\\n long s = System.currentTimeMillis();\\n tokens = new StringTokenizer(\\\"\\\");\\n reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);\\n out = new PrintWriter(System.out);\\n Locale.setDefault(Locale.US); \\/\\/ imprime double com ponto\\n solve();\\n out.close();\\n debug(\\\"Time elapsed: %dms\\\", System.currentTimeMillis() - s);\\n }\\n\\n void freopen(String s){\\n try{ reader = new BufferedReader(new InputStreamReader(new FileInputStream(s)), 1 << 15); }\\n catch(FileNotFoundException e){ throw new RuntimeException(e); }\\n }\\n\\n \\/** input -- supõe que não chegou no EOF **\\/\\n int nextInt(){ return Integer.parseInt(next()); }\\n long nextLong(){ return Long.parseLong(next()); }\\n double nextDouble(){ return Double.parseDouble(next()); }\\n\\n String next(){ readTokens(); return tokens.nextToken(); }\\n String nextLine(){ readTokens(); return tokens.nextToken(\\\"\\\\n\\\"); }\\n\\n boolean readTokens(){\\n while(!tokens.hasMoreTokens()){ \\/\\/ lê os dados, ignorando linhas vazias\\n try{\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\n\\n\\npublic class Task1b {\\n\\n\\tstatic int[] fromRC (String data) {\\n\\t\\tint pos = data.indexOf('C');\\n\\t\\tint res[] = new int[2];\\n\\t\\tres[0] = Integer.parseInt(data.substring(1, pos));\\n\\t\\tres[1] = Integer.parseInt(data.substring(pos + 1));\\n\\t\\treturn res;\\n\\t}\\n\\t\\n\\tstatic int[] fromXC (String data) {\\n\\t\\tint pos = 0;\\n\\t\\tint res[] = new int[2];\\n\\t\\tres[0] = res[1] = 0;\\n\\t\\twhile (data.charAt(pos) >= 'A' && data.charAt(pos) <= 'Z') {\\n\\t\\t\\tres[1] *= 26;\\n\\t\\t\\tres[1]++;\\n\\t\\t\\tres[1] += data.charAt(pos) - 'A';\\n\\t\\t\\tpos++;\\n\\t\\t}\\n\\t\\tres[0] = Integer.parseInt(data.substring(pos));\\n\\t\\treturn res;\\n\\t}\\n\\t\\n\\tstatic String toRC (int[] data) {\\n\\t\\treturn String.format(\\\"R%dC%d\\\", data[0], data[1]);\\n\\t}\\n\\t\\n\\tstatic String toXC (int[] data) {\\n\\t\\tStringBuilder sb = new StringBuilder();\\n\\t\\twhile (data[1] > 0) {\\n\\t\\t\\tdata[1]--;\\n\\t\\t\\tsb.append((char)('A' + data[1] % 26));\\n\\t\\t\\tdata[1] \\/= 26;\\n\\t\\t}\\n\\t\\tsb = sb.reverse();\\n\\t\\tsb.append(data[0]);\\n\\t\\treturn sb.toString();\\n\\t}\\n\\t\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint n = Integer.parseInt(br.readLine());\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tString s = br.readLine();\\n\\t\\t\\tif ((s.charAt(0) == 'R') && \\n\\t\\t\\t\\t(s.charAt(1) >= '0' && s.charAt(1) <= '9') &&\\n\\t\\t\\t\\t(s.indexOf('C') != -1)) {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tSystem.out.println(toXC(fromRC(s)));\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tSystem.out.println(toRC(fromXC(s)));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class C {\\n\\n MyScanner in;\\n PrintWriter out;\\n\\n public static void main(String[] args) throws Exception {\\n new C().run();\\n }\\n\\n public void run() throws Exception {\\n in = new MyScanner();\\n out = new PrintWriter(System.out);\\n\\n solve();\\n\\n out.close();\\n }\\n\\n public void solve() throws Exception {\\n int n = in.nextInt();\\n char[] a = in.next().toCharArray();\\n int h = 0;\\n for (int i = 0; i < a.length; i++) {\\n if (a[i] == 'H') h++;\\n }\\n char[] b = new char[2 * a.length - 1];\\n for (int i = 0; i < b.length; i++) {\\n b[i] = a[i % a.length];\\n }\\n int maxh = 0;\\n int hh = 0;\\n for (int i = 0; i < b.length - h; i++) {\\n hh = 0;\\n for (int j = 0; j < h; j++) {\\n if (b[i + j] == 'H') hh++;\\n }\\n maxh = Math.max(maxh, hh);\\n }\\n \\/*for (int i = 0; i < b.length; i++) {\\n out.print(b[i]);\\n }\\n out.println();*\\/\\n \\/\\/out.println(h + \\\" \\\" + maxh);\\n out.println(h - maxh);\\n }\\n class MyScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public MyScanner() throws Exception {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n String next() throws Exception {\\n if ((st == null) || (!st.hasMoreTokens())) {\\n st = new StringTokenizer(br.readLine());\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() throws Exception {\\n return Integer.parseInt(next());\\n }\\n\\n double nextDouble() throws Exception {\\n return Double.parseDouble(next());\\n }\\n\\n boolean nextBoolean() throws Exception {\\n return Boolean.parseBoolean(next());\\n }\\n\\n long nextLong() throws Exception {\\n return Long.parseLong(next());\\n }\\n }\\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.ArrayList;\\nimport java.util.HashMap;\\nimport java.util.HashSet;\\nimport java.util.LinkedList;\\nimport java.util.List;\\nimport java.util.Scanner;\\n\\npublic class Main2 {\\n\\n\\tstatic List> getLayers(int[] numbers, int a, int b) {\\n\\t\\tboolean[] used = new boolean[numbers.length];\\n\\t\\tHashSet hs = new HashSet();\\n\\t\\tfor (int i = 0; i < numbers.length; i++) {\\n\\t\\t\\ths.add(numbers[i]);\\n\\t\\t}\\n\\t\\tHashMap numberToIndex = new HashMap();\\n\\t\\tfor (int i = 0; i < numbers.length; i++) {\\n\\t\\t\\tnumberToIndex.put(numbers[i], i);\\n\\t\\t}\\n\\n\\t\\tList> ans = new ArrayList>();\\n\\t\\tfor (int i = 0; i < numbers.length; i++) {\\n\\t\\t\\tif (!used[i]) {\\n\\n\\t\\t\\t\\tList ansRow = new ArrayList();\\n\\t\\t\\t\\tLinkedList current = new LinkedList();\\n\\t\\t\\t\\tcurrent.add(numbers[i]);\\n\\t\\t\\t\\twhile (!current.isEmpty()) {\\n\\t\\t\\t\\t\\tint c = current.removeFirst();\\n\\t\\t\\t\\t\\tused[numberToIndex.get(c)] = true;\\n\\n\\t\\t\\t\\t\\tboolean found = false;\\n\\n\\t\\t\\t\\t\\tif (hs.contains(a - c)) {\\n\\t\\t\\t\\t\\t\\tfound = true;\\n\\t\\t\\t\\t\\t\\tif (a - c != c)\\n\\t\\t\\t\\t\\t\\t\\tcurrent.add(a - c);\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif (hs.contains(b - c)) {\\n\\t\\t\\t\\t\\t\\tfound = true;\\n\\t\\t\\t\\t\\t\\tif (b - c != c)\\n\\t\\t\\t\\t\\t\\t\\tcurrent.add(b - c);\\n\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\tif (found || ansRow.size() > 0)\\n\\t\\t\\t\\t\\t\\tansRow.add(c);\\n\\n\\t\\t\\t\\t\\ths.remove(c);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tans.add(ansRow);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\treturn ans;\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\n\\t\\tint n = sc.nextInt();\\n\\t\\tint a = sc.nextInt();\\n\\t\\tint b = sc.nextInt();\\n\\n\\t\\tint[] numbers = new int[n];\\n\\t\\tfor (int i = 0; i < numbers.length; i++) {\\n\\t\\t\\tnumbers[i] = sc.nextInt();\\n\\t\\t}\\n\\n\\t\\tHashSet hs = new HashSet();\\n\\t\\tfor (int i = 0; i < numbers.length; i++) {\\n\\t\\t\\ths.add(numbers[i]);\\n\\t\\t}\\n\\n\\t\\tint[] belongs = new int[n];\\n\\t\\tfor (int i = 0; i < belongs.length; i++) {\\n\\t\\t\\tbelongs[i] = -1;\\n\\t\\t}\\n\\n\\t\\tHashMap numberToIndex = new HashMap();\\n\\t\\tfor (int i = 0; i < numbers.length; i++) {\\n\\t\\t\\tnumberToIndex.put(numbers[i], i);\\n\\t\\t}\\n\\n\\t\\tboolean possible = true;\\n\\n\\t\\tList>... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Main {\\n static class Node implements Comparable{\\n public int l,r;\\n public long s;\\n Node(int l,int r,long s){\\n this.l=l;\\n this.r=r;\\n this.s=s;\\n }\\n public int compareTo(Node o) {\\n if(o.s==s){\\n if(r>o.r) return 1;\\n else if(r==o.r) {\\n return 0;\\n }\\n else return -1;\\n } else if(s>o.s){\\n return 1;\\n } else {\\n return -1;\\n }\\n }\\n }\\n static long[] sum=new long[1550];\\n public static void main(String[] args) {\\n TreeMap > mp = new TreeMap<>();\\n Scanner cin = new Scanner(System.in);\\n int N=cin.nextInt();\\n for(int i=1;i<=N;i++){\\n int x=cin.nextInt();\\n sum[i]=sum[i-1]+x;\\n }\\n \\/\\/System.out.println(\\\"here\\\");\\n ArrayList arr = new ArrayList<>();\\n for(int l=1;l<=N;l++){\\n for(int r=l;r<=N;r++){\\n arr.add(new Node(l,r,sum[r]-sum[l-1]));\\n }\\n }\\n Collections.sort(arr);\\n for(int i=0;i a=mp.get(arr.get(i).s);\\n if(a==null) {\\n a=new ArrayList<>();\\n mp.put(arr.get(i).s,a);\\n }\\n a.add(arr.get(i));\\n }\\n int mx=-1;\\n long mxv=-1;\\n Iterator it=mp.keySet().iterator();\\n while(it.hasNext()){\\n int ans=0,t=0;\\n long v=it.next();\\n ArrayList vec= mp.get(v);\\n for(int i=0;imx){\\n mx=ans;\\n mxv=v;\\n \\/\\/ System.out.println(mxv);\\n }\\n }\\n ArrayList vec=mp.get(mxv);\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.lang.*;\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.*;\\nimport java.math.*;\\npublic class Main {\\n public void dfs(ArrayList[] graph,int[] visited,int source) {\\n \\n }\\n public static void main(String[] args) throws Exception{\\n Reader.init(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n Main mm =new Main();\\n int n=Reader.nextInt();\\n int m=Reader.nextInt();\\n String s=Reader.next();\\n int[][] count=new int[m][m];\\n for(int i=1;i0) {\\n for(int k=0;k 0)\\n\\t\\t\\ta -= (long) w * w;\\n\\t\\tif ((w = 1 - (y - r)) > 0)\\n\\t\\t\\ta -= (long) w * w;\\n\\t\\tif ((w = (x + r) - n) > 0)\\n\\t\\t\\ta -= (long) w * w;\\n\\t\\tif ((w = (y + r) - n) > 0)\\n\\t\\t\\ta -= (long) w * w;\\n\\t\\tif ((w = r - 1 - (x - 1) - (y - 1)) > 0)\\n\\t\\t\\ta += (long) w * (w + 1) \\/ 2;\\n\\t\\tif ((w = r - 1 - (x - 1) - (n - y)) > 0)\\n\\t\\t\\ta += (long) w * (w + 1) \\/ 2;\\n\\t\\tif ((w = r - 1 - (n - x) - (y - 1)) > 0)\\n\\t\\t\\ta += (long) w * (w + 1) \\/ 2;\\n\\t\\tif ((w = r - 1 - (n - x) - (n - y)) > 0)\\n\\t\\t\\ta += (long) w * (w + 1) \\/ 2;\\n\\t\\treturn a;\\n\\t}\\n\\tvoid main() {\\n\\t\\tint n = sc.nextInt();\\n\\t\\tint x = sc.nextInt();\\n\\t\\tint y = sc.nextInt();\\n\\t\\tint c = sc.nextInt();\\n\\t\\tint lower = -1, upper = c;\\n\\t\\twhile (upper - lower > 1) {\\n\\t\\t\\tint r = (lower + upper) \\/ 2;\\n\\t\\t\\tif (count(n, x, y, r) >= c)\\n\\t\\t\\t\\tupper = r;\\n\\t\\t\\telse\\n\\t\\t\\t\\tlower = r;\\n\\t\\t}\\n\\t\\tprintln(upper);\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.InputMismatchException;\\nimport java.math.BigInteger;\\nimport java.io.*;\\nimport java.util.*;\\n\\n\\/**\\n * Generated by Contest helper plug-in\\n * Actual solution is at the bottom\\n *\\/\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputReader in = new StreamInputReader(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\trun(in, out);\\n\\t}\\n\\n\\tpublic static void run(InputReader in, PrintWriter out) {\\n\\t\\tSolver solver = new Task();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tExit.exit(in, out);\\n\\t}\\n}\\n\\nabstract class InputReader {\\n\\tprivate boolean finished = false;\\n\\n\\tpublic abstract int read();\\n\\n\\tpublic long readLong() {\\n\\t\\treturn new BigInteger(readString()).longValue();\\n\\t}\\n\\n\\tpublic int readInt() {\\n\\t\\tint c = read();\\n\\t\\twhile (isSpaceChar(c))\\n\\t\\t\\tc = read();\\n\\t\\tint sgn = 1;\\n\\t\\tif (c == '-') {\\n\\t\\t\\tsgn = -1;\\n\\t\\t\\tc = read();\\n\\t\\t}\\n\\t\\tint res = 0;\\n\\t\\tdo {\\n\\t\\t\\tif (c < '0' || c > '9')\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\tres *= 10;\\n\\t\\t\\tres += c - '0';\\n\\t\\t\\tc = read();\\n\\t\\t} while (!isSpaceChar(c));\\n\\t\\treturn res * sgn;\\n\\t}\\n\\n\\tpublic String readString() {\\n\\t\\tint c = read();\\n\\t\\twhile (isSpaceChar(c))\\n\\t\\t\\tc = read();\\n\\t\\tStringBuffer res = new StringBuffer();\\n\\t\\tdo {\\n\\t\\t\\tres.appendCodePoint(c);\\n\\t\\t\\tc = read();\\n\\t\\t} while (!isSpaceChar(c));\\n\\t\\treturn res.toString();\\n\\t}\\n\\n\\tprivate boolean isSpaceChar(int c) {\\n\\t\\treturn c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1;\\n\\t}\\n\\n\\tpublic void setFinished(boolean finished) {\\n\\t\\tthis.finished = finished;\\n\\t}\\n\\n\\tpublic abstract void close();\\n}\\n\\nclass StreamInputReader extends InputReader {\\n\\tprivate InputStream stream;\\n\\tprivate byte[] buf = new byte[1024];\\n\\tprivate int curChar, numChars;\\n\\n\\tpublic StreamInputReader(InputStream stream) {\\n\\t\\tthis.stream = stream;\\n\\t}\\n\\n\\tpublic int read() {\\n\\t\\tif (numChars == -1)\\n\\t\\t\\tthrow new InputMismatchException();\\n\\t\\tif (curChar >= numChars) {\\n\\t\\t\\tcurChar = 0;\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tnumChars = stream.read(buf);\\n\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t}\\n\\t\\t\\tif (numChars <= 0)\\n\\t\\t\\t\\treturn -1;\\n\\t\\t}\\n\\t\\treturn buf[curChar++];\\n\\t}\\n\\n\\tpublic void... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class MainClass {\\n\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n int arr[] = {4,7,47,74,447,474,477,744,747,774};\\n int i=0, x = in.nextInt();\\n while (i= dif? dif:left;\\n num[index] = dif;\\n \\n double result = 0;\\n for (int k = 0; k < (1 << num.length); k++) {\\n double val = 1;\\n double total = 0;\\n for (int i = 0; i < num.length; i++) {\\n if (((1 << i) & k) != 0) {\\n val *= ((double)(data[i].loyal + 10*num[i])\\/100);\\n } else {\\n val *= ((double)(100 - (data[i].loyal + 10*num[i]))\\/100);\\n total += data[i].level;\\n }\\n }\\n if (countBit(k) > num.length \\/ 2) {\\n result += val;\\n } else {\\n result += val * ((double) A \\/ (A + total));\\n }\\n }\\n\\/\\/ \\/\\/ if(result >= 1){\\n\\/\\/ for(int i : num){\\n\\/\\/ System.out.print(i + \\\" \\\");\\n\\/\\/ }\\n\\/\\/ System.out.println(\\\"\\\\n\\\" + result);\\n\\/\\/ \\/\\/}\\n return result;\\n } else {\\n double result = 0;\\n ... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.awt.Point;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.HashSet;\\nimport java.util.StringTokenizer;\\nimport static java.lang.Math.*;\\nimport static java.lang.Integer.*;\\nimport static java.lang.Long.*;\\nimport static java.lang.Character.*;\\nimport static java.lang.String.*;\\n@SuppressWarnings(\\\"unused\\\")\\n\\npublic class round169D {\\n static PrintWriter out = new PrintWriter(System.out);\\n static BufferedReader br = new BufferedReader(new InputStreamReader(\\n System.in));\\n static StringTokenizer st = new StringTokenizer(\\\"\\\");\\n static int nextInt() throws Exception {\\n return Integer.parseInt(next());\\n }\\n static String next() throws Exception {\\n while (true) {\\n if (st.hasMoreTokens()) {\\n return st.nextToken();\\n }\\n String s = br.readLine();\\n if (s == null) {\\n return null;\\n }\\n st = new StringTokenizer(s);\\n }\\n }\\n public static void main(String[] args)throws Exception { \\n long l = parseLong(next());\\n long r = parseLong(next());\\n long [] min = new long [61];\\n for(int i = 1 ; i <= 60 ; ++i){\\/\\/(2^i)-1 is obtained by min[i]^min[i]+1\\n min[i] = (long) pow(2, i - 1) - 1; \\n }\\n for(int i = 60 ; i >= 0 ; --i){\\/\\/try to get 2^i-1 as answer. \\n if(min[i] >= r)\\n continue;\\n if(min[i] >= l && min[i] + 1 <= r){ \\n out.println((1L << i) - 1);\\n out.flush();\\n return;\\n }\\n if(min[i] < l){\\n long one_jump = (long) pow(2, i);\\n long jumps = (long) ceil((l - min[i]) \\/ (one_jump * 1.0)); \\n long cur = min[i] + (jumps * one_jump);\\n if(cur >= l && cur + 1 <= r){ \\n out.println((1L << i) - 1);\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\nimport java.lang.*;\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.*;\\n \\npublic class Main {\\n \\n public static void main(String[] args) throws Exception{\\n FastReader sc=new FastReader(); \\n OutputStream outputStream = System.out;\\n PrintWriter out = new PrintWriter(outputStream);\\n int n=sc.nextInt();\\n HashMap map=new HashMap();\\n for(int i=0;i list=new ArrayList();\\n int count=0;\\n if(!map.containsKey(\\\"purple\\\")) {\\n count++;\\n list.add(\\\"Power\\\");\\n }\\nif(!map.containsKey(\\\"green\\\")) {\\n count++;\\n list.add(\\\"Time\\\");\\n }\\n\\nif(!map.containsKey(\\\"blue\\\")) {\\n count++;\\n list.add(\\\"Space\\\");\\n}\\n\\nif(!map.containsKey(\\\"orange\\\")) {\\n count++;\\n list.add(\\\"Soul\\\");\\n}\\n\\nif(!map.containsKey(\\\"red\\\")) {\\n count++;\\n list.add(\\\"Reality\\\");\\n}\\n\\nif(!map.containsKey(\\\"yellow\\\")) {\\n count++;\\n list.add(\\\"Mind\\\");\\n}System.out.println(count);\\n for(String s:list) {\\n System.out.println(s);\\n }\\n }\\n}\\n\\nclass FastReader \\n{ \\n BufferedReader br; \\n StringTokenizer st; \\n \\n public FastReader() \\n { \\n br = new BufferedReader(new\\n InputStreamReader(System.in)); \\n } \\n \\n String next() \\n { \\n while (st == null || !st.hasMoreElements()) \\n { \\n try\\n { \\n st = new StringTokenizer(br.readLine()); \\n } \\n catch (IOException e) \\n { \\n e.printStackTrace(); \\n } \\n } \\n return st.nextToken(); \\n } \\n \\n int nextInt() \\n { \\n return Integer.parseInt(next()); \\n } \\n \\n long nextLong() \\n { \\n return Long.parseLong(next()); \\n } \\n \\n double nextDouble() \\n { \\n return Double.parseDouble(next()); \\n } \\n \\n String nextLine() \\n { \\n ... Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class Round8_C {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\t\\n\\tint n ;\\n\\tint[] X, Y ;\\n\\t\\n\\tpublic Round8_C() {\\n\\t\\tinfo_in() ;\\n\\t\\tprocess() ;\\n\\t}\\n\\t\\n\\tvoid info_in()\\n\\t{\\n\\t\\tScanner input = new Scanner(System.in) ;\\n\\t\\tint dx = input.nextInt() ;\\n\\t\\tint dy = input.nextInt() ;\\n\\t\\t\\n\\t\\tn = input.nextInt() ;\\n\\t\\tX = new int[n] ;\\n\\t\\tY = new int[n] ;\\n\\t\\t\\n\\t\\tfor( int i=0;i 0 ) {\\n\\t\\t\\t\\t\\tint val = d[i^(1< 0) {\\n\\t\\t\\t\\t\\t\\t\\tval = d[state^(1< 0 ) {\\n\\t\\t\\tint v1 = trace[gh] \\/ 100 - 1 ;\\n\\t\\t\\tint v2 = trace[gh] % 100 - 1 ;\\n\\t\\t\\tSystem.out.print(0 + \\\" \\\") ;\\n\\t\\t\\tif ( v1 != -1 ) {\\n\\t\\t\\t\\tSystem.out.print((v1+1) + \\\" \\\" ) ;\\n\\t\\t\\t\\tgh -= 1 << v1 ;\\n\\t\\t\\t}\\n\\t\\t\\tSystem.out.print( (v2+1) + \\\" \\\" ) ;\\n\\t\\t\\tgh -= 1 << v2 ;\\n\\t\\t}\\n\\t\\tSystem.out.println(0) ;\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\t\\tnew Round8_C() ;\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n static final int primeCount = 452;\\n static final int[] prime = new int[primeCount];\\n\\n static void build_prime() {\\n boolean[] notPrime = new boolean[3200];\\n for (int i = 2; i < 3200; i++) {\\n if (notPrime[i]) continue;\\n for (int j = i * i; j < 3200; j += i) {\\n notPrime[j] = true;\\n }\\n }\\n\\n int count = 0;\\n for (int i = 2; i < 3200; i++) {\\n if (notPrime[i]) continue;\\n\\n prime[count++] = i;\\n }\\n }\\n\\n private static void run(Reader in, PrintWriter out) throws IOException {\\n int n = in.nextInt();\\n int m = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = getReal(in.nextInt());\\n }\\n\\n int[] pre = new int[n];\\n for (int i = 0; i < n; i++) pre[i] = -1;\\n\\n TreeMap exist = new TreeMap<>();\\n for (int i = 0; i < n; i++) {\\n Integer result = exist.get(a[i]);\\n if (result != null) {\\n pre[i] = result;\\n }\\n exist.put(a[i], i);\\n }\\n\\n int[][] left = new int[m + 1][n];\\n for (int i = 0; i <= m; i++) {\\n int start = 0;\\n PriorityQueue inSame = new PriorityQueue<>();\\n for (int j = 0; j < n; j++) {\\n if (pre[j] >= start) {\\n inSame.add(pre[j]);\\n\\n if (inSame.size() > i) {\\n start = inSame.poll() + 1;\\n }\\n }\\n left[i][j] = start;\\n }\\n }\\n\\n int[][] dp = new int[n][m + 1];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j <= m; j++) {\\n dp[i][j] = Integer.MAX_VALUE;\\n }\\n for (int j = 0; j <= m; j++) {\\n for (int k = 0; k <= j; k++) {\\n if (left[k][i] == 0) {\\n dp[i][j] = 1;\\n ... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Solution {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner scanner = new Scanner(System.in);\\n\\t\\tComp c1 = getComp(scanner);\\n\\t\\tComp c2 = getComp(scanner);\\n\\t\\tc1.sortByPrice();\\n\\t\\tc2.sortByPrice();\\t\\n\\t\\tint i = 0;\\n\\t\\tint j = 0;\\n\\t\\twhile(i < c1.num || j < c2.num) {\\n\\t\\t\\tElem xi = (i < c1.num) ? c1.elems.get(i) : null;\\n\\t\\t\\tElem yj = (j < c2.num) ? c2.elems.get(j) : null;\\n\\t\\t\\tif(xi != null && yj != null) {\\n\\t\\t\\t\\tif(xi.price >= yj.price) {\\n\\t\\t\\t\\t\\tif(!c2.resultSet.contains(xi)) {\\n\\t\\t\\t\\t\\t\\tc1.resultSet.add(xi);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\ti++;\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tif(!c1.resultSet.contains(yj)) {\\n\\t\\t\\t\\t\\t\\tc2.resultSet.add(yj);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tj++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t} else\\n\\t\\t\\tif(xi != null) {\\n\\t\\t\\t\\tif(!c2.resultSet.contains(xi)) {\\n\\t\\t\\t\\t\\tc1.resultSet.add(xi);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\ti++;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tif(!c1.resultSet.contains(yj)) {\\n\\t\\t\\t\\t\\tc2.resultSet.add(yj);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tj++;\\n\\t\\t\\t}\\t\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong result = c1.getResultPrice() + c2.getResultPrice();\\n\\t\\tSystem.out.println(result);\\n }\\n \\n private static Comp getComp(Scanner scanner) {\\n\\t Comp c = new Comp();\\n\\t c.num = scanner.nextInt();\\n\\t for(int i = 0; i < c.num; i++) {\\n\\t\\t c.addElem(scanner.nextLong(), scanner.nextLong());\\n\\t }\\n\\t return c;\\n }\\n}\\n\\nclass Comp {\\n\\tint num;\\n\\tList elems = new ArrayList<>();\\n\\tSet resultSet = new HashSet<>();\\n\\t\\n\\tvoid addElem(long el, long pr) {\\n\\t\\tElem elem = new Elem(el, pr);\\n\\t\\telems.add(elem);\\n\\t}\\n\\t\\n\\tvoid sortByPrice() {\\n\\t\\tCollections.sort(elems);\\n\\t}\\n\\t\\n\\tlong getResultPrice() {\\n\\t\\tlong sumPrice = 0;\\n\\t\\tfor(Elem elem : resultSet) {\\n\\t\\t\\tsumPrice += elem.price;\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn sumPrice;\\n\\t}\\n}\\n\\nclass Elem implements Comparable {\\n\\tlong elem;\\n\\tlong price;\\n\\t\\n\\tpublic Elem(long el, long pr) {\\n\\t\\tthis.elem = el;\\n\\t\\tthis.price = pr;\\n\\t}\\n\\t\\n\\tpublic int compareTo(Elem other) {\\n\\t\\treturn (int) (other.price - price);\\n\\t}\\n\\t\\n\\tpublic boolean equals(Object o) {\\n\\t\\tif(!(o instanceof Elem)) {\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t\\t\\n\\t\\tElem other = (Elem) o;\\n\\t\\treturn (other.elem == elem);\\n\\t}\\n\\t\\n\\tpublic int hashCode() {\\n\\t\\treturn (int) elem;\\n\\t}\\n\\t\\n\\tpublic String toString() {\\n\\t\\treturn \\\"(\\\" + elem +... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\nimport java.lang.*;\\n\\n\\npublic class Main implements Runnable {\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private SpaceCharFilter filter;\\n private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars==-1)\\n throw new InputMismatchException();\\n\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n }\\n catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n\\n if(numChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n public String nextLine() {\\n String str = \\\"\\\";\\n try {\\n str = br.readLine();\\n }\\n catch (IOException e) {\\n e.printStackTrace();\\n }\\n return str;\\n }\\n public int nextInt() {\\n int c = read();\\n\\n while(isSpaceChar(c))\\n c = read();\\n\\n int sgn = 1;\\n\\n if (c == '-') {\\n sgn = -1;\\n c = read();\\n }\\n\\n int res = 0;\\n do {\\n if(c<'0'||c>'9')\\n throw new InputMismatchException();\\n res *= 10;\\n res += c - '0';\\n c = read();\\n }\\n while (!isSpaceChar(c));\\n\\n return res * sgn;\\n }\\n\\n public long nextLong() {\\n int c = read();\\n while (isSpaceChar(c))\\n c = read();\\n int sgn = 1;\\n if (c == '-') {\\n sgn = -1;\\n c =... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*; \\nimport java.util.*; \\n\\n\\npublic class p7{\\n\\t\\n\\tstatic class FastReader{ \\n\\t\\tBufferedReader br; \\n\\t\\tStringTokenizer st; \\n\\n\\t\\tpublic FastReader() \\n\\t\\t{ \\n\\t\\t\\tbr = new BufferedReader(new\\n\\t\\t\\t\\t\\tInputStreamReader(System.in)); \\n\\t\\t} \\n\\n\\t\\tString next() \\n\\t\\t{ \\n\\t\\t\\twhile (st == null || !st.hasMoreElements()) \\n\\t\\t\\t{ \\n\\t\\t\\t\\ttry\\n\\t\\t\\t\\t{ \\n\\t\\t\\t\\t\\tst = new StringTokenizer(br.readLine()); \\n\\t\\t\\t\\t} \\n\\t\\t\\t\\tcatch (IOException e) \\n\\t\\t\\t\\t{ \\n\\t\\t\\t\\t\\te.printStackTrace(); \\n\\t\\t\\t\\t} \\n\\t\\t\\t} \\n\\t\\t\\treturn st.nextToken(); \\n\\t\\t} \\n\\n\\t\\tint nextInt() \\n\\t\\t{ \\n\\t\\t\\treturn Integer.parseInt(next()); \\n\\t\\t} \\n\\n\\t\\tlong nextLong() \\n\\t\\t{ \\n\\t\\t\\treturn Long.parseLong(next()); \\n\\t\\t} \\n\\n\\t\\tdouble nextDouble() \\n\\t\\t{ \\n\\t\\t\\treturn Double.parseDouble(next()); \\n\\t\\t} \\n\\n\\t\\tString nextLine() \\n\\t\\t{ \\n\\t\\t\\tString str = \\\"\\\"; \\n\\t\\t\\ttry\\n\\t\\t\\t{ \\n\\t\\t\\t\\tstr = br.readLine(); \\n\\t\\t\\t} \\n\\t\\t\\tcatch (IOException e) \\n\\t\\t\\t{ \\n\\t\\t\\t\\te.printStackTrace(); \\n\\t\\t\\t} \\n\\t\\t\\treturn str; \\n\\t\\t} \\n\\t}\\n\\n\\tpublic static void main(String[] args) \\n\\t{ \\n FastReader sc = new FastReader(); \\n \\/\\/PrintWriter out = new PrintWriter(System.out); \\n int n = sc.nextInt();\\n\\t\\tint k = sc.nextInt();\\n\\t\\tlong one = (long)Math.pow(2, k) - 1;\\n\\t\\t\\n\\t\\tlong[] arr = new long[n+1];\\n\\t\\t\\n\\t\\tarr[0] = 0;\\n\\t\\tfor(int i=1;i<=n;i++){\\n\\t\\t\\tarr[i] = sc.nextLong();\\n\\t\\t\\tarr[i] ^= arr[i-1];\\n\\t\\t}\\n\\n\\t\\tMap count = new HashMap<>();\\n\\n\\t\\tfor(int i=0;i<=n;i++){\\n\\t\\t\\tLong key = Math.min(arr[i], (arr[i]^one));\\n\\t\\t\\tLong val = count.get(key);\\n\\t\\t\\tif(val==null) val = 0L;\\n\\t\\t\\tcount.put(key, val+1);\\n\\t\\t}\\n\\n\\t\\tlong num = n;\\n\\t\\tlong ans = num*(num+1)\\/2;\\n\\t\\t\\n\\t\\tfor(Map.Entry ent: count.entrySet()){\\n\\t\\t\\t\\n\\t\\t\\tLong cnt = ent.getValue();\\n\\t\\t\\t\\n\\t\\t\\tlong num1 = cnt\\/2;\\n\\t\\t\\tlong num2 = (cnt+1)\\/2;\\n\\t\\t\\t\\n\\t\\t\\tans -= ( (num1*(num1-1))\\/2 );\\n\\t\\t\\tans -= ( (num2*(num2-1))\\/2 );\\n\\t\\t}\\n\\n\\t\\tSystem.out.println(ans);\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Solution {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner scanner = new Scanner(System.in);\\n\\t\\tComp c1 = getComp(scanner);\\n\\t\\tComp c2 = getComp(scanner);\\n\\t\\tc1.sortByPrice();\\n\\t\\tc2.sortByPrice();\\t\\n\\t\\tint i = 0;\\n\\t\\tint j = 0;\\n\\t\\twhile(i < c1.num || j < c2.num) {\\n\\t\\t\\tElem xi = (i < c1.num) ? c1.elems.get(i) : null;\\n\\t\\t\\tElem yj = (j < c2.num) ? c2.elems.get(j) : null;\\n\\t\\t\\tif(xi != null && yj != null) {\\n\\t\\t\\t\\tif(xi.price >= yj.price) {\\n\\t\\t\\t\\t\\tif(!c2.resultSet.contains(xi)) {\\n\\t\\t\\t\\t\\t\\tc1.resultSet.add(xi);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\ti++;\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tif(!c1.resultSet.contains(yj)) {\\n\\t\\t\\t\\t\\t\\tc2.resultSet.add(yj);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tj++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t} else\\n\\t\\t\\tif(xi != null) {\\n\\t\\t\\t\\tif(!c2.resultSet.contains(xi)) {\\n\\t\\t\\t\\t\\tc1.resultSet.add(xi);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\ti++;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tif(!c1.resultSet.contains(yj)) {\\n\\t\\t\\t\\t\\tc2.resultSet.add(yj);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tj++;\\n\\t\\t\\t}\\t\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong result = c1.getResultPrice() + c2.getResultPrice();\\n\\t\\tSystem.out.println(result);\\n }\\n \\n private static Comp getComp(Scanner scanner) {\\n\\t Comp c = new Comp();\\n\\t c.num = scanner.nextInt();\\n\\t for(int i = 0; i < c.num; i++) {\\n\\t\\t c.addElem(scanner.nextLong(), scanner.nextLong());\\n\\t }\\n\\t return c;\\n }\\n}\\n\\nclass Comp {\\n\\tint num;\\n\\tList elems = new ArrayList<>();\\n\\tSet resultSet = new HashSet<>();\\n\\t\\n\\tvoid addElem(long el, long pr) {\\n\\t\\tElem elem = new Elem(el, pr);\\n\\t\\telems.add(elem);\\n\\t}\\n\\t\\n\\tvoid sortByPrice() {\\n\\t\\tCollections.sort(elems);\\n\\t}\\n\\t\\n\\tlong getResultPrice() {\\n\\t\\tlong sumPrice = 0;\\n\\t\\tfor(Elem elem : resultSet) {\\n\\t\\t\\tsumPrice += elem.price;\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn sumPrice;\\n\\t}\\n}\\n\\nclass Elem implements Comparable {\\n\\tlong elem;\\n\\tlong price;\\n\\t\\n\\tpublic Elem(long el, long pr) {\\n\\t\\tthis.elem = el;\\n\\t\\tthis.price = pr;\\n\\t}\\n\\t\\n\\tpublic int compareTo(Elem other) {\\n\\t\\treturn (int) (other.price - price);\\n\\t}\\n\\t\\n\\tpublic boolean equals(Object o) {\\n\\t\\tif(!(o instanceof Elem)) {\\n\\t\\t\\treturn false;\\n\\t\\t}\\n\\t\\t\\n\\t\\tElem other = (Elem) o;\\n\\t\\treturn (other.elem == elem);\\n\\t}\\n\\t\\n\\tpublic int hashCode() {\\n\\t\\treturn (int) elem;\\n\\t}\\n\\t\\n\\tpublic String toString() {\\n\\t\\treturn \\\"(\\\" + elem +... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.lang.reflect.Array;\\nimport java.util.*;\\nimport java.util.regex.*;\\n\\/\\/import java.math.*;\\n\\/\\/import static java.lang.Math.*;\\n\\/\\/import static java.util.Arrays.*;\\n \\npublic class Main{\\n public static void main(String[] args) throws IOException { \\/\\/1-checker 2-console\\n \\/\\/if (args.length==2) open(args[0], args[1], true, false); else open (\\\"input.txt\\\", \\\"output.txt\\\", true, false);\\n open (\\\"input.txt\\\", \\\"output.txt\\\", false, true);\\n char[] alph = \\\" ABCDEFGHIJKLMNOPQRSTUVWXYZ\\\".toCharArray();\\n Pattern pat = Pattern.compile(\\\"[A-Z]+[\\\\\\\\d]+\\\");\\n Matcher mat;\\n boolean b ;\\n String s;\\n int index, coef, row, col;\\n int n = nextInt();\\n String[] tmp;\\n char[] c;\\n for (int i=0; i='0' && c[index]<='9')\\n {\\n row += (c[index]-'0')*coef;\\n coef*=10;\\n index--;\\n }\\n coef = 1;\\n col = 0;\\n while (index>=0)\\n {\\n \\/*if (coef!=1)*\\/ col += (Arrays.binarySearch(alph, c[index]))*coef;\\n \\/\\/else col += (Arrays.binarySearch(alph, c[index]))*coef;\\n coef*=26;\\n index--;\\n }\\n out.println(\\\"R\\\"+row+\\\"C\\\"+col);\\n }\\n else\\n {\\n tmp = s.split(\\\"R|C\\\");\\n \\/\\/out.print(tmp.length);\\n \\/\\/row = Integer.parseInt(tmp[1]);\\n col = Integer.parseInt(tmp[2]);\\n char[] temp = new char[10];\\n int len = 0;\\n int v = 0;\\n while (col>0)\\n {\\n index =... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/*\\n * To change this license header, choose License Headers in Project Properties.\\n * To change this template file, choose Tools | Templates\\n * and open the template in the editor.\\n *\\/\\n\\n\\/\\/package NumberTheory;\\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\/**\\n *\\n * @author Sourav Kumar Paul\\n *\\/\\npublic class A235 {\\n public static void main(String[] args) throws IOException{\\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\\n long n = Long.parseLong(reader.readLine());\\n \\/\\/int gcd = gcd(924,923);\\n \\/\\/System.out.println(gcd);\\n \\/\\/ System.out.println(gcd(923,461));\\n if(n<=2)\\n System.out.println(n);\\n else if(n==3)\\n System.out.println(\\\"6\\\");\\n \\n else if(n % 2== 0)\\n {\\n if(n % 3 == 0)\\n {\\n System.out.println((n-3)*(n-1)*(n-2));\\n }\\n else\\n \\n System.out.println(n * (n-1) * (n-3) );\\n }\\n else\\n System.out.println(n*(n-1)*(n-2));\\n }\\n private static int gcd(int i, int j) {\\n int a = Math.min(i,j);\\n int b = Math.max(i,j);\\n while(a != 0)\\n {\\n int temp = b % a;\\n b = a;\\n a = temp;\\n }\\n return b;\\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author cunbidun\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n BSportMafia solver = new BSportMafia();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class BSportMafia {\\n private InputReader in;\\n private OutputWriter out;\\n\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n this.in = in;\\n this.out = out;\\n long n = in.nextInt();\\n long k = in.nextInt();\\n for (long i = 1; i * (i + 1) \\/ 2 + i <= n + k; i++) {\\n if (i * (i + 1) \\/ 2 + i == n + k) {\\n out.println(n - i);\\n return;\\n }\\n }\\n }\\n\\n }\\n\\n static class InputReader extends InputStream {\\n private InputStream stream;\\n private byte[] buf = new byte[1 << 16];\\n private int curChar;\\n private int numChars;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1) {\\n throw new InputMismatchException();\\n }\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n if (numChars... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class B {\\n\\n\\tpublic static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\tpublic static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\treadInput();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tstatic boolean sq(long x) {\\n\\t\\tlong l = 1;\\n\\t\\tlong r = (int)Math.sqrt(1e16)+1;\\n\\t\\twhile (l+1>1;\\n\\t\\t\\tif (m * m > x) r = m;\\n\\t\\t\\telse l = m;\\n\\t\\t}\\n\\t\\treturn l*l == x;\\n\\t}\\n\\t\\n\\tstatic boolean solve(long x) {\\n\\t\\tif ((x&1)==1) return false;\\n\\t\\tif ((x & (x-1)) == 0) return true;\\n\\t\\tlong num = 2;\\n\\t\\twhile (num < x && x % num == 0) {\\n\\t\\t\\tif (sq(x\\/num)) return true;\\n\\t\\t\\tnum*=2;\\n\\t\\t}\\n\\t\\treturn false;\\n\\t}\\n\\t\\n\\tpublic static void readInput() throws IOException {\\n\\t\\t\\/\\/ br = new BufferedReader(new FileReader(\\\".in\\\"));\\n\\t\\t\\/\\/ out = new PrintWriter(new FileWriter(\\\".out\\\"));\\n\\t\\tint t = Integer.parseInt(br.readLine());\\n\\t\\twhile (t-->0) {\\n\\t\\t\\tint x = Integer.parseInt(br.readLine());\\n\\t\\t\\tout.println(solve(x) ? \\\"YES\\\":\\\"NO\\\");\\n\\t\\t}\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\n\\/**\\n * @author Vaibhav Mittal\\n *\\/\\n\\npublic class Main {\\n public static void main(String[] args) throws Exception {\\n Scanner in = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n\\n int testCases = 1;\\n Task solver = new Task();\\n for (int i = 1; i <= testCases; ++i)\\n solver.solve(in, out);\\n\\n out.close();\\n }\\n}\\n\\nclass Task {\\n public void solve(Scanner in, PrintWriter out) {\\n int n = in.nextInt();\\n int a = in.nextInt();\\n int b = in.nextInt();\\n int[] complexity = new int[n];\\n for (int i = 0; i < n; ++i)\\n complexity[i] = in.nextInt();\\n Arrays.sort(complexity);\\n out.println(complexity[b] - complexity[b - 1]);\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\npublic class phoenix_and_computers {\\n\\n\\tpublic static void main(String[] args) throws NumberFormatException, IOException {\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\n\\t\\tString[] st = br.readLine().split(\\\" \\\");\\n\\t\\tint n = Integer.parseInt(st[0]);\\n\\t\\tint m = Integer.parseInt(st[1]);\\n\\n\\t\\tlong[][] ncr = ncrcoll(405, 405, m);\\n\\t\\tint[] p2 = new int[n + 1];\\n\\t\\tp2[0] = 1;\\n\\t\\tfor (int i = 1; i < p2.length; i++) {\\n\\t\\t\\tp2[i] = 2 * p2[i - 1] % m;\\n\\t\\t}\\n\\n\\t\\tlong[][] dp = new long[405][405];\\n\\t\\tdp[0][0] = 1;\\n\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tfor (int j = 0; j <= i; j++) {\\n\\t\\t\\t\\tfor (int k = 1; i + k <= n; k++) {\\n\\t\\t\\t\\t\\tdp[i + k + 1][j + k] += ((dp[i][j] * p2[k - 1]) % m * ncr[j + k][k]);\\n\\t\\t\\t\\t\\tdp[i + k + 1][j + k] %= m;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tlong ans = 0;\\n\\t\\tfor (int i = 0; i <= n; i++) {\\n\\t\\t\\tans = (ans + dp[n + 1][i]) % m;\\n\\t\\t}\\n\\n\\t\\tSystem.out.println(ans);\\n\\t}\\n\\n\\tstatic long[][] ncrcoll(int n, int k, int p) {\\n\\t\\tlong[][] arr = new long[n + 1][k + 1];\\n\\t\\tfor (int i = 1; i < arr.length; i++) {\\n\\t\\t\\tarr[i][0] = 1;\\n\\t\\t}\\n\\t\\tfor (int i = 1; i < arr.length; i++) {\\n\\t\\t\\tfor (int j = 1; j <= i && j < arr[0].length; j++) {\\n\\t\\t\\t\\tif (i == 1 && j == 1) {\\n\\t\\t\\t\\t\\tarr[i][j] = 1;\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tarr[i][j] = (arr[i - 1][j] + arr[i - 1][j - 1]) % (p);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn arr;\\n\\t}\\n\\n\\tpublic static long xpown(long x, long n) {\\n\\t\\tlong res = 1;\\n\\t\\twhile (n > 0) {\\n\\t\\t\\tif (n % 2 != 0) {\\n\\t\\t\\t\\tres = (res * x) % 1000000007;\\n\\t\\t\\t\\tn--;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tx = (x * x) % 1000000007;\\n\\t\\t\\t\\tn = n \\/ 2;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\nimport java.util.StringTokenizer;\\n\\n\\/**\\n * Created with IntelliJ IDEA.\\n * User: Саша\\n * Date: 08.08.12\\n * Time: 14:12\\n *\\/\\npublic class LuckyDivision {\\n\\n public final String check (String s) {\\n String result = \\\"NO\\\";\\n StringTokenizer stringTokenizer = new StringTokenizer(s, \\\"47\\\");\\n if(!stringTokenizer.hasMoreTokens()) return \\\"YES\\\";\\n int S = Integer.parseInt(s);\\n generateSimpleAndDivide(S, 4, 4, 7);\\n generateSimpleAndDivide(S, 7, 4, 7);\\n if(lucky) return \\\"YES\\\";\\n return result;\\n }\\n public static final void main(String[] args) {\\n Scanner scanner = new Scanner(System.in);\\n System.out.print(new LuckyDivision().check(scanner.next()));\\n }\\n\\n public void generateSimpleAndDivide(int divided, int n, int n1, int n2) {\\n if(lucky || n >= divided) return;\\n if(divided % n == 0) lucky = true;\\n generateSimpleAndDivide(divided, Integer.parseInt(n + \\\"\\\" + n1), n1, n2);\\n generateSimpleAndDivide(divided, Integer.parseInt(n + \\\"\\\" + n2), n1, n2);\\n }\\n private boolean lucky = false;\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\npublic class B {\\n static class Scan {\\n private byte[] buf=new byte[1024];\\n private int index;\\n private InputStream in;\\n private int total;\\n public Scan()\\n {\\n in=System.in;\\n }\\n public int scan()throws IOException\\n {\\n if(total<0)\\n throw new InputMismatchException();\\n if(index>=total)\\n {\\n index=0;\\n total=in.read(buf);\\n if(total<=0)\\n return -1;\\n }\\n return buf[index++];\\n }\\n public int scanInt()throws IOException\\n {\\n int integer=0;\\n int n=scan();\\n while(isWhiteSpace(n))\\n n=scan();\\n int neg=1;\\n if(n=='-')\\n {\\n neg=-1;\\n n=scan();\\n }\\n while(!isWhiteSpace(n))\\n {\\n if(n>='0'&&n<='9')\\n {\\n integer*=10;\\n integer+=n-'0';\\n n=scan();\\n }\\n else throw new InputMismatchException();\\n }\\n return neg*integer;\\n }\\n public double scanDouble()throws IOException\\n {\\n double doub=0;\\n int n=scan();\\n while(isWhiteSpace(n))\\n n=scan();\\n int neg=1;\\n if(n=='-')\\n {\\n neg=-1;\\n n=scan();\\n }\\n while(!isWhiteSpace(n)&&n!='.')\\n {\\n if(n>='0'&&n<='9')\\n {\\n doub*=10;\\n doub+=n-'0';\\n n=scan();\\n }\\n else throw new InputMismatchException();\\n }\\n if(n=='.')\\n {\\n n=scan();\\n double temp=1;\\n while(!isWhiteSpace(n))\\n {\\n if(n>='0'&&n<='9')\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class Main{\\n public static void main(String[] args) {\\n long n,k;\\n Scanner s= new Scanner(System.in);\\n\\tn=s.nextInt();\\n\\tk=s.nextInt();\\n\\tSystem.out.println((int)(n-((-3+Math.sqrt(9+8*(n+k)))\\/2))); \\n }\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\/*\\n * Heart beats fast\\n * \\t\\tColors and promises\\n * \\t\\t\\tHow to be brave\\n * \\t\\t\\t\\tHow can I love when I am afraid...\\n *\\/\\n\\/\\/read the question correctly (is y a vowel? what are the exact constraints?)\\n\\/\\/look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)\\n\\/\\/always declare multidimensional arrays as [2][n] not [n][2]\\n\\/\\/it can lead to upto 2-3x diff in runtime\\n\\/\\/declare int\\/long tries with 16 array size due to object overhead :D\\npublic class Main\\n{\\n\\t\\n\\tpublic static void main(String[] args) throws Exception\\n\\t{\\n\\t\\tint n=ni();\\n\\t\\tMap hola=new HashMap();\\n\\t\\thola.put(\\\"S\\\", 0);\\n\\t\\thola.put(\\\"XS\\\", 0);\\n\\t\\thola.put(\\\"XXS\\\", 0);\\n\\t\\thola.put(\\\"XXXS\\\", 0);\\n\\t\\thola.put(\\\"M\\\", 0);\\n\\t\\thola.put(\\\"L\\\", 0);\\n\\t\\thola.put(\\\"XL\\\", 0);\\n\\t\\thola.put(\\\"XXL\\\", 0);\\n\\t\\thola.put(\\\"XXXL\\\", 0);\\n\\t\\tfor(int i=0; i0)\\n\\t\\t{\\n\\t\\t\\tif(b%2!=0)\\n\\t\\t\\t\\tc*=a;\\n\\t\\t\\ta*=a;\\n\\t\\t}\\n\\t\\treturn c;\\n\\t}\\n\\tstatic class pair\\n\\t{\\n\\t\\tint a, b;\\n\\t\\tpair(){}\\n\\t\\tpair(int c,int d){a=c;b=d;}\\n\\t}\\n\\tstatic interface combiner\\n\\t{\\n\\t\\tpublic long combine(long a,long b);\\n\\t}\\n\\tstatic final long mod=1000000007;\\n\\tstatic final double eps=1e-9;\\n\\tstatic final long inf=100000000000000000L;\\n\\tstatic Reader in=new Reader();\\n\\tstatic StringBuilder output=new StringBuilder();\\n\\tstatic Random rn=new Random();\\n\\tstatic void reverse(int[]a){for(int i=0; i= 0 && c <= ' ')\\n c = in.read();\\n if (c < 0)\\n return \\\"\\\";\\n while (c > ' ') {\\n b.append((char) c);\\n c = in.read();\\n }\\n return b.toString();\\n }\\n\\n public static void main(String[] args) {\\n \\/\\/ Locale.setDefault(Locale.US);\\n new Thread(new Hexadec()).start();\\n }\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.ArrayList;\\nimport java.util.List;\\nimport java.util.Scanner;\\n\\npublic class A {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tint n = scan.nextInt();\\n\\t\\tint k = scan.nextInt()-1;\\n\\t\\tPrimeGen p = new PrimeGen(n);\\n\\t\\tList prims = new ArrayList();\\n\\t\\tfor(int i = 2; i <= n; i++){\\n\\t\\t\\tif(p.isPrime(i)>0){\\n\\t\\t\\t\\tprims.add(i);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint sum = 0;\\n\\t\\tfor(int i = 0; i < prims.size() - 1; i++){\\n\\t\\t\\tint c = prims.get(i) + prims.get(i+1) + 1;\\n\\t\\t\\tif(c <= n && p.isPrime(c)>0){\\n\\t\\t\\t\\tsum ++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(sum>=k?\\\"YES\\\":\\\"NO\\\");\\n\\t}\\n\\n\\tstatic int sum(List is) {\\n\\t\\tint c = 0;\\n\\t\\tfor (int i : is)\\n\\t\\t\\tc += i;\\n\\t\\treturn c;\\n\\t}\\n\\t\\n\\tstatic class PrimeGen {\\n\\t\\tpublic PrimeGen(int m) {\\n\\t\\t\\tm = (int) Math.sqrt(m);\\n\\t\\t\\tdouble max = 0;\\n\\t\\t\\tint r = 1;\\n\\t\\t\\tfor (int i = 0; i < 4;) {\\n\\t\\t\\t\\tmax += r * m \\/ Math.pow(Math.log1p(m), ++i);\\n\\t\\t\\t\\tr *= i;\\n\\t\\t\\t}\\n\\t\\t\\tp = new int[(int) max];\\n\\t\\t\\tfor (int i = 0, e = 2; i < p.length; i++) {\\n\\t\\t\\t\\tfor (; isPrime(e) < 1; e++)\\n\\t\\t\\t\\t\\t;\\n\\t\\t\\t\\tp[i] = e++;\\n\\t\\t\\t}\\n\\t\\t\\tthis.m = p[p.length - 1];\\n\\t\\t\\tthis.m = this.m * this.m;\\n\\t\\t}\\n\\n\\t\\tint isPrime(int n) {\\n\\t\\t\\tfor (int e : p)\\n\\t\\t\\t\\tif (e < 1)\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\telse if (n != e && n % e < 1)\\n\\t\\t\\t\\t\\treturn 0;\\n\\t\\t\\treturn 1;\\n\\t\\t}\\n\\n\\t\\tint max() {\\n\\t\\t\\treturn m;\\n\\t\\t}\\n\\n\\t\\tint[] p;\\n\\t\\tint m;\\n\\t}\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.NoSuchElementException;\\n\\npublic class D {\\n\\n int N,M;\\n int[] a,l,r;\\n\\n private void solve() {\\n N = nextInt();\\n\\n a = new int[N];\\n for(int i = 0;i < N;i++) {\\n a[i] = nextInt();\\n }\\n\\n M = nextInt();\\n\\n l = new int[M];\\n r = new int[M];\\n for(int i = 0;i < M;i++) {\\n l[i] = nextInt();\\n r[i] = nextInt();\\n }\\n\\n int count = 0;\\n for(int i = 0;i < N - 1;i++) {\\n for(int j = i + 1;j < N;j++) if (a[i] > a[j]) {\\n count++;\\n }\\n }\\n\\n for(int i = 0;i < M;i++) {\\n count += (r[i] - l[i] + 1) * (r[i] - l[i]) \\/ 2;\\n count %= 2;\\n out.println(count == 0 ? \\\"even\\\" : \\\"odd\\\");\\n }\\n }\\n\\n public static void main(String[] args) {\\n out.flush();\\n new D().solve();\\n out.close();\\n }\\n\\n \\/* Input *\\/\\n private static final InputStream in = System.in;\\n private static final PrintWriter out = new PrintWriter(System.out);\\n private final byte[] buffer = new byte[2048];\\n private int p = 0;\\n private int buflen = 0;\\n\\n private boolean hasNextByte() {\\n if (p < buflen)\\n return true;\\n p = 0;\\n try {\\n buflen = in.read(buffer);\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n if (buflen <= 0)\\n return false;\\n return true;\\n }\\n\\n public boolean hasNext() {\\n while (hasNextByte() && !isPrint(buffer[p])) {\\n p++;\\n }\\n return hasNextByte();\\n }\\n\\n private boolean isPrint(int ch) {\\n if (ch >= '!' && ch <= '~')\\n return true;\\n return false;\\n }\\n\\n private int nextByte() {\\n if (!hasNextByte())\\n return -1;\\n return buffer[p++];\\n }\\n\\n public String next() {\\n if (!hasNext())\\n throw new NoSuchElementException();\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n FastScanner in = new FastScanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n public void solve(int testNumber, FastScanner in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = in.nextInt();\\n }\\n Arrays.sort(a);\\n boolean[] dead = new boolean[n];\\n int ans = 0;\\n for (int i = 0; i < n; i++) {\\n if (dead[i]) {\\n continue;\\n }\\n ++ans;\\n for (int j = i; j < n; j++) {\\n if (a[j] % a[i] == 0) {\\n dead[j] = true;\\n }\\n }\\n }\\n out.println(ans);\\n }\\n\\n }\\n\\n static class FastScanner {\\n private BufferedReader in;\\n private StringTokenizer st;\\n\\n public FastScanner(InputStream stream) {\\n in = new BufferedReader(new InputStreamReader(stream));\\n }\\n\\n public String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(in.readLine());\\n } catch (IOException e) {\\n throw new RuntimeException(e);\\n }\\n }\\n return st.nextToken();\\n }\\n\\n ... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class C\\n{\\n\\n\\tstatic FastIO f;\\n\\n\\tpublic static void main(String args[]) throws IOException\\n\\t{\\n\\t\\tf = new FastIO();\\n\\n\\t\\tint t, n, a, i;\\n\\t\\tNode r, p, c;\\n\\t\\t\\n\\t\\tt = f.ni();\\n\\t\\t\\n\\t\\twhile(t-->0)\\n\\t\\t{\\n\\t\\t\\tn = f.ni();\\n\\t\\t\\tr = p = new Node(-1, null);\\n\\t\\t\\t\\/\\/ f.out(\\\"1\\\\n\\\");\\n\\n\\t\\t\\tfor(i = 0; i < n; i++)\\n\\t\\t\\t{\\n\\t\\t\\t\\ta = f.ni();\\n\\t\\t\\t\\tif(a != 1)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\twhile(a != p.i + 1)\\n\\t\\t\\t\\t\\t\\tp = p.p;\\n\\t\\t\\t\\t\\tp = p.p;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\/\\/ if(a == p.i + 1)\\n\\t\\t\\t\\t\\/\\/ \\tp = p.p;\\n\\t\\t\\t\\t\\/\\/ else if(p.p != null && a == p.p.i + 1)\\n\\t\\t\\t\\t\\/\\/ \\tp = p.p.p;\\n\\t\\t\\t\\tc = new Node(a, p);\\n\\t\\t\\t\\tp.c.add(c);\\n\\t\\t\\t\\tp = c;\\n\\t\\t\\t}\\n\\n\\t\\t\\tdfs(r, \\\"\\\");\\n\\t\\t}\\n\\n\\t\\tf.flush();\\n\\t}\\n\\n\\tpublic static void dfs(Node n, String s) throws IOException\\n\\t{\\n\\t\\tString t;\\n\\n\\t\\tif(n.i == -1)\\n\\t\\t\\tt = s;\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\tt = s + n.i + \\\".\\\";\\n\\t\\t\\tf.out(s + n.i + \\\"\\\\n\\\");\\n\\t\\t}\\n\\n\\t\\tfor(Node c : n.c)\\n\\t\\t\\tdfs(c, t);\\n\\t}\\n\\n\\tstatic class Node\\n\\t{\\n\\t\\tint i;\\n\\t\\tNode p;\\n\\t\\tArrayList c;\\n\\t\\n\\t\\tNode(int x, Node y)\\n\\t\\t{\\n\\t\\t\\ti = x;\\n\\t\\t\\tp = y;\\n\\t\\t\\tc = new ArrayList<>();\\n\\t\\t}\\n\\t\\n\\t\\t@Override\\n\\t\\tpublic int hashCode()\\n\\t\\t{\\n\\t\\t\\treturn super.hashCode();\\n\\t\\t}\\n\\t\\n\\t\\t@Override\\n\\t\\tpublic boolean equals(Object obj)\\n\\t\\t{\\n\\t\\t\\tNode that = (Node)obj;\\n\\t\\n\\t\\t\\treturn super.equals(obj);\\n\\t\\t}\\n\\t\\n\\t\\t@Override\\n\\t\\tpublic String toString()\\n\\t\\t{\\n\\t\\t\\treturn \\\"[\\\" + \\\"PARAMETERS\\\" + \\\"]\\\";\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static class FastIO\\n\\t{\\n\\t\\tBufferedReader br;\\n\\t\\tBufferedWriter bw, be;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic FastIO()\\n\\t\\t{\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tbw = new BufferedWriter(new OutputStreamWriter(System.out));\\n\\t\\t\\tbe = new BufferedWriter(new OutputStreamWriter(System.err));\\n\\t\\t\\tst = new StringTokenizer(\\\"\\\");\\n\\t\\t}\\n\\n\\t\\tprivate void read() throws IOException\\n\\t\\t{\\n\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t}\\n\\n\\t\\tpublic String ns() throws IOException\\n\\t\\t{\\n\\t\\t\\twhile(!st.hasMoreTokens())\\n\\t\\t\\t\\tread();\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int ni() throws IOException\\n\\t\\t{\\n\\t\\t\\treturn Integer.parseInt(ns());\\n\\t\\t}\\n\\n\\t\\tpublic long nl() throws IOException\\n\\t\\t{\\n\\t\\t\\treturn Long.parseLong(ns());\\n\\t\\t}\\n\\n\\t\\tpublic float nf() throws IOException\\n\\t\\t{\\n\\t\\t\\treturn... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\npublic class Main {\\n\\n\\tprivate static void solve() {\\n\\t\\tint n = ni();\\n\\t\\tdouble r = ni();\\n\\n\\t\\tdouble[][] p = new double[n][2];\\n\\t\\tdouble EPS = 0.0000000000001;\\n\\n\\t\\tfor (int i = 0; i < n; i ++) {\\n\\t\\t\\tdouble x = ni();\\n\\t\\t\\tdouble y = r;\\n\\t\\t\\tfor (int j = 0; j < i; j ++) {\\n\\t\\t\\t\\tdouble dx = Math.abs(p[j][0] - x);\\n\\t\\t\\t\\tif (dx <= r * 2 + EPS) {\\n\\t\\t\\t\\t\\tdouble dy = Math.sqrt(4.0 * r * r - dx * dx);\\n\\t\\t\\t\\t\\ty = Math.max(y, p[j][1] + dy);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tout.printf(\\\"%.12f \\\", y);\\n\\t\\t\\tp[i][0] = x;\\n\\t\\t\\tp[i][1] = y;\\n\\t\\t}\\n\\t\\tout.println();\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew Thread(null, new Runnable() {\\n\\t\\t\\t@Override\\n\\t\\t\\tpublic void run() {\\n\\t\\t\\t\\tlong start = System.currentTimeMillis();\\n\\t\\t\\t\\tString debug = args.length > 0 ? args[0] : null;\\n\\t\\t\\t\\tif (debug != null) {\\n\\t\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\t\\tis = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));\\n\\t\\t\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\treader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);\\n\\t\\t\\t\\tsolve();\\n\\t\\t\\t\\tout.flush();\\n\\t\\t\\t\\ttr((System.currentTimeMillis() - start) + \\\"ms\\\");\\n\\t\\t\\t}\\n\\t\\t}, \\\"\\\", 64000000).start();\\n\\t}\\n\\n\\tprivate static java.io.InputStream is = System.in;\\n\\tprivate static java.io.PrintWriter out = new java.io.PrintWriter(System.out);\\n\\tprivate static java.util.StringTokenizer tokenizer = null;\\n\\tprivate static java.io.BufferedReader reader;\\n\\n\\tpublic static String next() {\\n\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\ttokenizer = new java.util.StringTokenizer(reader.readLine());\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn tokenizer.nextToken();\\n\\t}\\n\\n\\tprivate static double nd() {\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\n\\tprivate static long nl() {\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\n\\tprivate static int[] na(int n) {\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\ta[i] = ni();\\n\\t\\treturn a;\\n\\t}\\n\\n\\tprivate static char[] ns() {\\n\\t\\treturn next().toCharArray();\\n\\t}\\n\\n\\tprivate static long[] nal(int n) {\\n\\t\\tlong[] a = new long[n];\\n\\t\\tfor (int i = 0; i < n;... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import javax.print.DocFlavor;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\npublic class Round584_a {\\n public static void main(String[] args) throws Exception {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer st;\\n\\n int n = Integer.parseInt(br.readLine());\\n st = new StringTokenizer(br.readLine());\\n int a[] = new int[n];\\n for(int i=0 ; i b) break;\\n if (((a>>ind) != (b>>ind)) || diff >= res)\\n tot += res;\\n ind++;\\n }\\n System.out.println(tot);\\n } \\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.FileWriter;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.io.ObjectInputStream.GetField;\\nimport java.security.KeyStore.Entry;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collection;\\nimport java.util.Collections;\\nimport java.util.HashMap;\\nimport java.util.HashSet;\\nimport java.util.LinkedList;\\nimport java.util.PriorityQueue;\\nimport java.util.Queue;\\nimport java.util.Stack;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\nimport java.util.TreeSet;\\n\\nimport javax.swing.JLabel;\\n\\npublic class codeforcesreturn {\\n\\tstatic class edge {\\n\\t\\tint u;\\n\\t\\tint v;\\n\\n\\t\\tpublic edge(int u, int v) {\\n\\t\\t\\tthis.u = u;\\n\\t\\t\\tthis.v = v;\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic ArrayList[] adjlist;\\n\\tstatic int[][] adjmatrix;\\n\\tstatic int[][] adjmatrix2;\\n\\tstatic boolean[] vis;\\n\\tstatic boolean[] intialvis;\\n\\tstatic boolean[] vis2;\\n\\tstatic int[] counter;\\n\\tstatic int V, E;\\n\\tstatic Stack st;\\n\\tstatic ArrayList arrylist;\\n\\tstatic boolean flag;\\n\\tstatic int[] dx = new int[] { 1, -1, 0, 0 };\\n\\tstatic int[] dy = new int[] { 0, 0, 1, -1 };\\n\\tstatic int[] Arr;\\n\\tstatic PrintWriter pw;\\n\\tstatic boolean ans = true;;\\n\\n\\tpublic static long gcd(long u, long v) {\\n\\t\\tif (u == 0)\\n\\t\\t\\treturn v;\\n\\t\\treturn gcd(v % u, u);\\n\\t}\\n\\n\\tpublic static void bib(int u) {\\n\\n\\t\\tvis[u] = true;\\n\\t\\tfor (int v : adjlist[u]) {\\n\\t\\t\\tif (!vis[v]) {\\n\\t\\t\\t\\tcounter[v] = 1 ^ counter[u];\\n\\t\\t\\t\\tbib(v);\\n\\t\\t\\t} else if (counter[v] != (1 ^ counter[u]))\\n\\t\\t\\t\\tans = false;\\n\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\t\\/\\/ FileWriter f = new FileWriter(\\\"C:\\\\\\\\Users\\\\\\\\Hp\\\\\\\\Desktop\\\\\\\\out.txt\\\");\\n\\t\\tPrintWriter pw = new PrintWriter(System.out);\\n\\t\\tint n = sc.nextInt();\\n\\t\\tint k = sc.nextInt();\\n\\t\\tint sum = n;\\n\\n\\t\\tfor (long i = 0; i < 1e5; i++) {\\n\\t\\t\\tif (i * (i + 1) \\/ 2 - (n - i) == k) {\\n\\t\\t\\t\\tSystem.out.println(n - i);\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\t\\tStringTokenizer... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\npublic class A {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew A().run();\\n\\t}\\n\\n\\tprivate void run() {\\n\\t\\tScanner sc =new Scanner(System.in);\\n\\t\\tint n = sc.nextInt();\\n\\t\\tint k = sc.nextInt();\\n\\t\\tsc.close();\\n\\t\\tboolean[] isp = new boolean[n + 1];\\n\\t\\tArrays.fill(isp, true);\\n\\t\\tisp[1] = false;\\n\\t\\tint[] primes = new int[n];\\n\\t\\tint pc = 0;\\n\\t\\tfor (int i = 2; i <= n; i++) {\\n\\t\\t\\tif (isp[i]) {\\n\\t\\t\\t\\tprimes[pc++] = i;\\n\\t\\t\\t\\tfor (int j = i * i; j <= n; j+= i) {\\n\\t\\t\\t\\t\\tisp[j] = false;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint res = 0;\\n\\t\\tfor (int i = 0; i < pc; i++) {\\n\\t\\t\\tfor (int j = 1; j < i; j++)\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tif (primes[i] == primes[j] + primes[j - 1] + 1)\\n\\t\\t\\t\\t\\t\\tres++;\\n\\t\\t}\\n\\t\\tSystem.out.println(res >= k ? \\\"YES\\\" : \\\"NO\\\");\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.math.*;\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class Test5 {\\n public static void main(String[] z){\\n StreamTokenizer st = new StreamTokenizer(new InputStreamReader(System.in));\\n PrintWriter pw = new PrintWriter(System.out);\\n Scanner s = new Scanner(System.in);\\n int a = s.nextInt(), o=0;\\n String i = \\\"\\\";\\n ArrayList l1 = new ArrayList<>(), l2 = new ArrayList<>();\\n for(int q=0; q 1) {\\n swap(a, 0, heapSize - 1);\\n heapSize--;\\n heapify(a, 0);\\n }\\n }\\n\\n private static void buildHeap(int[] a) {\\n heapSize = a.length;\\n for (int i = a.length \\/ 2; i >= 0; i--) {\\n heapify(a, i);\\n }\\n }\\n\\n private static void heapify(int[] a, int i) {\\n int l = 2 * i + 2;\\n int r = 2 * i + 1;\\n int largest = i;\\n if (l < heapSize && a[i] < a[l]) {\\n largest = l;\\n }\\n if (r < heapSize && a[largest] < a[r]) {\\n largest = r;\\n }\\n if (i != largest) {\\n swap(a, i, largest);\\n heapify(a, largest);\\n }\\n }\\n\\n private static void swap(int[] a, int i, int j) {\\n a[i] ^= a[j] ^= a[i];\\n a[j] ^= a[i];\\n }\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/package codeforces;\\n\\nimport java.util.Scanner;\\n\\npublic class Fingerprints {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner scanner = new Scanner(System.in);\\n\\n\\t\\tint[] code = new int[scanner.nextInt()];\\n\\t\\tint[] prints = new int[scanner.nextInt()];\\n\\n\\t\\tfor (int i = 0; i < code.length; i++) {\\n\\t\\t\\tcode[i] = scanner.nextInt();\\n\\t\\t}\\n\\t\\tfor (int i = 0; i < prints.length; i++) {\\n\\t\\t\\tprints[i] = scanner.nextInt();\\n\\t\\t}\\n\\t\\tfor (int i = 0; i < code.length; i++) {\\n\\t\\t\\tfor (int j = 0; j < prints.length; j++) {\\n\\t\\t\\t\\tif (code[i] == prints[j]) {\\n\\t\\t\\t\\t\\tSystem.out.print(prints[j] + \\\" \\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tscanner.close();\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\npublic class template {\\n\\tpublic static void main(String[] args) {\\n\\t\\tFastScanner sc = new FastScanner();\\n\\t\\tPrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));\\n\\t\\tint n = sc.nextInt();\\n\\t\\tint k = sc.nextInt();\\n\\t\\tlong left = 0;\\n\\t\\tlong right = n;\\n\\t\\tlong mid = left+right\\/2;\\n\\t\\twhile(left<=right) {\\n\\t\\t\\tmid = (left+(right))\\/2;\\n\\t\\t\\tif(((mid+1)*mid)\\/2-(n-mid)==k) {\\n\\t\\t\\t\\tpw.println(n-mid);\\n\\t\\t\\t\\tpw.close();\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t\\telse if(((mid+1)*mid)\\/2-(n-mid)>k) {\\n\\t\\t\\t\\tright = mid-1;\\n\\t\\t\\t}\\n\\t\\t\\telse left = mid+1;\\n\\t\\t}\\n\\t}\\n}\\n@SuppressWarnings(\\\"all\\\")\\nclass FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner(String s) {\\n try {\\n br = new BufferedReader(new FileReader(s));\\n } catch (FileNotFoundException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n }\\n\\n public FastScanner() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n String nextToken() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() {\\n return Double.parseDouble(nextToken());\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader sc = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n Task solver = new Task();\\n solver.solve(1, sc, out);\\n out.close();\\n }\\n\\n static class Task {\\n public void solve(int testNumber, InputReader sc, PrintWriter out) {\\n int n=sc.nextInt();\\n int[] a=new int[n];\\n boolean[] jud=new boolean[101];\\n \\n for(int i=0;i> sums;\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out)\\n {\\n this.in = in;\\n\\n int n = ni();\\n long[] a = nla(n);\\n\\n sums = new HashMap<>();\\n for (int i = 0; i < n; i++)\\n {\\n long sum = 0;\\n for (int j = i; j < n; j++)\\n {\\n sum += a[j];\\n sums.computeIfAbsent(sum, k -> new ArrayList<>()).add(\\n new F1BlokiRavnoiSummiProstayaRedakciya.Block(i, j, sum));\\n }\\n }\\n\\n for (Map.Entry> e : sums.entrySet())\\n {\\n Collections.sort(e.getValue());\\n }\\n\\n List res = Collections.emptyList();\\n for (Map.Entry top ){\\n out.print(-1);\\n return;\\n }\\n\\n int ans = 0;\\n if ( n > 0 ){\\n ++ans;\\n n -= k;\\n k -= 2;\\n }\\n\\n while ( n > 0 ){\\n ++ans;\\n n -= k;\\n k--;\\n }\\n out.print(ans);\\n }\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Main {\\n\\t\\n\\tpublic static class node implements Comparable{\\n\\t\\tint l,r;\\n\\t\\tnode(){}\\n\\t\\tnode(int l,int r) {\\n\\t\\t\\tthis.l=l;\\n\\t\\t\\tthis.r=r;\\n\\t\\t}\\n\\t\\t@Override\\n\\t\\tpublic int compareTo(node rhs) {\\n\\t\\t\\treturn r-rhs.r;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static void main(String args[]){\\n\\t\\tScanner in = new Scanner(System.in);\\n\\t\\tint a = in.nextInt();\\n\\t\\tint x[] = new int[a];\\n\\t\\tfor(int n=0;n> map = new HashMap>();\\n\\t\\tfor(int n=0;n list = new ArrayList();\\n\\t\\t\\t\\t\\tlist.add(node);\\n\\t\\t\\t\\t\\tmap.put(num, list);\\n\\t\\t\\t\\t\\tif(max == 1)t = num;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse{\\n\\t\\t\\t\\t\\tArrayList list = map.get(num);\\n\\t\\t\\t\\t\\tint left = 0;\\n\\t\\t\\t\\t\\tint right = list.size()-1;\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tint res = list.size();\\n\\t\\t\\t\\t\\twhile(left <= right){\\n\\t\\t\\t\\t\\t\\tint mid = (left + right) >> 1;\\n\\t\\t\\t\\t\\t\\t\\/\\/System.out.println(mid +\\\" \\\"+ left +\\\" \\\" +right);\\n\\t\\t\\t\\t\\t\\tif(list.get(mid).r >= n){\\n\\t\\t\\t\\t\\t\\t\\tres = mid;\\n\\t\\t\\t\\t\\t\\t\\tright = mid - 1;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\telse{\\n\\t\\t\\t\\t\\t\\t\\tleft = mid + 1;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif(res == list.size()){\\n\\t\\t\\t\\t\\t\\tlist.add(node);\\n\\t\\t\\t\\t\\t\\tif(max < res+1){\\n\\t\\t\\t\\t\\t\\t\\tmax = res+1;\\n\\t\\t\\t\\t\\t\\t\\tt = num;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse if(list.get(res).r>m){\\n\\t\\t\\t\\t\\t\\tlist.set(res, node);\\n\\t\\t\\t\\t\\t\\tif(max < res){\\n\\t\\t\\t\\t\\t\\t\\tmax = list.size();\\n\\t\\t\\t\\t\\t\\t\\tt = num;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(max);\\n\\t\\tfor(int n=0;n 0) {\\n\\t\\t\\tif (n % 2 != 0) {\\n\\t\\t\\t\\tres = (res * x) % 1000000007;\\n\\t\\t\\t\\tn--;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tx = (x * x) % 1000000007;\\n\\t\\t\\t\\tn = n \\/ 2;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\/**\\n * Created by Gantushig on 2\\/18\\/2016.\\n *\\/\\n\\npublic class A {\\n\\n public static void main(String[] args) {\\n Scanner input = new Scanner(System.in);\\n long n = input.nextLong();\\n System.out.println(\\\"25\\\");\\n }\\n\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\n\\n\\npublic class OverlapedString {\\n\\tpublic static void main(String args[]) throws Exception {\\n\\t\\tOverlapedString os = new OverlapedString();\\n\\t\\tBufferedReader stdin =\\n\\t\\t\\tnew BufferedReader(new InputStreamReader(System.in));\\n\\t\\tString line;\\n\\t\\twhile ((line = stdin.readLine()) != null) {\\n\\t\\t\\tSystem.out.println(os.handleOverlap(line));\\n\\t\\t}\\n\\t}\\n\\tprivate int handleOverlap(String str) {\\n\\t\\tint len = str.length();\\n\\t\\tint count = 0;\\n\\t\\tfor(int i=0;i0) {\\n\\t\\t\\t\\t\\tif(getOverlapCount(str,_tmp)>1)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tif(_tmp.length()>count)\\n\\t\\t\\t\\t\\t\\t\\tcount = _tmp.length();\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\treturn count;\\n\\t}\\n\\tprivate int getOverlapCount(String str,String sub) {\\n\\t\\tint start = 0;\\n\\t\\tint count = 0;\\n\\t\\twhile(start numb=new ArrayList();\\nScanner br1 = new Scanner(System.in);\\nint n=br1.nextInt();\\nint steps=br1.nextInt();\\n\\/\\/if(n>2)numb.add(2);\\nif(n>=3)numb.add(3);\\nfor(int j=4;j<=n;j++){\\nif(chekprime(j)==0){\\n\\nnumb.add(j);\\n\\/\\/System.out.println(j);\\n}\\n\\n}\\nint counter =0;\\nfor(int give=0;give=steps)System.out.println(\\\"YES\\\");\\nelse System.out.println(\\\"NO\\\");\\n\\n\\n}\\n\\npublic static String sumup(ArrayList list,int number,int NUM){\\n\\nString ret=\\\"NO\\\";\\n ArrayList result=new ArrayList();\\n\\nArrayList[] arList=new ArrayList[number];\\nfor(int i=0;i();\\narList[i]=(ArrayList)list.clone();\\nfor(int k=0;k=max){\\n \\t\\t \\/\\/ \\tmax=sum;\\n \\t\\t \\/\\/ }\\n \\t\\t \\/\\/ }\\n\\n \\t\\t \\n \\t\\t x--;\\n \\t\\t j++;\\n \\t\\t}\\n \\t\\t return arr;\\n\\n\\t}\\n \\n\\n public static void main(String []args){\\n Scanner sc = new Scanner (System.in);\\n long a [] = new long [14];\\n long b [] = new long [14];\\n long p,q,r,s,max = 0;\\n for(int i = 0; i < 14; i++) a[i] = sc.nextInt();\\n for(int i = 0; i < 14; i++){\\n p = a[i]%14;\\n q = a[i]\\/14;\\n r = 0;\\n s = 0;\\n for(int j = 0; j < 14; j++) b[j] = a[j];\\n b[i] = 0;\\n int j = (i+1)%14;\\n for(; r < p; r++) {\\n b[j]++;\\n j=(j+1)%14;\\n }\\n for( j = 0; j < 14; j++) {\\n b[j] += q;\\n if(b[j] % 2 == 0) s+= b[j];\\n }\\n max = Math.max(max,s);\\n }\\n System.out.println(max);\\n\\n\\n\\n }\\n\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\npublic class Main {\\n\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n int[] wide = new int[n], sta = new int[n];\\n HashMap hm = new HashMap();\\n for (int i = 0; i < n; i++) {\\n \\twide[i] = sc.nextInt();\\n \\thm.put(wide[i], i + 1);\\n }\\n Util.sort(wide);\\n sc.nextLine();\\n String s = sc.nextLine();\\n int tp = 0, pos = 0;\\n StringBuilder out = new StringBuilder();\\n for (int i = 0; i < s.length(); i++) {\\n \\tint t;\\n \\tif (s.charAt(i) == '0') {\\n \\t\\tt = wide[pos++];\\n \\t\\tsta[tp++] = t;\\n \\t} else t = sta[--tp];\\n \\tout.append(hm.get(t) + \\\" \\\");\\n }\\n System.out.println(out.toString());\\n sc.close();\\n }\\n public static class Util {\\n \\t\\n \\tpublic static > void merge_sort(T[] a) {\\n \\t\\tObject[] aux = new Object[a.length];\\n \\t\\tmerge_sort0(a, aux, 0, a.length);\\n \\t}\\n \\t\\n \\tpublic static > void merge_sort(T[] a, int l, int r) {\\n \\t\\tObject[] aux = new Object[a.length];\\n \\t\\tmerge_sort0(a, aux, l, r);\\n \\t}\\n \\t\\n \\t@SuppressWarnings(\\\"unchecked\\\")\\n \\tprivate static > void merge_sort0(T[] a, Object[] temp, int l, int r) {\\n \\t\\tif (l + 1 == r) return;\\n \\t\\tint mid = (l + r) >> 1;\\n \\t\\tmerge_sort0(a, temp, l, mid);\\n \\t\\tmerge_sort0(a, temp, mid, r);\\n \\t\\tint x = l, y = mid, c = l;\\n \\t\\twhile (x < mid || y < r) {\\n \\t\\t\\tif (y == r || (x < mid && a[x].compareTo(a[y]) <= 0)) temp[c++] = a[x++];\\n \\t\\t\\telse temp[c++] = a[y++];\\n \\t\\t}\\n \\t\\tfor (int i = l; i < r; i++) a[i] = (T)temp[i];\\n \\t}\\n \\t\\n \\tstatic final Random RAN = new Random();\\n \\t\\n \\tpublic static > void quick_sort(T[] a) {\\n \\t\\tquick_sort0(a, 0, a.length);\\n \\t}\\n \\t\\n \\tpublic static > void quick_sort(T[] a, int l, int r) {\\n \\t\\tquick_sort0(a, l, r);\\n ... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class Main {\\n public static class Pair implements Comparable {\\n int k, x;\\n public Pair(int k) {\\n this.k = k;\\n }\\n public void update(int x) {\\n this.x = Math.max(this.x, x);\\n }\\n public int compareTo(Pair other) {\\n if (x != other.x) {\\n return other.x - x;\\n }\\n return k - other.k;\\n }\\n }\\n public static int sum(int[] arr) {\\n int sum = 0;\\n for (int x : arr) {\\n sum += x;\\n }\\n return sum;\\n }\\n public static int[] join(int[] a, int[] b) {\\n int n = a.length;\\n int[] best = new int[n];\\n int sum = 0;\\n for (int shift = 0; shift < n; shift++) {\\n int[] curr = new int[n];\\n for (int i = 0; i < n; i++) {\\n curr[i] = Math.max(a[i], b[(i + shift) % n]);\\n }\\n int now = sum(curr);\\n if (now > sum) {\\n sum = now;\\n best = curr;\\n }\\n }\\n return best;\\n }\\n public static int n;\\n public static int[] pow;\\n public static int[][] dp, real;\\n public static void calc(int mask) {\\n int[] best = new int[n];\\n int sum = 0;\\n for (int i = 0; i < n; i++) {\\n if ((mask & pow[i]) != 0) {\\n int to = mask ^ pow[i];\\n int[] init = new int[n];\\n for (int j = 0; j < n; j++) {\\n init[j] = real[j][i];\\n }\\n int[] curr = join(dp[to], init);\\n int s = sum(curr);\\n if (s > sum) {\\n sum = s;\\n best = curr;\\n }\\n }\\n }\\n dp[mask] = best;\\n }\\n public static void main(String[] args) {\\n pow = new int[15];\\n pow[0] = 1;\\n for (int i = 1; i < pow.length; i++) {\\n pow[i] = pow[i - 1] * 2;\\n }\\n Scanner in = new Scanner(System.in);\\n int t =... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Washoum\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n inputClass in = new inputClass(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n APaintTheNumbers solver = new APaintTheNumbers();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class APaintTheNumbers {\\n public void solve(int testNumber, inputClass sc, PrintWriter out) {\\n int n = sc.nextInt();\\n Integer[] tab = new Integer[n];\\n for (int i = 0; i < n; i++) {\\n tab[i] = sc.nextInt();\\n }\\n Arrays.sort(tab);\\n boolean[] done = new boolean[n];\\n int ans = 0;\\n for (int i = 0; i < n; i++) {\\n if (!done[i]) {\\n ans++;\\n done[i] = true;\\n for (int j = i + 1; j < n; j++) {\\n if (!done[j] && tab[j] % tab[i] == 0) {\\n done[j] = true;\\n }\\n }\\n }\\n }\\n out.println(ans);\\n }\\n\\n }\\n\\n static class inputClass {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public inputClass(InputStream in) {\\n\\n br = new BufferedReader(new InputStreamReader(in));\\n }\\n\\n public String next() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/package round15;\\n\\n\\nimport java.io.BufferedOutputStream;\\nimport java.io.PrintStream;\\nimport java.io.PrintWriter;\\nimport java.io.StringReader;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\n\\npublic class A {\\n\\tprivate Scanner in;\\n\\tprivate PrintWriter out;\\n\\t\\n\\tpublic void solve()\\n\\t{\\n\\t\\tint n = ni();\\n\\t\\tint t = ni();\\n\\t\\tPair[] p = new Pair[n];\\n\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\tp[i] = new Pair();\\n\\t\\t\\tp[i].x = ni();\\n\\t\\t\\tp[i].a = ni();\\n\\t\\t}\\n\\t\\tArrays.sort(p);\\n\\t\\t\\n\\t\\tint ct = 2;\\n\\t\\tfor(int i = 0;i < n - 1;i++){\\n\\t\\t\\tfloat d = p[i + 1].x - (float)p[i + 1].a \\/ 2 - p[i].x - (float)p[i].a \\/ 2;\\n\\t\\t\\tif(Math.abs(d - t) < EPS){\\n\\t\\t\\t\\tct++;\\n\\t\\t\\t}else if(d > t){\\n\\t\\t\\t\\tct += 2;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.println(ct);\\n\\t}\\n\\n\\tdouble EPS = 0.0001;\\n\\t\\n\\tprivate static class Pair implements Comparable\\n\\t{\\n\\t\\tpublic int x;\\n\\t\\tpublic int a;\\n\\t\\t\\n\\t\\t@Override\\n\\t\\tpublic int compareTo(Pair o) {\\n\\t\\t\\treturn x - o.x;\\n\\t\\t}\\n\\t}\\t\\n\\tpublic void run() throws Exception\\n\\t{\\n\\/\\/\\t\\tin = new Scanner(new StringReader(\\\"2 3 0 4 5 2\\\"));\\n\\t\\tin = new Scanner(System.in);\\n\\t\\tSystem.setOut(new PrintStream(new BufferedOutputStream(System.out)));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\n\\/\\/\\t\\tint n = in.nextInt();\\n\\t\\tint n = 1;\\n\\t\\tfor(int i = 1;i <= n;i++){\\n\\t\\t\\tlong t = System.currentTimeMillis();\\n\\t\\t\\tsolve();\\n\\t\\t\\tout.flush();\\n\\/\\/\\t\\t\\tSystem.err.printf(\\\"%04d\\/%04d %7d%n\\\", i, n, System.currentTimeMillis() - t);\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\n\\tpublic static void main(String[] args) throws Exception\\n\\t{\\n\\t\\tnew A().run();\\n\\t}\\n\\t\\n\\tprivate int ni() { return Integer.parseInt(in.next()); }\\n\\tprivate static void tr(Object... o) { System.out.println(o.length == 1 ? o[0] : Arrays.toString(o)); }\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.Reader;\\nimport java.io.IOException;\\nimport java.util.StringTokenizer;\\n\\/*\\n * @author Tnascimento \\n *\\/\\n\\npublic class MaeDosDragoes {\\n\\t\\/\\/ public static StringTokenizer tokenizer;\\n\\t\\/\\/ public static BufferedReader reader;\\n\\tpublic static PrintWriter saida = new PrintWriter(System.out, false);\\n\\t\\/\\/ public static String proximo() {\\n\\t\\/\\/ \\twhile (tokenizer == null || !tokenizer.hasMoreElements()) {\\n\\t\\/\\/ \\t\\ttry {\\n\\t\\/\\/ \\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\/\\/ \\t\\t} catch (RuntimeException e) {\\n\\t\\/\\/ \\t\\t\\te.printStackTrace();\\n\\t\\/\\/ \\t\\t}\\n\\t\\/\\/ \\t}\\n\\t\\/\\/ \\treturn tokenizer.nextToken();\\n\\t\\/\\/ }\\n\\n\\tpublic static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n \\n public FastScanner(Reader in) {\\n br = new BufferedReader(in);\\n }\\n \\n public FastScanner() {\\n this(new InputStreamReader(System.in));\\n }\\n \\n String next() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n \\n int nextInt() {\\n return Integer.parseInt(next());\\n }\\n \\n long nextLong() {\\n return Long.parseLong(next());\\n }\\n \\n double nextDouble() {\\n return Double.parseDouble(next());\\n }\\n \\n String readNextLine() {\\n String str = \\\"\\\";\\n try {\\n str = br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return str;\\n }\\n }\\n\\n\\n\\n public static void main(String[] args) {\\n\\t\\tFastScanner fastScanner = new FastScanner();\\n int proximoInt = fastScanner.nextInt();\\n double proximoDouble = fastScanner.nextInt();\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.io.OutputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.FileNotFoundException;\\nimport java.io.File;\\nimport java.util.StringTokenizer;\\nimport java.io.Writer;\\nimport java.io.BufferedReader;\\nimport java.io.UnsupportedEncodingException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author MaxHeap\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n FastReader in = new FastReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public void solve(int testNumber, FastReader in, OutputWriter out) {\\n int n = in.nextInt();\\n double r = in.nextInt();\\n double[] x = new double[n];\\n for (int i = 0; i < n; i++) {\\n x[i] = in.nextDouble();\\n }\\n double[] ans = new double[n];\\n ans[0] = r;\\n for (int i = 1; i < n; i++) {\\n ans[i] = r;\\n double maxY = 0;\\n for (int j = 0; j < i; j++) {\\n if (Math.abs(x[j] - x[i]) <= 2.0 * r) {\\n double y = ans[j] + Math.sqrt(4 * r * r - (x[j] - x[i]) * (x[j] - x[i]));\\n ans[i] = Math.max(ans[i], y);\\n }\\n }\\n }\\n for (int i = 0; i < n; i++) {\\n if (i > 0) out.print(\\\" \\\");\\n out.printf(\\\"%.8f\\\", ans[i]);\\n }\\n }\\n\\n }\\n\\n static class FastReader {\\n BufferedReader reader;\\n StringTokenizer st;\\n\\n public FastReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream));\\n st = null;\\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\npublic class Main\\n{\\n\\tpublic static void main(String[] args) throws Exception\\n\\t{\\n\\t BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n\\t int n=Integer.parseInt(br.readLine());\\n\\t String s=br.readLine();\\n\\t String ss[]=s.split(\\\" \\\");\\n\\t int arr[]=new int[n];\\n\\t for(int i=0;i= 0 && k < m) {\\n\\t\\t\\tk += fs[ptr--] - 1;\\n\\t\\t\\tres++;\\n\\t\\t}\\n\\t\\tif (k < m) out.println(-1);\\n\\t\\telse out.println(res);\\n\\t}\\n}\\n\\nclass IOUtils {\\n public static int[] readIntArray(Scanner in, int size) {\\n int[] array = new int[size];\\n for (int i = 0; i < size; i++)\\n array[i] = in.nextInt();\\n return array;\\n }\\n\\n }\\n\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.BigInteger;\\npublic class VkR2A{\\n static BufferedReader br;\\n public static void main(String args[])throws Exception{\\n br=new BufferedReader(new InputStreamReader(System.in));\\n\\n int nm[] = toIntArray();\\n int n = nm[0];\\n int a = nm[1];\\n int b = nm[2];\\n nm=toIntArray();\\n Arrays.sort(nm);\\n int k=nm[b-1];\\n int res=nm[b]-k;\\n System.out.println(res);\\n\\n }\\n\\n\\n \\/****************************************************************\\/\\n public static int[] toIntArray()throws Exception{\\n String str[]=br.readLine().split(\\\" \\\");\\n int k[]=new int[str.length];\\n for(int i=0;i x[j] + r) {\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tyc = Math.max(yc, y[j] + Math.sqrt(Math.abs(Math.pow(x[i] - x[j], 2) - 4 * r * r)));\\n\\t\\t\\t}\\n\\t\\t\\ty[i] = yc;\\n\\t\\t\\tmark[i] = true;\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\tSystem.out.print(y[i] + \\\" \\\");\\n\\t\\t}\\n\\t\\tSystem.out.println();\\n\\t}\\n} Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\tstatic final int MAXN= 1005;\\n\\tstatic final long MOD =1_000_000_007;\\n\\tstatic final boolean DEBUG= false;\\n\\tstatic int n, m;\\n\\tstatic long stlr[][]= new long[MAXN][MAXN],bell[]= new long[MAXN],occ[];\\n\\tstatic PrintStream cerr=System.err;\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\t\\tReadin();\\n\\t\\tstlr[0][0]= bell[0] =1;\\n\\t\\tfor (int i=1; i<=m; i++)\\n\\t\\t\\tfor (int j=1;j<=i;j++) {\\n\\t\\t\\t\\tstlr[i][j]= (stlr[i-1][j-1]+stlr[i-1][j]*(long)j)%MOD;\\n\\t\\t\\t\\tbell[i]= (bell[i]+stlr[i][j])%MOD;\\n\\t\\t\\t}\\n\\t\\tif (DEBUG)\\n\\t\\t\\tfor (int i=1; i<=m; i++) cerr.println(\\\"Bell[\\\"+i+\\\"] =\\\"+bell[i]);\\n\\t\\tArrays.sort(occ);\\n\\t\\tif (DEBUG) {\\n\\t\\t\\tcerr.println(\\\"After Sorting\\\");\\n\\t\\t\\tfor (int i=0;i ints = new ArrayList();\\n\\t\\t\\n\\t\\tfor (int i = 0; i < split.length; i++) {\\n\\t\\t\\tints.add(Integer.valueOf(split[i]));\\n\\t\\t}\\n\\t\\t\\n\\t\\tCollections.sort(ints);\\n\\t\\tInteger object = ints.get(0);\\n\\t\\tfor (int i = 0; i < split.length; i++) {\\n\\t\\t\\tif(ints.get(i).compareTo(object) > 0){\\n\\t\\t\\t\\tSystem.out.println(ints.get(i));\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\n\\t\\tnew One().solve();\\n\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class A961_Tetris {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\n\\t\\tScanner input = new Scanner(System.in);\\n\\t\\tint platforms = input.nextInt();\\n\\t\\tint in = input.nextInt();\\n\\t\\tint[] cols = new int[platforms];\\n\\t\\tint[] squares = new int[in];\\n\\t\\t\\n\\t\\tfor (int i = 0; i < in; i ++) {\\n\\t\\t\\tsquares[i] = input.nextInt();\\n\\t\\t}\\n\\t\\t\\n\\t\\tboolean hi = false;\\n\\t\\tint score = 0;\\n\\t\\t\\n\\t\\tfor (int i = 0; i < in; i ++) {\\n\\t\\t\\tcols[squares[i] - 1] ++;\\n\\t\\t\\thi = checkscore(cols);\\n\\t\\t\\tif (hi == true) {\\n\\t\\t\\t\\thi = false;\\n\\t\\t\\t\\tscore ++;\\n\\t\\t\\t\\tfor (int j = 0; j < cols.length; j ++) {\\n\\t\\t\\t\\t\\tcols[j] --;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(score);\\n\\t\\t\\n\\t}\\n\\t\\n\\tpublic static boolean checkscore(int[] cols) {\\n\\t\\tfor (int i = 0; i < cols.length; i ++) {\\n\\t\\t\\tif (cols[i] == 0) {\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn true;\\n\\t\\t\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package c;\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n\\n\\tint n,m;\\n\\tint d[][];\\n\\tQueue q = new LinkedList();\\n\\tint cur[];\\n\\t\\n\\tpublic void run() throws Exception{\\n\\t\\tScanner in = new Scanner(new File(\\\"input.txt\\\"));\\n\\t\\tPrintWriter out = new PrintWriter(new File(\\\"output.txt\\\"));\\n\\t\\tn = in.nextInt();\\n\\t\\tm = in.nextInt();\\n\\t\\tint k = in.nextInt();\\n\\t\\td = new int[n][m];\\n\\t\\tfor(int i=0;i 0){\\n\\t\\t\\tcur = q.poll();\\n\\t\\t\\tint x = cur[0];\\n\\t\\t\\tint y = cur[1];\\n\\t\\t\\tadd(x, y+1);\\n\\t\\t\\tadd(x+1, y);\\n\\t\\t\\tadd(x-1, y);\\n\\t\\t\\tadd(x, y-1);\\n\\t\\t}\\n\\t\\tint max = 0;\\n\\t\\tint x = 0;\\n\\t\\tint y = 0;\\n\\t\\tfor(int i=0;i=n || y >=m) return;\\n\\t\\tif (d[x][y] > d[cur[0]][cur[1]] + 1){\\n\\t\\t\\td[x][y] = d[cur[0]][cur[1]] + 1;\\n\\t\\t\\tq.add(new int[]{x,y});\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tnew Main().run();\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\tFastReader scn;\\n\\tPrintWriter out;\\n\\tString INPUT = \\\"\\\";\\n\\n\\tvoid solve() {\\n\\t\\tlong n = scn.nextLong(), k = scn.nextLong(), mod = (int)1e9 + 7;\\n\\t\\tif(n == 0) {\\n\\t\\t\\tout.println(0);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tn %= mod;\\n\\t\\tlong x = (pow(2, k + 1, mod) * n) % mod;\\n\\t\\tlong y = (pow(2, k, mod) + mod - 1) % mod;\\n\\t\\t\\n\\t\\tlong ans = ((x - y) % mod + mod) % mod;\\n\\t\\tout.println(ans);\\n\\t}\\n\\t\\n\\tlong pow(long a, long x, long m) {\\n\\t\\tif(x == 0) {\\n\\t\\t\\treturn 1;\\n\\t\\t}\\n\\t\\tlong p = pow(a, x \\/ 2, m);\\n\\t\\tp *= p;\\n\\t\\tp %= m;\\n\\t\\tif(x % 2 == 1) {\\n\\t\\t\\tp *= a;\\n\\t\\t\\tp %= m;\\n\\t\\t}\\n\\t\\treturn p;\\n\\t}\\n\\t\\n\\tlong gcd(long a, long b) {\\n\\t\\treturn b == 0 ? a : gcd(b, a % b);\\n\\t}\\n\\n\\tvoid run() throws Exception {\\n\\t\\tboolean onlineJudge = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tscn = new FastReader(onlineJudge);\\n\\t\\tlong time = System.currentTimeMillis();\\n\\t\\tsolve();\\n\\t\\tout.flush();\\n\\t\\tif (!onlineJudge) {\\n\\t\\t\\tSystem.out.println(Arrays.deepToString(new Object[] { System.currentTimeMillis() - time + \\\" ms\\\" }));\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tnew Main().run();\\n\\t}\\n\\n\\tclass FastReader {\\n\\t\\tInputStream is;\\n\\n\\t\\tpublic FastReader(boolean onlineJudge) {\\n\\t\\t\\tis = onlineJudge ? System.in : new ByteArrayInputStream(INPUT.getBytes());\\n\\t\\t}\\n\\n\\t\\tbyte[] inbuf = new byte[1024];\\n\\t\\tpublic int lenbuf = 0, ptrbuf = 0;\\n\\n\\t\\tint readByte() {\\n\\t\\t\\tif (lenbuf == -1)\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\tif (ptrbuf >= lenbuf) {\\n\\t\\t\\t\\tptrbuf = 0;\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\tlenbuf = is.read(inbuf);\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (lenbuf <= 0)\\n\\t\\t\\t\\t\\treturn -1;\\n\\t\\t\\t}\\n\\t\\t\\treturn inbuf[ptrbuf++];\\n\\t\\t}\\n\\n\\t\\tboolean isSpaceChar(int c) {\\n\\t\\t\\treturn !(c >= 33 && c <= 126);\\n\\t\\t}\\n\\n\\t\\tint skip() {\\n\\t\\t\\tint b;\\n\\t\\t\\twhile ((b = readByte()) != -1 && isSpaceChar(b))\\n\\t\\t\\t\\t;\\n\\t\\t\\treturn b;\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tchar nextChar() {\\n\\t\\t\\treturn (char) skip();\\n\\t\\t}\\n\\n\\t\\tString next() {\\n\\t\\t\\tint b = skip();\\n\\t\\t\\tStringBuilder sb = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.nio.CharBuffer;\\nimport java.util.NoSuchElementException;\\n\\npublic class P1195B {\\n\\n public static void main(String[] args) {\\n SimpleScanner scanner = new SimpleScanner(System.in);\\n PrintWriter writer = new PrintWriter(System.out);\\n\\n int n = scanner.nextInt();\\n int k = scanner.nextInt();\\n int l = 0;\\n int r = n;\\n int ans = 0;\\n while (l <= r) {\\n int eat = (l + r) >> 1;\\n int lastPut = n - eat;\\n long totalPut = (long) (lastPut + 1) * lastPut \\/ 2;\\n long remain = totalPut - eat;\\n if (remain == k) {\\n ans = eat;\\n break;\\n } else if (remain > k)\\n l = eat + 1;\\n else\\n r = eat - 1;\\n }\\n writer.println(ans);\\n\\n writer.close();\\n }\\n\\n private static class SimpleScanner {\\n\\n private static final int BUFFER_SIZE = 10240;\\n\\n private Readable in;\\n private CharBuffer buffer;\\n private boolean eof;\\n\\n SimpleScanner(InputStream in) {\\n this.in = new BufferedReader(new InputStreamReader(in));\\n buffer = CharBuffer.allocate(BUFFER_SIZE);\\n buffer.limit(0);\\n eof = false;\\n }\\n\\n\\n private char read() {\\n if (!buffer.hasRemaining()) {\\n buffer.clear();\\n int n;\\n try {\\n n = in.read(buffer);\\n } catch (IOException e) {\\n n = -1;\\n }\\n if (n <= 0) {\\n eof = true;\\n return '\\\\0';\\n }\\n buffer.flip();\\n }\\n return buffer.get();\\n }\\n\\n void checkEof() {\\n if (eof)\\n throw new NoSuchElementException();\\n }\\n\\n char nextChar() {\\n checkEof();\\n char b = read();\\n checkEof();\\n return b;\\n }\\n\\n String next() {\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class E implements Runnable {\\n\\tpublic static void main (String[] args) {new Thread(null, new E(), \\\"_cf\\\", 1 << 28).start();}\\n\\n\\tint n, m;\\n\\tchar[] str;\\n\\tint[][] occs, cost;\\n\\tint[] dp;\\n\\t\\n\\tpublic void run() {\\n\\t\\tFastScanner fs = new FastScanner();\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tSystem.err.println(\\\"\\\");\\n\\n\\t\\tn = fs.nextInt(); m = fs.nextInt();\\n\\t\\tstr = fs.next().toCharArray();\\n\\t\\toccs = new int[m][m];\\n\\t\\tfor(int i = 0; i < n-1; i++) {\\n\\t\\t\\toccs[str[i]-'a'][str[i+1]-'a']++;\\n\\t\\t\\toccs[str[i+1]-'a'][str[i]-'a']++;\\n\\t\\t}\\n\\t\\t\\/\\/cost[mask][v] = numPairs with v for some all bits on in mask\\n\\t\\tint all = (1< 0) continue;\\n\\t\\t\\t\\tint lb = mask & (-mask);\\n\\t\\t\\t\\tint trail = Integer.numberOfTrailingZeros(lb);\\n\\t\\t\\t\\tint nmask = mask ^ lb;\\n\\t\\t\\t\\tcost[i][mask] = cost[i][nmask]+occs[i][trail];\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tdp = new int[1< 0) continue;\\n\\t\\t\\taddOn += cost[nxt][mask];\\n\\t\\t}\\n\\t\\tfor(int nxt = 0; nxt < m; nxt++) {\\n\\t\\t\\tif(((1< 0) continue;\\n\\t\\t\\tint ret = addOn+solve(mask | (1< m = new HashMap();\\n int n = in.nextInt();\\n char[] s = in.next().toCharArray();\\n\\n for (int i = 0; i < n; i++) {\\n m.put(s[i], 0);\\n }\\n int mx = m.size();\\n int start = 0;\\n int end = 0;\\n int min = Integer.MAX_VALUE;\\n int cur = 0;\\n while (end < n) {\\n while (end < n && cur != mx) {\\n int x = m.get(s[end]);\\n if (x == 0) {\\n cur += 1;\\n }\\n m.put(s[end], x + 1);\\n end += 1;\\n }\\n while (start <= end && cur == mx) {\\n int x = m.get(s[start]);\\n m.put(s[start], x - 1);\\n if (x - 1 == 0) {\\n cur -= 1;\\n }\\n start += 1;\\n }\\n min = Math.min(min, end - start + 1);\\n }\\n System.out.println(min);\\n }\\n\\n\\n static class Pair {\\n\\n long x;\\n long y;\\n\\n public Pair(long x, long y) {\\n this.x = x;\\n this.y = y;\\n }\\n\\n @Override\\n public boolean equals(Object o) {\\n if (this == o) return true;\\n if (o == null || getClass() != o.getClass()) return false;\\n\\n Pair pair = (Pair) o;\\n\\n if (x != pair.x) return false;\\n return y == pair.y;\\n\\n }\\n\\n @Override\\n public int hashCode() {\\n int result = (int) (x ^ (x >>> 32));\\n result = 31 * result + (int) (y ^ (y >>> 32));\\n return result;\\n }\\n }\\n\\n static class MyInputReader {\\n public BufferedReader reader;\\n public... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.FileReader;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\n\\npublic class Fish extends Thread {\\n\\n public Fish() {\\n this.input = new BufferedReader(new InputStreamReader(System.in));\\n this.output = new PrintWriter(System.out);\\n this.setPriority(Thread.MAX_PRIORITY);\\n }\\n\\n\\n private void solve() throws Throwable {\\n int n = nextInt();\\n double[][] a = new double[n][n];\\n double[] dp = new double[(1 << n)];\\n for (int i = 0; i < n; ++i) {\\n for (int j = 0; j < n; ++j) {\\n a[i][j] = nextDouble();\\n }\\n }\\n int limit = (1 << n) - 1;\\n \\/\\/dp[mask] = probability of current subset (mask) to remain in the end\\n dp[limit] = 1.0;\\n for (int mask = limit; mask > 0; --mask) {\\n int cardinality = Integer.bitCount(mask);\\n int probability = cardinality * (cardinality - 1) \\/ 2;\\n for (int first = 0; first < n; ++first) {\\n if ((mask & powers[first]) != 0) {\\n for (int second = first + 1; second < n; ++second) {\\n if ((mask & powers[second]) != 0) {\\n dp[mask - powers[first]] += dp[mask] * a[second][first] \\/ probability;\\n dp[mask - powers[second]] += dp[mask] * a[first][second] \\/ probability;\\n }\\n\\n }\\n }\\n }\\n }\\n for (int i = 0; i < n; ++i) {\\n output.printf(\\\"%.10f \\\", dp[powers[i]]);\\n }\\n }\\n\\n public void run() {\\n try {\\n solve();\\n } catch (Throwable e) {\\n System.err.println(e.getMessage());\\n e.printStackTrace();\\n System.exit(666);\\n } finally {\\n output.flush();\\n output.close();\\n }\\n }\\n\\n\\n public static void main(String[] args) {\\n 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.File;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collection;\\nimport java.util.Collections;\\nimport java.util.Dictionary;\\nimport java.util.HashMap;\\nimport java.util.Iterator;\\nimport java.util.LinkedList;\\nimport java.util.Map;\\nimport java.util.Map.Entry;\\nimport java.util.Queue;\\nimport java.util.Scanner;\\n\\npublic class Main {\\n\\tpublic String[][] a;\\n\\tpublic void run () throws Exception {\\n\\t\\tScanner in = new Scanner(new File(\\\"input.txt\\\"));\\n\\t\\tPrintWriter pw = new PrintWriter(new File(\\\"output.txt\\\"));\\n\\n\\t\\tint n = in.nextInt();\\n\\t\\tint m = in.nextInt();\\n\\t\\tint k = in.nextInt();\\n\\t\\t\\n\\t\\tint[] xx = new int[k];\\n\\t\\tint[] yy = new int[k];\\n\\t\\tfor(int i=0;ir){\\n\\t\\t\\t\\t\\tr=rr;\\n\\t\\t\\t\\t\\tx=i;\\n\\t\\t\\t\\t\\ty=j;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\tpw.print((x+1)+\\\" \\\"+(y+1));\\n\\n\\t\\tpw.close();\\n\\t}\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tnew Main ().run();\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\n\\/**\\n * Created with IntelliJ IDEA.\\n * User: Alexey\\n * Date: 16.09.12\\n * Time: 19:29\\n * To change this template use File | Settings | File Templates.\\n *\\/\\npublic class stub implements Runnable {\\n public static void main(String[] args) {\\n new stub().run();\\n }\\n\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(System.out);\\n StringTokenizer st;\\n\\n public String nextToken() throws IOException {\\n while (st == null || !st.hasMoreTokens()) {\\n st = new StringTokenizer(br.readLine());\\n }\\n return st.nextToken();\\n }\\n\\n public int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n private void solve() throws IOException {\\n int[] cnt = new int[(int) 1e6];\\n int n = nextInt();\\n int k = nextInt();\\n int[] a = new int[n];\\n\\n for (int i = 0; i < n; i++) {\\n a[i] = nextInt();\\n }\\n\\n int cur = 0;\\n int left = 0;\\n int i = left;\\n while (i < n && cur != k) {\\n if (cnt[a[i]] == 0) {\\n cur++;\\n }\\n cnt[a[i]]++;\\n i++;\\n }\\n i--;\\n if (cur != k) {\\n out.println(\\\"-1 -1\\\");\\n return;\\n }\\n int right = i;\\n while (cnt[a[left]] > 1) {\\n cnt[a[left]]--;\\n left++;\\n }\\n out.println((left + 1) + \\\" \\\" + (right + 1));\\n }\\n\\n public void run() {\\n try {\\n solve();\\n out.close();\\n br.close();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.BigDecimal;\\nimport java.math.BigInteger;\\nimport java.math.RoundingMode;\\nimport java.text.DecimalFormat;\\nimport java.util.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Main {\\n\\n final boolean ONLINE_JUDGE = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n BufferedReader in;\\n PrintWriter out;\\n StringTokenizer tok = new StringTokenizer(\\\"\\\");\\n\\n void init() throws FileNotFoundException {\\n if (ONLINE_JUDGE) {\\n in = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(\\\"output.txt\\\");\\n } else {\\n in = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(\\\"output.txt\\\");\\n }\\n }\\n\\n String readString() throws IOException {\\n while (!tok.hasMoreTokens()) {\\n tok = new StringTokenizer(in.readLine());\\n }\\n return tok.nextToken();\\n }\\n\\n int readInt() throws IOException {\\n return Integer.parseInt(readString());\\n }\\n\\n long readLong() throws IOException {\\n return Long.parseLong(readString());\\n }\\n\\n double readDouble() throws IOException {\\n return Double.parseDouble(readString());\\n }\\n\\n public static void main(String[] args) {\\n new Main().run();\\n \\/\\/ Sworn to fight and die\\n }\\n\\n public static void mergeSort(int[] a) {\\n mergeSort(a, 0, a.length - 1);\\n }\\n\\n private static void mergeSort(int[] a, int levtIndex, int rightIndex) {\\n final int MAGIC_VALUE = 50;\\n if (levtIndex < rightIndex) {\\n if (rightIndex - levtIndex <= MAGIC_VALUE) {\\n insertionSort(a, levtIndex, rightIndex);\\n } else {\\n int middleIndex = (levtIndex + rightIndex) \\/ 2;\\n mergeSort(a, levtIndex, middleIndex);\\n mergeSort(a, middleIndex + 1, rightIndex);\\n merge(a, levtIndex, middleIndex, rightIndex);\\n }\\n }\\n }\\n\\n private static void merge(int[] a, int levtIndex, int middleIndex,\\n ... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\n \\npublic class Main {\\n public static void main(String[] args) throws IOException {\\n PrintWriter out = new PrintWriter(System.out);\\n \\/\\/Scanner sc = new Scanner();\\n Reader in = new Reader();\\n Main solver = new Main();\\n solver.solve(out, in);\\n out.flush();\\n out.close();\\n \\n }\\n \\n static int INF = (int)1e5*4*4+5;\\n static int maxn = (int)1e5*2+1;\\n static int mod=(int)1e9+7 ;\\n static int n,m,k,t,q,x,a,b,y;\\n \\n static ArrayList adj[];\\n static int[] dist,parent,back;\\n static boolean[] vis,vist;\\n static int root=0,ans=1;\\n \\n \\n void solve(PrintWriter out, Reader in) throws IOException{\\n n = in.nextInt();\\n\\n\\n if(n==1) {out.println(1);return;}\\n adj = new ArrayList[n+1];\\n for(int i=1;i<=n;i++) \\n adj[i] = new ArrayList();\\n \\n int u,v;\\n for(int i=0;i pq = new PriorityQueue();\\n for(int i=1;i<=n;i++){\\n if(i!=root) pq.add(new Node(i,dist[i]));\\n }\\n \\n Node elm;\\n int rt = root;\\n out.print(1);\\n \\n makeroot(root);\\n removeNodes(root,rt);\\n ans+=dist[rt];\\n out.print(\\\" \\\"+ans);\\n int itr=2;\\n for(int i=2;i<=n;i++){\\n \\n elm = pq.remove();\\n if(vis[elm.idx]) continue;\\n removeNodes(back[elm.idx],elm.idx);\\n ans +=... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.awt.*;\\n\\npublic class A\\n{\\n\\tstatic Comparator cmp = new Comparator()\\n\\t{\\n\\t\\tpublic int compare(Point a, Point b)\\n\\t\\t{\\n\\t\\t\\tif(a.x < b.x)\\n\\t\\t\\t\\treturn -1;\\n\\t\\t\\telse if(a.x > b.x)\\n\\t\\t\\t\\treturn 1;\\n\\n\\t\\t\\treturn 0;\\n\\t\\t}\\n\\t};\\n\\n\\tpublic static void main(String args[])\\n\\t{\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\n\\t\\twhile(scan.hasNextInt())\\n\\t\\t{\\n\\n\\t\\tint n = scan.nextInt();\\n\\t\\tint k = scan.nextInt();\\n\\n\\t\\tPoint[] a = new Point[n];\\n\\n\\t\\tfor(int i=0;i < n;i++)\\n\\t\\t{\\n\\t\\t\\ta[i] = new Point();\\n\\t\\t\\ta[i].x = scan.nextInt();\\n\\t\\t\\ta[i].y = scan.nextInt();\\n\\t\\t}\\n\\n\\t\\tArrays.sort(a, cmp);\\n\\n\\t\\tint rtn = 0;\\n\\n\\t\\tArrayList ans = new ArrayList();\\n\\n\\t\\tfor(int i=0;i < n;i++)\\n\\t\\t{\\n\\t\\t\\t\\/\\/Left\\n\\t\\t\\tdouble lb = a[i].x - (a[i].y \\/ 2.0) - k;\\n\\t\\t\\tdouble pos = lb + (k\\/2.0);\\n\\t\\t\\tboolean good = true;\\n\\n\\t\\t\\tfor(int j=0;j < ans.size();j++)\\n\\t\\t\\t\\tif(Math.abs(ans.get(j) - pos) < 0.0000001)\\n\\t\\t\\t\\t\\tgood = false;\\n\\n\\n\\t\\t\\tif(good && (i == 0 || a[i-1].x + (a[i-1].y \\/ 2.0) <= lb))\\n\\t\\t\\t{\\n\\t\\t\\t\\trtn++;\\n\\t\\t\\t\\tans.add(pos);\\n\\t\\t\\t}\\n\\n\\t\\t\\tdouble rb = a[i].x + (a[i].y \\/ 2.0) + k;\\n\\t\\t\\tpos = rb - (k\\/2.0);\\n\\t\\t\\tgood = true;\\n\\n\\t\\t\\tfor(int j=0;j < ans.size();j++)\\n\\t\\t\\t\\tif(Math.abs(ans.get(j) - pos) < 0.0000001)\\n\\t\\t\\t\\t\\tgood = false;\\n\\n\\t\\t\\tif(good && (i == n-1 || a[i+1].x - (a[i+1].y \\/ 2.0) >= rb))\\n\\t\\t\\t{\\n\\t\\t\\t\\trtn++;\\n\\t\\t\\t\\tans.add(pos);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tSystem.out.println(rtn);\\n\\t\\t}\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\nimport static java.lang.System.out;\\n\\npublic class Main {\\n\\n private FastScanner scanner = new FastScanner();\\n\\n public static void main(String[] args) {\\n new Main().solve();\\n }\\n\\n private List[] gr = new ArrayList[1000_000+5];\\n private int dp[][] = new int[21][1000_000+5];\\n private boolean used[] = new boolean[1000_000+5];\\n\\n void init(int v, int p) {\\n Stack st = new Stack<>();\\n st.push(v);\\n st.push(p);\\n while (!st.isEmpty()) {\\n p = st.pop();\\n v = st.pop();\\n used[v] = true;\\n\\n dp[0][v] = p;\\n for (int i = 1; i <= 20; i++) {\\n if (dp[i - 1][v] != -1) {\\n dp[i][v] = dp[i - 1][dp[i - 1][v]];\\n }\\n }\\n\\n for (int next : gr[v]) {\\n if (!used[next]) {\\n st.push(next);\\n st.push(v);\\n }\\n }\\n\\n }\\n }\\n\\n\\n private void solve() {\\n int n = scanner.nextInt(), k = scanner.nextInt();\\n boolean[] ans = new boolean[1000_000 + 5];\\n\\n for (int i = 0; i < n; i++) {\\n gr[i] = new ArrayList<>();\\n }\\n\\n for (int i = 0; i < n - 1; i ++) {\\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1;\\n gr[u].add(v);\\n gr[v].add(u);\\n }\\n\\n k = n - k - 1;\\n ans[n - 1] = true;\\n\\n init(n - 1 , n - 1);\\n\\n int t, d, next;\\n for (int i = n - 2; i >= 0; i--) {\\n t = i;\\n d = 1;\\n if (ans[i]) {\\n continue;\\n }\\n for (int j = 20; j >= 0; j--){\\n next = dp[j][t];\\n if (next != -1 && !ans[next]) {\\n t = next;\\n d += 1 << j;\\n }\\n }\\n\\n if (d <= k) {\\n k -=d;\\n t = i;\\n\\n while (!ans[t]) {\\n ans[t] = true;\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.awt.Point;\\nimport java.io.BufferedReader;\\nimport java.io.FileInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.UnsupportedEncodingException;\\nimport java.net.URISyntaxException;\\nimport java.util.LinkedList;\\nimport java.util.Queue;\\nimport java.util.StringTokenizer;\\n\\npublic class Main {\\n public static void main(String[] args)throws IOException, URISyntaxException {\\n Reader.init(new FileInputStream(\\\"input.txt\\\"));\\n StringBuilder s=new StringBuilder();\\n boolean[][]vis=new boolean[Reader.nextInt()][Reader.nextInt()];\\n int k=Reader.nextInt(),r,c;\\n Queueq=new LinkedList();\\n while(k-->0) {\\n r=Reader.nextInt()-1;\\n c=Reader.nextInt()-1;\\n vis[r][c]=true;\\n q.add(new Point(r,c));\\n }\\n Point end=null;\\n int[]x={0,0,1,-1},y={1,-1,0,0};\\n int a,b,i;\\n while(!q.isEmpty()) {\\n end=q.poll();\\n for(i=0;i<4;i++) {\\n a=end.x+x[i];\\n b=end.y+y[i];\\n if(a>=0&&b>=0&&a q = new LinkedList();\\n\\t\\t\\twhile(n-- > 0) {\\n\\t\\t\\t\\tq.add(new State(readInt()-1, readInt()-1));\\n\\t\\t\\t\\tdist[q.peekLast().x][q.peekLast().y] = 0;\\n\\t\\t\\t}\\n\\t\\t\\tint[] dx = new int[]{-1,1,0,0};\\n\\t\\t\\tint[] dy = new int[]{0,0,-1,1};\\n\\t\\t\\tState ret = q.peekLast();\\n\\t\\t\\twhile(!q.isEmpty()) {\\n\\t\\t\\t\\tState curr = q.removeFirst();\\n\\t\\t\\t\\tret = curr;\\n\\t\\t\\t\\tfor(int k = 0; k < dx.length; k++) {\\n\\t\\t\\t\\t\\tint nx = curr.x + dx[k];\\n\\t\\t\\t\\t\\tint ny = curr.y + dy[k];\\n\\t\\t\\t\\t\\tif(nx >= 0 && nx < r && ny >= 0 && ny < c && dist[nx][ny] > 1 + dist[curr.x][curr.y]) {\\n\\t\\t\\t\\t\\t\\tdist[nx][ny] = 1 + dist[curr.x][curr.y];\\n\\t\\t\\t\\t\\t\\tq.add(new State(nx, ny));\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tpw.println(ret.x+1 + \\\" \\\" + (ret.y+1));\\n\\t\\t}\\n\\t\\texitImmediately();\\n\\t}\\n\\n\\tstatic class State {\\n\\t\\tpublic int x,y;\\n\\n\\t\\tpublic State(int x, int y) {\\n\\t\\t\\tsuper();\\n\\t\\t\\tthis.x = x;\\n\\t\\t\\tthis.y = y;\\n\\t\\t}\\n\\t\\t\\n\\t}\\n\\t\\n\\tprivate static void exitImmediately() {\\n\\t\\tpw.close();\\n\\t\\tSystem.exit(0);\\n\\t}\\n\\n\\tprivate static long readLong() throws IOException... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class LCM235A\\n{\\n public static void main(String[] args) \\n {\\n \\/\\/ Set up scanner\\n Scanner sc = new Scanner(System.in); \\n \\/\\/ System.out.println(\\\"Enter n\\\");\\n long n = sc.nextLong();\\n \\n if (n==1)\\n {\\n System.out.println(1);\\n return;\\n }\\n if (n==2)\\n {\\n System.out.println(2);\\n return;\\n }\\n if (n==3)\\n {\\n System.out.println(6);\\n return;\\n }\\n if (n==4)\\n {\\n System.out.println(12);\\n return;\\n }\\n \\n if (n%2 ==1) \\/\\/ Odd number easy\\n {\\n System.out.println(n*(n-1)*(n-2));\\n return;\\n }\\n \\n \\/\\/ Even number is a bit harder\\n if (n%3 == 0)\\n {\\n System.out.println((n-1)*(n-2)*(n-3));\\n }\\n else\\n {\\n System.out.println(n*(n-1)*(n-3));\\n }\\n }\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class Main\\n{\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tFastReader fr =new FastReader();\\n\\n\\t\\tPrintWriter op =new PrintWriter(System.out);\\n\\n\\t\\tlong n =fr.nextLong() ,k =fr.nextLong() ,d =(long)Math.sqrt(9l+8l*(n+k)) ;\\n\\n\\t\\td -= 3l ;\\td \\/=2l ;op.println(n-d) ;\\n\\n\\t\\top.flush();\\top.close();\\n\\t}\\n\\n\\tstatic class FastReader {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic FastReader() {\\n\\t\\t\\tbr =new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\n\\t\\tString next() {\\n\\t\\t\\twhile (st==null || (!st.hasMoreElements())) \\n\\t\\t\\t{\\n\\t\\t\\t\\ttry\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tst =new StringTokenizer(br.readLine());\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tcatch(IOException e)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tString nextLine() {\\n\\t\\t\\tString str =\\\"\\\";\\n\\n\\t\\t\\ttry\\n\\t\\t\\t{\\n\\t\\t\\t\\tstr =br.readLine();\\n\\t\\t\\t}\\n\\t\\t\\tcatch(IOException e)\\n\\t\\t\\t{\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\n\\t\\t\\treturn str;\\n\\t\\t}\\n\\n\\t\\tint nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tlong nextLong() {\\n\\t\\t\\treturn Long.parseLong(next()) ;\\n\\t\\t}\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class codeee {\\n public static void main(String[] args) {\\n Scanner sc=new Scanner(System.in);\\n int n=sc.nextInt();\\n if(n==1){System.out.println(1); return;}\\n int []mas=new int[n];\\n int sum=0;\\n for (int i = 0; i < n; i++) {\\n mas[i]=sc.nextInt();\\n sum+=mas[i];\\n }\\n Arrays.sort(mas);\\n int sum1=0;\\n int ans=0;\\n for(int i=0;i(sum-sum1)){\\n ans=i;\\n break;\\n }\\n }\\n System.out.println(ans+1);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class E\\n{\\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer tok;\\n\\n public void go() throws IOException\\n {\\n StringTokenizer tok = new StringTokenizer(in.readLine());\\n int zzz = Integer.parseInt(tok.nextToken());\\n for (int zz = 0; zz < zzz; zz++)\\n {\\n ntok();\\n int n = ipar();\\n int m = ipar();\\n int[][] mat = new int[n][m];\\n for (int i = 0; i < n; i++)\\n {\\n ntok();\\n mat[i] = iapar(m);\\n }\\n long[][] dp = new long[1 << n][m+1];\\n for (int i = 0; i < 1 << n; i++)\\n {\\n dp[i][m] = -1000000000;\\n }\\n dp[(1 << n) - 1][m] = 0;\\n for (int i = m-1; i >= 0; i--)\\n {\\n for (int e = 0; e < 1 << n; e++)\\n {\\n dp[e][i] = dp[e][i+1];\\n for (int w = 0; w < 1 << n; w++)\\n {\\n if ((e & w) == 0)\\n {\\n dp[e][i] = Math.max(dp[e][i], best(w, mat, i) + dp[e|w][i+1]);\\n }\\n }\\n }\\n }\\n \\/\\/ for (long[] arr : dp)\\n \\/\\/ {\\n \\/\\/ out.println(Arrays.toString(arr));\\n \\/\\/ }\\n out.println(dp[0][0]);\\n }\\n\\n out.flush();\\n in.close();\\n }\\n\\n public long best(int mask, int[][] mat, int col)\\n {\\n long max = 0;\\n for (int t = 0; t < mat.length; t++)\\n {\\n long sum = 0;\\n int mk = mask;\\n for (int i = 0; i < mat.length; i++)\\n {\\n if (mk % 2 == 1)\\n {\\n sum += mat[i][col];\\n }\\n mk \\/= 2;\\n }\\n max =... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class Bag implements Runnable {\\n private void solve() throws IOException {\\n int xs = nextInt();\\n int ys = nextInt();\\n int n = nextInt();\\n int[] x = new int[n];\\n int[] y = new int[n];\\n for (int i = 0; i < n; ++i) {\\n x[i] = nextInt();\\n y[i] = nextInt();\\n }\\n final int[][] pair = new int[n][n];\\n for (int i = 0; i < n; ++i)\\n for (int j = i + 1; j < n; ++j)\\n pair[i][j] = (x[i] - xs) * (x[i] - xs) + (y[i] - ys) * (y[i] - ys) + (x[j] - xs) * (x[j] - xs) + (y[j] - ys) * (y[j] - ys) + (x[j] - x[i]) * (x[j] - x[i]) + (y[j] - y[i]) * (y[j] - y[i]);\\n final int[] single = new int[n];\\n for (int i = 0; i < n; ++i) {\\n single[i] = 2 * ((x[i] - xs) * (x[i] - xs) + (y[i] - ys) * (y[i] - ys));\\n }\\n final int[] best = new int[1 << n];\\n final int[] prev = new int[1 << n];\\n for (int set = 1; set < (1 << n); ++set) {\\n int i;\\n for (i = 0; i < n; ++i)\\n if ((set & (1 << i)) != 0)\\n break;\\n int bestC = best[set ^ (1 << i)] + single[i];\\n int prevC = 1 << i;\\n int nextSet = set ^ (1 << i);\\n int unoI = 1 << i;\\n for (int j = i + 1, unoJ = 1 << (i + 1); j < n; ++j, unoJ <<= 1)\\n if ((set & unoJ) != 0) {\\n int cur = best[nextSet ^ unoJ] + pair[i][j];\\n if (cur < bestC) {\\n bestC = cur;\\n prevC = unoI | unoJ;\\n }\\n }\\n best[set] = bestC;\\n prev[set] = prevC;\\n }\\n writer.println(best[(1 << n) - 1]);\\n int now = (1 << n) - 1;\\n writer.print(\\\"0\\\");\\n while (now > 0) {\\n \\tint differents = prev[now];\\n \\tfor(int i = 0; i < n;... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.*;\\nimport java.security.*;\\nimport java.text.*;\\nimport java.util.*;\\nimport java.util.concurrent.*;\\nimport java.util.function.*;\\nimport java.util.regex.*;\\nimport java.util.stream.*;\\nimport static java.util.stream.Collectors.joining;\\nimport static java.util.stream.Collectors.toList;\\n\\n\\npublic class Main{\\n\\n static long MOD = 1_000_000_007L;\\n \\/\\/static long MOD = 998_244_353L;\\n \\/\\/static long MOD = 1_000_000_033L;\\n static long inv2 = (MOD + 1) \\/ 2;\\n\\n static int[][] dir = new int[][]{{1, 0}, {0, 1}, {-1, 0}, {0, -1}};\\n static long lMax = 0x3f3f3f3f3f3f3f3fL;\\n static int iMax = 0x3f3f3f3f;\\n static HashMap memo = new HashMap();\\n static MyScanner sc = new MyScanner();\\n \\/\\/static ArrayList primes;\\n\\n static int nn = 300000;\\n static long[] pow2;\\n static long [] fac;\\n static long [] pow;\\n static long [] inv;\\n static long [] facInv;\\n static int[] base;\\n static int[] numOfDiffDiv;\\n static int[] numOfDiv;\\n static ArrayList primes;\\n \\/\\/static int[] primes;\\n static int ptr = 0;\\n static boolean[] isPrime;\\n\\n \\/\\/-----------PrintWriter for faster output---------------------------------\\n public static PrintWriter out;\\n public static void main(String[] args) {\\n out = new PrintWriter(new BufferedOutputStream(System.out));\\n \\/\\/ Start writing your solution here. -------------------------------------\\n\\n\\n\\n \\/*fac = new long[nn + 1];\\n fac[1] = 1;\\n for(int i = 2; i <= nn; i++)\\n fac[i] = fac[i - 1] * i % MOD;*\\/\\n\\n\\n \\/*pow2 = new long[nn + 1];\\n pow2[0] = 1L;\\n for(int i = 1; i <= nn; i++)\\n pow2[i] = pow2[i - 1] * 2L;*\\/\\n\\n\\n \\/*inv = new long[nn + 1];\\n inv[1] = 1;\\n for (int i = 2; i <= nn; ++i)\\n inv[i] = (MOD - MOD \\/ i) * inv[(int)(MOD % i)] % MOD;*\\/\\n\\n \\/*facInv = new long[nn + 1];\\n facInv[0] = facInv[1] = 1;\\n for (int i = 2; i <= nn; ++i)\\n facInv[i] = facInv[i - 1] * inv[i]... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class q1\\n{\\n\\tpublic static void main(String[] args) \\n\\t{\\n\\t\\tScanner s=new Scanner(System.in);\\n\\t\\tint n=s.nextInt();\\n\\t\\tint[] arr1=new int[9];\\n\\t\\tint[] arr2=new int[9];\\n\\t\\tString ss;\\n\\t\\ts.nextLine();\\n\\t\\tfor(int i=0;i> gr = new ArrayList<>();\\n long MOD = 1_000_000_007;\\n\\n public void solve() {\\n long x = io.readLong(), k = io.readLong();\\n if(x==0){\\n io.writeLine(\\\"0\\\");\\n return;\\n }\\n\\n long res = ((pow(2, k+1, MOD) * (x % MOD)) % MOD - pow(2, k, MOD) % MOD + 1 + MOD) % MOD;\\n io.writeLine(res+\\\"\\\");\\n }\\n\\n long pow(long a, long p, long mod) {\\n long res = 1;\\n while (p > 0) {\\n if (p % 2 == 1) res = (res * a) % mod;\\n a = (a * a) % mod;\\n p \\/= 2;\\n }\\n return res;\\n }\\n}\\n\\n\\nclass ConsoleIO {\\n\\n BufferedReader br;\\n PrintWriter out;\\n public ConsoleIO(Reader reader, PrintWriter writer){br = new BufferedReader(reader);out = writer;}\\n public void flush(){this.out.flush();}\\n public void close(){this.out.close();}\\n public void writeLine(String s) {this.out.println(s);}\\n public void writeInt(int a) {this.out.print(a);this.out.print(' ');}\\n public void writeWord(String s){\\n this.out.print(s);\\n }\\n public void writeIntArray(int[] a, int k, String separator) {\\n StringBuilder sb = new StringBuilder();\\n for (int i = 0;... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n Scanner in = new Scanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public void solve(int testNumber, Scanner in, PrintWriter out) {\\n int n = in.nextInt();\\n int r = in.nextInt();\\n int[] xs = new int[n];\\n for (int i = 0; i < n; i++) xs[i] = in.nextInt();\\n double[] ys = new double[n];\\n for (int i = 0; i < n; i++) {\\n int x = xs[i];\\n double y = r;\\n for (int j = 0; j < i; j++) {\\n y = Math.max(y, calc(xs[j], ys[j], x, r));\\n }\\n ys[i] = y;\\n }\\n for (int i = 0; i < n; i++) {\\n out.printf(\\\"%.10f \\\", ys[i]);\\n }\\n out.println();\\n }\\n\\n private double calc(int x, double y, int x1, int r) {\\n int dx = Math.abs(x - x1);\\n if (dx > 2 * r) return 0;\\n double dy = Math.sqrt(4 * r * r - dx * dx);\\n return y + dy;\\n }\\n\\n }\\n\\n static class Scanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public Scanner(InputStream in) {\\n br = new BufferedReader(new InputStreamReader(in), 32768);\\n }\\n\\n public String nextLine() {\\n try {\\n return br.readLine();\\n } catch (IOException e) {\\n return null;\\n }\\n }\\n\\n... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Solution {\\n public static void main (String[] args) throws IOException {\\n boolean online = \\\"true\\\".equals(System.getProperty(\\\"ONLINE_JUDGE\\\"));\\n if (online) {\\n in = new InputReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n }\\n else {\\n in = new InputReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(new File(\\\"output.txt\\\"));\\n }\\n \\n new Solution().run();\\n \\n out.close();\\n }\\n \\n long sum (int x) {\\n return x * 1l * (x+1) \\/ 2;\\n }\\n \\n int bins (long n, int k) {\\n int l = 1,\\n r = k;\\n while (l < r) {\\n int w = (l+r)\\/2;\\n long s = sum(k) - sum(w-1);\\n if (s == n)\\n return w;\\n if (s < n)\\n r = w;\\n else\\n l = w+1;\\n }\\n return l;\\n }\\n \\n private void run () {\\n long n = in.nextLong();\\n int k = in.nextInt();\\n if (n == 1) {\\n out.println(0);\\n return;\\n }\\n if (1 + sum(k-1) < n) {\\n out.println(-1);\\n return;\\n }\\n int c = bins(n-1,k-1);\\n if (1 + sum(k-1) - sum(c-1) == n)\\n out.println(k-c);\\n else\\n out.println(k-c+1);\\n }\\n \\n private static InputReader in;\\n private static PrintWriter out;\\n}\\n\\nclass InputReader {\\n public InputReader (Reader r) {\\n buff = new BufferedReader(r);\\n try {\\n str = new StringTokenizer(buff.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n \\n public String next () {\\n while (!str.hasMoreTokens())\\n try {\\n str = new StringTokenizer(buff.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return str.nextToken();\\n }\\n \\n public int nextInt () {\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.ArrayList;\\nimport java.util.List;\\nimport java.util.Scanner;\\n\\npublic class A {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tint n = scan.nextInt();\\n\\t\\tint k = scan.nextInt()-1;\\n\\t\\tPrimeGen p = new PrimeGen(n);\\n\\t\\tList prims = new ArrayList();\\n\\t\\tfor(int i = 2; i <= n; i++){\\n\\t\\t\\tif(p.isPrime(i)>0){\\n\\t\\t\\t\\tprims.add(i);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint sum = 0;\\n\\t\\tfor(int i = 0; i < prims.size() - 1; i++){\\n\\t\\t\\tint c = prims.get(i) + prims.get(i+1) + 1;\\n\\t\\t\\tif(c <= n && p.isPrime(c)>0){\\n\\t\\t\\t\\tsum ++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(sum>=k?\\\"YES\\\":\\\"NO\\\");\\n\\t}\\n\\n\\tstatic int sum(List is) {\\n\\t\\tint c = 0;\\n\\t\\tfor (int i : is)\\n\\t\\t\\tc += i;\\n\\t\\treturn c;\\n\\t}\\n\\t\\n\\tstatic class PrimeGen {\\n\\t\\tpublic PrimeGen(int m) {\\n\\t\\t\\tm = (int) Math.sqrt(m);\\n\\t\\t\\tdouble max = 0;\\n\\t\\t\\tint r = 1;\\n\\t\\t\\tfor (int i = 0; i < 4;) {\\n\\t\\t\\t\\tmax += r * m \\/ Math.pow(Math.log1p(m), ++i);\\n\\t\\t\\t\\tr *= i;\\n\\t\\t\\t}\\n\\t\\t\\tp = new int[(int) max];\\n\\t\\t\\tfor (int i = 0, e = 2; i < p.length; i++) {\\n\\t\\t\\t\\tfor (; isPrime(e) < 1; e++)\\n\\t\\t\\t\\t\\t;\\n\\t\\t\\t\\tp[i] = e++;\\n\\t\\t\\t}\\n\\t\\t\\tthis.m = p[p.length - 1];\\n\\t\\t\\tthis.m = this.m * this.m;\\n\\t\\t}\\n\\n\\t\\tint isPrime(int n) {\\n\\t\\t\\tfor (int e : p)\\n\\t\\t\\t\\tif (e < 1)\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\telse if (n != e && n % e < 1)\\n\\t\\t\\t\\t\\treturn 0;\\n\\t\\t\\treturn 1;\\n\\t\\t}\\n\\n\\t\\tint max() {\\n\\t\\t\\treturn m;\\n\\t\\t}\\n\\n\\t\\tint[] p;\\n\\t\\tint m;\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.PrintWriter;\\n\\nimport java.util.*;\\nimport java.util.Arrays ; \\nimport java .lang.String.* ;\\nimport java .lang.StringBuilder ;\\n\\n\\npublic class Test{\\n static int pos = 0 ; \\n static int arr[] ; \\n static LinkedList l1 = new LinkedList() ; \\nstatic void find(int p ,char[]x,int put[],String s){\\n int c= 0 ; \\n for (int i = 0; i < s.length(); i++) {\\n if(x[p]==s.charAt(i)){\\n c++ ; }\\n }\\n put[p] = c ; \\n}\\nstatic int mode(int m ,int[]x ){\\n int temp = 0 ; \\n for (int i = x.length-1; i >=0; i--) {\\n if(x[i]<=m){\\n temp= x[i] ; \\n \\/\\/\\/ break ; \\n return m-temp ; \\n \\n }\\n }\\n return m-temp ; \\n}\\nstatic int mode2(int m ,int[]x ){\\n int temp = 0 ; \\n \\n for (int i = x.length-1; i >=0; i--) {\\n if(x[i]<=m){\\n temp= x[i] ; \\n \\/\\/\\/ break ; \\n return x[i] ; \\n \\n }\\n }\\n return 0 ; \\n}\\nstatic int find(int x[],int temp){\\n int j = 0 ; \\n for (int i = x.length-1; i >=0; i--) {\\n if(x[i]==temp) return j+1 ; \\n j++ ; \\n }\\n return -1 ; \\n}\\nstatic String ch(long[]x,long b){\\n for (int i = 0; i < x.length; i++) {\\n if(x[i]==b)return \\\"YES\\\" ;\\n }\\n return \\\"NO\\\" ; \\n}\\n\\n public static void main(String[] args) {\\n\\n Scanner in = new Scanner(System.in) ;\\n PrintWriter pw = new PrintWriter(System.out); \\n int k=in.nextInt(), n=in.nextInt(), s=in.nextInt(), p=in.nextInt() ;\\n int paper =n\\/s; \\n if(n%s!=0) paper++ ; \\n paper*=k ; \\n int fin = paper\\/p ; \\n if(paper%p!=0) fin++ ; \\n System.out.println( fin );\\n \\n \\n } \\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/never leave a uncompleted question in this file, always remove the code after submitting it.\\n\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class run{\\n public static void main(String args[]){\\n Scanner in = new Scanner(System.in);\\n long n = in.nextInt();\\n long k = in.nextInt();\\n long ans = (-3 + (long)Math.sqrt(9+8*(n+k)))\\/2;\\n System.out.println(n-ans);\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class programA {\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint n = Integer.parseInt(br.readLine());\\n\\t\\tif(n%2 == 0)System.out.println(n\\/2 +1);\\n\\t\\telse System.out.println((int)Math.ceil((double)n\\/2));\\n\\t}\\n}\\n\\n\\n\\n\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class Subtractions {\\n\\t\\n\\t\\n\\t\\n\\t\\n\\tpublic static void main(String[]args){\\n\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\tint test=sc.nextInt();\\n\\t\\twhile(test-->0){\\n\\t\\t\\tlong a=sc.nextLong();\\n\\t\\t\\tlong b=sc.nextLong();\\n\\t\\t\\tlong count=0;\\n\\t\\t\\tlong cnt=0;\\n\\t\\t\\twhile(a>0&&b>0){\\n\\t\\t\\t\\tcount=0;\\n\\t\\t\\t\\t\\/\\/System.out.println(a+\\\" \\\"+b);\\n\\t\\t\\tif(a>b){\\n\\t\\t\\tcount+=(a-b)\\/b;\\n\\t\\t\\tif(count!=0){\\n\\t\\t\\tcnt+=count;\\n\\t\\t\\ta-=b*count;}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tcnt++;\\n\\t\\t\\t\\ta-=b;\\n\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse{ \\n\\t\\t\\t\\tcount+=(b-a)\\/a;\\n\\t\\t\\t\\tif(count!=0){\\n\\t\\t\\t\\tcnt+=count;\\n\\t\\t\\tb-=a*count;}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tcnt++;\\n\\t\\t\\t\\t\\tb-=a;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\tSystem.out.println(cnt);\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t}\\n\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class StrangeAddition {\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tsc = new StringTokenizer(br.readLine());\\n\\t\\tint tc = nxtInt();\\n\\t\\twhile (tc-- > 0) {\\n\\t\\t\\tint a = nxtInt();\\n\\t\\t\\tint b = nxtInt();\\n\\t\\t\\tint ans = 0;\\n\\t\\t\\twhile (a != b) {\\n\\t\\t\\t\\tif (a == 0 || b == 0)\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\tif (a > b) {\\n\\t\\t\\t\\t\\tint div = a \\/ b;\\n\\t\\t\\t\\t\\ta -= b * div;\\n\\t\\t\\t\\t\\tans += div;\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tint div = b \\/ a;\\n\\t\\t\\t\\t\\tb -= a * div;\\n\\t\\t\\t\\t\\tans += div;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tout.println(ans + (a == b ? 1 : 0));\\n\\t\\t}\\n\\t\\tbr.close();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tstatic BufferedReader br = new BufferedReader(new InputStreamReader(\\n\\t\\t\\tSystem.in));\\n\\n\\tstatic StringTokenizer sc;\\n\\n\\tstatic String nxtTok() throws IOException {\\n\\t\\twhile (!sc.hasMoreTokens()) {\\n\\t\\t\\tString s = br.readLine();\\n\\t\\t\\tif (s == null)\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\tsc = new StringTokenizer(s.trim());\\n\\t\\t}\\n\\t\\treturn sc.nextToken();\\n\\t}\\n\\n\\tstatic int nxtInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nxtTok());\\n\\t}\\n\\n\\tstatic long nxtLng() throws IOException {\\n\\t\\treturn Long.parseLong(nxtTok());\\n\\t}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/*\\n * PDPM IIITDM Jabalpur\\n * Asutosh Rana\\n *\\/\\n\\nimport java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\n\\npublic class Main {\\n\\tlong MOD = 1000000007;\\n\\tInputReader in;\\n\\tBufferedReader br;\\n\\tPrintWriter out;\\n\\n\\tpublic static void main(String[] args) throws java.lang.Exception {\\n\\t\\tMain solver = new Main();\\n\\t\\tsolver.in = new InputReader(System.in);\\n\\t\\tsolver.br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tsolver.out = new PrintWriter(System.out);\\n\\t\\tsolver.solve();\\n\\t\\tsolver.out.flush();\\n\\t\\tsolver.out.close();\\n\\t}\\n\\n\\tpublic void solve() {\\n\\n\\t\\tint tc = 1;\\/\\/in.readInt();\\n\\n\\t\\tfor (int cas = 1; cas <= tc; cas++) {\\n\\t\\t\\tint N = in.readInt();\\n\\t\\t\\tint[] A = new int[N];\\n\\t\\t\\tin.readInt(A);\\n\\n\\t\\t\\tint res = 0;\\n\\t\\t\\tfor(int i=0;iA[j])\\n\\t\\t\\t\\t\\t\\tres++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tres = res % 2;\\n\\t\\t\\t\\n\\t\\t\\tint Q = in.readInt();\\n\\t\\t\\twhile(Q-->0){\\n\\t\\t\\t\\tint l = in.readInt();\\n\\t\\t\\t\\tint r = in.readInt();\\n\\t\\t\\t\\tint add = (r-l+1)\\/2;\\n\\t\\t\\t\\tres = res + add;\\n\\t\\t\\t\\tres%=2;\\n\\t\\t\\t\\tout.println(res%2==0?\\\"even\\\":\\\"odd\\\");\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n\\n}\\n\\nclass InputReader {\\n\\tprivate InputStream stream;\\n\\tprivate byte[] buf = new byte[1024];\\n\\tprivate int curChar;\\n\\tprivate int numChars;\\n\\tprivate SpaceCharFilter filter;\\n\\n\\tpublic InputReader(InputStream stream) {\\n\\t\\tthis.stream = stream;\\n\\t}\\n\\n\\tpublic int read() {\\n\\t\\tif (numChars == -1)\\n\\t\\t\\tthrow new InputMismatchException();\\n\\t\\tif (curChar >= numChars) {\\n\\t\\t\\tcurChar = 0;\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tnumChars = stream.read(buf);\\n\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t}\\n\\t\\t\\tif (numChars <= 0)\\n\\t\\t\\t\\treturn -1;\\n\\t\\t}\\n\\t\\treturn buf[curChar++];\\n\\t}\\n\\n\\tpublic int readInt() {\\n\\t\\tint c = read();\\n\\t\\twhile (isSpaceChar(c))\\n\\t\\t\\tc = read();\\n\\t\\tint sgn = 1;\\n\\t\\tif (c == '-') {\\n\\t\\t\\tsgn = -1;\\n\\t\\t\\tc = read();\\n\\t\\t}\\n\\t\\tint res = 0;\\n\\t\\tdo {\\n\\t\\t\\tif (c < '0' || c > '9')\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\tres *= 10;\\n\\t\\t\\tres += c - '0';\\n\\t\\t\\tc = read();\\n\\t\\t} while (!isSpaceChar(c));\\n\\t\\treturn res * sgn;\\n\\t}\\n\\n\\tpublic void readInt(int[] A) {\\n\\t\\tfor (int i = 0; i < A.length; i++)\\n\\t\\t\\tA[i] = readInt();\\n\\t}\\n\\n\\tpublic long readLong() {\\n\\t\\tint c... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class B {\\n\\n\\tstatic int n, t[], g[], MOD = (int) 1e9 + 7;\\n\\tstatic int[][][] memo1, memo2[], memo3[];\\n\\n\\tstatic int dp1(int idx, int remCnt, int remSum) {\\n\\t\\tif (idx == n)\\n\\t\\t\\treturn remSum == 0 && remCnt == 0 ? 1 : 0;\\n\\t\\tif (remCnt < 0 || remSum < 0)\\n\\t\\t\\treturn 0;\\n\\t\\tif (memo1[idx][remCnt][remSum] != -1)\\n\\t\\t\\treturn memo1[idx][remCnt][remSum];\\n\\t\\tint ans = dp1(idx + 1, remCnt, remSum);\\n\\t\\tif (g[idx] == 0) {\\n\\t\\t\\tans += dp1(idx + 1, remCnt - 1, remSum - t[idx]);\\n\\t\\t\\tif (ans >= MOD)\\n\\t\\t\\t\\tans -= MOD;\\n\\t\\t}\\n\\t\\treturn memo1[idx][remCnt][remSum] = ans;\\n\\t}\\n\\n\\tstatic int dp2(int idx, int remCnt1, int remCnt2, int remSum) {\\n\\n\\t\\tif (idx == n)\\n\\t\\t\\treturn remSum == 0 && remCnt1 == 0 && remCnt2 == 0 ? 1 : 0;\\n\\t\\tif (remSum < 0 || remCnt1 < 0 || remCnt2 < 0)\\n\\t\\t\\treturn 0;\\n\\t\\tif (memo2[idx][remCnt1][remCnt2][remSum] != -1)\\n\\t\\t\\treturn memo2[idx][remCnt1][remCnt2][remSum];\\n\\t\\tint ans = dp2(idx + 1, remCnt1, remCnt2, remSum);\\n\\n\\t\\tif (g[idx] == 1)\\n\\t\\t\\tans += dp2(idx + 1, remCnt1 - 1, remCnt2, remSum - t[idx]);\\n\\t\\telse if (g[idx] == 2)\\n\\t\\t\\tans += dp2(idx + 1, remCnt1, remCnt2 - 1, remSum - t[idx]);\\n\\t\\tif (ans >= MOD)\\n\\t\\t\\tans -= MOD;\\n\\t\\treturn memo2[idx][remCnt1][remCnt2][remSum] = ans;\\n\\t}\\n\\n\\tprivate static int dp3(int cnt0, int cnt1, int cnt2, int last) {\\n\\t\\tif (cnt0 + cnt1 + cnt2 == 0)\\n\\t\\t\\treturn 1;\\n\\t\\tif (memo3[last][cnt0][cnt1][cnt2] != -1)\\n\\t\\t\\treturn memo3[last][cnt0][cnt1][cnt2];\\n\\t\\tlong ans = 0;\\n\\t\\tif (cnt0 > 0 && last != 0)\\n\\t\\t\\tans += dp3(cnt0 - 1, cnt1, cnt2, 0);\\n\\t\\tif (cnt1 > 0 && last != 1)\\n\\t\\t\\tans += dp3(cnt0, cnt1 - 1, cnt2, 1);\\n\\t\\tif (cnt2 > 0 && last != 2)\\n\\t\\t\\tans += dp3(cnt0, cnt1, cnt2 - 1, 2);\\n\\t\\treturn memo3[last][cnt0][cnt1][cnt2] = (int) (ans % MOD);\\n\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner sc = new Scanner();\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tn = sc.nextInt();\\n\\t\\tint[] fac = new int[n + 1];\\n\\t\\tt = new int[n];\\n\\t\\tg = new int[n];\\n\\t\\tint[] cnt = new int[3];\\n\\t\\tfac[0] = 1;\\n\\t\\tfor (int i = 1; i <= n; i++)\\n\\t\\t\\tfac[i] = (int) (i * 1L * fac[i - 1] % MOD);\\n\\t\\tint T =... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author ZYCSwing\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n Scanner in = new Scanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n private static final int MOD = (int) 1e9 + 7;\\n private static final int N = 5000;\\n\\n public void solve(int testNumber, Scanner in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] dp = new int[N];\\n Arrays.fill(dp, 0);\\n dp[0] = 1;\\n String pre = null, ch;\\n for (int i = 0; i < n; ++i) {\\n ch = in.next();\\n if (i > 0) {\\n if (pre.equals(\\\"s\\\")) {\\n int j = N - 1;\\n while (dp[j] == 0) {\\n --j;\\n }\\n long sum = 0;\\n for (; j >= 0; --j) {\\n sum += dp[j];\\n sum %= MOD;\\n dp[j] = (int) sum;\\n }\\n } else {\\n for (int k = N - 1; k > 0; --k) {\\n dp[k] = dp[k - 1];\\n }\\n dp[0] = 0;\\n }\\n }\\n pre = ch;\\n }\\n\\n long sum = 0;\\n for (int i = 0; i < N; ++i) {\\n sum += dp[i];\\n sum %= MOD;\\n }\\n out.println(sum);\\n }\\n\\n }\\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\n\\/**\\n * @author def\\n * @version 1.0\\n *\\/\\npublic class B {\\n\\n public static void main(String[] args) throws IOException {\\n new B().solve();\\n }\\n\\n void solve() throws IOException {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n\\n int n = Integer.parseInt(in.readLine());\\n while (n-- > 0) {\\n String s = in.readLine();\\n int pr = s.indexOf('R');\\n int pc = s.indexOf('C');\\n if (pr == 0 && pc > 1 && Character.isDigit(s.charAt(1))) {\\n int r = Integer.parseInt(s.substring(1, pc));\\n int c = Integer.parseInt(s.substring(pc + 1, s.length()));\\n out.println(i2s(c) + r);\\n } else {\\n int i = 0;\\n while (!Character.isDigit(s.charAt(i))) ++i;\\n out.println(\\\"R\\\" + Integer.parseInt(s.substring(i, s.length())) + \\\"C\\\" + s2i(s.substring(0, i)));\\n }\\n }\\n\\n out.close();\\n }\\n\\n int s2i(String s) {\\n int r = 0;\\n for (int i = 0; i < s.length(); ++i) {\\n r = r * 26 + (s.charAt(i) - 'A' + 1);\\n }\\n return r;\\n }\\n\\n String i2s(int i) {\\n StringBuffer s = new StringBuffer();\\n while (i > 0) {\\n i -= 1;\\n s.append((char)('A' + (i % 26)));\\n i \\/= 26;\\n }\\n return s.reverse().toString();\\n }\\n\\n BufferedReader in;\\n PrintWriter out;\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\nimport java.awt.geom.*;\\nimport static java.lang.Math.*;\\npublic class Main implements Runnable\\n{\\n boolean multiiple = false;\\n\\n void solve() throws Exception\\n {\\n int n = sc.nextInt();\\n\\n ArrayList list = new ArrayList<>();\\n for (int i = 0; i < n; i++)\\n list.add(sc.nextInt());\\n Collections.sort(list);\\n int ans = 0;\\n while (!list.isEmpty())\\n {\\n ans++;\\n int next = list.get(0);\\n for (int i = list.size() - 1; i >= 1; i--)\\n {\\n if (list.get(i) % next == 0)\\n list.remove(i);\\n }\\n list.remove(0);\\n }\\n\\n System.out.println(ans);\\n }\\n\\n @Override\\n public void run()\\n {\\n try\\n {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n sc = new FastScanner(in);\\n if (multiiple)\\n {\\n int q = sc.nextInt();\\n for (int i = 0; i < q; i++)\\n solve();\\n }\\n else\\n solve();\\n }\\n catch (Throwable uncaught)\\n {\\n Main.uncaught = uncaught;\\n }\\n finally\\n {\\n out.close();\\n }\\n }\\n\\n public static void main(String[] args) throws Throwable {\\n Thread thread = new Thread(null, new Main(), \\\"\\\", (1 << 26));\\n thread.start();\\n thread.join();\\n if (Main.uncaught != null) {\\n throw Main.uncaught;\\n }\\n }\\n\\n static Throwable uncaught;\\n BufferedReader in;\\n FastScanner sc;\\n PrintWriter out;\\n}\\n\\nclass FastScanner\\n{\\n BufferedReader in;\\n StringTokenizer st;\\n\\n public FastScanner(BufferedReader in)\\n {\\n this.in = in;\\n }\\n\\n public String nextToken() throws Exception {\\n while (st == null || !st.hasMoreTokens()) {\\n st = new StringTokenizer(in.readLine());\\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class Main {\\n \\n final static long Mod = 1000000009;\\n static long n, m, k, t, l, u, ans;\\n static Scanner cin = new Scanner(System.in); \\n \\n static long multi_mod(long base, long cur) {\\n long res = 1;\\n while(cur > 0) {\\n if(cur % 2 == 1) res = (res * base) % Mod;\\n cur >>= 1;\\n base = (base * base) % Mod;\\n }\\n return res;\\n }\\n \\n public static void main(String[] args) {\\n n = cin.nextLong(); m = cin.nextLong(); k = cin.nextLong();\\n l = (k - 1)*(n \\/ k) + n % k;\\n if(m <= l) {\\n System.out.println(m);\\n }\\n else {\\n t = n \\/ k;\\n u = m - l;\\n ans = (0 + (t - u) * (k - 1) + n % k) % Mod;\\n ans = (ans + ((k)*((multi_mod(2, u + 1) - 2 + Mod) % Mod)) % Mod) % Mod;\\n System.out.println(ans);\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class n2{\\n public static void main(String[] args) throws Exception{\\n BufferedReader in=new BufferedReader(new InputStreamReader(System.in));\\n int n=Integer.parseInt(in.readLine());\\n int[] S=new int[4];\\n int[] L=new int[4];\\n int m=0;\\n for(int i=0;i0){\\n count+=S[i];\\n }\\n if(L[i]>0){\\n count+=L[i];\\n }\\n }\\n if(m>0){\\n count+=m;\\n }\\n System.out.println(count);\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\npublic class Main{\\n public static void main(String[] args){\\n Scanner scan = new Scanner(System.in);\\n int n = scan.nextInt();\\n if (n % 4 == 0 || n % 7 == 0 || n % 47 == 0 || n % 77 == 0 || n % 74 == 0 || n % 447 == 0 || n % 474 == 0 || n % 477 == 0 || n % 747 == 0 || n % 774 == 0 || n % 777 == 0)\\n System.out.println(\\\"YES\\\");\\n else\\n System.out.println(\\\"NO\\\");\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\npublic class LCM {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tlong n=sc.nextLong();\\n\\t\\tif(n < 3) {\\n\\t\\t\\tSystem.out.println(n);\\n\\t\\t}\\n\\t\\telse if(n % 2 != 0) {\\n\\t\\t\\tSystem.out.println(n * (n-1) * (n-2));\\n\\t\\t}\\n\\t\\telse if(n % 3 == 0) {\\n\\t\\t\\tSystem.out.println((n-1) * (n-2) * (n-3));\\n\\t\\t}\\n\\t\\telse {\\n\\t\\t\\tSystem.out.println(n * (n-1) * (n-3));\\n\\t\\t}\\n\\t}\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Vaibhav Pulastya\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n BSportMafia solver = new BSportMafia();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class BSportMafia {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n long n = in.nextInt();\\n long k = in.nextInt();\\n long d = 9 + 4 * (2 * n + 2 * k);\\n double smh = Math.sqrt(d);\\n double ans = (-3 + smh) \\/ 2;\\n out.println(n - (int) ans);\\n }\\n\\n }\\n\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n if (numChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n public int nextInt() {\\n int c = read();\\n while (isSpaceChar(c))\\n c = read();\\n int sgn = 1;\\n if (c == '-') {\\n sgn = -1;\\n c = read();\\n... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Solution {\\n public static void main (String[] args) throws IOException {\\n boolean online = \\\"true\\\".equals(System.getProperty(\\\"ONLINE_JUDGE\\\"));\\n if (online) {\\n in = new InputReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n }\\n else {\\n in = new InputReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(new File(\\\"output.txt\\\"));\\n }\\n \\n new Solution().run();\\n \\n out.close();\\n }\\n \\n long sum (int x) {\\n return x * 1l * (x+1) \\/ 2;\\n }\\n \\n int bins (long n, int k) {\\n int l = 1,\\n r = k;\\n while (l < r) {\\n int w = (l+r)\\/2;\\n long s = sum(k) - sum(w-1);\\n if (s == n)\\n return w;\\n if (s < n)\\n r = w;\\n else\\n l = w+1;\\n }\\n return l;\\n }\\n \\n private void run () {\\n long n = in.nextLong();\\n int k = in.nextInt();\\n if (n == 1) {\\n out.println(0);\\n return;\\n }\\n if (1 + sum(k-1) < n) {\\n out.println(-1);\\n return;\\n }\\n int c = bins(n-1,k-1);\\n if (1 + sum(k-1) - sum(c-1) == n)\\n out.println(k-c);\\n else\\n out.println(k-c+1);\\n }\\n \\n private static InputReader in;\\n private static PrintWriter out;\\n}\\n\\nclass InputReader {\\n public InputReader (Reader r) {\\n buff = new BufferedReader(r);\\n try {\\n str = new StringTokenizer(buff.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n \\n public String next () {\\n while (!str.hasMoreTokens())\\n try {\\n str = new StringTokenizer(buff.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return str.nextToken();\\n }\\n \\n public int nextInt () {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.util.Scanner;\\n\\npublic class problemA {\\n public static void main(String[] args) {\\n Scanner scan = new Scanner(System.in);\\n int n = scan.nextInt();\\n int[] numbs = new int[n];\\n int[] smallest_color = new int[n];\\n for(int i = 0; i < n;i++){\\n numbs[i] = scan.nextInt();\\n }\\n Arrays.sort(numbs);\\n int count = 0;\\n for(int i =0; i < n; i++){\\n for(int j=0; j map = new HashMap<>();\\n boolean[] dp;\\n boolean[] vis;\\n boxPair[] ans;\\n\\n int two(int bit) {\\n return 1 << bit;\\n }\\n\\n boolean contain(int mask, int bit) {\\n return ((two(bit) & mask) > 0);\\n }\\n\\n int get(long val) {\\n if (val > Integer.MAX_VALUE || val < Integer.MIN_VALUE) return -1;\\n int key = (int) val;\\n if (map.containsKey(key) == false) return -1;\\n return map.get(key);\\n }\\n\\n boolean rec(int mask, boolean[] hasCycle) {\\n if (hasCycle[mask]) return true;\\n if (vis[mask] == true) return dp[mask];\\n vis[mask] = true;\\n for (int i = mask & (mask - 1); i > 0; i = mask & (i - 1)) {\\n if (rec(i, hasCycle) && rec(i ^ mask, hasCycle)) {\\n return dp[mask] = true;\\n }\\n }\\n return dp[mask] = false;\\n }\\n\\n void findPath(int mask, boolean[] hasCycle, ArrayList[] maskPath) {\\n if (hasCycle[mask]) {\\n for (boxPair b : maskPath[mask]) {\\n ans[get(b.addTo)] = b;\\n }\\n return;\\n }\\n for (int i = mask & (mask -... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Codeforces913F {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner input = new Scanner(System.in);\\n\\t\\tint n = input.nextInt();\\n\\t\\tint a = input.nextInt();\\n\\t\\tint b = input.nextInt();\\n\\t\\tinput.close();\\n\\t\\tfinal int mod = 998244353;\\n\\t\\t\\n\\t\\tint frac = multiply(a, inverse(b, mod), mod);\\n\\t\\tint reverse = (mod+1-frac)%mod;\\n\\t\\t\\n\\t\\tint[] fracpower = new int[n+1];\\n\\t\\tint[] reversepower = new int[n+1];\\n\\t\\tfracpower[0] = 1;\\n\\t\\treversepower[0] = 1;\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tfracpower[i] = multiply(fracpower[i-1], frac, mod);\\n\\t\\t\\treversepower[i] = multiply(reversepower[i-1], reverse, mod);\\n\\t\\t}\\n\\t\\t\\n\\t\\tint[][] dp1 = new int[n+1][n+1];\\n\\t\\tdp1[2][1] = 1;\\n\\t\\tfor (int i = 3; i <= n; i++) {\\n\\t\\t\\tfor (int j = 1; j < i; j++) {\\n\\t\\t\\t\\tif (j == 1) {\\n\\t\\t\\t\\t\\tdp1[i][j] = fracpower[i-1];\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tdp1[i][j] = multiply(dp1[i-1][j-1], fracpower[i-j], mod);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (j == i-1) {\\n\\t\\t\\t\\t\\tdp1[i][j] += reversepower[i-1];\\n\\t\\t\\t\\t\\tdp1[i][j] %= mod;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tdp1[i][j] += multiply(dp1[i-1][j], reversepower[j], mod);\\n\\t\\t\\t\\t\\tdp1[i][j] %= mod;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tint[][] dp2 = new int[n+1][n+1];\\n\\t\\tdp2[1][1] = 1;\\n\\t\\tdp2[2][1] = 1;\\n\\t\\tdp2[2][2] = 0;\\n\\t\\tfor (int i = 3; i <= n; i++) {\\n\\t\\t\\tint val = 0;\\n\\t\\t\\tfor (int j = 1; j < i; j++) {\\n\\t\\t\\t\\tdp2[i][j] = multiply(dp2[j][j], dp1[i][j], mod);\\n\\t\\t\\t\\tval += dp2[i][j];\\n\\t\\t\\t\\tval %= mod;\\n\\t\\t\\t}\\n\\t\\t\\tdp2[i][i] = (mod+1-val)%mod;\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\/*for (int i = 2; i <= n; i++) {\\n\\t\\t\\tfor (int j = 1; j <= i; j++) {\\n\\t\\t\\t\\tSystem.out.print(dp2[i][j] + \\\" \\\");\\n\\t\\t\\t}\\n\\t\\t\\tSystem.out.println();\\n\\t\\t}*\\/\\n\\t\\t\\n\\t\\tint[] EV = new int[n+1];\\n\\t\\tEV[1] = 0;\\n\\t\\tEV[2] = 1;\\n\\t\\tfor (int i = 3; i <= n; i++) {\\n\\t\\t\\tint val = 0;\\n\\t\\t\\tfor (int j = 1; j < i; j++) {\\n\\t\\t\\t\\tint r = j*(i-j) + (j*(j-1))\\/2 + EV[i-j] + EV[j];\\n\\t\\t\\t\\tr %= mod;\\n\\t\\t\\t\\tval += multiply(dp2[i][j], r, mod);\\n\\t\\t\\t\\tval %= mod;\\n\\t\\t\\t}\\n\\t\\t\\tval += multiply((i*(i-1))\\/2, dp2[i][i], mod);\\n\\t\\t\\tval %= mod;\\n\\t\\t\\t\\n\\t\\t\\tint s = (mod+1-dp2[i][i])%mod;\\n\\t\\t\\tEV[i] = multiply(val, inverse(s, mod), mod);\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(EV[n]);\\n\\t}\\n\\t\\n\\tpublic static int... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class Soldiers {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tnew Soldiers().run();\\n\\t}\\n\\n\\tvoid run() throws IOException {\\n\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tpw = new PrintWriter(System.out);\\n\\n\\t\\tint n = nextInt();\\n\\t\\tpw.println(3 * (n \\/ 2));\\n\\n\\t\\tpw.close();\\n\\t}\\n\\n\\tBufferedReader br;\\n\\tStringTokenizer st;\\n\\tPrintWriter pw;\\n\\n\\tString next() throws IOException {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\n\\tdouble nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.math.BigInteger;\\nimport java.util.StringTokenizer;\\n\\n\\npublic class problemA {\\n public static long GCD(long number1, long number2) {\\n \\/\\/base case\\n if(number2 == 0){\\n return number1;\\n }\\n return GCD(number2, number1%number2);\\n }\\n \\n\\npublic static void main(String[] args) throws NumberFormatException, IOException {\\n BufferedReader br = new BufferedReader (new InputStreamReader(System.in));\\n StringTokenizer st = new StringTokenizer(br.readLine());\\n long b = Long.parseLong(st.nextToken());\\n long c = Long.parseLong(st.nextToken());\\n if(c-b<2 ||((c-b==2)&& GCD(c,b)==1) ){\\n System.out.println(\\\"-1\\\");\\n }else{\\n if(b%2==0 ){\\n System.out.println(b+\\\" \\\"+(b+1)+\\\" \\\"+(b+2));\\n }else\\n System.out.println((b+1)+\\\" \\\"+(b+2)+\\\" \\\"+(b+3));\\n \\n \\n \\n}\\n \\n\\n \\n\\n}\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\n\\npublic class Main {\\n\\n\\tboolean test = false;\\n\\tPrintWriter pw = new PrintWriter(System.out);\\n\\tInputStreamReader inp = new InputStreamReader(System.in);\\n\\tBufferedReader in = new BufferedReader(inp);\\n\\t\\n\\tprivate String[] inData = {\\\"zzz\\\"\\n\\t\\t\\t};\\n\\t\\n\\t\\n\\tstatic int id = -1;\\n\\t\\n\\tpublic String readLine() {\\n\\t\\tid++;\\n\\t\\tif (test)\\n\\t\\t\\treturn inData[id];\\n\\t\\telse\\n\\t\\t\\ttry{\\n\\t\\t\\t\\treturn in.readLine();\\t\\n\\t\\t\\t} catch( Exception e){\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\treturn \\\"\\\";\\n\\t}\\n\\n\\tprivate void solve() {\\n\\t\\t\\n\\t\\tString readLine = readLine();\\n\\t\\t\\n\\t\\tint best = 0;\\n\\t\\t\\n\\t\\tfor (int i = 0; i < readLine.length(); i++) {\\n\\t\\t\\tfor (int j = i; j < readLine.length(); j++) {\\n\\t\\t\\t\\tString substring = readLine.substring(i,j+1);\\n\\t\\t\\t\\tString remainString = readLine.substring(i+1);\\n\\t\\t\\t\\tif(remainString.contains(substring)){\\n\\t\\t\\t\\t\\tif(substring.length() > best){\\n\\t\\t\\t\\t\\t\\tbest = substring.length();\\t\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(best);\\n\\t}\\n\\t\\n\\tpublic static void main(String args[]) throws Exception {\\n\\n\\t\\tnew Main().solve();\\n }\\n\\n\\t\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class utkarsh{\\n\\tBufferedReader br;\\n\\tPrintWriter out;\\n\\n\\tint game(int s, int mid, int e, int[] a){\\n\\t\\tint i, j, n, m;\\n\\t\\tn = mid - s + 1;\\n\\t\\tm = e - mid;\\n\\t\\tint b[] = new int[n];\\n\\t\\tint c[] = new int[m];\\n\\t\\tfor(i = 0; i < n; i++)\\tb[i] = a[s + i];\\n\\t\\tfor(j = 0; j < m; j++)\\tc[j] = a[mid + 1 + j];\\n\\t\\ti = j = 0;\\n\\t\\tint ans = 0;\\n\\t\\tfor(int k = s; k <= e; k++){\\n\\t\\t\\tif(i == n){\\n\\t\\t\\t\\ta[k] = c[j++];\\n\\t\\t\\t}else if(j == m){\\n\\t\\t\\t\\ta[k] = b[i++];\\n\\t\\t\\t}else{\\n\\t\\t\\t\\tif(b[i] < c[j]){\\n\\t\\t\\t\\t\\ta[k] = b[i++];\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\ta[k] = c[j++];\\n\\t\\t\\t\\t\\tans += n - i;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn ans;\\n\\t}\\n\\n\\tint play(int s, int e, int[] a){\\n\\t\\tif(s >= e)\\treturn 0;\\n\\t\\tint m = (s + e) >> 1;\\n\\t\\treturn play(s, m, a) + play(m+1, e, a) + game(s, m, e, a);\\n\\t}\\n\\n\\tvoid solve(){\\n\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tint i, j, k, l, r, n;\\n\\t\\tn = ni();\\n\\t\\tint a[] = new int[n];\\n\\t\\tint d[] = new int[n];\\n\\t\\tfor(i = 0; i < n; i++) {\\n\\t\\t\\ta[i] = ni();\\n\\t\\t\\td[i] = a[i];\\n\\t\\t}\\n\\t\\tint ans = (play(0, n-1, d) & 1);\\n\\n\\t\\tint q = ni();\\n\\t\\twhile(q-- > 0){\\n\\t\\t\\tl = ni();\\tr = ni();\\n\\t\\t\\tans ^= ((r - l + 1) * (r - l) \\/ 2);\\n\\t\\t\\t\\/\\/out.println(ans);\\n\\t\\t\\tif((ans & 1) > 0)\\tout.println(\\\"odd\\\");\\n\\t\\t\\telse\\t\\t\\t\\tout.println(\\\"even\\\");\\n\\t\\t}\\n\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tint ni(){\\n\\t\\treturn Integer.parseInt(ns());\\n\\t}\\n\\n\\tString ip[];\\n\\tint len, sz;\\n\\n\\tString ns(){\\n\\t\\tif(len >= sz){\\n\\t\\t\\ttry{\\n\\t\\t\\t\\tip = br.readLine().split(\\\" \\\");\\n\\t\\t\\t\\tlen = 0;\\n\\t\\t\\t\\tsz = ip.length;\\n\\t\\t\\t}catch(IOException e){\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t}\\n\\t\\t\\tif(sz <= 0)\\treturn \\\"-1\\\";\\n\\t\\t}\\n\\t\\treturn ip[len++];\\n\\t}\\n\\n\\tpublic static void main(String[] args){\\tnew utkarsh().solve();\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n CNastyaAndAWardrobe solver = new CNastyaAndAWardrobe();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class CNastyaAndAWardrobe {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n long x = in.nextLong(), k = in.nextLong();\\n if (x != 0) {\\n long m = (int) 1e9 + 7;\\n x = x % m;\\n long res = in.fastPowerMod(2, k, m);\\n long res1 = (2 * res) % m;\\n long ans = ((res1 * x) % m - (res - 1) % m) % m;\\n ans = (ans + m) % m;\\n out.println(ans);\\n } else {\\n out.println(0);\\n }\\n }\\n\\n }\\n\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private InputReader.SpaceCharFilter filter;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n\\n if (numChars <= 0)\\n return -1;\\n }\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.* ;\\nimport java.util.* ;\\nimport java.text.* ;\\nimport java.math.* ;\\nimport static java.lang.Math.min ;\\nimport static java.lang.Math.max ;\\nimport static java.lang.Math.sqrt ;\\npublic class Codeshefcode{\\n\\tpublic static void main(String[] args) throws IOException{\\n\\t\\tSolver Machine = new Solver() ;\\n\\t\\tMachine.Solve() ;\\n\\t\\tMachine.Finish() ;\\n\\t\\t\\/\\/ new Thread(null,new Runnable(){\\n\\t\\t\\/\\/ \\tpublic void run(){\\n\\t\\t\\/\\/ \\t\\tSolver Machine = new Solver() ;\\n\\t\\t\\/\\/ \\t\\ttry{\\n\\t\\t\\/\\/ \\t\\t\\tMachine.Solve() ;\\n\\t\\t\\/\\/ \\t\\t\\tMachine.Finish() ;\\n\\t\\t\\/\\/ \\t\\t}catch(Exception e){\\n\\t\\t\\/\\/ \\t\\t\\te.printStackTrace() ;\\n\\t\\t\\/\\/ \\t\\t\\tSystem.out.flush() ;\\n\\t\\t\\/\\/ \\t\\t\\tSystem.exit(-1) ;\\n\\t\\t\\/\\/ \\t\\t}catch(Error e){\\n\\t\\t\\/\\/ \\t\\t\\te.printStackTrace() ;\\n\\t\\t\\/\\/ \\t\\t\\tSystem.out.flush() ;\\n\\t\\t\\/\\/ \\t\\t\\tSystem.exit(-1) ;\\n\\t\\t\\/\\/ \\t\\t}\\n\\t\\t\\/\\/ \\t}\\n\\t\\t\\/\\/ },\\\"Solver\\\",1l<<27).start() ;\\n\\t}\\n}\\nclass Mod{\\n\\tstatic long mod=1000000007 ;\\n\\tstatic long d(long a,long b){ return (a*MI(b))%mod ; }\\n\\tstatic long m(long a,long b){ return (a*b)%mod ; }\\n\\tstatic private long MI(long a){ return pow(a,mod-2) ; }\\n\\tstatic long pow(long a,long b){\\n\\t\\tif(b<0) return pow(MI(a),-b) ;\\n\\t\\tlong val=a ; long ans=1 ;\\n\\t\\twhile(b!=0){\\n\\t\\t\\tif((b&1)==1) ans = (ans*val)%mod ; \\n\\t\\t\\tval = (val*val)%mod ; \\n\\t\\t\\tb\\/=2 ;\\n\\t\\t}\\n\\t\\treturn ans ;\\n\\t}\\t\\n}\\nclass pair implements Comparable{\\n\\tint x ; int y ; \\n\\tpair(int x,int y){ this.x=x ; this.y=y ;} \\n\\tpublic int compareTo(pair p){\\n\\t\\treturn (this.xp.x ? 1 : (this.yp.y ? 1 : 0)))) ;\\n\\t}\\n}\\nclass Solver{\\n\\tReader ip = new Reader(System.in) ;\\t \\n\\tPrintWriter op = new PrintWriter(System.out) ;\\n\\tpublic void Solve() throws IOException{\\n\\t\\tint n = ip.i() ; int r = ip.i() ;\\n\\t\\tdouble x[] = new double[n] ;\\n\\t\\tdouble y[] = new double[n] ;\\n\\t\\tfor(int i=0 ; iy ? x-y : y-x ;\\n\\t}\\n\\tdouble func(double x1,double y1,double r,double... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.text.*;\\npublic class Main{\\n \\/\\/SOLUTION BEGIN\\n \\/\\/Into the Hardware Mode\\n void pre() throws Exception{}\\n void solve(int TC)throws Exception{\\n int n = ni();\\n int[] a = new int[n];\\n for(int i = 0; i< n; i++)a[i] = ni();\\n Arrays.sort(a);\\n int ans = 0;\\n for(int i = 0; i< n; i++){\\n if(a[i] == -1)continue;\\n ans++;\\n for(int j = i+1; j< n; j++)if(a[j]%a[i] == 0)a[j] = -1;\\n }\\n pn(ans);\\n }\\n \\/\\/SOLUTION END\\n void hold(boolean b)throws Exception{if(!b)throw new Exception(\\\"Hold right there, Sparky!\\\");}\\n void exit(boolean b){if(!b)System.exit(0);}\\n long IINF = (long)1e18, mod = (long)1e9+7;\\n final int INF = (int)1e9, MX = (int)2e6+5;\\n DecimalFormat df = new DecimalFormat(\\\"0.00000000\\\");\\n double PI = 3.141592653589793238462643383279502884197169399, eps = 1e-6;\\n static boolean multipleTC = false, memory = false, fileIO = false;\\n FastReader in;PrintWriter out;\\n void run() throws Exception{\\n if(fileIO){\\n in = new FastReader(\\\"input.txt\\\");\\n out = new PrintWriter(\\\"output.txt\\\");\\n }else {\\n in = new FastReader();\\n out = new PrintWriter(System.out);\\n }\\n \\/\\/Solution Credits: Taranpreet Singh\\n int T = (multipleTC)?ni():1;\\n pre();\\n for(int t = 1; t<= T; t++)solve(t);\\n out.flush();\\n out.close();\\n }\\n public static void main(String[] args) throws Exception{\\n if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, \\\"1\\\", 1 << 28).start();\\n else new Main().run();\\n }\\n \\n int digit(long s){int ans = 0;while(s>0){s\\/=10;ans++;}return ans;}\\n long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}\\n int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}\\n int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}\\n void p(Object o){out.print(o);}\\n void pn(Object... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\nimport java.util.List;\\nimport java.awt.*;\\n\\npublic class Trains1_2 implements Runnable {\\n\\n private BufferedReader br = null;\\n private PrintWriter pw = null;\\n private StringTokenizer stk = new StringTokenizer(\\\"\\\");\\n\\n public static void main(String[] args) {\\n new Thread(new Trains1_2()).run();\\n }\\n\\n public void run() {\\n \\/*\\n * try { br = new BufferedReader(new FileReader(\\\"knapsackfixed.in\\\")); pw\\n * = new PrintWriter(\\\"knapsackfixed.out\\\"); } catch\\n * (FileNotFoundException e) { e.printStackTrace(); }\\n *\\/\\n br = new BufferedReader(new InputStreamReader(System.in));\\n pw = new PrintWriter(new OutputStreamWriter(System.out));\\n solver();\\n pw.close();\\n\\n }\\n\\n private void nline() {\\n try {\\n if (!stk.hasMoreTokens())\\n stk = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n throw new RuntimeException(\\\"KaVaBUnGO!!!\\\", e);\\n }\\n }\\n\\n private String nstr() {\\n while (!stk.hasMoreTokens())\\n nline();\\n return stk.nextToken();\\n }\\n\\n private int ni() {\\n return Integer.valueOf(nstr());\\n\\n }\\n\\n private long nl() {\\n\\n return Long.valueOf(nstr());\\n }\\n\\n private double nd() {\\n return Double.valueOf(nstr());\\n\\n }\\n\\n boolean isNumber(char c) {\\n if (c <= '9' && c >= '0')\\n return true;\\n return false;\\n }\\n\\n String to10(String s) {\\n long ans = 0;\\n for (int i = s.length() - 1; i >= 0; i--) {\\n ans += (s.charAt(i) - 'A' + 1) * Math.pow(26, s.length() - i - 1);\\n }\\n return String.valueOf(ans);\\n }\\n \\n String to26(String s){\\n String ans=\\\"\\\";\\n int a = Integer.valueOf(s);\\n while(a>26){\\n a--;\\n int k = a%26;\\n ans=ans+(char)((int)'A'+k);\\n a\\/=26;\\n }\\n ans+=(char)(a+'A'-1);\\n String ans1 = \\\"\\\";\\n for(int i =... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.InputStreamReader;\\nimport java.math.BigInteger;\\n\\npublic class A235 {\\n public static void main(String args[]) throws Exception{\\n BufferedReader ip = new BufferedReader(new InputStreamReader(System.in));\\n int n = Integer.parseInt(ip.readLine());\\n int a,b,c;\\n int x = 0,y = 0,z = 0;\\n BigInteger l,t;\\n \\n if(n-2 > 1)\\n {\\n a = n;\\n b = n-1;\\n c = n-2;\\n }\\n else\\n {\\n a = n;\\n if(n-1 > 1)\\n b = n-1;\\n else\\n b = 1;\\n c = 1;\\n \\n System.out.println(a*b);\\n return;\\n }\\n \\n if(n-3 > 1)\\n {\\n x = n-1;\\n y = n-2;\\n z = n-3;\\n }\\n \\n if(n % 2 == 0)\\n if(n % 3 == 0)\\n l = BigInteger.valueOf(x).multiply(BigInteger.valueOf(y).multiply(BigInteger.valueOf(z)));\\n else\\n {\\n l = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b).multiply(BigInteger.valueOf(c-1)));\\n t = BigInteger.valueOf(x).multiply(BigInteger.valueOf(y).multiply(BigInteger.valueOf(z)));\\n if(l.compareTo(t) < 0)\\n l = t;\\n }\\n else\\n l = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b).multiply(BigInteger.valueOf(c)));\\n \\n System.out.println(l);\\n }\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A {\\n\\n\\tfinal String filename = new String(\\\"C\\\").toLowerCase();\\n\\n\\tvoid solve() throws Exception {\\n\\t\\tint n = nextInt();\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\ta[i] = nextInt();\\n\\t\\t}\\n\\t\\tif (isSorted(a)) {\\n\\t\\t\\tout.println(\\\"YES\\\");\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tint pos1 = -1;\\n\\t\\tfor (int i = 0; i < n - 1; i++) {\\n\\t\\t\\tif (a[i] > a[i + 1]) {\\n\\t\\t\\t\\tint j = i;\\n\\t\\t\\t\\twhile (j >= 0 && a[j] == a[i]) {\\n\\t\\t\\t\\t\\tj--;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tpos1 = j + 1;\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\t\\tint pos2 = -1;\\n\\t\\tfor (int i = n - 2; i >= 0; i--) {\\n\\t\\t\\tif (a[i] > a[i + 1]) {\\n\\t\\t\\t\\tint j = i + 1;\\n\\t\\t\\t\\twhile (j < n && a[j] == a[i + 1]) {\\n\\t\\t\\t\\t\\tj++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tpos2 = j - 1;\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint tmp = a[pos1];\\n\\t\\ta[pos1] = a[pos2];\\n\\t\\ta[pos2] = tmp;\\n\\t\\tif (isSorted(a)) {\\n\\t\\t\\tout.println(\\\"YES\\\");\\n\\t\\t} else {\\n\\t\\t\\tout.println(\\\"NO\\\");\\n\\t\\t}\\n\\t}\\n\\n\\tboolean isSorted(int[] a) {\\n\\t\\tfor (int i = 0; i < a.length - 1; i++) {\\n\\t\\t\\tif (a[i] > a[i + 1]) {\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn true;\\n\\t}\\n\\n\\tvoid run() {\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\t\\/\\/ in = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t\\t\\/\\/ out = new PrintWriter(\\\"output.txt\\\");\\n\\n\\t\\t\\tsolve();\\n\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(1);\\n\\t\\t}\\n\\t}\\n\\n\\tBufferedReader in;\\n\\tStringTokenizer st;\\n\\tPrintWriter out;\\n\\n\\tString nextToken() throws Exception {\\n\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\tst = new StringTokenizer(in.readLine());\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws Exception {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tlong nextLong() throws Exception {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tdouble nextDouble() throws Exception {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew A().run();\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.lang.reflect.Array;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n \\n \\npublic class q5 {\\n\\t\\n\\t\\n\\t\\n \\n \\n\\t\\n \\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\n\\tReader.init(System.in);\\n\\tPrintWriter out=new PrintWriter(System.out);\\n\\tlong n=Reader.nextInt();\\n\\tlong k=Reader.nextLong();\\n\\tlong v=8*n+8*k+4;\\n\\tlong v2=(long) Math.sqrt(v);\\n\\tlong v3=2*n+2;\\n\\t\\/\\/long v4=(v3+v2)\\/2;\\n\\tlong v5=(v3-v2)\\/2;\\n\\tout.println(v5);\\n\\t\\n\\t\\n\\t\\n\\t\\n\\t\\n\\tout.flush();\\n\\t}\\n}\\n\\n\\n\\n\\n \\n \\n \\nclass Reader {\\n static BufferedReader reader;\\n static StringTokenizer tokenizer;\\n \\/** call this method to initialize reader for InputStream *\\/\\n static void init() throws IOException {\\n \\t reader = new BufferedReader(\\n new FileReader(\\\"detect.in\\\"));\\n tokenizer = new StringTokenizer(\\\"\\\");\\n }\\n static void init(InputStream input) {\\n reader = new BufferedReader(\\n new InputStreamReader(input) );\\n tokenizer = new StringTokenizer(\\\"\\\");\\n }\\n \\/** get next word *\\/\\n static String nextLine() throws IOException{\\n \\treturn reader.readLine();\\n }\\n static String next() throws IOException {\\n while ( ! tokenizer.hasMoreTokens() ) {\\n \\/\\/TODO add check for eof if necessary\\n tokenizer = new StringTokenizer(\\n reader.readLine() );\\n }\\n return tokenizer.nextToken();\\n }\\n static int nextInt() throws IOException {\\n return Integer.parseInt( next() );\\n }\\n static long nextLong() throws IOException {\\n return Long.parseLong( next() );\\n }\\n static double nextDouble() throws IOException {\\n return Double.parseDouble( next() );\\n }\\n} Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\n\\/\\/created at 6:06 PM 12\\/9\\/11 by Abrackadabra\\n\\npublic class A {\\n int IOMode = 0; \\/\\/0 - consoleIO, 1 - .in\\/out, 2 - input.txt\\/output.txt, 3 - test case generator\\n String taskName = \\\"\\\";\\n\\n void solve() throws IOException {\\n int n = nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++)\\n a[i] = nextInt();\\n Arrays.sort(a);\\n int z = 0;\\n for (int i = 0; i < n; i++) {\\n if (a[i] != 1) z++;\\n }\\n if (z == 0 && n > 1) a[n - 2] = 2;\\n if (n == 1 && a[0] == 1) {\\n out.println(2);\\n return;\\n }\\n out.print(\\\"1 \\\");\\n for (int i = 0; i < n - 1; i++)\\n out.print(a[i] + \\\" \\\");\\n }\\n\\n public static void main(String[] args) throws IOException {\\n if (args.length > 0 && args[0].equals(\\\"Abra\\\")) debugMode = true;\\n new A().run();\\n }\\n\\n long startTime = System.nanoTime(), tempTime = startTime, finishTime = startTime;\\n long startMem = Runtime.getRuntime().totalMemory(), finishMem = startMem;\\n\\n void run() throws IOException {\\n init();\\n if (debugMode) {\\n con.println(\\\"Start\\\");\\n con.println(\\\"Console output:\\\");\\n }\\n solve();\\n finishTime = System.nanoTime();\\n finishMem = Runtime.getRuntime().totalMemory();\\n out.flush();\\n if (debugMode) {\\n int maxSymbols = 1000, c = 0;\\n BufferedReader tbr = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n char[] a = new char[maxSymbols];\\n tbr.read(a);\\n if (a[0] != 0) {\\n con.println();\\n con.println(\\\"File input:\\\");\\n con.print(a);\\n }\\n boolean left = true;\\n for (int i = 0; i < maxSymbols; i++) left = left && a[i] != 0;\\n if (left) con.println(\\\"...\\\");\\n else con.println();\\n tbr = new BufferedReader(new FileReader(\\\"output.txt\\\"));\\n ... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class A {\\n\\t\\n\\tpublic static boolean realbig (long num, long s) {\\n\\t\\tString str = num + \\\"\\\";\\n\\t\\tString[] digs = str.split(\\\"\\\");\\n\\t\\tint sum = 0;\\n\\t\\tfor(String dig : digs) {\\n\\t\\t\\tsum+= Integer.parseInt(dig);\\n\\t\\t}\\n\\t\\tif(num-sum < s) {\\n\\t\\t\\treturn false;\\n\\t\\t} else {\\n\\t\\t\\treturn true;\\n\\t\\t}\\n\\t}\\n\\n\\t\\t\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tlong n = sc.nextLong();\\n\\t\\tlong s = sc.nextLong();\\n\\t\\tsc.close();\\n\\t\\tlong count = 0;\\n\\t\\tlong i = s;\\n\\t\\tfor(; i < s+200 && i <= n; i++) {\\n\\t\\t\\tif(realbig(i,s)) {\\n\\t\\t\\t\\tcount++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif(i <= n) {\\n\\t\\t\\tcount+=n-i+1;\\n\\t\\t}\\n\\t\\tSystem.out.println(count);\\n\\t}\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.text.*;\\nimport java.math.*;\\n\\npublic class Main{\\n \\n static double EPS=1e-10;\\n static double PI=Math.acos(-1.0);\\n \\n static double p[][]=new double[25][25];\\n static double f[]=new double[1<<20];\\n static int n;\\n \\n \\n public static void PR(String s){\\n System.out.print(s);\\n }\\n \\n public static void PR(double s)\\n {\\n java.text.DecimalFormat d=new java.text.DecimalFormat(\\\"#.0000000\\\");\\n System.out.print(d.format(s));\\n }\\n \\n public static void DP()\\n {\\n int i,j,k,cnt;\\n for(i=0;i<(1<=0;k--)\\n {\\n cnt=0;\\n for(i=0;i 0) {\\n int n = in.nextInt();\\n int m = in.nextInt();\\n\\n int[][] a = new int[n + 1][m];\\n\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < m; j++) {\\n a[i][j] = in.nextInt();\\n a[n][j] = Math.max(a[n][j], a[i][j]);\\n }\\n }\\n\\n a = transpose(a, n, m);\\n\\n Arrays.sort(a, new Comparator() {\\n @Override\\n public int compare(int[] o1, int[] o2) {\\n int max1 = 0;\\n for (int i = 0; i < o1.length; i++) {\\n max1 = Math.max(max1, o1[i]);\\n }\\n\\n int max2 = 0;\\n for (int i = 0; i < o2.length; i++) {\\n max2 = Math.max(max2, o2[i]);\\n }\\n\\n return max2 - max1;\\n }\\n });\\n\\n a = transpose(a, m, n);\\n\\n int[] dp = new int[1 << n];\\n\\n for (int i = 0; i < Math.min(n, m); i++) {\\n int[] best = new int[1 << n];\\n\\n for (int j = 1; j < (1 << n); j++) {\\n for (int k = 0; k < n; k++) {\\n int sum = 0;\\n for (int l = 0; l < n; l++) {\\n if ((j & (1 << l)) != 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\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.OutputStreamWriter;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.Writer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author BSRK Aditya (bsrkaditya@gmail.com)\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tOutputWriter out = new OutputWriter(outputStream);\\n\\t\\tTaskB solver = new TaskB();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskB {\\n\\n long n,x,y,c;\\n\\n\\n\\n\\tpublic void solve(int testNumber, InputReader in, OutputWriter out) {\\n n = in.readInt();\\n x = in.readInt();\\n y = in.readInt();\\n c = in.readInt();\\n\\n int lo = -1;\\n int hi = (int)c;\\n\\n while(lo+1= c) return true;\\n }\\n\\n return false;\\n }\\n\\n private long D(long a, long b) {\\n return b - a + 1;\\n }\\n}\\n\\nclass InputReader {\\n\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private SpaceCharFilter filter;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedWriter;\\nimport java.io.IOException;\\nimport java.io.OutputStreamWriter;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.HashSet;\\nimport java.util.Set;\\nimport java.util.stream.IntStream;\\n\\npublic class Test {\\n static PrintWriter writer =\\n new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\n static int readInt() {\\n int ans = 0;\\n boolean neg = false;\\n try {\\n boolean start = false;\\n for (int c = 0; (c = System.in.read()) != -1; ) {\\n if (c == '-') {\\n start = true;\\n neg = true;\\n continue;\\n } else if (c >= '0' && c <= '9') {\\n start = true;\\n ans = ans * 10 + c - '0';\\n } else if (start) break;\\n }\\n } catch (IOException e) {\\n }\\n return neg ? -ans : ans;\\n }\\n\\n static long readLong() {\\n long ans = 0;\\n boolean neg = false;\\n try {\\n boolean start = false;\\n for (int c = 0; (c = System.in.read()) != -1; ) {\\n if (c == '-') {\\n start = true;\\n neg = true;\\n continue;\\n } else if (c >= '0' && c <= '9') {\\n start = true;\\n ans = ans * 10 + c - '0';\\n } else if (start) break;\\n }\\n } catch (IOException e) {\\n }\\n return neg ? -ans : ans;\\n }\\n\\n static String readLine() {\\n StringBuilder b = new StringBuilder();\\n try {\\n boolean start = false;\\n for (int c = 0; (c = System.in.read()) != -1; ) {\\n if (Character.isLetterOrDigit(c)) {\\n start = true;\\n b.append((char) c);\\n } else if (start) break;\\n }\\n } catch (IOException e) {\\n }\\n return b.toString();\\n }\\n\\n public static void main(String[] args) {\\n Test te = new Test();\\n te.start();\\n writer.flush();\\n }\\n\\n void start() {\\n int t = readInt();\\n while (t-- > 0) {\\n int n = readInt(), m = readInt();\\n int[][] a = new int[n][m];\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < m; j++)\\n a[i][j] = readInt();\\n int[] dp = new... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class E\\n{\\n private static final int oo = 1000000000;\\n public static void main(String[] args) throws Exception\\n {\\n Scanner in = new Scanner(System.in);\\n int n = in.nextInt();\\n int m = in.nextInt();\\n if(n > m)\\n {\\n int t = n;\\n n = m;\\n m = t;\\n }\\n\\n int [][] curr = new int[1<>1)) | (all&(c1<<1)) | c0 | c2;\\n done &= (all^c1);\\n\\n next[c1][c2] = Math.min(next[c1][c2], curr[c0][c1] + n - Integer.bitCount(done));\\n\\n }\\n curr = next;\\n }\\n\\n int res = oo;\\n for(int i = 0 ; i < 1<0) {\\n\\t\\t\\tl = sc.nextInt();\\n\\t\\t\\tr = sc.nextInt();\\n\\n\\t\\t\\tSystem.out.println(f(r)-f(l-1));\\n\\t\\t}\\n\\t\\tsc.close();\\n\\t}\\n\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class B {\\n\\n\\tBufferedReader br;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\tboolean eof;\\n\\n\\tlong f(int x, int y, int sz) {\\n\\t\\tif (x > y) {\\n\\t\\t\\tint tmp = x;\\n\\t\\t\\tx = y;\\n\\t\\t\\ty = tmp;\\n\\t\\t}\\n\\t\\tif (sz <= x)\\n\\t\\t\\treturn (long) sz * (sz + 1) \\/ 2;\\n\\t\\tif (sz >= x + y - 1)\\n\\t\\t\\treturn (long) x * y;\\n\\t\\tlong val = x * (x + 1) \\/ 2;\\n\\t\\tif (sz <= y)\\n\\t\\t\\treturn val + (long) (sz - x) * x;\\n\\n\\t\\tlong rest = x + y - 1 - sz;\\n\\t\\treturn (long) x * y - (long) rest * (rest + 1) \\/ 2;\\n\\t}\\n\\n\\tlong count(int x, int y, int n, int time) {\\n\\t\\tlong DL = f(x + 1, y + 1, time + 1);\\n\\t\\tlong DR = f(n - x, y + 1, time + 1);\\n\\t\\tlong UL = f(x + 1, n - y, time + 1);\\n\\t\\tlong UR = f(n - x, n - y, time + 1);\\n\\/\\/\\t\\tif (time == 1)\\n\\/\\/\\t\\t\\tSystem.err.println(DL + \\\" \\\" + DR + \\\" \\\" + UL + \\\" \\\" + UR);\\n\\t\\tlong L = Math.min(x + 1, time + 1);\\n\\t\\tlong R = Math.min(n - x, time + 1);\\n\\t\\tlong U = Math.min(n - y, time + 1);\\n\\t\\tlong D = Math.min(y + 1, time + 1);\\n\\/\\/\\t\\tif (time == 1)\\n\\/\\/\\t\\t\\tSystem.err.println(L + \\\" \\\" + R + \\\" \\\" + U + \\\" \\\" + D);\\n\\t\\treturn DL + DR + UL + UR - L - R - U - D + 1;\\n\\t}\\n\\n\\tvoid solve() throws IOException {\\n\\t\\tint n = nextInt();\\n\\t\\tint x = nextInt() - 1;\\n\\t\\tint y = nextInt() - 1;\\n\\t\\tlong need = nextLong();\\n\\n\\t\\tif (need == 1) {\\n\\t\\t\\tout.println(0);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tint low = 0;\\n\\t\\tint high = Math.max(x, n - 1 - x) + Math.max(y, n - 1 - y);\\n\\t\\t\\n\\/\\/\\t\\tfor (int i = 0; i <= 100; i++)\\n\\/\\/\\t\\t\\tSystem.err.println(count(x, y, n, i));\\n\\n\\t\\twhile (low < high - 1) {\\n\\t\\t\\tint mid = (int) (((long) low + high) \\/ 2);\\n\\t\\t\\tif (count(x, y, n, mid) >= need)\\n\\t\\t\\t\\thigh = mid;\\n\\t\\t\\telse\\n\\t\\t\\t\\tlow = mid;\\n\\t\\t}\\n\\n\\t\\tout.println(high);\\n\\n\\t}\\n\\n\\tB() throws IOException {\\n\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tsolve();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tnew B();\\n\\t}\\n\\n\\tString nextToken() {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\teof = true;\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tString... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.IOException;\\nimport java.io.OutputStreamWriter;\\nimport java.util.Arrays;\\nimport java.io.BufferedWriter;\\nimport java.util.InputMismatchException;\\nimport java.util.Comparator;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.NoSuchElementException;\\nimport java.io.Writer;\\nimport java.math.BigInteger;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Nguyen Trung Hieu - vuondenthanhcong11@yahoo.com\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n}\\n\\nclass TaskC {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int xs = in.readInt();\\n int ys = in.readInt();\\n int n = in.readInt();\\n int[] x = new int[n];\\n int[] y = new int[n];\\n IOUtils.readIntArrays(in, x, y);\\n int[] res = new int[1 << n];\\n int[] last = new int[1 << n];\\n Arrays.fill(res, Integer.MAX_VALUE);\\n int[] ds = new int[n];\\n for (int i = 0; i < n; i++) {\\n ds[i] = (x[i] - xs) * (x[i] - xs) + (y[i] - ys) * (y[i] - ys);\\n }\\n int[][] d = new int[n][n];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++)\\n d[i][j] = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]);\\n }\\n res[0] = 0;\\n for (int i = 1; i < (1 << n); i++) {\\n for (int j = 0; j < n; j++) {\\n if (((i >> j) & 1) != 0) {\\n if (res[i - (1 << j)] + 2 * ds[j] < res[i]) {\\n res[i] = res[i - (1 << j)] + 2 * ds[j];\\n last[i] = i - (1 << j);\\n }\\n for (int k = j + 1; k < n; k++) {\\n ... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.HashMap;\\nimport java.util.Scanner;\\n\\nimport javax.swing.text.html.HTMLDocument.Iterator;\\n\\n\\npublic class Main\\n{\\n public static double p[];\\n static double s[];\\n static double m[];\\n static int n;\\n public static double a[][];\\n public static int index=0;\\n public static boolean vis[];\\n public static HashMap permMap;\\n\\n public static void main(String g[])\\n {\\n\\n Scanner sc = new Scanner(System.in);\\n n=sc.nextInt();\\n m = new double[(1<\\n {\\n public int compare(card o1,card o2)\\n {\\n if(o1.l!=o2.l)\\n return (int)(o1.l-o2.l);\\n else\\n return (int)(o1.r-o2.r);\\n }\\n }\\n static void shuffle(long a[])\\n {\\n List l=new ArrayList<>();\\n for(int i=0;i s[]){\\n if(!v[so.intValue()])\\n {\\n v[so]=true;\\n for(Integer h:s[so.intValue()])\\n {\\n if(!v[h.intValue()])\\n ... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.math.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tlong n = scan.nextLong();\\n\\t\\tlong k = scan.nextLong();\\n\\t\\tlong total = k * (k - 1) \\/ 2 + 1;\\n\\t\\tif (total < n) {\\n\\t\\t\\tSystem.out.println(-1);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong left = total - n;\\n\\t\\tlong low = 1;\\n\\t\\tlong high = k - 1;\\n\\t\\twhile (low < high) {\\n\\t\\t\\tlong mid = (low + high) \\/ 2;\\n\\t\\t\\tlong temp = mid * (mid + 1) \\/ 2;\\n\\t\\t\\tif (temp < left) {\\n\\t\\t\\t\\tlow = mid + 1;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\thigh = mid;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tlong temp = low * (low + 1) \\/ 2;\\n\\t\\tif (temp == left) {\\n\\t\\t\\tSystem.out.println(k - 1 - low);\\n\\t\\t} else {\\n\\t\\t\\tSystem.out.println(k - low);\\n\\t\\t}\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class Main implements Runnable {\\n\\tprivate void solution() throws IOException {\\n\\t\\tint n = in.nextInt();\\n\\t\\tint m = in.nextInt();\\n\\t\\tboolean[][] adj = new boolean[n][n];\\n\\t\\tlong res = 0;\\n\\t\\tfor (int i = 0; i < m; ++i) {\\n\\t\\t\\tint x = in.nextInt();\\n\\t\\t\\tint y = in.nextInt();\\n\\t\\t\\tadj[x - 1][y - 1] = true;\\n\\t\\t\\tadj[y - 1][x - 1] = true;\\n\\t\\t}\\n\\t\\tfinal long[][] dp = new long[1 << n][n];\\n\\t\\tfor (int i = 0; i < n; ++i) {\\n\\t\\t\\tfor (int mask = 0; mask < (1 << (n - i)); ++mask) {\\n\\t\\t\\t\\tfor (int j = 0; j < n - i; ++j) {\\n\\t\\t\\t\\t\\tdp[mask][j] = 0;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tdp[0][0] = 1;\\n\\t\\t\\tfor (int mask = 0; mask < (1 << (n - i)); ++mask) {\\n\\t\\t\\t\\tfor (int j = 0; j < n - i; ++j) {\\n\\t\\t\\t\\t\\tif (dp[mask][j] != 0) {\\n\\t\\t\\t\\t\\t\\tlong am = dp[mask][j];\\n\\t\\t\\t\\t\\t\\tfor (int k = 0; k < n - i; ++k) {\\n\\t\\t\\t\\t\\t\\t\\tif (((mask >> k) & 1) == 0 && adj[j + i][k + i]) {\\n\\t\\t\\t\\t\\t\\t\\t\\tdp[mask | (1 << k)][k] += am;\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (((mask >> 0) & 1) != 0) {\\n\\t\\t\\t\\t\\tres += dp[mask][0];\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println((res - m) \\/ 2);\\n\\t}\\n\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tsolution();\\n\\t\\t\\tin.reader.close();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(1);\\n\\t\\t}\\n\\t}\\n\\n\\tprivate class Scanner {\\n\\t\\tBufferedReader reader;\\n\\t\\tStringTokenizer tokenizer;\\n\\n\\t\\tpublic Scanner(Reader reader) {\\n\\t\\t\\tthis.reader = new BufferedReader(reader);\\n\\t\\t\\tthis.tokenizer = new StringTokenizer(\\\"\\\");\\n\\t\\t}\\n\\n\\t\\tpublic boolean hasNext() throws IOException {\\n\\t\\t\\twhile (!tokenizer.hasMoreTokens()) {\\n\\t\\t\\t\\tString next = reader.readLine();\\n\\t\\t\\t\\tif (next == null) {\\n\\t\\t\\t\\t\\treturn false;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\ttokenizer = new StringTokenizer(next);\\n\\t\\t\\t}\\n\\t\\t\\treturn true;\\n\\t\\t}\\n\\n\\t\\tpublic String next() throws IOException {\\n\\t\\t\\thasNext();\\n\\t\\t\\treturn tokenizer.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic String nextLine() throws IOException {\\n\\t\\t\\ttokenizer = new StringTokenizer(\\\"\\\");\\n\\t\\t\\treturn reader.readLine();\\n\\t\\t}\\n\\n\\t\\tpublic double nextDouble() throws IOException {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.lang.*;\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n void solve() {\\n int n=ni();\\n int a[]=new int[n+1];\\n for(int i=1;i<=n;i++) a[i]=ni();\\n int vis[]=new int[101];\\n int ans=0;\\n Arrays.sort(a,1,n+1);\\n for(int i=1;i<=n;i++){\\n if(vis[a[i]]==1) continue;\\n ans++;\\n for(int j=a[i];j<=100;j+=a[i]) vis[j]=1;\\n }\\n pw.println(ans);\\n }\\n\\n long M = (long)1e9+7;\\n \\/\\/ END\\n PrintWriter pw;\\n StringTokenizer st;\\n BufferedReader br;\\n\\n void run() throws Exception {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n pw = new PrintWriter(System.out);\\n long s = System.currentTimeMillis();\\n solve();\\n pw.flush();\\n }\\n public static void main(String[] args) throws Exception {\\n new Main().run();\\n }\\n\\n String ns() {\\n while (st == null || !st.hasMoreElements()) {\\n\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n String nextLine() throws Exception {\\n String str = \\\"\\\";\\n try {\\n str = br.readLine();\\n } catch (IOException e) {\\n throw new Exception(e.toString());\\n }\\n return str;\\n }\\n\\n int ni() {\\n return Integer.parseInt(ns());\\n }\\n\\n long nl() {\\n return Long.parseLong(ns());\\n }\\n\\n double nd() {\\n return Double.parseDouble(ns());\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package fourninetysixDiv3;\\nimport java.util.HashMap;\\nimport java.util.Scanner;\\npublic class Median_Segments_general {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner s = new Scanner(System.in);\\n\\t\\tint n = s.nextInt();\\n\\t\\tint m = s.nextInt();\\n\\t\\tint[] arr = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tarr[i] = s.nextInt();\\n\\t\\t}\\n\\t\\tSystem.out.println(func(n, m, arr)-func(n, m+1, arr));\\n\\t}\\n\\tpublic static long func(int n,int m,int[] arr) {\\n\\t\\tHashMap map = new HashMap<>();\\n\\t\\tmap.put((long) 0, 1);\\n\\t\\tlong sum = 0;\\n\\t\\tlong res = 0;\\n\\t\\tlong add=0;\\n\\t\\tfor(int i=0;i map;\\n\\tstatic long[][] ans;\\n\\tstatic boolean[][] connect;\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tStringTokenizer st = new StringTokenizer(br.readLine());\\n\\t\\tint n = Integer.parseInt(st.nextToken());\\n\\t\\tmap = new HashMap();\\n\\t\\tconnect = new boolean[n][n];\\n\\t\\tans = new long[n][1< 0)\\t{\\n\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\tint a = Integer.parseInt(st.nextToken());\\n\\t\\t\\tint b = Integer.parseInt(st.nextToken());\\n\\t\\t\\ta--;\\n\\t\\t\\tb--;\\n\\t\\t\\tconnect[a][b] = connect[b][a] = true;\\n\\t\\t}\\n\\t\\tlong ret = 0;\\n\\t\\tint mask = 1 << n;\\n\\t\\tmask--;\\n\\t\\tfor(int i = 0; i < n; i++)\\t{\\n\\t\\t\\tfor(int out = i+1; out < n; out++)\\t{\\n\\t\\t\\t\\tif(connect[i][out])\\t{\\n\\t\\t\\t\\t\\tret += solve(mask - (1<d1) System.out.println(\\\"Black\\\");\\nelse System.out.println(\\\"White\\\");\\n\\n\\n }\\n \\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.Locale;\\nimport java.util.StringTokenizer;\\n\\npublic class C {\\n String fileName = \\\"\\\";\\n\\n public static final int MOD = (int) (1e9 + 7);\\n\\n public void solve() throws IOException {\\n long x = nextLong();\\n if (x == 0) {\\n out.print(0);\\n return;\\n }\\n long k = nextLong();\\n BigInteger power = BigInteger.valueOf(2)\\n .modPow(BigInteger.valueOf(k), BigInteger.valueOf(MOD));\\n BigInteger r = BigInteger.valueOf(x).multiply(power);\\n BigInteger l = r.subtract(power).add(BigInteger.ONE);\\n out.print(l.add(r).mod(BigInteger.valueOf(MOD)));\\n }\\n\\n public void run() {\\n try {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n\\n solve();\\n\\n out.close();\\n } catch (IOException e) {\\n e.printStackTrace();\\n System.exit(1);\\n }\\n }\\n\\n BufferedReader br;\\n StringTokenizer in;\\n PrintWriter out;\\n\\n public String nextToken() throws IOException {\\n while (in == null || !in.hasMoreTokens()) {\\n in = new StringTokenizer(br.readLine());\\n }\\n return in.nextToken();\\n }\\n\\n public int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n public double nextDouble() throws IOException {\\n return Double.parseDouble(nextToken());\\n }\\n\\n public long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n\\n public static void main(String[] args) throws IOException {\\n Locale.setDefault(Locale.US);\\n new C().run();\\n }\\n} Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n \\n \\npublic class Main {\\n \\n \\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tBufferedReader jk = new BufferedReader(new InputStreamReader( System.in)) ; \\n\\t\\tPrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)) ; \\n\\t\\tStringTokenizer ana = new StringTokenizer(jk.readLine()) ;\\n\\t\\tint n = Integer.parseInt(ana.nextToken()) ; \\n\\t\\t\\n\\t\\tint t[]= new int[101] ; \\n\\t\\tArrayList v = new ArrayList<>() ; \\n\\t\\tana = new StringTokenizer(jk.readLine()) ;\\n\\t\\tfor(int i=0 ; i {\\n\\t\\tint x;\\n\\t\\tint pos;\\n\\t\\t\\n\\t\\tValue(int x, int pos) {\\n\\t\\t\\tthis.x = x;\\n\\t\\t\\tthis.pos = pos;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic int compareTo(Value second) {\\n\\t\\t\\tif (this.x == second.x) {\\n\\t\\t\\t\\treturn this.pos - second.pos;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\treturn this.x - second.x;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\tvoid solve() {\\n\\t\\tint n = in.nextInt();\\n\\t\\t\\n\\t\\tValue ar[] = new Value[n];\\n\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tar[i] = new Value(in.nextInt(), i);\\n\\t\\t}\\n\\t\\tArrays.sort(ar);\\n\\t\\tint cnt = 0;\\n\\t\\t\\/\\/LinkedList gavno = new LinkedList();\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tif (ar[i].pos != i && ar[ar[i].pos].x != ar[i].x) {\\n\\t\\t\\t\\tcnt++;\\n\\t\\t\\t\\t\\/\\/gavno.add(i);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif (cnt > 2) {\\n\\t\\t\\tout.println(\\\"NO\\\");\\n\\t\\t} else {\\n\\t\\t\\tout.println(\\\"YES\\\");\\n\\t\\t}\\n\\t}\\n\\t\\n\\tstatic void asserT(boolean e) {\\n\\t\\tif (!e) {\\n\\t\\t\\tthrow new Error();\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\n\\tpublic void run() {\\n\\t\\tin = new Scanner(System.in);\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\ttry {\\n\\t\\t\\tsolve();\\n\\t\\t} finally {\\n\\t\\t\\tout.close();\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew Main().run();\\n\\t}\\n\\n} What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.util.StringTokenizer;\\nimport java.io.BufferedReader;\\nimport java.io.FileReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author ShekharN\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n FastScanner in = new FastScanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n private final int MOD = (int) (1e9 + 7);\\n\\n public void solve(int testNumber, FastScanner in, PrintWriter out) {\\n int n = in.nextInt();\\n String[] arr = new String[n];\\n for (int i = 0; i < n; i++) {\\n arr[i] = in.nextString();\\n }\\n int[] dp = new int[n];\\n Arrays.parallelSetAll(dp, i -> 0);\\n dp[0] = 1;\\n int cnt = 0;\\n for (int i = 0; i < n; i++) {\\n if (arr[i].equals(\\\"f\\\")) {\\n cnt++;\\n continue;\\n }\\n calc(dp, n, cnt);\\n cnt = 0;\\n }\\n int sum = 0;\\n for (int i = 0; i < n; i++) {\\n sum += dp[i];\\n sum %= MOD;\\n }\\n out.println(sum);\\n }\\n\\n private void calc(int[] dp, int n, int cnt) {\\n for (int i = n - 1; i >= 0; i--) {\\n if (i != n - 1) dp[i] += dp[i + 1];\\n dp[i] %= MOD;\\n }\\n \\/\\/int[] tmp = new int[n];\\n int prev = dp[0];\\n for (int i = 0, y = 0; i < MathUtil.gcdInt(n, cnt); i++)... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.DataInputStream;\\nimport java.io.FileInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.StringWriter;\\nimport java.util.Arrays;\\nimport java.util.Comparator;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStream ;\\nimport java.util.InputMismatchException;\\nimport java.util.ArrayList;\\n\\n\\npublic class Main {\\n public static void main(String[] args) throws IOException {\\n PrintWriter out = new PrintWriter(System.out);\\n \\/\\/Scanner sc = new Scanner();\\n Reader in = new Reader();\\n Main solver = new Main();\\n solver.solve(out, in);\\n out.flush();\\n out.close();\\n\\n }\\n \\n \\n void solve(PrintWriter out, Reader in) throws IOException{ \\n int n = in.nextInt();\\n int m = in.nextInt();\\n \\n \\n \\n int[] vert = new int[n+1];\\n for(int i=0 ;i arr = new ArrayList<>();\\n for(int i=0 ;i 0)\\n\\t\\t\\t\\t\\tcnt++;\\n\\t\\t\\t\\n\\t\\t\\tdouble cont = (k \\/ (cnt*1.0));\\n\\t\\t\\tdouble edges = (cnt) * (cnt - 1) \\/ 2.0;\\n\\t\\t\\treturn cont * cont * edges;\\n\\t\\t}\\n\\t\\tdouble res = 0;\\n\\t\\tint j = 0;\\n\\t\\tfor (int i = 0; i < nodes; i++)\\n\\t\\t\\tif ((pool & 1L << i) > 0 || (excl & 1L << i) > 0)\\n\\t\\t\\t\\tj = i;\\n\\n\\t\\tfor (int i = 0; i < nodes; i++) {\\n\\t\\t\\tif ((pool & 1L << i) == 0 || adj[i][j])\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\tlong ncurr = curr, npool = 0, nexcl = 0;\\n\\t\\t\\tncurr |= 1L << i;\\n\\n\\t\\t\\tfor (int k = 0; k < nodes; k++) {\\n\\t\\t\\t\\tif (adj[i][k]) {\\n\\t\\t\\t\\t\\tnpool |= pool & 1L << k;\\n\\t\\t\\t\\t\\tnexcl |= excl & 1L << k;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tres = Math.max(res, solveUnweighted(nodes, ncurr, npool, nexcl));\\n\\n\\t\\t\\tpool &= ~(1L << i);\\n\\t\\t\\texcl |= 1L >> i;\\n\\t\\t}\\n\\t\\treturn res;\\n\\t}\\n\\tpublic static void main(String[] args) {new Thread(null, new Runnable() { public void run() {try {\\n\\t\\tsol();\\n\\t} catch (Throwable e) {\\n\\t\\t\\n\\t\\te.printStackTrace();\\n\\t}}}, \\\"2\\\",1<<26).start();}\\n\\t\\n\\tstatic int n,k;\\n\\tstatic boolean adj[][];\\n\\tpublic static void sol() throws Throwable {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tn = sc.nextInt();\\n\\t\\tk = sc.nextInt();\\n\\t\\tadj = new boolean[n][n];\\n\\t\\tfor (int i = 0 ; i < n ; ++i) {\\n\\t\\t\\tfor (int j = 0 ; j < n ; ++j) {\\n\\t\\t\\t\\tadj[i][j] = sc.nextInt() == 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tdouble ans = solveUnweighted(n, 0, (1L << n) - 1, 0);\\n\\t\\tSystem.out.println(ans);\\n\\t}\\n\\n\\n\\tstatic class Scanner {\\n\\t\\tStringTokenizer st;\\n\\t\\tBufferedReader br;\\n\\n\\t\\tpublic Scanner(InputStream s) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(s));\\n\\t\\t}\\n\\n\\t\\tpublic Scanner(String s) throws FileNotFoundException {\\n\\t\\t\\tbr = 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class Solution implements Runnable {\\n\\tprivate BufferedReader in;\\n\\tprivate PrintWriter out;\\n\\tprivate StringTokenizer st;\\n\\tprivate Random rnd;\\n\\t\\n\\tdouble Vend;\\n\\t\\n\\tprivate double calcFirstSegment(double a, double Vmax, double Vend, double l) {\\n\\t\\tdouble Vl = 0, Vr = Vmax;\\n\\t\\t\\n\\t\\tfor(int it = 0; it < 256; it++) {\\n\\t\\t\\tdouble Vm = (Vl + Vr) \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tdouble tFirst = Vm \\/ a;\\n\\t\\t\\t\\n\\t\\t\\tdouble tSecond = 0;\\n\\t\\t\\tif(Vend < Vm) tSecond = (Vm - Vend) \\/ a;\\n\\t\\t\\t\\n\\t\\t\\tdouble firstPart = a * tFirst * tFirst \\/ 2.0;\\n\\t\\t\\tdouble secondPart = Vm * tSecond - a * tSecond * tSecond \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tdouble res = firstPart + secondPart;\\n\\t\\t\\t\\n\\t\\t\\tif(res < l) Vl = Vm;\\n\\t\\t\\telse Vr = Vm;\\n\\t\\t}\\n\\t\\t\\n\\t\\tthis.Vend = Math.min(Vl, Vend);\\n\\t\\t\\n\\t\\tdouble res = 0.0;\\n\\t\\t\\n\\t\\t{\\n\\t\\t\\tdouble Vm = Vl;\\n\\t\\t\\t\\n\\t\\t\\tdouble tFirst = Vm \\/ a;\\n\\t\\t\\tdouble tSecond = 0;\\n\\t\\t\\tif(Vend < Vm) tSecond = (Vm - Vend) \\/ a;\\n\\t\\t\\t\\n\\t\\t\\t\\/\\/out.println(tSecond);\\n\\t\\t\\t\\n\\t\\t\\tdouble firstPart = a * tFirst * tFirst \\/ 2.0;\\n\\t\\t\\tdouble secondPart = Vm * tSecond - a * tSecond * tSecond \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tdouble remain = l - firstPart - secondPart;\\n\\t\\t\\t\\n\\t\\t\\tres = tFirst + tSecond + (remain \\/ Vm);\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn res;\\n\\t}\\n\\t\\n\\tprivate double calcSecondPart(double a, double Vmax, double Vstart, double l) {\\n\\t\\tdouble Vl = Vstart, Vr = Vmax;\\n\\t\\t\\n\\t\\t\\/\\/out.println(Vstart);\\n\\t\\t\\n\\t\\tfor(int it = 0; it < 256; it++) {\\n\\t\\t\\tdouble Vm = (Vl + Vr) \\/ 2.0;\\n\\t\\t\\tdouble t = (Vm - Vstart) \\/ a;\\n\\t\\t\\t\\n\\t\\t\\tdouble s = Vstart * t + a * t * t \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tif(s < l) Vl = Vm;\\n\\t\\t\\telse Vr = Vm;\\n\\t\\t}\\n\\t\\t\\n\\t\\tdouble res = 0.0;\\n\\t\\t\\n\\t\\t{\\n\\t\\t\\tdouble Vm = (Vl + Vr) \\/ 2.0;\\n\\t\\t\\tdouble t = (Vm - Vstart) \\/ a;\\n\\t\\t\\t\\n\\t\\t\\tdouble s = Vstart * t + a * t * t \\/ 2.0;\\n\\t\\t\\t\\n\\t\\t\\tdouble remain = l - s;\\n\\t\\t\\t\\n\\t\\t\\tres = t + (remain \\/ Vmax);\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn res;\\n\\t}\\n\\t\\n\\tpublic void solve() throws IOException {\\n\\t\\tdouble a = nextDouble(), v = nextDouble(), l = nextDouble(), d = nextDouble(), w = nextDouble();\\n\\t\\t\\n\\t\\tdouble res = calcFirstSegment(a, v, w, d);\\n\\t\\tres += calcSecondPart(a, v, Vend, l - d);\\n\\t\\t\\n\\t\\tout.println(res);\\n\\t}\\n\\t\\t\\n\\tpublic static void... What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.text.*;\\n\\npublic class FollowTrafficRules\\n{\\n\\tpublic Scanner in = new Scanner(System.in);\\n\\tpublic PrintStream out = System.out;\\n\\n\\tpublic double len, d, w, vmax, a;\\n\\t\\n\\tDecimalFormat fmt = new DecimalFormat(\\\"0.0000000000000000\\\");\\n\\t\\n\\tpublic void main()\\n\\t{\\n\\t\\ta = in.nextDouble();\\n\\t\\tvmax = in.nextDouble();\\n\\t\\tlen = in.nextDouble();\\n\\t\\td = in.nextDouble();\\n\\t\\tw = in.nextDouble();\\n\\t\\t\\n\\t\\tout.println(fmt.format(T()));\\n\\t}\\/\\/end public void main()\\n\\t\\n\\tpublic double T()\\n\\t{\\n\\t\\tdouble t, s;\\n\\t\\t\\n\\t\\tdouble t1, s1;\\n\\t\\tt1 = vmax \\/ a;\\n\\t\\ts1 = vmax*vmax\\/(2.0*a);\\n\\t\\t\\n\\t\\tdouble t3, s3;\\n\\t\\tt3 = w\\/a;\\n\\t\\ts3 = w*w\\/(2.0*a);\\n\\t\\t\\t\\t\\n\\t\\tif(w >= vmax)\\n\\t\\t{\\n\\t\\t\\tif(s1 < len)\\n\\t\\t\\t{\\n\\t\\t\\t\\treturn t1 + (len - s1)\\/vmax;\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\treturn Math.sqrt(2.0*len\\/a);\\n\\t\\t\\t}\\t\\t\\t\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\t\\/\\/w < vmax\\n\\t\\t\\t\\n\\t\\t\\tdouble t2, s2, v2;\\n\\t\\t\\tt2 = Math.sqrt(2.0*d\\/a);\\n\\t\\t\\tv2 = a*t2;\\n\\t\\t\\t\\n\\t\\t\\tdouble tx, vx;\\n\\t\\t\\tvx = Math.sqrt((2.0*a*d + w*w)\\/2.0);\\n\\t\\t\\ttx = vx \\/ a;\\t\\n\\t\\t\\t\\n\\t\\t\\t\\/\\/vmax > w\\n\\n\\t\\t\\t\\/\\/v2 > vx > w\\n\\t\\t\\t\\n\\t\\t\\tif(v2 < w)\\n\\t\\t\\t{\\n\\t\\t\\t\\tif(v2 > vmax)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\/\\/v2 > vmax > w\\n\\t\\t\\t\\t\\tif(vmax > vx)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\treturn tx + (vx - w)\\/a + T2(w);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tdouble ty, sy;\\n\\t\\t\\t\\t\\t\\tty = (vmax - w)\\/a;\\n\\t\\t\\t\\t\\t\\tsy = ty * (vmax + w)\\/2.0;\\n\\t\\t\\t\\t\\t\\treturn t1 + ty + (d - s1 - sy)\\/vmax + T2(w);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\/\\/v2 < w, v2 <= vmax\\n\\t\\t\\t\\t\\treturn t2 + T2(v2);\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse if(v2 > vmax) \\/\\/v2 >= w, vmax > w\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\/\\/v2 > vmax > w\\n\\t\\t\\t\\tif(vmax > vx)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\treturn tx + (vx - w)\\/a + T2(w);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tdouble ty, sy;\\n\\t\\t\\t\\t\\tty = (vmax - w)\\/a;\\n\\t\\t\\t\\t\\tsy = ty * (vmax + w)\\/2.0;\\n\\t\\t\\t\\t\\treturn t1 + ty + (d - s1 - sy)\\/vmax + T2(w);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse \\/\\/vmax >= v2 >= w\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\/\\/out.println(\\\"Questionable.\\\");\\n\\t\\t\\t\\t\\/\\/return binary() + T2(w);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\/\\/return t3 + (d-s3)\\/w + T2(w);\\n\\n\\t\\t\\t\\treturn tx + (vx - w)\\/a + T2(w);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic double binary()\\n\\t{\\n\\t\\tdouble low, high, t, s;\\n\\t\\tlow = 0.0; high = vmax\\/a;\\n\\t\\t\\n\\t\\tfor(int c=0;c<50;++c)\\n\\t\\t{\\n\\t\\t\\tt = (low+high)\\/2;\\n\\t\\t\\ts = (a*t*t)\\/2 + ((a*t - w)\\/a)*(a*t + w)\\/2.0;\\n\\t\\t\\t\\n\\t\\t\\tif(s > d)... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Compute {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n long M = sc.nextInt();\\n long fact[] = new long[n+1];\\n long inv[] = new long[n+1];\\n long ifact[] = new long[n+1];\\n long dp[][] = new long[n+1][n+1];\\n fact[1] = 1;\\n ifact[1] = 1;\\n ifact[0] = 1;\\n inv[1] = 1;\\n dp[1][1] = 1;\\n \\n for(int i = 2; i <= n; i++) {\\n fact[i] = (i*fact[i-1]) % M;\\n inv[i] = (inv[(int)(M % i)]*(M - M\\/i)) % M;\\n dp[i][i] = (dp[i-1][i-1] * 2) % M;\\n ifact[i] = (ifact[i-1]*inv[i]) % M;\\n }\\n \\n for(int i = 3; i <= n; i++) {\\n for(int j = i\\/2 + 1; j <= i-1; j++) {\\n for(int k = 2; k <= i-1 && j-k+1 > (i-k)\\/2; k++) {\\n dp[i][j] = (dp[i][j] + ((((dp[k-1][k-1]*dp[i-k][j-k+1] % M)*fact[j] % M)*ifact[k-1] % M)*ifact[j-k+1] % M)) % M; \\n }\\n } \\n }\\n \\n long sum = 0;\\n for(int i = n\\/2 + 1; i <= n; i++)\\n sum = (sum + dp[n][i]) % M;\\n \\n System.out.println(sum % M);\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\/\\/ LM10: The next Ballon d'or\\nimport java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\nimport javafx.util.Pair;\\npublic class Main\\n{\\n static class FastReader\\n {\\n private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}\\n 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++];}\\n 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() ;}\\n 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();}\\n 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;}\\n 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;}\\n public double d() throws IOException {return Double.parseDouble(next()) ;}\\n public boolean isSpaceChar(int c) { return c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1; }\\n public boolean isEndOfLine(int c) { return c == '\\\\n' || c == '\\\\r' || c == -1; }\\n public void scanIntArr(int [] arr){ for(int li=0;li 0 || mask == 0)\\n {\\n for(int b=0; b < N; b++)\\n if((mask&(1<0){\\n\\t\\t\\tint k = (int)(n%10);\\n\\t\\t\\tn \\/=10;\\n\\t\\t\\tsum+=k;\\n\\t\\t}\\n\\t\\treturn storen-(long)sum >= s;\\n\\t}\\n\\tpublic static void main(String args[]){\\n\\t\\tPrintWriter pw=new PrintWriter(System.out);\\n\\t\\tInputReader ip=new InputReader(System.in);\\n\\t\\t\\n\\t\\tlong n;\\n\\t\\tn=ip.nextLong();\\n\\t\\ts=ip.nextLong();\\n\\n\\t\\tif(s>n){\\n\\t\\t\\tpw.println(\\\"0\\\");\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tlong l=0,r=n;\\n\\t\\t\\tboolean possible=false;\\n\\t\\t\\tlong mid=0;\\n\\t\\t\\tint it=100;\\n\\t\\t\\twhile(it-->0){\\n\\t\\t\\t\\tmid = (l+r)\\/2;\\n\\t\\t\\t\\tif(check(mid)){\\n\\t\\t\\t\\t\\tr=mid;\\n\\t\\t\\t\\t\\tpossible = true;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse{\\n\\t\\t\\t\\t\\tl=mid+1;\\n\\t\\t\\t\\t}\\n\\t\\t\\/\\/\\t\\tpw.println(mid);\\n\\t\\t\\/\\/\\t\\tpw.println(l+\\\" \\\"+r);\\n\\t\\t\\t}\\n\\t\\t\\tif(possible){\\n\\t\\t\\t\\tpw.println(n-l+1);\\n\\t\\t\\t}\\t\\n\\t\\t\\telse{\\n\\t\\t\\t\\tpw.println(\\\"0\\\");\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tpw.close();\\n\\t}\\n\\tstatic class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private SpaceCharFilter filter;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n\\n if (numChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n public String nextLine() {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n String str = \\\"\\\";\\n try {\\n str = br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return str;\\n }\\n\\n public int nextInt() {\\n int c = read();\\n\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/ @author Sanzhar\\nimport java.io.*;\\nimport java.util.*;\\nimport java.awt.Point;\\n\\npublic class Template {\\n\\n BufferedReader in;\\n PrintWriter out;\\n StringTokenizer st;\\n\\n String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(in.readLine());\\n } catch (Exception e) {\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n long nextLong() {\\n return Long.parseLong(next());\\n }\\n\\n double nextDouble() {\\n return Double.parseDouble(next());\\n }\\n\\n public void run() throws Exception {\\n \\/\\/in = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n \\/\\/out = new PrintWriter(new FileWriter(\\\"output.txt\\\"));\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n solve();\\n out.flush();\\n out.close();\\n in.close();\\n }\\n\\n public void solve() throws Exception {\\n int n = nextInt();\\n int k = nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = nextInt();\\n }\\n boolean[] ok = new boolean[n];\\n Arrays.fill(ok, true);\\n Arrays.sort(a);\\n if (k != 1) {\\n for (int i = 0; i < n; i++) {\\n if (a[i] % k == 0) {\\n int x = a[i] \\/ k;\\n int ind = Arrays.binarySearch(a, x);\\n if (ind >= 0 && ok[ind]) {\\n ok[i] = false;\\n }\\n }\\n }\\n }\\n int ans = 0;\\n for (int i = 0; i < n; i++) {\\n if (ok[i]) {\\n ans++;\\n }\\n }\\n out.println(ans);\\n }\\n\\n public static void main(String[] args) throws Exception {\\n new Template().run();\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class A {\\n\\tprivate static Scanner in;\\n\\t\\n\\tfinal int M = 1000000009;\\n\\n\\tpublic void run() {\\n\\t\\tint n = in.nextInt();\\n\\t\\tint m = in.nextInt();\\n\\t\\tint k = in.nextInt();\\n\\t\\tint z = n - m;\\n\\t\\tif (z >= n \\/ k) {\\n\\t\\t\\tSystem.out.println(m);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tint f = n - k * z;\\n\\t\\tint ans = BigInteger.ONE.shiftLeft(f \\/ k + 1).remainder(BigInteger.valueOf(M)).intValue();\\n\\t\\tSystem.out.println(((ans + M - 2L) * k + (f % k + (k - 1) * z)) % M);\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tLocale.setDefault(Locale.US);\\n\\t\\tin = new Scanner(System.in);\\n\\t\\tnew A().run();\\n\\t\\tin.close();\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class a\\n{\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\t\\n\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\t\\n\\t\\tint N=sc.nextInt();\\n\\t\\t\\n\\t\\tsolve(N);\\n\\t\\t\\n\\t\\t\\n\\t}\\n\\t\\n\\tstatic void solve(int a)\\n\\t{\\n\\t\\tif((a-8)%3==0)\\n\\t\\t{\\n\\t\\t\\tSystem.out.println(8+\\\" \\\"+(a-8));\\n\\t\\t\\treturn ;\\n\\t\\t}\\n\\t\\tif((a-4)%3==0)\\n\\t\\t{\\n\\t\\t\\tSystem.out.println(4+\\\" \\\"+(a-4));\\n\\t\\t\\treturn ;\\n\\t\\t}\\n\\t\\tif((a-6)%3==0)\\n\\t\\t{\\n\\t\\t\\tSystem.out.println(6+\\\" \\\"+(a-6));\\n\\t\\t\\treturn ;\\n\\t\\t}\\n\\t}\\n\\t\\t\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.awt.*;\\nimport java.math.BigDecimal;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.util.List;\\n\\npublic class Main {\\n\\n\\n public static void main(String[] args) {\\n Scanner scanner = new Scanner(System.in);\\n long n = scanner.nextLong();\\n long x = scanner.nextLong(), y = scanner.nextLong();\\n long whiteSteps, blackSteps;\\n\\n if(x == 1 || y == 1){\\n whiteSteps = (x - 1) + (y - 1);\\n } else {\\n whiteSteps = Math.min((x - 1) + Math.abs(y - x), (y - 1) + Math.abs(y - x));\\n }\\n\\n if(x == n || y == n){\\n blackSteps = (n - x) + (n - y);\\n } else {\\n blackSteps = Math.min((n - x) + Math.abs(y - x), (n - y) + Math.abs(y - x));\\n }\\n\\n if (whiteSteps <= blackSteps){\\n System.out.println(\\\"White\\\");\\n } else {\\n System.out.println(\\\"Black\\\");\\n }\\n\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.HashMap;\\nimport java.util.HashSet;\\nimport java.util.StringTokenizer;\\n\\npublic class BT {\\n\\n static BufferedReader in = new BufferedReader(new InputStreamReader(\\n System.in));\\n static StringTokenizer str;\\n static String SK;\\n\\n static String next() throws IOException {\\n while ((str == null) || (!str.hasMoreTokens())) {\\n SK = in.readLine();\\n if (SK == null)\\n return null;\\n str = new StringTokenizer(SK);\\n }\\n return str.nextToken();\\n }\\n\\n static int nextInt() throws IOException {\\n return Integer.parseInt(next());\\n }\\n\\n public static void main(String[] args) throws IOException {\\n int n, k;\\n n = nextInt();\\n k = nextInt();\\n HashSet hs = new HashSet();\\n HashMap hm = new HashMap();\\n\\n int[] ar = new int[n];\\n int ii = 0, jj = -1;\\n for (int i = 0; i < n; i++) {\\n ar[i] = nextInt();\\n\\n Integer iii = hm.get(ar[i]);\\n if(iii!=null)\\n hm.put(ar[i], ++iii); else hm.put(ar[i], 1);\\n hs.add(ar[i]);\\n if (hs.size() == k) {\\n jj = i;\\n break;\\n }\\n }\\n if (jj == -1) {\\n System.out.println(-1 + \\\" \\\" + (-1));\\n System.exit(0);\\n }\\n for (int i = 0; i < ar.length; i++) {\\n Integer iii = hm.get(ar[i]);\\n if (iii != null && iii - 1 > 0) {\\n hm.put(ar[i], --iii);\\n ii++;\\n } else {\\n break;\\n }\\n }\\n System.out.println((ii+1) + \\\" \\\" + (jj+1));\\n\\n }\\n\\n} Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class prob1 {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner input = new Scanner(System.in);\\n\\t\\tint n = input.nextInt();\\n\\t\\tif(n == 1)\\n\\t\\t{\\n\\/\\/\\t\\t\\tthrow new RuntimeException();\\n\\t\\t\\tint m = input.nextInt();\\n\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\/\\/\\t\\t\\tSystem.out.println(input.next());\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tint[] num = new int[n];\\n\\t\\tboolean flag = false;\\n\\t\\tfor(int i = 0; i < n; i++)\\n\\t\\t{\\n\\t\\t\\tnum[i] = input.nextInt();\\n\\t\\t\\tif(num[i] != num[0])\\n\\t\\t\\t\\tflag = true;\\n\\t\\t}\\n\\t\\tif(!flag)\\n\\t\\t{\\n\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tint min = Integer.MAX_VALUE;\\n\\t\\tfor(int i = 0; i < n; i++)\\n\\t\\t\\tif(num[i] < min)\\n\\t\\t\\t\\tmin = num[i];\\n\\t\\tint min2 = Integer.MAX_VALUE;\\n\\t\\tfor(int i = 0; i < n; i++)\\n\\t\\t\\tif(num[i] <= min2 && num[i] > min)\\n\\t\\t\\t\\tmin2 = num[i];\\n\\t\\tSystem.out.println(min2);\\n\\t\\t\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\t\\npublic\\t class template\\n\\t{\\n\\t\\tprivate InputStream is;\\n\\t\\tprivate PrintWriter pw;\\n\\t\\tstatic char[][] ch;\\n\\t\\tstatic int x1,x2,y1,y2,n,m,h,k;\\n\\t\\tstatic long dist[][];\\n\\t\\tstatic boolean boo[][];\\n\\t\\t\\n\\t\\tvoid soln()\\n\\t\\t{\\n\\t\\t\\tis = System.in;\\n\\t\\t\\tpw = new PrintWriter(System.out);\\n\\t\\t\\tlong s = System.currentTimeMillis();\\n\\t\\t\\tsolve();\\n\\t\\t\\tpw.close();\\n\\t\\t\\tpw.flush();\\n\\t\\t\\t\\/\\/ tr(System.currentTimeMillis() - s + \\\"ms\\\");\\n\\t\\t}\\n\\t\\n\\t\\tpublic static void main(String[] args) throws Exception \\n\\t\\t{\\n\\t\\t\\tnew Thread(null, new Runnable() \\n\\t\\t\\t{\\n\\t\\t\\t\\tpublic void run() \\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\ttry\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\t\\/\\/ new CODEFORCES().soln();\\n\\t\\t\\t\\t\\t} catch (Exception e)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tSystem.out.println(e);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}, \\\"1\\\", 1 << 26).start();\\n\\t\\t\\tnew template().soln();\\n\\t\\t}\\n\\t\\n\\t\\tvoid solve() \\n\\t\\t{\\n\\t\\t\\tlong n = nl(), k = nl();\\n\\t\\t\\tif(n==0){\\n\\t\\t\\t\\tpw.println(0);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tlong MOD = 1000000007;\\n\\t\\t\\tlong pow1 = pow(2,k,MOD), pow2 = pow(2,k+1,MOD);\\n\\t\\t\\tpw.println(((((n%MOD)*pow2)%MOD) - (pow1-1+MOD)%MOD + 2*MOD)%MOD);\\n\\t\\t\\tpw.close();\\t\\n\\t\\t}\\n\\t\\tlong pow(long x, long y, long mod){\\n\\t\\t\\tlong ans = 1;\\n\\t\\t\\twhile(y>0){\\n\\t\\t\\t\\tif(y%2==0) {\\n\\t\\t\\t\\t\\tx *= x;\\n\\t\\t\\t\\t\\tx %= mod;\\n\\t\\t\\t\\t\\ty\\/=2;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse{\\n\\t\\t\\t\\t\\tans *= x;\\n\\t\\t\\t\\t\\tans %= mod;\\n\\t\\t\\t\\t\\ty-=1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn ans;\\n\\t\\t}\\n\\t\\tlong gcd(long a, long b){\\n\\t\\t\\tif(b==0) return a;\\n\\t\\t\\treturn gcd(b,a%b);\\n\\t\\t}\\n\\t\\tvoid printArray(long[] arr) {\\n\\t\\t\\tfor(long i : arr) pw.print(i +\\\" \\\");\\n\\t\\t\\tpw.println();\\n\\t\\t}\\n\\tstatic long min(long x, long y){\\n\\t\\treturn (x{\\n\\t\\tlong val;\\n\\t\\tint x, y;\\n\\t\\tPair(long v, int a, int b){\\n\\t\\t\\tval = v; x = a; y = b;\\n\\t\\t}\\n\\t\\tpublic int compareTo(Pair p){\\n\\t\\t\\treturn Long.compare(this.val,p.val);\\n\\t\\t}\\n\\t}\\n\\tprivate static class Queue{\\n\\t\\tint st = 0;\\n\\t\\tint et = 0;\\n\\t\\tPair[] arr;\\n\\t\\tpublic Queue(int len) {\\n\\t\\t\\tarr = new Pair[len];\\n\\t\\t}\\n\\t\\tpublic boolean isEmpty() {\\n\\t\\t\\treturn st==et;\\n\\t\\t}\\n\\t\\tpublic void add(Pair x) {\\n\\t\\t\\tarr[et++] = x;\\n\\t\\t}\\n\\t\\tpublic Pair poll() {\\n\\t\\t\\treturn arr[st++];\\n\\t\\t}\\n\\t\\tpublic void clear() {\\n\\t\\t\\tst = et = 0;\\n\\t\\t}\\n\\t}\\n\\t\\t\\/*void bfs(int k) {\\n\\t\\t\\twhile(!q.isEmpty())... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedWriter;\\nimport java.io.FileInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.OutputStreamWriter;\\nimport java.io.PrintWriter;\\nimport java.io.Writer;\\nimport java.math.BigInteger;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Comparator;\\nimport java.util.HashSet;\\nimport java.util.InputMismatchException;\\nimport java.util.List;\\nimport java.util.Random;\\nimport java.util.TreeSet;\\n\\n\\/**\\n * Actual solution is at the top, in class Solver\\n *\\/\\nfinal public class Main implements Runnable {\\n\\tprivate static String[] args;\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tMain.args = args;\\n\\t\\tnew Thread(null, new Main(), \\\"MyRunThread\\\", 1 << 27).start();\\n\\t}\\n\\n\\t\\/\\/@Override\\n\\tpublic void run() {\\n\\t\\tlong time_beg = -1;\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tif (args.length > 0 && args[0].equals(\\\"outside\\\")) {\\n\\t\\t\\ttime_beg = System.currentTimeMillis();\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tinputStream = new FileInputStream(\\\"IO\\/in.txt\\\");\\n\\/\\/\\t\\t\\t\\toutputStream = new FileOutputStream(\\\"IO\\/out.txt\\\");\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\tSystem.err.println(e);\\n\\t\\t\\t\\tSystem.exit(1);\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\ttry {\\n\\/\\/\\t\\t\\t\\tinputStream = new FileInputStream(\\\"IO\\/in.txt\\\");\\n\\/\\/\\t\\t\\t\\toutputStream = new FileOutputStream(\\\"IO\\/out.txt\\\");\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\tSystem.err.println(e);\\n\\t\\t\\t\\tSystem.exit(1);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tSolver s = new Solver();\\n\\t\\ts.in = new InputReader(inputStream);\\n\\t\\ts.out = new OutputWriter(outputStream);\\n\\t\\tif (args.length > 0 && args[0].equals(\\\"outside\\\")) {\\n\\t\\t\\ts.dout = new DebugWriter(s.out);\\n\\t\\t}\\n\\n\\t\\ts.solve();\\n\\n\\t\\tif (args.length > 0 && args[0].equals(\\\"outside\\\")) {\\n\\t\\t\\ts.dout.printFormat(\\\"*** Total time: %.3f ***\\\\n\\\", (System.currentTimeMillis() - time_beg) \\/ 1000.0);\\n\\t\\t}\\n\\n\\t\\ts.out.close();\\n\\t}\\n}\\n\\n\\nfinal class Solver {\\n\\tInputReader in;\\n\\tOutputWriter out;\\n\\tDebugWriter dout;\\n\\n\\tpublic void solve() {\\n\\t\\tint n = in.readInt();\\n\\t\\tint k = in.readInt();\\n\\n\\n\\t\\tTreeSet q = new TreeSet();\\n\\t\\tint[] mas = new int[n];\\n\\t\\tfor (int i = 0; i... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.StringTokenizer;\\n\\npublic class C {\\n\\n static final int MOD = (int)1e9 + 7;\\n\\n public static void main(String[] args) throws IOException {\\n\\n Scanner sc = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n\\n long x = sc.nextLong(), k = sc.nextLong();\\n if(x == 0)\\n out.println(0);\\n else\\n out.println(((x % MOD * 2 - 1 + MOD) % MOD * modPow(2, k) % MOD + 1) % MOD);\\n out.close();\\n }\\n\\n static long modPow(long b, long e) {\\n long res = 1;\\n while(e > 0) {\\n if((e & 1) == 1)\\n res = res * b % MOD;\\n b = b * b % MOD;\\n e >>= 1;\\n }\\n\\n return res;\\n }\\n\\n static class Scanner\\n {\\n StringTokenizer st;\\n BufferedReader br;\\n\\n public Scanner(InputStream s){\\tbr = new BufferedReader(new InputStreamReader(s));}\\n\\n public String next() throws IOException\\n {\\n while (st == null || !st.hasMoreTokens())\\n st = new StringTokenizer(br.readLine());\\n return st.nextToken();\\n }\\n\\n public int nextInt() throws IOException {return Integer.parseInt(next());}\\n\\n public long nextLong() throws IOException {return Long.parseLong(next());}\\n\\n public double nextDouble() throws IOException { return Double.parseDouble(next()); }\\n\\n public String nextLine() throws IOException {return br.readLine();}\\n\\n public boolean ready() throws IOException { return br.ready(); }\\n\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\nimport java.awt.Point;\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class A implements Runnable{\\n\\t\\n\\tfinal boolean ONLINE_JUDGE = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n\\t\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer tok = new StringTokenizer(\\\"\\\");\\n\\t\\n\\tvoid init() throws FileNotFoundException{\\n\\t\\tif (ONLINE_JUDGE){\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t}else{\\n\\t\\t\\tin = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t\\tout = new PrintWriter(\\\"output.txt\\\");\\n\\t\\t}\\n\\t}\\n\\t\\n\\tString readString() throws IOException{\\n\\t\\twhile(!tok.hasMoreTokens()){\\n\\t\\t\\ttry{\\n\\t\\t\\t\\ttok = new StringTokenizer(in.readLine());\\n\\t\\t\\t}catch (Exception e){\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn tok.nextToken();\\n\\t}\\n\\t\\n\\tint readInt() throws IOException{\\n\\t\\treturn Integer.parseInt(readString());\\n\\t}\\n\\t\\n\\tlong readLong() throws IOException{\\n\\t\\treturn Long.parseLong(readString());\\n\\t}\\n\\t\\n\\tdouble readDouble() throws IOException{\\n\\t\\treturn Double.parseDouble(readString());\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args){\\n\\t\\tnew Thread(null, new A(), \\\"\\\", 128 * (1L << 20)).start();\\n\\t}\\n\\t\\n\\tlong timeBegin, timeEnd;\\n\\n\\tvoid time(){\\n\\t\\ttimeEnd = System.currentTimeMillis();\\n\\t\\tSystem.err.println(\\\"Time = \\\" + (timeEnd - timeBegin));\\n\\t}\\n\\t\\n\\tlong memoryTotal, memoryFree;\\n\\t\\n\\n\\tvoid memory(){\\n\\t\\tmemoryFree = Runtime.getRuntime().freeMemory();\\n\\t\\tSystem.err.println(\\\"Memory = \\\" + ((memoryTotal - memoryFree) >> 10) + \\\" KB\\\");\\n\\t}\\n\\t\\n\\tvoid debug(Object... objects){\\n\\t\\tif (DEBUG){\\n\\t\\t\\tfor (Object o: objects){\\n\\t\\t\\t\\tSystem.err.println(o.toString());\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic void run(){\\n\\t\\ttry{\\n\\t\\t\\ttimeBegin = System.currentTimeMillis();\\n\\t\\t\\tmemoryTotal = Runtime.getRuntime().freeMemory();\\n\\t\\t\\tinit();\\n\\t\\t\\tsolve();\\n\\t\\t\\tout.close();\\n\\t\\t\\ttime();\\n\\t\\t\\tmemory();\\n\\t\\t}catch (Exception e){\\n\\t\\t\\te.printStackTrace(System.err);\\n\\t\\t\\tSystem.exit(-1);\\n\\t\\t}\\n\\t}\\n\\t\\n\\tboolean DEBUG = false;\\n\\t\\n\\tvoid solve() throws IOException{\\n\\t\\tint n = readInt();\\n\\t\\t\\n\\t\\tint[] a = new int[n];\\n\\t\\tInteger[] b = new Integer[n];\\n\\t\\tfor... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\nimport java.util.TreeMap;\\n\\npublic class B {\\n\\n static Scanner in;\\n\\n static void put(TreeMap m, int key) {\\n if (m.containsKey(key)) {\\n m.put(key, m.get(key) + 1);\\n } else {\\n m.put(key, 1);\\n }\\n }\\n\\n static void remove(TreeMap m, int key) {\\n if (!m.containsKey(key))\\n return;\\n m.put(key, m.get(key) - 1);\\n if (m.get(key) == 0) {\\n m.remove(key);\\n }\\n }\\n\\n public static void main(String[] args) {\\n in = new Scanner(System.in);\\n int n = in.nextInt();\\n int k = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = in.nextInt();\\n }\\n int i = 0;\\n while (i + 1 < n && a[i + 1] == a[0]) {\\n i++;\\n }\\n int left = i;\\n TreeMap used = new TreeMap();\\n for (; i < n; i++) {\\n put(used, a[i]);\\n if (used.size() == k) {\\n while (used.get(a[left]) > 1) {\\n remove(used, a[left]);\\n left++;\\n }\\n System.out.println(left + 1 + \\\" \\\" + (i + 1));\\n return;\\n }\\n }\\n System.out.println(\\\"-1 -1\\\");\\n }\\n\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\t \\t\\t\\t\\/*\\n\\t \\t\\t * Author- Priyam Vora\\n\\t \\t\\t * BTech 2nd Year DAIICT\\n\\t \\t\\t *\\/\\n\\t \\n\\t \\n\\t \\t\\t import java.awt.Checkbox;\\n\\timport java.awt.Point;\\n\\timport java.io.*;\\n\\t \\t\\t import java.math.*;\\n\\t \\t\\t import java.util.*;\\n\\timport java.util.Map.Entry;\\n\\t\\n\\timport javax.print.attribute.SetOfIntegerSyntax;\\n\\t\\n\\t \\n\\t \\t\\t public class Main{\\n\\t \\t\\t \\tprivate static InputStream stream;\\n\\t \\t\\t \\tprivate static byte[] buf = new byte[1024];\\n\\t \\t\\t \\tprivate static int curChar;\\n\\t \\t\\t \\tprivate static int numChars;\\n\\t \\t\\t \\tprivate static SpaceCharFilter filter;\\n\\t \\t\\t \\tprivate static PrintWriter pw;\\n\\t \\t\\t \\tprivate static long count = 0,mod=1000000007;\\n\\t \\t\\t \\/\\/\\tprivate static TreeSet ts=new TreeSet[200000];\\n\\t \\t\\t \\tpublic final static int INF = (int) 1E9;\\n\\t\\n\\t \\t\\t \\n\\t \\t\\t public static void main(String[] args) {\\n\\t \\t\\t \\tInputReader(System.in);\\n\\t \\t\\t \\t\\tpw = new PrintWriter(System.out); \\n\\t \\t\\t new Thread(null ,new Runnable(){\\n\\t \\t\\t public void run(){\\n\\t \\t\\t try{\\n\\t \\t\\t solve();\\n\\t \\t\\t pw.close();\\n\\t \\t\\t } catch(Exception e){\\n\\t \\t\\t e.printStackTrace();\\n\\t \\t\\t }\\n\\t \\t\\t }\\n\\t \\t\\t },\\\"1\\\",1<<26).start();\\n\\t \\t\\t }\\n\\t \\t\\t public static void test(){\\n\\t \\t\\t \\tint t=nextInt();\\n\\t \\t\\t \\twhile(t-->0){\\n\\t \\t\\t \\t\\tsolve();\\n\\t \\t\\t \\t}\\n\\t \\t\\t }\\n\\t \\t\\t public static long pow(long n, long p,long mod) {\\n\\t \\t\\t\\t\\t\\tif(p==0)\\n\\t \\t\\t\\t\\t\\t\\treturn 1;\\n\\t \\t\\t\\t\\t\\tif(p==1)\\n\\t \\t\\t\\t\\t\\t\\treturn n%mod;\\n\\t \\t\\t\\t\\t\\tif(p%2==0){\\n\\t \\t\\t\\t\\t\\t\\tlong temp=pow(n, p\\/2,mod);\\n\\t \\t\\t\\t\\t\\treturn (temp*temp)%mod;\\n\\t \\t\\t\\t\\t\\t}else{\\n\\t \\t\\t\\t\\t\\t\\t \\tlong... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/**\\n * BaZ :D\\n *\\/\\nimport java.util.*;\\nimport java.io.*;\\nimport static java.lang.Math.*;\\npublic class Main\\n{\\n static Reader scan;\\n static PrintWriter pw;\\n static int n,k,left[],right[],arr[];\\n static long MOD = 1000000007,count[],dp[];\\n public static void main(String[] args) {\\n new Thread(null,null,\\\"BaZ\\\",1<<25)\\n {\\n public void run()\\n {\\n try\\n {\\n solve();\\n }\\n catch(Exception e)\\n {\\n e.printStackTrace();\\n System.exit(1);\\n }\\n }\\n }.start();\\n }\\n static void solve() throws IOException\\n {\\n scan = new Reader();\\n pw = new PrintWriter(System.out,true);\\n StringBuilder sb = new StringBuilder();\\n n = ni();\\n k = ni();\\n int stack[] = new int[1000001];\\n int top = -1;\\n arr = new int[n];\\n left = new int[n];\\n right = new int[n];\\n for(int i=0;i=0 && arr[stack[top]]<=arr[i])\\n top--;\\n if(top==-1)\\n left[i] = 0;\\n else left[i] = stack[top]+1;\\n stack[++top] = i;\\n }\\n top = -1;\\n for(int i=n-1;i>=0;--i) {\\n while(top>=0 && arr[stack[top]]=MOD)\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.HashMap;\\nimport java.util.InputMismatchException;\\nimport java.util.Map;\\n\\n\\/**\\n * Created by hama_du on 2014\\/09\\/21.\\n *\\/\\npublic class ProblemB {\\n public static void main(String[] args) {\\n InputReader in = new InputReader(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n\\n int n = in.nextInt();\\n long a = in.nextLong();\\n long b = in.nextLong();\\n long[] x = new long[n];\\n for (int i = 0; i < n; i++) {\\n x[i] = in.nextLong();\\n }\\n\\n Map idxmap = new HashMap<>();\\n for (int i = 0; i < n; i++) {\\n idxmap.put(x[i], i);\\n }\\n if (a == b) {\\n solve1(x, a, idxmap, out);\\n return;\\n }\\n\\n int[] mark = new int[n];\\n Arrays.fill(mark, -1);\\n boolean isok = true;\\n for (int i = 0 ; i < n ; i++) {\\n if (mark[i] != -1) {\\n continue;\\n }\\n long w = x[i];\\n long aw = a - w;\\n long bw = b - w;\\n if (idxmap.containsKey(aw) && idxmap.containsKey(bw)) {\\n continue;\\n } else if (idxmap.containsKey(bw)) {\\n long w1 = w;\\n long w2 = bw;\\n while (true) {\\n if (!idxmap.containsKey(w1) || !idxmap.containsKey(w2)) {\\n break;\\n }\\n int i1 = idxmap.get(w1);\\n int i2 = idxmap.get(w2);\\n if (mark[i1] == 0 || mark[i2] == 0) {\\n isok = false;\\n }\\n mark[i1] = 1;\\n mark[i2] = 1;\\n if (w1 + a - b == w2) {\\n break;\\n }\\n w1 += (a - b);\\n w2 += (b - a);\\n }\\n } else if (idxmap.containsKey(aw)){\\n long w1... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class C23A {\\n public static void main(String args[]){\\n Scanner sc=new Scanner(System.in);\\n String str=sc.next();\\n\\n for(int k=str.length()-1;k>=1;k--){\\n for(int i=0;i<=str.length()-k;i++){\\n for(int j=i+1;j<=str.length()-k;j++){\\n if(str.substring(i,i+k).equals(str.substring(j,j+k))){\\n System.out.println(k);\\n return;\\n }\\n }\\n }\\n }\\n System.out.println(0);\\n\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package practice;\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.util.Stack;\\nimport java.util.regex.Pattern;\\n\\npublic class ROUGH {\\n\\t\\n\\tpublic static class FastReader {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\t\\t\\/\\/it reads the data about the specified point and divide the data about it ,it is quite fast\\n\\t\\t\\/\\/than using direct \\n\\n\\t\\tpublic FastReader() {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\n\\t\\tString next() {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t\\t} catch (Exception r) {\\n\\t\\t\\t\\t\\tr.printStackTrace();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tint nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\/\\/converts string to integer\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tlong nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tString nextLine() {\\n\\t\\t\\tString str = \\\"\\\";\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tstr = br.readLine();\\n\\t\\t\\t} catch (Exception r) {\\n\\t\\t\\t\\tr.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t\\treturn str;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));\\n\\tstatic long mod = (long) (1e9+7);\\n\\tstatic int N = (int) 1e5;\\n\\/\\/\\tScanner sc = new Scanner(System.in);\\n\\tpublic static void main(String[] args) {\\n\\t\\t FastReader sc = new FastReader();\\n\\t\\t int n = sc.nextInt();\\n\\t\\t int[] a = new int[n];\\n\\t\\t TreeSet set = new TreeSet();\\n\\t\\t for(int i=0;i 0) {\\n\\t\\t\\t ++ans;\\n\\t\\t\\t int min = set.first();\\n\\t\\t\\t TreeSet temp = new TreeSet<>();\\n\\t\\t\\t for(int x : set) {\\n\\t\\t\\t\\t if(x%min != 0) temp.add(x);\\n\\t\\t\\t }\\n\\t\\t\\t set = temp;\\n\\t\\t\\t \\n\\t\\t }\\n\\t\\t out.print(ans);\\n\\t\\t \\n\\t\\t out.close();\\n\\t}\\n\\t\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.util.stream.*;\\n\\npublic class ProblemF {\\n private static boolean debug = false;\\n\\n private static int N;\\n private static int[] A;\\n\\n private static void solveProblem(InputStream instr) throws Exception {\\n InputReader sc = new InputReader(instr);\\n int testCount = 1;\\n if (debug) {\\n testCount = sc.nextInt();\\n }\\n\\n for (int t = 1; t <= testCount; t++) {\\n printDebug(\\\"------ \\\" + t + \\\" ------\\\");\\n N = sc.nextInt();\\n A = readInts(sc, N);\\n Object result = solveTestCase();\\n System.out.println(result);\\n }\\n }\\n\\n private static Object solveTestCase() {\\n int sum[] = new int[N];\\n sum[0] = A[0];\\n for (int i = 1; i < N; i++) {\\n sum[i] = sum[i - 1] + A[i];\\n }\\n TreeMap> map = new TreeMap<>();\\n for (int i = 0; i < N; i++) {\\n for (int j = i; j < N; j++) {\\n int groupSum = sum[j] - (i == 0 ? 0 : sum[i - 1]);\\n map.putIfAbsent(groupSum, new ArrayList<>());\\n map.get(groupSum).add(new int[]{i, j});\\n }\\n }\\n int max = -1;\\n List maxAnswer = null;\\n for (Map.Entry> entry : map.entrySet()) {\\n List values = entry.getValue();\\n if (values.size() <= max) {\\n continue;\\n }\\n List curr = findMax(values);\\n if (curr.size() > max) {\\n max = curr.size();\\n maxAnswer = curr;\\n\\n }\\n }\\n List answer = new ArrayList<>();\\n for (int[] value : maxAnswer) {\\n answer.add((value[0] + 1) + \\\" \\\" + (value[1] + 1));\\n }\\n return max + \\\"\\\\n\\\" + joinValues(answer, \\\"\\\\n\\\");\\n }\\n\\n private static List findMax(List values) {\\n values.sort(new Comparator() {\\n @Override\\n public int compare(int[] o1,... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.util.InputMismatchException;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.Reader;\\nimport java.io.Writer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Niyaz Nigmatullin\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tFastScanner in = new FastScanner(inputStream);\\n\\t\\tFastPrinter out = new FastPrinter(outputStream);\\n\\t\\tTaskA solver = new TaskA();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskA {\\n public void solve(int testNumber, FastScanner in, FastPrinter out) {\\n long a = in.nextLong();\\n long b = in.nextLong();\\n if (a < b) {\\n long t = a;\\n a = b;\\n b = t;\\n }\\n long ans = 0;\\n while (b > 0) {\\n ans += a \\/ b;\\n long t = a % b;\\n a = b;\\n b = t;\\n }\\n out.println(ans);\\n }\\n}\\n\\nclass FastScanner extends BufferedReader {\\n\\n public FastScanner(InputStream is) {\\n super(new InputStreamReader(is));\\n }\\n\\n public int read() {\\n try {\\n int ret = super.read();\\n\\/\\/ if (isEOF && ret < 0) {\\n\\/\\/ throw new InputMismatchException();\\n\\/\\/ }\\n\\/\\/ isEOF = ret == -1;\\n return ret;\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n }\\n\\n public String next() {\\n StringBuilder sb = new StringBuilder();\\n int c = read();\\n while (isWhiteSpace(c)) {\\n c = read();\\n }\\n if (c < 0) {\\n return null;\\n }\\n while (c >= 0 && !isWhiteSpace(c)) {\\n sb.appendCodePoint(c);\\n c = read();\\n }\\n return sb.toString();\\n }\\n\\n static boolean isWhiteSpace(int c) {\\n return c >= 0 && c <= 32;\\n }\\n\\n... Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.*;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\n\\n\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n TaskC.InputReader in = new TaskC.InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.Solve(in, out);\\n out.close();\\n }\\n\\n\\n static class TaskC {\\n\\n private long mod = 1_000_000_007;\\n private int n;\\n private boolean[] s;\\n\\n public void Solve(InputReader in, PrintWriter out) {\\n n = in.NextInt();\\n s = new boolean[n];\\n for (int i = 0; i < n; i++) {\\n String ss = in.Next();\\n s[i] = ss.charAt(0) == 'f';\\n }\\n if (s[n - 1]) {\\n out.println(0);\\n return;\\n }\\n long[] dpSum = new long[n + 1], lastDpSum = new long[n + 1];\\n for (int i = 0; i <= n; i++) {\\n lastDpSum[i] = i + 1;\\n }\\n for (int i = n - 2; i >= 0; i--) {\\n for (int j = 0; j <= i; j++) {\\n if (!s[i]) {\\n dpSum[j] = lastDpSum[j];\\n } else {\\n dpSum[j] = lastDpSum[j + 1] - lastDpSum[j];\\n }\\n if (j != 0) {\\n dpSum[j] += dpSum[j - 1];\\n }\\n dpSum[j] %= mod;\\n while (dpSum[j] < 0) dpSum[j] += mod;\\n\\n }\\n long[] temp = dpSum;\\n dpSum = lastDpSum;\\n lastDpSum = temp;\\n }\\n out.println(lastDpSum[0]);\\n }\\n\\n public static int GetMax(int[] ar) {\\n int max = Integer.MIN_VALUE;\\n for (int a : ar) {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class B {\\n\\n\\tstatic int n, t[], g[], MOD = (int) 1e9 + 7;\\n\\tstatic int[][][] memo1, memo2[], memo3[];\\n\\n\\tstatic int dp1(int idx, int remCnt, int remSum) {\\n\\t\\tif (idx == n)\\n\\t\\t\\treturn remSum == 0 && remCnt==0 ? 1 : 0;\\n\\t\\tif (memo1[idx][remCnt][remSum] != -1)\\n\\t\\t\\treturn memo1[idx][remCnt][remSum];\\n\\t\\tint ans = dp1(idx + 1, remCnt, remSum);\\n\\t\\tif (g[idx] == 0 && t[idx] <= remSum && remCnt>0) {\\n\\t\\t\\tans += dp1(idx + 1, remCnt - 1, remSum - t[idx]);\\n\\t\\t\\tif (ans >= MOD)\\n\\t\\t\\t\\tans -= MOD;\\n\\t\\t}\\n\\t\\treturn memo1[idx][remCnt][remSum] = ans;\\n\\t}\\n\\n\\tstatic int dp2(int idx, int remCnt1, int remCnt2, int remSum) {\\n\\t\\tint all = remCnt1 + remCnt2;\\n\\t\\tif (all == 0)\\n\\t\\t\\treturn remSum == 0 ? 1 : 0;\\n\\t\\tif (idx == n || remSum == 0)\\n\\t\\t\\treturn 0;\\n\\t\\tif (memo2[idx][remCnt1][remCnt2][remSum] != -1)\\n\\t\\t\\treturn memo2[idx][remCnt1][remCnt2][remSum];\\n\\t\\tint ans = dp2(idx + 1, remCnt1, remCnt2, remSum);\\n\\t\\tif (t[idx] <= remSum) {\\n\\t\\t\\tif (g[idx] == 1 && remCnt1 > 0)\\n\\t\\t\\t\\tans += dp2(idx + 1, remCnt1 - 1, remCnt2, remSum - t[idx]);\\n\\t\\t\\telse if (g[idx] == 2 && remCnt2 > 0)\\n\\t\\t\\t\\tans += dp2(idx + 1, remCnt1, remCnt2 - 1, remSum - t[idx]);\\n\\n\\t\\t}\\n\\n\\t\\treturn memo2[idx][remCnt1][remCnt2][remSum] = ans;\\n\\t}\\n\\n\\tprivate static int dp3(int cnt0, int cnt1, int cnt2, int last) {\\n\\t\\tif (cnt0 + cnt1 + cnt2 == 0)\\n\\t\\t\\treturn 1;\\n\\t\\tif (memo3[last][cnt0][cnt1][cnt2] != -1)\\n\\t\\t\\treturn memo3[last][cnt0][cnt1][cnt2];\\n\\t\\tlong ans = 0;\\n\\t\\tif (cnt0 > 0 && last != 0)\\n\\t\\t\\tans += dp3(cnt0 - 1, cnt1, cnt2, 0);\\n\\t\\tif (cnt1 > 0 && last != 1)\\n\\t\\t\\tans += dp3(cnt0, cnt1 - 1, cnt2, 1);\\n\\t\\tif (cnt2 > 0 && last != 2)\\n\\t\\t\\tans += dp3(cnt0, cnt1, cnt2 - 1, 2);\\n\\t\\treturn memo3[last][cnt0][cnt1][cnt2] = (int) (ans % MOD);\\n\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner sc = new Scanner();\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tn = sc.nextInt();\\n\\t\\tint[] fac = new int[n + 1];\\n\\t\\tt = new int[n];\\n\\t\\tg = new int[n];\\n\\t\\tint[] cnt = new int[3];\\n\\t\\tfac[0] = 1;\\n\\t\\tfor (int i = 1; i <= n; i++)\\n\\t\\t\\tfac[i] = (int) (i * 1L * fac[i - 1] % MOD);\\n\\t\\tint T =... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class B {\\n public static String toB(String str){\\n String row,col;\\n int i=0;\\n while(i='A')i++;\\n col = str.substring(0,i);\\n row = str.substring(i,str.length());\\n StringBuffer sb = new StringBuffer(col);\\n col = sb.reverse().toString();\\n int accum = 0;\\n for(i=0;i0){\\n mod = colVal%26;\\n if(mod==0){\\n ans+='Z';\\n colVal--;\\n }\\n else{\\n ans+=getLetter(mod);\\n }\\n colVal\\/=26;\\n }\\n StringBuffer sb = new StringBuffer(ans);\\n ans = sb.reverse().toString();\\n return ans+row;\\n }\\n public static int getValue(char c){\\n return c-'A'+1;\\n }\\n public static char getLetter(int n){\\n return (char)(n+'A'-1);\\n }\\n public static void main(String[] args)throws Exception{\\n Scanner in = new Scanner(System.in);\\n int cases = in.nextInt();\\n for(int i = 0;i='0'&&str.charAt(1)<='9' && str.indexOf('C')!=-1){\\n System.out.println(toA(str));\\n }\\n else System.out.println(toB(str));\\n }\\n \\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.HashSet;\\nimport java.util.List;\\n\\npublic class Main {\\n\\n public static void main(String[] args) throws IOException {\\n\\t\\/\\/ write your code here\\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\\n String[] s = reader.readLine().split(\\\" \\\");\\n int n = Integer.parseInt(s[0]);\\n int d = Integer.parseInt(s[1]);\\n\\n List list = new ArrayList<>();\\n s = reader.readLine().split(\\\" \\\");\\n for (int i = 0; i < n; i++) {\\n list.add(Integer.parseInt(s[i]));\\n }\\n\\n HashSet set = new HashSet<>();\\n for (Integer i : list) {\\n set.add(i - d);\\n set.add(i + d);\\n }\\n\\n HashSet set2 = new HashSet<>();\\n\\n for (Integer i : set) {\\n for (Integer x : list) {\\n if (Math.abs(i - x) < d) {\\n set2.add(i);\\n }\\n }\\n }\\n\\n set.removeAll(set2);\\n System.out.println(set.size());\\n\\n }\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package round429;\\nimport java.io.ByteArrayInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\n\\npublic class C2 {\\n\\tInputStream is;\\n\\tPrintWriter out;\\n\\tString INPUT = \\\"\\\";\\n\\t\\n\\tvoid solve()\\n\\t{\\n\\t\\tint n = ni();\\n\\t\\tint[] a = na(n);\\n\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\tint v = a[i];\\n\\t\\t\\tfor(int j = 2;j*j <= v;j++){\\n\\t\\t\\t\\twhile(v % (j*j) == 0){\\n\\t\\t\\t\\t\\tv \\/= j*j;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\ta[i] = v;\\n\\t\\t}\\n\\t\\t\\n\\t\\tArrays.sort(a);\\n\\t\\tint[] f = new int[n];\\n\\t\\tint p = 0;\\n\\t\\tfor(int i= 0;i < n;i++){\\n\\t\\t\\tif(i > 0 && a[i] != a[i-1]){\\n\\t\\t\\t\\tp++;\\n\\t\\t\\t}\\n\\t\\t\\tf[p]++;\\n\\t\\t}\\n\\t\\tf = Arrays.copyOf(f, p+1);\\n\\t\\tint mod = 1000000007;\\n\\t\\t\\n\\t\\tint[][] fif = enumFIF(1000, mod);\\n\\t\\tlong[] res = countSameNeighborsSequence(f, fif, mod);\\n\\t\\tlong ans = res[0];\\n\\t\\tfor(int v : f){\\n\\t\\t\\tans = ans * fif[0][v] % mod;\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.println(ans);\\n\\t}\\n\\t\\n\\tpublic static int[][] enumFIF(int n, int mod) {\\n\\t\\tint[] f = new int[n + 1];\\n\\t\\tint[] invf = new int[n + 1];\\n\\t\\tf[0] = 1;\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tf[i] = (int) ((long) f[i - 1] * i % mod);\\n\\t\\t}\\n\\t\\tlong a = f[n];\\n\\t\\tlong b = mod;\\n\\t\\tlong p = 1, q = 0;\\n\\t\\twhile (b > 0) {\\n\\t\\t\\tlong c = a \\/ b;\\n\\t\\t\\tlong d;\\n\\t\\t\\td = a;\\n\\t\\t\\ta = b;\\n\\t\\t\\tb = d % b;\\n\\t\\t\\td = p;\\n\\t\\t\\tp = q;\\n\\t\\t\\tq = d - c * q;\\n\\t\\t}\\n\\t\\tinvf[n] = (int) (p < 0 ? p + mod : p);\\n\\t\\tfor (int i = n - 1; i >= 0; i--) {\\n\\t\\t\\tinvf[i] = (int) ((long) invf[i + 1] * (i + 1) % mod);\\n\\t\\t}\\n\\t\\treturn new int[][] { f, invf };\\n\\t}\\n\\n\\t\\n\\tpublic static long[] countSameNeighborsSequence(int[] a, int[][] fif, int mod)\\n\\t{\\n\\t\\tint n = a.length;\\n\\t\\t\\n\\t\\tint bef = a[0];\\n\\t\\tint aft = a[0];\\n\\t\\tlong[] dp = new long[bef];\\n\\t\\tdp[bef-1] = 1;\\n\\t\\tfor(int u = 1;u < n;u++){\\n\\t\\t\\tint v = a[u];\\n\\t\\t\\taft += v;\\n\\t\\t\\tlong[][] ldp = new long[bef][aft];\\n\\t\\t\\tfor(int i = 0;i < dp.length;i++){\\n\\t\\t\\t\\tldp[i][0] = dp[i];\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tfor(int i = 0;i < v;i++){\\n\\t\\t\\t\\tlong[][] ndp = new long[bef][aft];\\n\\t\\t\\t\\tfor(int j = 0;j < bef;j++){\\n\\t\\t\\t\\t\\tfor(int k = 0;j+k < aft;k++){\\n\\t\\t\\t\\t\\t\\tif(ldp[j][k] == 0)continue;\\n\\t\\t\\t\\t\\t\\t\\/\\/ XX -> XCX\\n\\t\\t\\t\\t\\t\\tif(j > 0){\\n\\t\\t\\t\\t\\t\\t\\tndp[j-1][k] += ldp[j][k] *... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.InputStream;\\nimport java.util.*;\\n\\npublic class E {\\n\\t\\n\\tstatic InputStream is;\\n\\t\\/\\/String INPUT = \\\"\\\";\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tis = System.in;\\n\\t\\tint n = ni();\\n\\t\\tint k = ni();\\n\\t\\t\\n\\t\\tint[][] aj = new int[n][n];\\n\\t\\t\\n\\t\\tfor (int i = 0; i < aj.length; i++) {\\n\\t\\t\\taj[i] = na(n);\\n\\t\\t}\\n\\t\\t\\n\\t\\tint F = (n+1)\\/2;\\n\\t\\tint B = n-F;\\n\\t\\t\\n\\t\\tint[] spanftf = new int[F];\\n\\t\\tint[] spanftb = new int[F];\\n\\t\\tfor(int i =0; i < F; i++){\\n\\t\\t\\tfor(int j =0; j < F; j++){\\n\\t\\t\\t\\tif(i == j || aj[i][j] == 1){\\n\\t\\t\\t\\t\\tspanftf[i] |= 1< 0 && losign > 0 || k < 0 && losign < 0){\\n bins(mid , hi , k , hisign);\\n }\\n else {\\n bins(lo , mid , losign , k);\\n }\\n\\n }\\n static int query(int i){\\n System.out.println(\\\"? \\\" + i);\\n int a1 = in.nextInt();\\n System.out.println(\\\"? \\\" + ((i + (n\\/2)) > n ? (i - (n\\/2)) : (i + (n\\/2))));\\n int a2 = in.nextInt();\\n return a1 - a2;\\n }\\n\\n static class FastScanner {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n\\n public FastScanner(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n if (numChars <= 0) return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n boolean isSpaceChar(int c) {\\n return c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1;\\n }\\n\\n boolean isEndline(int c) {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\n\\npublic class HexTheorem {\\n public static void main(String[] args) throws NumberFormatException, IOException {\\n BufferedReader read = new BufferedReader(new InputStreamReader(System.in));\\n int x = Integer.parseInt(read.readLine());\\n System.out.println(\\\"0 0 \\\"+x);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import sun.reflect.generics.tree.Tree;\\n\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport java.net.Inet4Address;\\nimport java.util.*;\\n\\npublic class l {\\n \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEEEEEEEEEE MMMM MMMM OOOOOO SSSSSSS EEEEEEEEEEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEEEEEEEEEE MMMMMM MMMMMM OOO OOO SSSS SSS EEEEEEEEEEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMM MMM MMMM OOO OOO SSSS SSS EEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMMMMM MMMM OOO OOO SSSS EEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMMM OOO OOO SSSSSSS EEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHHHHHHHHHHHHHH EEEEEEEEEEE MMMM MMMM OOO OOO SSSSSS EEEEEEEEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHHHHHHHHHHHHHH EEEEEEEEEEE MMMM MMMM OOO OOO SSSSSSS EEEEEEEEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMMM OOO OOO SSSS EEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMMM OOO ... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n \\n\\npublic class Main {\\n\\t\\n\\tpublic static void main(String[] args) throws java.lang.Exception {\\n\\t\\tBufferedReader kek = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\/\\/Scanner skek = new Scanner(System.in);\\n\\t\\tPrintWriter outkek = new PrintWriter(System.out);\\n\\n\\t\\tint N = Integer.parseInt(kek.readLine());\\n\\t\\tdouble[][] lake = new double[N][N];\\n\\t\\t\\n\\t\\tfor(int i = 0; i < N; i++){\\n\\t\\t\\tString[] input = kek.readLine().split(\\\" \\\");\\n\\t\\t\\tfor(int j = 0; j < N; j++){\\n\\t\\t\\t\\tlake[i][j] = Double.parseDouble(input[j]);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tint pow = (int)Math.pow(2, N);\\n\\t\\tdouble[] res = new double[pow];\\n\\t\\tres[pow - 1] = 1.0;\\n\\t\\t\\n\\t\\tfor(int i = pow - 1; i >= 0; i--){\\n\\t\\t\\tint ones = Integer.bitCount(i); \\/\\/ So this is apparently a thing\\n\\t\\t\\tint possibleCombos = ones * (ones - 1) \\/2;\\n\\t\\t\\t\\n\\t\\t\\tfor(int j = 0; j < N; j++){\\n\\t\\t\\t\\tif((i >> j) % 2 == 0){ \\/\\/ (X >> Y) literally does the same thing as divis func. Bit operators are weird.\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tfor(int k = j + 1; k < N; k++){\\n\\t\\t\\t\\t\\tif((i >> k) % 2 == 0){\\n\\t\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tres[i ^ (1 << k)] += res[i] * lake[j][k]\\/possibleCombos;\\n\\t\\t\\t\\t\\tres[i ^ (1 << j)] += res[i] * lake[k][j]\\/possibleCombos;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int i = 0; i < N; i++){\\n\\t\\t\\toutkek.print(res[1 << i] + \\\" \\\");\\n\\t\\t}\\n\\t\\t\\n\\t\\tkek.close();\\n\\t\\toutkek.close();\\n\\t}\\t\\n\\t\\n\\t\\/*static int divis(int n, int a){\\n\\t\\tfor(int i = 0; i < a; i++){\\n\\t\\t\\tn \\/= 2;\\n\\t\\t}\\n\\t\\treturn n;\\n\\t}*\\/\\n\\t\\t\\n}\\n Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.util.Map.Entry;\\n\\npublic class ProblemA {\\n\\tpublic static void main (String args[]) throws IOException{\\n\\t\\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint n=Integer.parseInt(br.readLine());\\n\\t\\tString s1=br.readLine();\\n\\t\\tString[] s=s1.split(\\\" \\\");\\n\\t\\tint a[] = new int[n];\\n\\t\\tfor(int i = 0;i mp = new HashMap();\\n\\t\\tint f=0;\\n\\t\\tfor(int i = 0; i entry : mp.entrySet()) \\n\\t\\t\\t{\\n\\t\\t\\t\\tif(a[i] % entry.getKey()==0)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tf=1;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(f==0)\\n\\t\\t\\t{\\n\\t\\t\\t\\tmp.put(a[i],1);\\n\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t}\\n\\t\\treturn mp.size();\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.*;\\n\\nimport static java.lang.Double.parseDouble;\\nimport static java.lang.Integer.parseInt;\\nimport static java.lang.Long.parseLong;\\nimport static java.lang.System.in;\\nimport static java.lang.System.out;\\n\\npublic class SolutionD extends Thread {\\n static class FastReader {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastReader() {\\n br = new BufferedReader(new\\n InputStreamReader(in));\\n }\\n\\n String next() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() {\\n return parseInt(next());\\n }\\n\\n long nextLong() {\\n return parseLong(next());\\n }\\n\\n double nextDouble() {\\n return parseDouble(next());\\n }\\n\\n String nextLine() {\\n String str = \\\"\\\";\\n try {\\n str = br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return str;\\n }\\n }\\n\\n private static final FastReader scanner = new FastReader();\\n private static final PrintWriter out = new PrintWriter(System.out);\\n\\n public static void main(String[] args) {\\n solve();\\n out.close();\\n }\\n\\n private static void solve() {\\n int n = scanner.nextInt();\\n int m = scanner.nextInt();\\n int k = scanner.nextInt();\\n\\n int[][] hori = new int[n][m-1];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < m-1; j++) {\\n int xij = scanner.nextInt();\\n hori[i][j] = xij;\\n }\\n }\\n\\n int[][] vert = new int[n-1][m];\\n... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Main {\\n\\n private FastScanner scanner = new FastScanner();\\n\\n public static void main(String[] args) {\\n new Main().solve();\\n }\\n\\n\\n private void solve() {\\n int n = scanner.nextInt();\\n\\n Map cnt = new HashMap<>();\\n\\n for (int i = 0; i < n; i++) {\\n String s = scanner.nextLine();\\n\\n LinkedList st = new LinkedList<>();\\n\\n for (char c : s.toCharArray()) {\\n if (c == ')' && !st.isEmpty() && st.getLast() == '(') {\\n st.pollLast();\\n continue;\\n }\\n st.addLast(c);\\n }\\n\\n int t = st.size();\\n Set set = new HashSet<>(st);\\n if (set.size() > 1) {\\n continue;\\n }\\n if (set.isEmpty()) {\\n cnt.put(0, cnt.getOrDefault(0, 0) + 1);\\n continue;\\n }\\n\\n if (st.getLast() == '(') {\\n cnt.put(t, cnt.getOrDefault(t, 0) + 1);\\n } else {\\n cnt.put(-t, cnt.getOrDefault(-t, 0) + 1);\\n }\\n }\\n\\n long ans = 0;\\n\\n for (int next : cnt.keySet()) {\\n if (next == 0) {\\n ans += (long) cnt.get(next) * (cnt.get(next) - 1) + cnt.get(next);\\n } else if (next > 0) {\\n int t = next * -1;\\n if (cnt.containsKey(t)) {\\n ans += (long) cnt.get(next) * cnt.get(t);\\n }\\n }\\n }\\n\\n System.out.print(ans);\\n\\n }\\n\\n class FastScanner {\\n BufferedReader reader;\\n StringTokenizer tokenizer;\\n\\n FastScanner() {\\n reader = new BufferedReader(new InputStreamReader(System.in), 32768);\\n tokenizer = null;\\n }\\n\\n String next() {\\n while (tokenizer == null ||... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n\\tpublic static void main(String[] args) throws IOException{\\n\\t\\tScanner cin = new Scanner(System.in);\\n\\t\\t\\n\\t\\tint t, n, m;\\n\\t\\t\\n\\t\\tt = cin.nextInt();\\n\\t\\t\\n\\t\\twhile(t > 0) {\\n\\t\\t\\tt--;\\n\\t\\t\\tint sum = 0;\\n\\t\\t\\tn = cin.nextInt();\\n\\t\\t\\tm = cin.nextInt();\\n\\t\\t\\twhile(n > 0 && m > 0) {\\n\\t\\t\\t\\tif(n < m) {\\n\\t\\t\\t\\t\\tint k = n;\\n\\t\\t\\t\\t\\tn = m;\\n\\t\\t\\t\\t\\tm = k;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tsum += n \\/ m; n %= m;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tSystem.out.println(sum);\\n\\t\\t}\\n\\t}\\n\\n}\\n\\t \\t\\t \\t \\t \\t\\t\\t \\t \\t \\t Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.awt.Point;\\nimport java.math.BigInteger;\\n\\nimport static java.lang.Math.*;\\n\\n\\/\\/ Solution is at the bottom of code\\n\\npublic class ProblemC_008 implements Runnable{\\n\\t\\n\\tfinal boolean ONLINE_JUDGE = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n\\t\\n\\tBufferedReader in;\\n\\tOutputWriter out;\\n\\tStringTokenizer tok = new StringTokenizer(\\\"\\\");\\n\\t\\n\\tpublic static void main(String[] args){\\n\\t\\tnew Thread(null, new ProblemC_008(), \\\"\\\", 128 * (1L << 20)).start();\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tvoid init() throws FileNotFoundException{\\n\\t\\tLocale.setDefault(Locale.US);\\n\\t\\t\\n\\t\\tif (ONLINE_JUDGE){\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new OutputWriter(System.out);\\n\\t\\t}else{\\n\\t\\t\\tin = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t\\tout = new OutputWriter(\\\"output.txt\\\");\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tlong timeBegin, timeEnd;\\n\\n\\tvoid time(){\\n\\t\\ttimeEnd = System.currentTimeMillis();\\n\\t\\tSystem.err.println(\\\"Time = \\\" + (timeEnd - timeBegin));\\n\\t}\\n\\t\\n\\tvoid debug(Object... objects){\\n\\t\\tif (ONLINE_JUDGE){\\n\\t\\t\\tfor (Object o: objects){\\n\\t\\t\\t\\tSystem.err.println(o.toString());\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tpublic void run(){\\n\\t\\ttry{\\n\\t\\t\\ttimeBegin = System.currentTimeMillis();\\n\\t\\t\\tLocale.setDefault(Locale.US);\\n\\t\\t\\t\\n\\t\\t\\tinit();\\n\\t\\t\\tsolve();\\n\\t\\t\\t\\n\\t\\t\\tout.close();\\n\\t\\t\\ttime();\\n\\t\\t}catch (Exception e){\\n\\t\\t\\te.printStackTrace(System.err);\\n\\t\\t\\tSystem.exit(-1);\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tString delim = \\\" \\\";\\n\\t\\n\\tString readString() throws IOException{\\n\\t\\twhile(!tok.hasMoreTokens()){\\n\\t\\t\\ttry{\\n\\t\\t\\t\\ttok = new StringTokenizer(in.readLine());\\n\\t\\t\\t}catch (Exception e){\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn tok.nextToken(delim);\\n\\t}\\n\\t\\n\\tString readLine() throws IOException{\\n\\t\\treturn in.readLine();\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tfinal char NOT_A_SYMBOL = '\\\\0';\\n\\t\\n\\tchar... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Q3a {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner in = new Scanner(System.in);\\n\\t\\tint n = in.nextInt();\\n\\t\\tin.nextLine();\\n\\t\\tString s = in.nextLine();\\n\\n\\t\\tHashMap seen = new HashMap<>();\\n\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tCharacter c = s.charAt(i);\\n\\t\\t\\tint ci = (int) c.charValue();\\n\\t\\t\\t\\/\\/ System.out.println(ci);\\n\\t\\t\\tseen.put(ci, seen.get(ci) == null ? 1 : seen.get(ci) + 1);\\n\\t\\t}\\n\\n\\t\\tHashMap sub = new HashMap();\\n\\t\\tint start = 0;\\n\\t\\tint min = 10000000;\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tCharacter c = s.charAt(i);\\n\\t\\t\\tint ci = (int) c.charValue();\\n\\n\\t\\t\\tsub.put(ci, sub.get(ci) == null ? 1 : sub.get(ci) + 1);\\n\\t\\t\\t\\n\\t\\t\\twhile(sub.size() == seen.size()) {\\n\\t\\t\\t\\tmin = Math.min(min, i - start + 1);\\n\\t\\t\\t\\tc = s.charAt(start);\\n\\t\\t\\t\\tstart ++;\\n\\t\\t\\t\\tci = (int) c.charValue();\\n\\t\\t\\t\\tif( sub.get(ci) == 1) \\n\\t\\t\\t\\t\\tsub.remove(ci);\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tsub.put(ci, sub.get(ci) - 1);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tSystem.out.print(min);\\n\\n\\t\\t\\/\\/ System.out.println( seen_all_at - begin + 1);\\n\\n\\t\\tin.close();\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.lang.*;\\n\\npublic class Main {\\n\\n public static void main(String[] args) {\\n Scanner cin=new Scanner(new BufferedInputStream(System.in));\\n \\n int n=cin.nextInt(),\\n m=cin.nextInt(),\\n k=cin.nextInt();\\n int[] a=new int[51];\\n \\n for (int i=0;i= maxk) {\\n maxn = i;\\n break;\\n }\\n }\\n\\n long[] vala = new long[(int) maxn + 1];\\n\\n vala[1] = 1;\\n\\n for (int i = 2; i <= maxn; i++) {\\n vala[i] = 1 + 4 * vala[i - 1];\\n }\\n\\n o:\\n while (t-- > 0) {\\n long n = in.nextInt();\\n long k = in.nextLong();\\n\\n if (n - 1 >= maxn) {\\n out.println(\\\"YES \\\" + (n - 1));\\n continue;\\n }\\n\\n k--;\\n\\n if (k <= vala[(int) n - 1]) {\\n out.println(\\\"YES \\\" + (n - 1));\\n continue;\\n }\\n\\n long cs = n - 1;\\n long cc = 3;\\n int ind = 2;\\n\\n long end = -1;\\n while (k > 0) {\\n if (k >= cc && cs > 0) {\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\n\\/**\\n * CodeForces 8C - Looking for Order\\n * Created by Darren on 14-10-1.\\n *\\/\\npublic class Main {\\n Reader in = new Reader(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n\\n public static void main(String[] args) throws IOException {\\n new Main().run();\\n }\\n\\n int n;\\n int[] x, y;\\n int[][] time;\\n int status;\\n int[] dp;\\n int[] pre;\\n\\n\\n void run() throws IOException {\\n int xs = in.nextInt(), ys = in.nextInt();\\n n = in.nextInt();\\n x = new int[n+1];\\n y = new int[n+1];\\n for (int i = 0; i < n; i++) {\\n x[i] = in.nextInt();\\n y[i] = in.nextInt();\\n }\\n x[n] = xs;\\n y[n] = ys;\\n\\n computeTime();\\n\\n status = (1< temp1) {\\n dp[t1] = temp1;\\n pre[t1] = i;\\n }\\n for (int k = 0; k < n; k++) {\\n if (((1< temp2) {\\n dp[t2] = temp2;\\n pre[t2] = i;\\n }\\n }\\n }\\n break;\\n }\\n }\\n }\\n\\n int cur = (1 << n) - 1;\\n out.println(dp[cur]);\\n out.print(0);\\n while (cur > 0) {\\n int last = pre[cur], diff = cur... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/ Working program using Reader Class\\nimport java.io.DataInputStream;\\nimport java.io.FileInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.*;\\n\\npublic class Main2\\n{\\n static class Reader\\n {\\n final private int BUFFER_SIZE = 1 << 16;\\n private DataInputStream din;\\n private byte[] buffer;\\n private int bufferPointer, bytesRead;\\n\\n public Reader()\\n {\\n din = new DataInputStream(System.in);\\n buffer = new byte[BUFFER_SIZE];\\n bufferPointer = bytesRead = 0;\\n }\\n\\n public Reader(String file_name) throws IOException\\n {\\n din = new DataInputStream(new FileInputStream(file_name));\\n buffer = new byte[BUFFER_SIZE];\\n bufferPointer = bytesRead = 0;\\n }\\n\\n public String readLine() throws IOException\\n {\\n byte[] buf = new byte[64]; \\/\\/ line length\\n int cnt = 0, c;\\n while ((c = read()) != -1)\\n {\\n if (c == '\\\\n')\\n break;\\n buf[cnt++] = (byte) c;\\n }\\n return new String(buf, 0, cnt);\\n }\\n\\n public int nextInt() throws IOException\\n {\\n int ret = 0;\\n byte c = read();\\n while (c <= ' ')\\n c = read();\\n boolean neg = (c == '-');\\n if (neg)\\n c = read();\\n do\\n {\\n ret = ret * 10 + c - '0';\\n } while ((c = read()) >= '0' && c <= '9');\\n\\n if (neg)\\n return -ret;\\n return ret;\\n }\\n\\n public long nextLong() throws IOException\\n {\\n long ret = 0;\\n byte c = read();\\n while (c <= ' ')\\n c = read();\\n boolean neg = (c == '-');\\n if (neg)\\n c = read();\\n do {\\n ret = ret * 10 + c - '0';\\n }\\n while ((c = read()) >= '0' && c <= '9');\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.text.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class code5 {\\n\\tInputStream is;\\n\\tPrintWriter out;\\n\\tstatic long mod=pow(10,9)+7;\\n\\tstatic int dx[]={0,0,1,-1},dy[]={1,-1,0,0};\\n\\tString arr[];\\n\\tlong dp[][];\\n\\tvoid solve() throws IOException\\n\\t{\\n\\t\\tint n=ni();\\n\\t\\tint a[]=na(n);\\n\\t\\tint q=ni();\\n\\t\\tboolean flag=false;\\n\\t\\tfor(int i=0;ia[i])\\n\\t\\t\\t\\t\\tflag^=true;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\twhile(q--!=0)\\n\\t\\t{\\n\\t\\t\\tint l=ni()-1;\\n\\t\\t\\tint r=ni()-1;\\n\\t\\t\\tint num=(r-l+1);\\n\\t\\t\\tint tot=num*(num-1)\\/2;\\n\\t\\t\\tif(tot%2==1)\\n\\t\\t\\t\\tflag^=true;\\n\\t\\t\\tif(flag)\\n\\t\\t\\t\\tout.println(\\\"odd\\\");\\n\\t\\t\\telse\\n\\t\\t\\t\\tout.println(\\\"even\\\");\\t\\t\\t\\n\\t\\t}\\n\\t}\\n\\tint sum(int i)\\n\\t{\\n\\t\\tint sum=0;\\n\\t\\twhile(i!=0)\\n\\t\\t{\\n\\t\\t\\tif((i%10)%2==1)\\n\\t\\t\\t\\tsum+=i%10;\\n\\t\\t\\ti\\/=10;\\n\\t\\t}\\n\\t\\treturn sum;\\n\\t}\\n\\tArrayList al[];\\n \\tvoid take(int n,int m)\\n \\t{\\n \\t\\tal=new ArrayList[n];\\n \\t\\tfor(int i=0;i();\\n \\t\\tfor(int i=0;i=1){\\n\\t\\t\\tint mid = (l+r)\\/2;\\n\\t\\t\\tmergeSort(arr,l,mid);\\n\\t\\t\\tmergeSort(arr,mid+1,r);\\n\\t\\t\\tmerge(arr,l,r,mid);\\n\\t\\t}\\n\\t}\\n\\tpublic static void merge(int arr[], int l, int r, int mid){\\n\\t\\tint n1 = (mid-l+1), n2 = (r-mid);\\n\\t\\tint left[] = new int[n1];\\n\\t\\tint right[] = new int[n2];\\n\\t\\tfor(int i =0 ;i adj[];\\n static int[] dist,parent,back;\\n static boolean[] vis,vist;\\n static int root=0,ans=1;\\n \\n \\n void solve(PrintWriter out, Reader in) throws IOException{\\n n = in.nextInt();\\n\\n\\n if(n==1) {out.println(1);return;}\\n adj = new ArrayList[n+1];\\n for(int i=1;i<=n;i++) \\n adj[i] = new ArrayList();\\n \\n int u,v;\\n for(int i=0;i pq = new PriorityQueue();\\n for(int i=1;i<=n;i++){\\n if(i!=root) pq.add(new Node(i,dist[i]));\\n }\\n \\n Node elm;\\n int rt = root;\\n out.print(1);\\n \\n makeroot(root);\\n removeNodes(root,rt);\\n ans+=dist[rt];\\n out.print(\\\" \\\"+ans);\\n int itr=2;\\n for(int i=2;i<=n;i++){\\n \\n elm = pq.remove();\\n if(vis[elm.idx]) continue;\\n removeNodes(back[elm.idx],elm.idx);\\n ans +=... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tTaskA solver = new TaskA();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskA {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n if (n % 2 == 0) {\\n out.println(4 + \\\" \\\" + (n - 4));\\n } else {\\n out.println(9 + \\\" \\\" + (n - 9));\\n }\\n }\\n}\\n\\nclass InputReader {\\n private final BufferedReader reader;\\n private StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream));\\n tokenizer = null;\\n }\\n\\n public String nextLine() {\\n try {\\n return reader.readLine();\\n } catch (IOException e) {\\n throw new RuntimeException(e);\\n }\\n }\\n\\n public String next() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n tokenizer = new StringTokenizer(nextLine());\\n }\\n return tokenizer.nextToken();\\n }\\n\\n public int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n}\\n\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n\\n\\tBufferedReader in;\\n\\tStringTokenizer str = null;\\n\\tPrintWriter out;\\n\\t\\n\\tprivate String next() throws Exception{\\n\\t\\twhile (str == null || !str.hasMoreElements())\\n\\t\\t\\tstr = new StringTokenizer(in.readLine());\\n\\t\\treturn str.nextToken();\\n\\t}\\n\\t\\n\\tprivate int nextInt() throws Exception{\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\t\\n\\tprivate long nextLong() throws Exception{\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\t\\n\\tprivate double nextDouble() throws Exception{\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\n\\tMap map;\\n\\tint []p, rank;\\n\\n\\tpublic void run() throws Exception{\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\n\\t\\tmap = new HashMap();\\n\\n\\t\\tint n = nextInt();\\n\\t\\tint x = nextInt(), y = nextInt();\\n\\t\\tint []a = new int[n];\\n\\t\\tp = new int[n];\\n\\t\\tfor(int i = 1; i < n; ++i) p[i] = i;\\n\\t\\trank = new int[n];\\n\\n\\t\\tfor(int i = 0; i < n; ++i) {\\n\\t\\t\\ta[i] = nextInt();\\n\\t\\t\\tmap.put(a[i], i);\\n\\t\\t}\\n\\t\\tint mask[] = new int[n];\\n\\t\\tfor(int i = 0; i < n; ++i) {\\n\\t\\t\\tif (map.containsKey(x - a[i])) {\\n\\t\\t\\t\\tunion(map.get(x - a[i]), i);\\n\\t\\t\\t\\tmask[i] |= 1;\\t\\n\\t\\t\\t} \\n\\t\\t\\tif (map.containsKey(y - a[i])) {\\n\\t\\t\\t\\tunion(map.get(y - a[i]), i);\\n\\t\\t\\t\\tmask[i] |= 2;\\n\\t\\t\\t} \\n\\t\\t}\\n\\n\\t\\tint []b = new int[n];\\n\\t\\tArrays.fill(b, 3);\\n\\t\\tfor(int i = 0; i < n; ++i) b[find(i)] &= mask[i];\\n\\t\\tfor(int i = 0; i < n; ++i) {\\n\\t\\t\\tif (b[i] == 0) {\\n\\t\\t\\t\\tout.println(\\\"NO\\\");\\n\\t\\t\\t\\tout.close();\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tout.println(\\\"YES\\\");\\n\\t\\tfor(int i = 0; i < n; ++i) {\\n\\t\\t\\tout.print((b[find(i)] & 1) == 1 ? 0 : 1);\\n\\t\\t\\tif (i != n - 1) out.print(\\\" \\\");\\n\\t\\t}\\n\\t\\tout.println();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tprivate int find(int x) {\\n\\t\\tif (x != p[x])\\n\\t\\t\\treturn p[x] = find(p[x]);\\n\\t\\treturn x;\\n\\t}\\n\\tprivate void union(int a, int b) {\\n\\t\\ta = find(a);\\n\\t\\tb = find(b);\\n\\t\\tif (rank[a] < rank[b]) {\\n\\t\\t\\tint tmp = a;\\n\\t\\t\\ta = b;\\n\\t\\t\\tb = tmp;\\n\\t\\t}\\n\\t\\tp[b] = a;\\n\\t\\tif (rank[a] == rank[b]) ++rank[a];\\n\\t}\\n\\t\\t\\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tnew Main().run();\\n\\t}\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\n\\n\\npublic class Main {\\n private static final int MAX = 5000 + 10,mod = 1000000007;\\n private static char [] S;\\n private static int n;\\n private static Integer [] [] dp = new Integer[MAX][MAX];\\n\\n private static int solve(int pos,int open){\\n if(pos == n) return (open == 0) ? 1 : 0;\\n if (dp[pos][open] != null) return dp[pos][open];\\n int res = 0;\\n if (S[pos] == 's') {\\n res = solve(pos + 1,open);\\n if (open > 0) res += solve(pos,open - 1);\\n if (res >= mod) res -= mod;\\n }\\n else {\\n res = solve(pos+1,open + 1);\\n }\\n return dp[pos][open] = res;\\n }\\n\\n public static void main(String[] args) throws Exception{\\n IO io = new IO(null,null);\\n n = io.getNextInt();\\n S = new char[n];\\n for (int i = 0;i < n;i++) S[i] = io.getNext().charAt(0);\\n io.println(solve(0,0));\\n io.close();\\n }\\n}\\n\\n\\n\\nclass IO{\\n private BufferedReader br;\\n private StringTokenizer st;\\n private PrintWriter writer;\\n private String inputFile,outputFile;\\n\\n public boolean hasMore() throws IOException{\\n if(st != null && st.hasMoreTokens()) return true;\\n if(br != null && br.ready()) return true;\\n return false;\\n }\\n public String getNext() throws FileNotFoundException, IOException{\\n while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());\\n return st.nextToken();\\n }\\n\\n public String getNextLine() throws FileNotFoundException, IOException{\\n return br.readLine().trim();\\n }\\n\\n public int getNextInt() throws FileNotFoundException, IOException{\\n return Integer.parseInt(getNext());\\n }\\n public long getNextLong() throws FileNotFoundException, IOException{\\n return Long.parseLong(getNext());\\n }\\n\\n public void print(double x,int num_digits) throws IOException{\\n writer.printf(\\\"%.\\\" + num_digits + \\\"f\\\" ,x);\\n }\\n public void println(double... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class E implements Runnable {\\n\\tpublic static void main (String[] args) {new Thread(null, new E(), \\\"_cf\\\", 1 << 28).start();}\\n\\n\\tint n, m;\\n\\tchar[] str;\\n\\tint[][] occs, cost;\\n\\tint[] dp;\\n\\t\\n\\tpublic void run() {\\n\\t\\tFastScanner fs = new FastScanner();\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tSystem.err.println(\\\"\\\");\\n\\n\\t\\t\\/\\/where's my 420???? :(\\n\\t\\tlong tot = 0;\\n\\t\\tfor(int i = 0; i < 20000; i++) tot += i;\\n\\t\\t\\n\\t\\tn = fs.nextInt(); m = fs.nextInt();\\n\\t\\tbyte[] str = fs.next().getBytes();\\n\\t\\tint[] occs = new int[1< 0) continue;\\n\\t\\t\\t\\tint lb = mask & (-mask);\\n\\t\\t\\t\\tint trail = Integer.numberOfTrailingZeros(lb);\\n\\t\\t\\t\\tint nmask = mask ^ lb;\\n\\t\\t\\t\\tcost[i][mask] = cost[i][nmask]+occs[1<= 0; mask--) {\\n\\t\\t\\tint addOn = 0;\\n\\t\\t\\tfor(int nxt = 0; nxt < m; nxt++) {\\n\\t\\t\\t\\tif(((1< 0) continue;\\n\\t\\t\\t\\taddOn += cost[nxt][mask];\\n\\t\\t\\t}\\n\\t\\t\\tint res = oo;\\n\\t\\t\\tfor(int nxt = 0; nxt < m; nxt++) {\\n\\t\\t\\t\\tif(((1< 0) continue;\\n\\t\\t\\t\\tint ret = addOn+dp[mask | (1<>1);\\n\\t\\t\\n\\t\\tout.close();\\n\\t}\\n\\t\\n\\tint oo = (int)1e9;\\n\\tint min(int a, int b) {\\n\\t\\tif(a < b) return a;\\n\\t\\treturn b;\\n\\t}\\n\\t\\n\\tclass FastScanner {\\n\\t\\tpublic int BS = 1<<16;\\n\\t\\tpublic char NC = (char)0;\\n\\t\\tbyte[] buf = new byte[BS];\\n\\t\\tint bId = 0, size = 0;\\n\\t\\tchar c = NC;\\n\\t\\tdouble num = 1;\\n\\t\\tBufferedInputStream in;\\n\\n\\t\\tpublic FastScanner() {\\n\\t\\t\\tin = new BufferedInputStream(System.in, BS);\\n\\t\\t}\\n\\n\\t\\tpublic FastScanner(String s) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tin = new BufferedInputStream(new FileInputStream(new File(s)),... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n Scanner in = new Scanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public void solve(int testNumber, Scanner in, PrintWriter out) {\\n int n = in.nextInt();\\n int r = in.nextInt();\\n int[] xs = new int[n];\\n for (int i = 0; i < n; i++) xs[i] = in.nextInt();\\n double[] ys = new double[n];\\n for (int i = 0; i < n; i++) {\\n int x = xs[i];\\n double y = r;\\n for (int j = 0; j < i; j++) {\\n y = Math.max(y, calc(xs[j], ys[j], x, r));\\n }\\n ys[i] = y;\\n }\\n for (int i = 0; i < n; i++) {\\n out.printf(\\\"%.10f \\\", ys[i]);\\n }\\n out.println();\\n }\\n\\n private double calc(int x, double y, int x1, int r) {\\n int dx = Math.abs(x - x1);\\n if (dx > 2 * r) return 0;\\n double dy = Math.sqrt(4 * r * r - dx * dx);\\n return y + dy;\\n }\\n\\n }\\n\\n static class Scanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public Scanner(InputStream in) {\\n br = new BufferedReader(new InputStreamReader(in), 32768);\\n }\\n\\n public String nextLine() {\\n try {\\n return br.readLine();\\n } catch (IOException e) {\\n return null;\\n }\\n }\\n\\n... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.lang.*;\\nimport java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class Solution implements Runnable{\\n private static BufferedReader br = null;\\n private static PrintWriter out = null;\\n private static StringTokenizer stk = null;\\n \\n public static void main(String[] args) {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n (new Thread(new Solution())).start();\\n }\\n \\n private void loadLine() {\\n try {\\n stk = new StringTokenizer(br.readLine());\\n }\\n catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n \\n private String nextLine() {\\n try {\\n return br.readLine();\\n }\\n catch (IOException e) {\\n e.printStackTrace();\\n }\\n return null;\\n }\\n \\n private Integer nextInt() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return Integer.parseInt(stk.nextToken());\\n }\\n \\n private Long nextLong() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return Long.parseLong(stk.nextToken());\\n }\\n \\n private String nextWord() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return (stk.nextToken());\\n }\\n \\n private Double nextDouble() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return Double.parseDouble(stk.nextToken());\\n }\\n \\n public void run() {\\n int n = nextInt();\\n int t = nextInt();\\n \\n double[] d = new double[2*n];\\n for (int i = 0; i < n; ++i) {\\n double x = nextDouble();\\n double a = nextDouble();\\n d[2*i] = x-a\\/2;\\n d[2*i+1] = x+a\\/2;\\n }\\n \\n Arrays.sort(d);\\n int res = 2;\\n for (int i = 1; i < 2*n-1; i+=2) {\\n if (d[i+1] - d[i] >= t) {\\n ++res;\\n }\\n if (d[i+1] - d[i] > t) {\\n ++res;\\n }\\n }\\n \\n ... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n\\tstatic class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner() {\\n try {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n st = new StringTokenizer(br.readLine());\\n } catch (Exception e){e.printStackTrace();}\\n }\\n\\n public String next() {\\n if (st.hasMoreTokens()) return st.nextToken();\\n try {st = new StringTokenizer(br.readLine());}\\n catch (Exception e) {e.printStackTrace();}\\n return st.nextToken();\\n }\\n\\n public int nextInt() {return Integer.parseInt(next());}\\n\\n public long nextLong() {return Long.parseLong(next());}\\n\\n public double nextDouble() {return Double.parseDouble(next());}\\n\\n public String nextLine() {\\n String line = \\\"\\\";\\n if(st.hasMoreTokens()) line = st.nextToken();\\n else try {return br.readLine();}catch(IOException e){e.printStackTrace();}\\n while(st.hasMoreTokens()) line += \\\" \\\"+st.nextToken();\\n return line;\\n }\\n }\\n public static void main(String[] args) {\\n FastScanner sc = new FastScanner();\\n PrintWriter pw = new PrintWriter(System.out);\\n\\n int n = sc.nextInt();\\n int best = 1;\\n int bestTime = Integer.MAX_VALUE;\\n for(int i=0;i= numChars) {\\n\\t\\t\\t\\tcurChar = 0;\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\tnumChars = stream.read(buf);\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (numChars <= 0)\\n\\t\\t\\t\\t\\treturn -1;\\n\\t\\t\\t}\\n\\t\\t\\treturn buf[curChar++];\\n\\t\\t}\\n\\n\\t\\tboolean isSpaceChar(int c) {\\n\\t\\t\\treturn c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1;\\n\\t\\t}\\n\\n\\t\\tboolean isEndline(int c) {\\n\\t\\t\\treturn c == '\\\\n' || c == '\\\\r' || c == -1;\\n\\t\\t}\\n\\n\\t\\tint nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tint[] nextInt(int N) {\\n\\t\\t\\tint[] ret = new int[N];\\n\\t\\t\\tfor (int a = 0; a < N; a++)\\n\\t\\t\\t\\tret[a] = nextInt();\\n\\t\\t\\treturn ret;\\n\\t\\t}\\n\\n\\t\\tint[][] nextInt(int N, int M) {\\n\\t\\t\\tint[][] ret = new int[N][M];\\n\\t\\t\\tfor (int a = 0; a < N; a++)\\n\\t\\t\\t\\tret[a] = nextInt(M);\\n\\t\\t\\treturn ret;\\n\\t\\t}\\n\\n\\t\\tlong nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tlong[] nextLong(int N)... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/ package CF;\\n\\nimport java.io.BufferedReader;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeSet;\\n\\n\\npublic class F {\\n\\n\\tpublic static void main(String[] args) throws Exception\\n\\t{\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tint n = sc.nextInt(), d = sc.nextInt();\\n\\t\\tint [] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\ta[i] = sc.nextInt();\\n\\t\\t}\\n\\t\\tArrays.sort(a);\\n\\t\\tTreeSet set = new TreeSet<>();\\n\\t\\tfor (int i = 0; i < a.length; i++) {\\n\\t\\t\\tint tmp = a[i] - d;\\n\\t\\t\\tif(i == 0 || tmp > a[i-1] && tmp - a[i-1] >= d)\\n\\t\\t\\t\\tset.add(tmp);\\n\\t\\t\\ttmp = a[i] + d;\\n\\t\\t\\tif(i == n-1 || tmp < a[i+1] && a[i+1] - tmp >= d)\\n\\t\\t\\t\\tset.add(tmp);\\n \\t\\t}\\n\\t\\tout.println(set.size());\\n\\t\\tout.flush();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\t\\tStringTokenizer st;\\n\\t\\tBufferedReader br;\\n\\n\\t\\tpublic Scanner(InputStream s)\\n\\t\\t{\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(s));\\n\\t\\t}\\n\\n\\t\\tpublic Scanner(FileReader fileReader)\\n\\t\\t{\\n\\t\\t\\tbr = new BufferedReader(fileReader);\\n\\t\\t}\\n\\n\\t\\tpublic String next() throws IOException\\n\\t\\t{\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException\\n\\t\\t{\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() throws IOException\\n\\t\\t{\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic String nextLine() throws IOException\\n\\t\\t{\\n\\t\\t\\treturn br.readLine();\\n\\t\\t}\\n\\n\\t\\tpublic boolean ready() throws IOException\\n\\t\\t{\\n\\t\\t\\treturn br.ready();\\n\\t\\t}\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\nimport java.io.PrintWriter;\\n\\nimport java.util.*;\\nimport java.util.Arrays ; \\nimport java .lang.String.* ;\\nimport java .lang.StringBuilder ;\\n\\n\\npublic class Test{\\n static int pos = 0 ; \\n static int arr[] ; \\n static LinkedList l1 = new LinkedList() ; \\nstatic void find(int p ,char[]x,int put[],String s){\\n int c= 0 ; \\n for (int i = 0; i < s.length(); i++) {\\n if(x[p]==s.charAt(i)){\\n c++ ; }\\n }\\n put[p] = c ; \\n}\\nstatic int mode(int m ,int[]x ){\\n int temp = 0 ; \\n for (int i = x.length-1; i >=0; i--) {\\n if(x[i]<=m){\\n temp= x[i] ; \\n \\/\\/\\/ break ; \\n return m-temp ; \\n \\n }\\n }\\n return m-temp ; \\n}\\nstatic int mode2(int m ,int[]x ){\\n int temp = 0 ; \\n \\n for (int i = x.length-1; i >=0; i--) {\\n if(x[i]<=m){\\n temp= x[i] ; \\n \\/\\/\\/ break ; \\n return x[i] ; \\n \\n }\\n }\\n return 0 ; \\n}\\nstatic int find(int x[],int temp){\\n int j = 0 ; \\n for (int i = x.length-1; i >=0; i--) {\\n if(x[i]==temp) return j+1 ; \\n j++ ; \\n }\\n return -1 ; \\n}\\nstatic String ch(long[]x,long b){\\n for (int i = 0; i < x.length; i++) {\\n if(x[i]==b)return \\\"YES\\\" ;\\n }\\n return \\\"NO\\\" ; \\n}\\n\\n public static void main(String[] args) {\\n\\n Scanner in = new Scanner(System.in) ;\\n PrintWriter pw = new PrintWriter(System.out); \\n int k=in.nextInt(), n=in.nextInt(), s=in.nextInt(), p=in.nextInt() ;\\n int paper =n\\/s; \\n if(n%s!=0) paper++ ; \\n paper*=k ; \\n int fin = paper\\/p ; \\n if(paper%p!=0) fin++ ; \\n System.out.println( fin );\\n \\n \\n } \\n}\\n\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.text.DecimalFormat;\\nimport java.io.*;\\nimport java.util.*;\\nimport java.lang.reflect.Array;\\n\\n\\/**\\n * @author Mukesh Singh\\n *\\n *\\/\\n\\n\\npublic class AB {\\n\\n private InputStream input;\\n private PrintStream output;\\n private Scanner inputSc;\\n\\n public AB(InputStream input, PrintStream output) {\\n this.input = input;\\n this.output = output;\\n init();\\n }\\n\\n private void init() {\\n inputSc = new Scanner(input);\\n }\\n\\n static int lineToInt(String line) {\\n return Integer.parseInt(line);\\n }\\n\\n static long lineToLong(String line) {\\n return Long.parseLong(line);\\n }\\n static double lineToDouble(String line) {\\n return Double.parseDouble(line);\\n }\\n\\n\\n public void solve() \\n\\t{\\n solveTestCase();\\n }\\n\\n\\/**\\n * @define global \\/ instance variables \\n *\\/\\n\\n\\tHashMap mat ;\\n\\tlong dist[] ;\\n\\tint vec[] ;\\n\\tint ar[] ;\\n\\tSet st ;\\n\\tboolean isDone[] ;\\n\\tfinal long INF = 100000000000000000L ;\\n\\/**\\n * @solve test case \\n *\\/\\n@SuppressWarnings(\\\"unchecked\\\")\\n private void solveTestCase() \\n\\t{\\n\\t\\tint i , j , k , n , m , d , l ,b , p , q , r;\\n\\t\\tlong N , M, K;\\n\\t\\tint x1 , y1 , x2 , y2 ,x;\\n\\t\\tint a1,a2,b1,b2,a ;\\n\\t\\tDecimalFormat df = new DecimalFormat(\\\"#,###,##0.00\\\");\\n String str = inputSc.nextLine();\\n String delims = \\\"[ ]+\\\";\\n\\t\\tString tokens[] = str.split(delims);\\n\\t\\tn = lineToInt(tokens[0]);\\n\\t\\ta = lineToInt(tokens[1]);\\n\\t\\tb = lineToInt(tokens[2]);\\n\\t\\tmat = new HashMap() ;\\n\\t\\tst = new TreeSet();\\n\\t\\tar = new int[n+4] ;\\n\\t\\tvec = new int[n+4] ;\\n\\t\\tstr = inputSc.nextLine();\\n\\t\\ttokens = str.split(delims);\\n\\t\\tfor( i = 1 ; i <= n ; i++ )\\n\\t\\t{\\n\\t\\t\\tar[i] = lineToInt(tokens[i-1]);\\n\\t\\t\\tmat.put(ar[i],i) ;\\n\\t\\t\\tst.add(ar[i]);\\n\\t\\t\\tvec[i] = i ;\\n\\t\\t}\\n\\t\\tvec[n+1] = n+1 ;\\n\\t\\tvec[n+2] = n+2 ;\\n\\t\\tfor( i = 1 ; i <= n ; i++ )\\n\\t\\t{\\n\\t\\t\\tx= ar[i];\\n\\t\\t\\n\\t\\t\\tif(st.contains(a-x))\\n\\t\\t\\t{\\n\\t\\t\\t\\tBing(mat.get(x),mat.get(a-x));\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t\\tBing(n+1 , mat.get(x));\\n\\t\\t\\tif(st.contains(b-x))\\n\\t\\t\\t{\\n\\t\\t\\t\\tBing(mat.get(x),mat.get(b-x));\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t\\tBing(n+2 ,... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class B {\\n\\tstatic BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\tstatic PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\t\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tString[] split = br.readLine().split(\\\" \\\");\\n\\t\\t\\n\\t\\tlong n = Long.parseLong(split[0]);\\n\\t\\tlong k = Long.parseLong(split[1]);\\n\\t\\t\\n\\t\\tlong left = -1;\\n\\t\\tlong right = n + 1;\\n\\t\\t\\n\\t\\twhile(right - left >= 2) {\\n\\t\\t\\tlong mid = (left + right) \\/ 2; \\/\\/ 10\\n\\t\\t\\t\\/\\/ if(mid > n) {\\n\\t\\t\\t\\t\\/\\/ right = mid;\\n\\t\\t\\t\\t\\/\\/ continue;\\n\\t\\t\\t\\/\\/ }\\n\\t\\t\\t\\n\\t\\t\\tlong newN = n - mid; \\/\\/-5\\n\\t\\t\\tlong temp = newN * (newN + 1) \\/ 2; \\/\\/10\\n\\t\\t\\t\\n\\t\\t\\tlong eh = temp - k - mid;\\n\\t\\t\\t\\n\\t\\t\\tif(eh == 0) {\\n\\t\\t\\t\\tpw.println(mid);\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t\\telse if(eh < 0)\\n\\t\\t\\t\\tright = mid;\\n\\t\\t\\telse\\n\\t\\t\\t\\tleft = mid;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpw.close();\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class A {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc =new Scanner (System.in);\\n long a=sc.nextLong(); long b=sc.nextLong();\\n \\n if(b-a <=1)\\n \\tSystem.out.println(\\\"-1\\\");\\n else if(b-a==2 && a%2==1)\\n \\tSystem.out.println(\\\"-1\\\");\\n else\\n {\\n \\tif(a%2==1)\\n \\t\\tSystem.out.println((a+1)+\\\" \\\"+(a+2)+\\\" \\\"+(a+3));\\n \\telse\\n \\t\\tSystem.out.println((a)+\\\" \\\"+(a+1)+\\\" \\\"+(a+2));\\n }\\n sc.close();\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class D {\\n\\n\\tBufferedReader br;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\tboolean eof;\\n\\n\\tdouble f(int dist, double initSp, int a, int maxSp) {\\n\\t\\tdouble distToReachMaxSpeed = 0.5 * (maxSp * maxSp - initSp * initSp)\\n\\t\\t\\t\\t\\/ a;\\n\\n\\t\\tif (dist > distToReachMaxSpeed)\\n\\t\\t\\treturn 1d * (maxSp - initSp) \\/ a + (dist - distToReachMaxSpeed)\\n\\t\\t\\t\\t\\t\\/ maxSp;\\n\\n\\t\\treturn (Math.sqrt(initSp * initSp + 2 * a * dist) - initSp) \\/ a;\\n\\t}\\n\\n\\tvoid solve() throws IOException {\\n\\t\\tint a = nextInt();\\n\\t\\tint maxSp = nextInt();\\n\\t\\tint len = nextInt();\\n\\t\\tint signX = nextInt();\\n\\t\\tint signSp = nextInt();\\n\\n\\t\\tif (maxSp <= signSp) {\\n\\t\\t\\tout.printf(\\\"%.9f\\\\n\\\", f(len, 0, a, maxSp));\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tdouble distToReachSignSp = 0.5 * signSp * signSp \\/ a;\\n\\t\\tif (distToReachSignSp >= signX) {\\n\\t\\t\\tout.printf(\\\"%.9f\\\\n\\\", f(len, 0, a, maxSp));\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tdouble distToReachMaxThenSign = 0.5\\n\\t\\t\\t\\t* (maxSp * maxSp + maxSp * maxSp - signSp * signSp) \\/ a;\\n\\t\\tif (distToReachMaxThenSign <= signX) {\\n\\t\\t\\tdouble t = 1d * (2 * maxSp - signSp) \\/ a\\n\\t\\t\\t\\t\\t+ (signX - distToReachMaxThenSign) \\/ maxSp\\n\\t\\t\\t\\t\\t+ f(len - signX, signSp, a, maxSp);\\n\\t\\t\\tout.printf(\\\"%.9f\\\\n\\\", t);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tdouble xSp = Math.sqrt(a * signX + signSp * signSp * 0.5);\\n\\t\\tdouble xTime = (2 * xSp - signSp) \\/ a;\\n\\t\\tout.printf(\\\"%.9f\\\\n\\\", xTime + f(len - signX, signSp, a, maxSp));\\n\\t}\\n\\n\\tvoid inp() throws IOException {\\n\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tsolve();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tnew D().inp();\\n\\t}\\n\\n\\tString nextToken() {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\teof = true;\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tString nextString() {\\n\\t\\ttry {\\n\\t\\t\\treturn br.readLine();\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\teof = true;\\n\\t\\t\\treturn null;\\n\\t\\t}\\n\\t}\\n\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tlong nextLong() throws IOException... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class A {\\n\\n public static void main(String[] args) {\\n Scanner s = new Scanner(System.in);\\n int n = s.nextInt();\\n \\n System.out.println(n\\/2*3);\\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.awt.*;\\nimport java.math.BigDecimal;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.util.List;\\n\\n\\npublic class Main {\\n\\n\\n public static void main(String[] args) {\\n Scanner scanner = new Scanner(System.in);\\n int n = scanner.nextInt(), m = scanner.nextInt();\\n int[] vertical = new int[n];\\n\\n for (int i = 0; i < n; i++) {\\n vertical[i] = scanner.nextInt();\\n }\\n\\n Arrays.sort(vertical);\\n\\n\\n ArrayList horisontal = new ArrayList<>();\\n int amount = 0;\\n for (int i = 0; i < m; i++) {\\n int x1 = scanner.nextInt(), x2 = scanner.nextInt(), y = scanner.nextInt();\\n if (x1 == 1) {\\n amount++;\\n horisontal.add(x2);\\n }\\n }\\n\\n Collections.sort(horisontal);\\n\\n\\n if (amount == 0) {\\n System.out.println(0);\\n return;\\n }\\n\\n\\n int minVal = amount, horSize = horisontal.size(), verLen = vertical.length;\\n int h = 0, v = 0;\\n\\n for (; v < verLen && h < horSize; ) {\\n\\n while (h < horSize && horisontal.get(h) < vertical[v]){\\n h++;\\n amount--;\\n }\\n minVal = Math.min(minVal, amount + v);\\n\\n while (h < horSize && v < verLen && horisontal.get(h) >= vertical[v]){\\n minVal = Math.min(minVal, amount + v);\\n v++;\\n }\\n\\n }\\n\\n if(horisontal.get(horSize - 1) < 1E9){\\n minVal = Math.min(minVal, v);\\n }\\n\\n\\n\\n System.out.println(minVal);\\n\\n }\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class Main {\\n\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n int n = in.nextInt();\\n if (n % 2 == 0) {\\n System.out.println((n - 4) + \\\" \\\" + (n - (n - 4)));\\n } else {\\n System.out.println((n - 9) + \\\" \\\" + (n - (n - 9)));\\n }\\n }\\n\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.math.*;\\nimport java.util.*;\\nimport java.io.*;\\npublic class Main{\\n static StreamTokenizer in=new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n static BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in));\\n static Scanner sc=new Scanner(System.in);\\n static PrintWriter out=new PrintWriter(System.out);\\n \\/\\/static InputReader sc=new InputReader(System.in);\\n static final int inf=10000000;\\n public static void main(String args[])throws Exception {\\n double n,k;\\n n=sc.nextDouble();\\n k=sc.nextDouble();\\n double ans=0;\\n ans=Math.sqrt(2.25+2*(n+k))-1.5;\\n System.out.printf(\\\"%.0f\\\\n\\\",n-ans);\\n }\\n static void ssort(int arr[]){\\n int len=arr.length;\\n for(int i=0;i= snumChars) {\\n curChar = 0;\\n try {\\n snumChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n if (snumChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n public int nextInt() {\\n int c = read();\\n while (isSpaceChar(c)) {\\n c = read();\\n }\\n int sgn = 1;\\n if (c == '-') {\\n sgn = -1;\\n c = read();\\n }\\n int res = 0;\\n do {\\n res *= 10;\\n res += c - '0';\\n c... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Set;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeSet;\\n\\npublic class A {\\n public static void main(String[] args) throws IOException {\\n new A().run();\\n }\\n\\n BufferedReader br;\\n StringTokenizer st = new StringTokenizer(\\\"\\\");\\n\\n private void run() throws IOException {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n int n = nextInt();\\n Set set = new TreeSet();\\n\\n for (int i = 0; i < n; i++) {\\n set.add(nextInt());\\n }\\n set.remove(set.iterator().next());\\n PrintWriter pw = new PrintWriter(System.out);\\n if (set.isEmpty()) {\\n pw.println(\\\"NO\\\");\\n } else {\\n pw.println(set.iterator().next());\\n }\\n pw.close();\\n }\\n\\n int nextInt() throws IOException {\\n while (!st.hasMoreElements()) {\\n st = new StringTokenizer(br.readLine());\\n }\\n return Integer.parseInt(st.nextToken());\\n }\\n\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\n\\npublic class A {\\n\\tstatic void solve(InputReader in, PrintWriter out) {\\n\\t\\tlong n = in.nextLong();\\n\\t\\tout.print(25);\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\n\\t\\tsolve(in, out);\\n\\n\\t\\tout.close();\\n\\t}\\n\\n\\tstatic class InputReader {\\n\\t\\tpublic BufferedReader reader;\\n\\t\\tpublic StringTokenizer tokenizer;\\n\\n\\t\\tpublic InputReader(InputStream stream) {\\n\\t\\t\\treader = new BufferedReader(new InputStreamReader(stream), 32768);\\n\\t\\t\\ttokenizer = null;\\n\\t\\t}\\n\\n\\t\\tpublic String next() {\\n\\t\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn tokenizer.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextDouble() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t}\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.HashSet;\\nimport java.util.StringTokenizer;\\n\\n\\npublic class GB_A {\\n FastScanner in;\\n PrintWriter out;\\n\\n public static void main(String[] arg) {\\n new GB_A().run();\\n }\\n\\n public void solve() throws IOException {\\n int n = in.nextInt();\\n int r = in.nextInt();\\n int[] a = new int[n];\\n double[] ans = new double[n];\\n a[0] = in.nextInt();\\n ans[0] = r;\\n for (int i = 1; i < n; i++) {\\n a[i] = in.nextInt();\\n double max = r;\\n for (int j = i - 1; j >= 0; j--) {\\n if (Math.abs(a[i] - a[j]) <= 2 * r) {\\n double d = Math.sqrt(4 * r * r - (a[i]- a[j]) * (a[i] - a[j])) + ans[j];\\n max = Math.max(max, d);\\n }\\n\\n }\\n ans[i] = max;\\n }\\n for (int i = 0; i < n; i++) {\\n out.println(ans[i]);\\n }\\n }\\n\\n\\n public void run() {\\n try {\\n in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));\\n out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\n solve();\\n\\n out.close();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n FastScanner(BufferedReader bufferedReader) {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n double nextDouble() {\\n return Double.parseDouble(next());\\n }\\n\\n long nextLong() {\\n return... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.awt.List;\\n\\nimport java.io.BufferedReader;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\nimport java.util.StringTokenizer;\\n\\npublic class T {\\n\\tstatic Scanner in = new Scanner();\\n\\tstatic PrintWriter out = new PrintWriter(System.out);\\n\\tstatic boolean adj[][];\\n\\tstatic int n, m, from;\\n\\tstatic long memo[][];\\n\\tstatic long Num_Cycle;\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\n\\t\\tn = in.nextInt();\\n\\t\\tm = in.nextInt();\\n\\t\\tadj = new boolean[n][n];\\n\\t\\tmemo = new long[n][1 << n];\\n\\t\\tfor (int i = 0; i < m; i++) {\\n\\t\\t\\tint u = in.nextInt() - 1;\\n\\t\\t\\tint v = in.nextInt() - 1;\\n\\t\\t\\tadj[u][v] = adj[v][u] = true;\\n\\t\\t}\\n\\t\\tfor (long arr[] : memo) {\\n\\t\\t\\tArrays.fill(arr, -1);\\n\\t\\t}\\n\\t\\tNum_Cycle = 0L;\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tfrom = i;\\n\\t\\t\\tNum_Cycle += dp(from, (1 << i));\\n\\t\\t}\\n\\t\\tout.println(Num_Cycle \\/ 2);\\n\\n\\t\\tout.flush();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tstatic long dp(int start, int mask) {\\n\\t\\tif (memo[start][mask] != -1) {\\n\\t\\t\\treturn (memo[start][mask]);\\n\\t\\t}\\n\\t\\tlong ans = 0L;\\n\\t\\tif (adj[start][from] && Integer.bitCount(mask) >= 3) {\\/\\/ Cycle has\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\/\\/ atleast 3\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\/\\/ node and 3\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\/\\/ edges\\n\\t\\t\\tans++;\\n\\t\\t}\\n\\t\\tfor (int i = from + 1; i < n; i++) {\\n\\t\\t\\tif (adj[start][i] && ((mask & (1 << i)) == 0)) {\\n\\t\\t\\t\\tans += dp(i, mask | (1 << i));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn memo[start][mask] = ans;\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tScanner() {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\n\\t\\tScanner(String file) throws FileNotFoundException {\\n\\t\\t\\tbr = new BufferedReader(new FileReader(file));\\n\\t\\t}\\n\\n\\t\\tString next() throws IOException {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tint nextInt() throws NumberFormatException, IOException {\\n\\t\\t\\treturn... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.StreamTokenizer;\\n\\npublic class A {\\n private static StreamTokenizer in;\\n private static PrintWriter out;\\n \\n private static int nextInt() throws Exception{\\n in.nextToken();\\n return (int)in.nval;\\n }\\n \\n private static String nextString() throws Exception{\\n in.nextToken();\\n return in.sval;\\n }\\n \\n static{\\n in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n out = new PrintWriter(System.out);\\n }\\n \\n public static void main(String[] args)throws Exception{\\n int n = nextInt();\\n \\n out.println(n*3\\/2);\\n \\n out.flush();\\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\n\\npublic class A\\n{\\n public static void main(String[] args)\\n {\\n new A(new Scanner(System.in));\\n }\\n\\n public A(Scanner in)\\n {\\n TreeSet ts = new TreeSet();\\n ArrayList sr = new ArrayList();\\n\\n String s = in.next();\\n for (int i=0; i res)\\n res = ss.length();\\n }\\n\\n System.out.printf(\\\"%d%n\\\", res);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.util.concurrent.ThreadLocalRandom;\\n\\n@SuppressWarnings(\\\"Duplicates\\\")\\n\\npublic class solveLOL {\\n FastScanner in;\\n PrintWriter out;\\n boolean systemIO = true, multitests = false;\\n int INF = Integer.MAX_VALUE \\/ 2;\\n\\n\\n void solve() {\\n int n = in.nextInt();\\n int arr[] = new int[n];\\n for (int i = 0; i < n; i++) {\\n arr[i] = in.nextInt();\\n }\\n Arrays.sort(arr);\\n boolean used[] = new boolean[n];\\n int k = 0;\\n for (int i = 0; i < n; i++) {\\n if (!used[i]) {\\n used[i] = true;\\n for (int j = i + 1; j < n; j++) {\\n if (!used[j] && arr[j] % arr[i] == 0) {\\n used[j] = true;\\n }\\n }\\n k++;\\n }\\n }\\n System.out.println(k);\\n\\n\\n\\n }\\n\\n class pair implements Comparable {\\n int a;\\n int b;\\n\\n pair(int A, int B) {\\n this.a = A;\\n this.b = B;\\n }\\n\\n public int compareTo(pair o) {\\n return a != o.a ? Double.compare(a, o.a) : b - o.b;\\n }\\n }\\n\\n void shuffleArray(long[] ar) {\\n Random rnd = ThreadLocalRandom.current();\\n for (int i = ar.length - 1; i > 0; i--) {\\n int index = rnd.nextInt(i + 1);\\n long a = ar[index];\\n ar[index] = ar[i];\\n ar[i] = a;\\n }\\n }\\n\\n void printArray(long[] ar) {\\n for (long k : ar) {\\n System.out.print(k + \\\" \\\");\\n }\\n System.out.println();\\n }\\n\\n void reverseArray(long[] ar) {\\n for (int i = 0, j = ar.length - 1; i < j; i++, j--) {\\n long a = ar[i];\\n ar[i] = ar[j];\\n ar[j] = a;\\n }\\n }\\n\\n private void run() throws IOException {\\n if (systemIO) {\\n in = new solveLOL.FastScanner(System.in);\\n out = new PrintWriter(System.out);\\n } else {\\n in = new solveLOL.FastScanner(new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\n\\npublic class C994{\\n\\tstatic double area(double x1,double y1,double x2,double y2,double x3,double y3){\\n\\t\\treturn Math.abs((x1 * (y2 - y3) + \\n x2 * (y3 - y1) + x3 * (y1 - y2)) \\/ 2.0); \\n\\t}\\n\\tpublic static void main(String args[])throws IOException{\\n\\t\\tScanner sc=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\\n\\t\\tPrintWriter pw=new PrintWriter(System.out);\\n\\t\\tint x11=sc.nextInt();\\n\\t\\tint y11=sc.nextInt();\\n\\t\\tint x12=sc.nextInt();\\n\\t\\tint y12=sc.nextInt();\\n\\t\\tint x13=sc.nextInt();\\n\\t\\tint y13=sc.nextInt();\\n\\t\\tint x14=sc.nextInt();\\n\\t\\tint y14=sc.nextInt();\\n\\t\\tdouble x1c=(x11+x12+x13+x14)\\/4.0;\\n\\t\\tdouble y1c=(y11+y12+y13+y14)\\/4.0;\\n\\t\\tint x21=sc.nextInt();\\n\\t\\tint y21=sc.nextInt();\\n\\t\\tint x22=sc.nextInt();\\n\\t\\tint y22=sc.nextInt();\\n\\t\\tint x23=sc.nextInt();\\n\\t\\tint y23=sc.nextInt();\\n\\t\\tint x24=sc.nextInt();\\n\\t\\tint y24=sc.nextInt();\\n\\t\\tdouble x2c=(x21+x22+x23+x24)\\/4.0;\\n\\t\\tdouble y2c=(y21+y22+y23+y24)\\/4.0;\\n\\t\\tdouble a1=area(x11,y11,x12,y12,x13,y13)+area(x11,y11,x13,y13,x14,y14);\\n\\t\\tdouble... Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author gaidash\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n final int SIZE = 256;\\n final int UNDEF = -1;\\n\\n int nPixels = in.nextInt();\\n int groupSize = in.nextInt();\\n int[] a = in.nextIntArray(nPixels);\\n boolean[] exists = new boolean[SIZE];\\n int[] left = new int[SIZE];\\n int[] right = new int[SIZE];\\n int[] ret = new int[nPixels];\\n Arrays.fill(ret, UNDEF);\\n\\n for (int i = 0; i < nPixels; i++) {\\n for (int p = 0; p < SIZE; p++) {\\n if (exists[p] && left[p] <= a[i] && a[i] <= right[p]) {\\n ret[i] = left[p];\\n left[a[i]] = left[p];\\n right[a[i]] = right[p];\\n break;\\n }\\n }\\n if (ret[i] == UNDEF) {\\n int l = Math.max(a[i] - groupSize + 1, 0);\\n int r = l + groupSize - 1;\\n for (int p = a[i] - 1; p >= 0; p--) {\\n if (exists[p]) {\\n if (p >= l) {\\n int d = p -... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.io.BufferedWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.util.ArrayList;\\nimport java.util.List;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Rishabhdeep Singh\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n int[] cnt = new int[10];\\n Arrays.fill(cnt, 0);\\n List a = new ArrayList<>();\\n for (int i = 0; i < n; i++) {\\n a.add(in.readLine());\\n }\\n List b = new ArrayList<>();\\n for (int i = 0; i < n; i++) {\\n String temp = in.readLine();\\n if (a.contains(temp)) {\\n a.remove(temp);\\n } else\\n b.add(temp);\\n }\\n int[] cnta = new int[10];\\n for (int i = 0; i < a.size(); i++) {\\n cnta[a.get(i).length()]++;\\n }\\n int[] cntb = new int[10];\\n Arrays.fill(cnta, 0);\\n Arrays.fill(cntb, 0);\\n for (int i = 0; i < b.size(); i++) {\\n cntb[a.get(i).length()]++;\\n }\\n int ans = 0;\\n for (int i = 0; i < 10; i++) {\\n ans += Math.abs(cnta[i] - cntb[i]);\\n }\\n out.println(ans);\\n }\\n\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\t\\n\\tvoid solve(Scanner in, PrintWriter out) {\\n\\t\\tlong a = in.nextLong();\\n\\t\\tout.println(25);\\n\\t}\\n\\tvoid run() {\\n\\t\\tLocale.setDefault(Locale.US);\\n\\t\\ttry (\\n\\t\\t\\t\\tScanner in = new Scanner(System.in);\\n\\t\\t\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\t) {\\n\\t\\t\\tsolve(in, out);\\n\\t\\t }\\t\\n\\t}\\n\\t\\n\\tpublic static void main(String args[]) {\\n\\t\\tnew Main().run();\\n\\t}\\n\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n static final int primeCount = 452;\\n static final int[] prime = new int[primeCount];\\n\\n static void build_prime() {\\n boolean[] notPrime = new boolean[3200];\\n for (int i = 2; i < 3200; i++) {\\n if (notPrime[i]) continue;\\n for (int j = i * i; j < 3200; j += i) {\\n notPrime[j] = true;\\n }\\n }\\n\\n int count = 0;\\n for (int i = 2; i < 3200; i++) {\\n if (notPrime[i]) continue;\\n\\n prime[count++] = i;\\n }\\n }\\n\\n private static void run(Reader in, PrintWriter out) throws IOException {\\n int n = in.nextInt();\\n int m = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = getReal(in.nextInt());\\n }\\n\\n int[] pre = new int[n];\\n for (int i = 0; i < n; i++) pre[i] = -1;\\n\\n TreeMap exist = new TreeMap<>();\\n for (int i = 0; i < n; i++) {\\n Integer result = exist.get(a[i]);\\n if (result != null) {\\n pre[i] = result;\\n }\\n exist.put(a[i], i);\\n }\\n\\n int[][] left = new int[m + 1][n];\\n for (int i = 0; i <= m; i++) {\\n int start = 0;\\n PriorityQueue inSame = new PriorityQueue<>();\\n for (int j = 0; j < n; j++) {\\n if (pre[j] >= start) {\\n inSame.add(pre[j]);\\n\\n if (inSame.size() > i) {\\n start = inSame.poll() + 1;\\n }\\n }\\n left[i][j] = start;\\n }\\n }\\n\\n int[][] dp = new int[n][m + 1];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j <= m; j++) {\\n if (j == 0) dp[i][0] = Integer.MAX_VALUE;\\n else dp[i][j] = dp[i][j - 1];\\n\\n for (int k = 0; k <= j; k++) {\\n if (left[k][i] == 0) {\\n dp[i][j] = 1;\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.util.Scanner;\\nimport java.util.regex.Matcher;\\nimport java.util.regex.Pattern;\\n\\npublic class Round1B {\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tnew Round1B().run();\\n\\t}\\n\\n\\tprivate void run() throws Exception {\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint tc = Integer.parseInt(br.readLine().trim());\\n\\t\\twhile (tc > 0) {\\n\\t\\t\\tString s = br.readLine().trim();\\n\\t\\t\\tif (s.matches(\\\"R[0-9]+C[0-9]+\\\")) {\\n\\t\\t\\t\\tPattern p = Pattern.compile(\\\"R([0-9]+)C([0-9]+)\\\");\\n\\t\\t\\t\\tMatcher m = p.matcher(s);\\n\\t\\t\\t\\tif (m.matches()) {\\n\\t\\t\\t\\t\\tint rows = Integer.parseInt(m.group(1));\\n\\t\\t\\t\\t\\tint cols = Integer.parseInt(m.group(2));\\n\\t\\t\\t\\t\\tString col = \\\"\\\";\\n\\t\\t\\t\\t\\twhile (cols > 0) {\\n\\t\\t\\t\\t\\t\\tint mod = (cols - 1) % 26;\\n\\t\\t\\t\\t\\t\\tcol = (char)('A' + mod) + col;\\n\\t\\t\\t\\t\\t\\tcols = (cols - 1) \\/ 26;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tSystem.out.println(col + rows);\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tthrow new Exception();\\n\\t\\t\\t\\t}\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tPattern p = Pattern.compile(\\\"([A-Z]+)([0-9]+)\\\");\\n\\t\\t\\t\\tMatcher m = p.matcher(s);\\n\\t\\t\\t\\tif (m.matches()) {\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\tint rows = Integer.parseInt(m.group(2));\\n\\t\\t\\t\\t\\tint cols = 0;\\n\\t\\t\\t\\t\\tint mul = 1;\\n\\t\\t\\t\\t\\tfor (int i = m.group(1).length() - 1; i >= 0; i--) {\\n\\t\\t\\t\\t\\t\\tcols += mul * (m.group(1).charAt(i) - 'A' + 1);\\n\\t\\t\\t\\t\\t\\tmul *= 26;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tSystem.out.printf(\\\"R%dC%d\\\\n\\\", rows, cols);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tthrow new Exception();\\n\\t\\t\\t\\t}\\n\\t\\t\\t} \\n\\t\\t\\ttc--;\\n\\t\\t}\\n\\t\\tbr.close();\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\/*\\n * Heart beats fast\\n * \\t\\tColors and promises\\n * \\t\\t\\tHow to be brave\\n * \\t\\t\\t\\tHow can I love when I am afraid...\\n *\\/\\npublic class Main\\n{\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tlong x=nl(),k=nl();\\n\\t\\tif(x==0)\\n\\t\\t{\\n\\t\\t\\tpr(0);\\n\\t\\t\\texit();\\n\\t\\t}\\n\\t\\tx%=mod;\\n\\t\\tpr((((x*powm(2,k+1,mod))%mod-powm(2,k,mod)+1)%mod+mod)%mod);\\n\\t\\tSystem.out.print(output);\\n\\t}\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\/\\/\\/template from here\\n\\tstatic class pair\\n\\t{\\n\\t\\tlong a, b;\\n\\t\\tpair(){}\\n\\t\\tpair(long c,long d){a=c;b=d;}\\n\\t}\\n\\tstatic interface combiner\\n\\t{\\n\\t\\tpublic long combine(long a, long b);\\n\\t}\\n\\tstatic final int mod=1000000007;\\n\\tstatic final double eps=1e-9;\\n\\tstatic final long inf=100000000000000000L;\\n\\tstatic Reader in=new Reader();\\n\\tstatic StringBuilder output=new StringBuilder();\\n\\tstatic Random rn=new Random();\\n\\tstatic void reverse(int[]a){for(int i=0; i()\\n\\t\\t{\\n\\t\\t\\tpublic int compare(int[]a,int[]b)\\n\\t\\t\\t{\\n\\t\\t\\t\\tif(a[0]>b[0])\\n\\t\\t\\t\\t\\treturn -1;\\n\\t\\t\\t\\tif(b[0]>a[0])\\n\\t\\t\\t\\t\\treturn 1;\\n\\t\\t\\t\\treturn 0;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t}\\n\\tstatic void sort(pair[]a)\\n\\t{\\n\\t\\tArrays.sort(a,new Comparator()\\n\\t\\t\\t\\t{\\n\\t\\t\\t@Override\\n\\t\\t\\tpublic int compare(pair a,pair b)\\n\\t\\t\\t{\\n\\t\\t\\t\\tif(a.a>b.a)\\n\\t\\t\\t\\t\\treturn 1;\\n\\t\\t\\t\\tif(b.a>a.a)\\n\\t\\t\\t\\treturn -1;\\n\\t\\t\\t\\treturn... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Egor Kulikov (egor@egork.net)\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskB solver = new TaskB();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskB {\\n int stage;\\n int n;\\n OutputWriter out;\\n InputReader in;\\n\\n void query(int end) {\\n switch (stage) {\\n case 0:\\n out.printLine('?', 1, 1, end, n);\\n break;\\n case 1:\\n out.printLine('?', 1, 1, n, end);\\n break;\\n case 2:\\n out.printLine('?', n + 1 - end, 1, n, n);\\n break;\\n case 3:\\n out.printLine('?', 1, n + 1 - end, n, n);\\n break;\\n }\\n out.flush();\\n }\\n\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n this.out = out = new OutputWriter(System.out);\\n this.in = in = new InputReader(System.in);\\n n = in.readInt();\\n int[] endx = new int[2];\\n int[] endy = new int[2];\\n int[] stx = new int[2];\\n int[] sty = new int[2];\\n find(endx);\\n stage++;\\n find(endy);\\n stage++;\\n find(stx);\\n for (int i = 0; i < 2; i++) {\\n stx[i] = n + 1 - stx[i];\\n }\\n stage++;\\n find(sty);\\n... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\n\\n\\/**\\n *\\n * @Har_Har_Mahadev\\n *\\/\\n\\npublic class D {\\n\\n\\tprivate static long INF = 2000000000000000000L, M = 1000000007, MM = 998244353;\\n\\tprivate static int N = 0;\\n\\tprivate static long[][][] dp;\\n\\tprivate static long[][] ff;\\n\\tprivate static long[][] ss;\\n\\n\\tpublic static void process() throws IOException {\\n\\n\\t\\tint n = sc.nextInt(),m = sc.nextInt(),k = sc.nextInt();\\n\\t\\t\\n\\t\\tff = new long[n][m];\\n\\t\\tss = new long[n][m];\\n\\t\\tfor(int i = 0; i=0) {\\n\\t\\t\\tans = min(ans,ss[i-1][j] + solve(i-1, j, k-1, n, m));\\n\\t\\t}\\n\\t\\tif(j+1=0) {\\n\\t\\t\\tans = min(ans,ff[i][j-1] + solve(i, j-1, k-1, n, m));\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn dp[i][j][k] = ans;\\n\\t}\\n\\n\\t\\/\\/=============================================================================\\n\\t\\/\\/--------------------------The End---------------------------------\\n\\t\\/\\/=============================================================================\\n\\n\\tstatic FastScanner sc;\\n\\tstatic PrintWriter out;\\n\\n\\tpublic... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\npublic class TestClass\\n{\\n public static void main(String args[])\\n {\\n \\tScanner in = new Scanner(System.in);\\n \\tint n = in.nextInt();\\n \\tint m = in.nextInt();\\n \\tint k = in.nextInt();\\n \\tint arr[] = new int[n+1];\\n \\tfor(int i =0;ii-m&&j>=1;j--)\\n {\\n long val = sum[i]-sum[j-1]+dp[j-1]-k;\\n dp[i]= Math.max(dp[i],val);\\n }\\t\\n }\\n long max =0;\\n for(int i =1;i<=n;i++)\\n max=Math.max(max,dp[i]);\\n \\n System.out.println(max);\\n \\n }\\t\\n} Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class Fishes {\\n\\n public static void main(String[] args) {\\n Scanner s = new Scanner(System.in);\\n int n = s.nextInt();\\n double[][] p = new double[n][n];\\n double[] dp = new double[1 << 18];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) {\\n p[i][j] = Double.parseDouble(s.next());\\n }\\n }\\n int last = 1 << n;\\n dp[last - 1] = 1.0;\\n for (int i = last - 2; i > 0; i--) {\\n int res = 0;\\n for (int j = 0; j < n; j++) {\\n if (((1 << j) & i) > 0) res++;\\n }\\n res++;\\n res = res * (res - 1) \\/ 2;\\n for (int j = 0; j < n; j++) {\\n if (((1 << j) & i) == 0) {\\n for (int z = 0; z < n; z++) {\\n if (((1 << z) & i) > 0) {\\n dp[i] += dp[i | (1 << j)] * 1.0 \\/ res * p[z][j];\\n }\\n }\\n }\\n }\\n }\\n for (int i = 0; i < n; i++) {\\n System.out.print(dp[1 << i] + \\\" \\\");\\n }\\n }\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.Arrays;\\nimport java.util.Random;\\n\\npublic class ProblemC {\\n \\n public static void main(String[] args) throws IOException {\\n init();\\n new ProblemC().run();\\n out.flush();\\n out.close();\\n }\\n \\n static void init() throws IOException {\\n in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n out = new PrintWriter(new OutputStreamWriter(System.out));\\n in.ordinaryChars(0, 65535);\\n in.wordChars(0, 65535);\\n in.whitespaceChars(' ', ' ');\\n in.whitespaceChars('\\\\n', '\\\\n');\\n in.whitespaceChars('\\\\r', '\\\\r');\\n }\\n \\n \\/\\/ класс для пар\\n class Pair {\\n private final L X;\\n private final R Y;\\n \\n public Pair(L X, R Y) {\\n this.X = X;\\n this.Y = Y;\\n }\\n \\n public L getX() {\\n return X;\\n }\\n \\n public R getY() {\\n return Y;\\n }\\n \\n @Override\\n public int hashCode() {\\n return X.hashCode() ^ Y.hashCode();\\n }\\n \\n @Override\\n public boolean equals(Object o) {\\n if (!(o instanceof Pair)) return false;\\n Pair pairo = (Pair) o;\\n return X.equals(pairo.getX()) && Y.equals(pairo.getY());\\n }\\n }\\n \\n static final long INFL = 200000000000000000L;\\n static final int INF = 2000000000;\\n static final boolean DEBUG = true;\\n \\n static StreamTokenizer in;\\n static PrintWriter out;\\n \\n static void print(String s) {\\n print(s, 0);\\n }\\n \\n static void print(String s, int debug) {\\n if (debug == 0 || DEBUG) {\\n out.print(s);\\n }\\n }\\n \\n static void println(String s) {\\n println(s, 0);\\n }\\n \\n static void println(String s, int debug) {\\n if (debug == 0 || DEBUG) {\\n out.println(s);\\n }\\n }\\n \\n static void printArray(int[] arr) {\\n println(Arrays.toString(arr));\\n }\\n \\n static void printArray(char[] arr) {\\n println(Arrays.toString(arr));\\n }\\n \\n static void printArray(String[] arr) {\\n println(Arrays.toString(arr));\\n }\\n \\n static void sort(int[] a) {\\n Random rnd = new Random();\\n for (int i = a.length - 1; i > 0; i--) {\\n int index... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class Main {\\n static StringTokenizer st;\\n static PrintWriter out = new PrintWriter(System.out,true);\\n static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n\\n public static int nextInt() throws Exception {\\n if(st == null || !st.hasMoreTokens()) st = new StringTokenizer(in.readLine());\\n return Integer.parseInt(st.nextToken());\\n }\\n\\n public static long nextLong() throws Exception {\\n if(st == null || !st.hasMoreTokens()) st = new StringTokenizer(in.readLine());\\n return Long.parseLong(st.nextToken());\\n }\\n\\n public static void main(String[] args) throws Exception {\\n HashSet set = new HashSet<>();\\n int n = nextInt();\\n int k = nextInt();\\n int[] m = new int[n];\\n int[] d = new int[n];\\n for(int i = 0;i < n;i++) m[i] = nextInt();\\n int l = -1;\\n int r = -1;\\n for(int i = 0;i < n;i++) {\\n set.add(m[i]);\\n d[i] = set.size();\\n if(d[i] == k) {\\n r = i;\\n break;\\n }\\n }\\n if(r == -1) {\\n out.println(\\\"-1 -1\\\");\\n return;\\n }\\n\\n for(int i = r;i >= 0;i--) {\\n set.remove(m[i]);\\n if(set.size() == 0) {\\n l = i;\\n break;\\n }\\n }\\n out.println((l+1)+\\\" \\\"+(r+1));\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\nimport java.io.FileInputStream;\\nimport java.io.FileOutputStream;\\nimport java.io.IOException;\\nimport java.util.Scanner;\\n\\npublic class FireAgain \\n{\\n\\n\\tpublic static void main(String[] args) throws IOException \\n\\t{\\n\\n\\t FileInputStream in = null;\\n\\t FileOutputStream out = null;\\n\\t\\n\\t try \\n\\t {\\n\\t in = new FileInputStream(\\\"input.txt\\\");\\n\\t out = new FileOutputStream(\\\"output.txt\\\");\\n\\t \\n\\t\\t \\t\\tScanner sc = new Scanner(in);\\n\\n\\t \\n\\t\\tint h = sc.nextInt();\\n\\t\\tint w = sc.nextInt();\\n\\t\\t\\n\\t\\tint k = sc.nextInt();\\n\\t\\t\\n\\t\\tint[] xk = new int[k];\\n\\t\\tint[] yk = new int[k];\\n\\t\\t\\n\\t\\tfor(int i = 0; i < k; i++)\\n\\t\\t{\\n\\t\\t\\tint y = sc.nextInt()-1;\\n\\t\\t\\tint x = sc.nextInt()-1;\\n\\t\\t\\t\\n\\t\\t\\txk[i] = x;\\n\\t\\t\\tyk[i] = y;\\n\\t\\t}\\n\\n\\t\\tint best = -1;\\n\\t\\tint bestx = -1;\\n\\t\\tint besty = -1;\\n\\t\\tfor(int x = 0; x < w; x++)\\n\\t\\t{\\n\\t\\t\\tfor(int y = 0; y < h; y++)\\n\\t\\t\\t{\\n\\t\\t\\t\\tint cur = 99999;\\n\\t\\t\\t\\tfor(int f = 0; f < k; f++)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tcur = Math.min(cur, Math.abs(xk[f] - x)+Math.abs(yk[f] - y));\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif(cur > best)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tbest = cur;\\n\\t\\t\\t\\t\\tbestx = x;\\n\\t\\t\\t\\t\\tbesty = y;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\/\\/\\t\\tSystem.out.println((besty+1) + \\\" \\\" + (bestx+1));\\n\\t\\tString s = (besty+1) + \\\" \\\" + (bestx+1);\\n\\n\\t\\tout.write(s.getBytes());\\n\\t\\t\\n\\t }finally \\n\\t {\\n\\t if (in != null) \\n\\t {\\n\\t in.close();\\n\\t }\\n\\t if (out != null) \\n\\t {\\n\\t out.close();\\n\\t }\\n\\t }\\t\\t\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.lang.reflect.Array;\\nimport java.util.Arrays;\\nimport java.util.Comparator;\\nimport java.util.StringTokenizer;\\nimport java.util.function.Function;\\n\\npublic class P1196D2 {\\n\\n static boolean multipleIndependent = true;\\n\\n void run() {\\n int n = in.nextInt();\\n int k = in.nextInt();\\n char[] s = in.next().toCharArray();\\n int[] dp = new int[3];\\n char[] c = {'R', 'G', 'B'};\\n int min = Integer.MAX_VALUE;\\n for (int i = 0; i < k; i++) {\\n dp[0] += s[i] == c[(i + 0) % 3] ? 0 : 1;\\n dp[1] += s[i] == c[(i + 1) % 3] ? 0 : 1;\\n dp[2] += s[i] == c[(i + 2) % 3] ? 0 : 1;\\n }\\n min = Math.min(Math.min(Math.min(dp[0], dp[1]), dp[2]), min);\\n\\/\\/ System.out.println(Arrays.toString(dp));\\n for (int i = k; i < n; i++) {\\n dp[0] += (s[i] == c[(i + 0) % 3] ? 0 : 1) - (s[i - k] == c[(i - k + 0) % 3] ? 0 : 1);\\n dp[1] += (s[i] == c[(i + 1) % 3] ? 0 : 1) - (s[i - k] == c[(i - k + 1) % 3] ? 0 : 1);\\n dp[2] += (s[i] == c[(i + 2) % 3] ? 0 : 1) - (s[i - k] == c[(i - k + 2) % 3] ? 0 : 1);\\n min = Math.min(Math.min(Math.min(dp[0], dp[1]), dp[2]), min);\\n\\/\\/ System.out.println(Arrays.toString(dp));\\n }\\n System.out.println(min);\\n }\\n\\n\\n \\/* -----: Template :----- *\\/\\n static InputReader in = new InputReader(System.in);\\n\\n public static void main(String[] args) {\\n P1196D2 p = new P1196D2();\\n int q = multipleIndependent ? in.nextInt() : 1;\\n while (q-- > 0) {\\n p.run();\\n }\\n }\\n\\n int numLength(long n) {\\n int l = 0;\\n while (n > 0) {\\n n \\/= 10;\\n l++;\\n }\\n return l;\\n }\\n\\n long binarySearch(long lowerBound, long upperBound,\\n R value, Function generatorFunction, Comparator comparator) {\\n if (lowerBound <= upperBound) {\\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.HashMap;\\nimport java.util.StringTokenizer;\\n\\npublic class CF8C {\\n\\tstatic int n;\\n\\tstatic int[] mem;\\n\\tstatic HashMap map;\\n\\tstatic int INF = (int) 1e9;\\n\\tstatic StringBuilder sb;\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tMyScanner sc = new MyScanner(System.in);\\n\\t\\tString s = sc.nextLine();\\n\\t\\tn = sc.nextInt();\\n\\t\\tmem = new int[1 << n];\\n\\t\\tArrays.fill(mem, -1);\\n\\t\\tmap = new HashMap<>();\\n\\t\\tmap.put(0, s);\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tmap.put(i, sc.nextLine());\\n\\t\\t}\\n\\t\\tint val = dp(0);\\n\\t\\tPrintWriter pw = new PrintWriter(System.out);\\n\\t\\tpw.println(val);\\n\\t\\tsb = new StringBuilder();\\n\\t\\tsb.append(\\\"0 \\\");\\n\\t\\tbuild(0);\\n\\t\\tpw.println(sb);\\n\\t\\tpw.flush();\\n\\t}\\n\\n\\t\\/\\/ node == 0 -- > count 0 \\/\\/ state == 0 has 1 \\/\\/ state == 1 has 2\\n\\n\\tprivate static int dp(int msk) {\\n\\t\\tif (msk == (1 << n) - 1)\\n\\t\\t\\treturn 0;\\n\\n\\t\\tif(mem[msk] != -1)\\n\\t\\t\\treturn mem[msk];\\n\\n\\t\\tboolean foundFirst = false;\\n\\t\\tint val = (int)1e9; \\n\\t\\tint mark = -1;\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tif ((msk & 1 << (i - 1)) == 0){\\n\\t\\t\\t\\tif(!foundFirst){\\n\\t\\t\\t\\t\\tfoundFirst = true;\\n\\t\\t\\t\\t\\tmark = i;\\n\\t\\t\\t\\t\\tval = dist(0, mark)*2 + dp(msk | 1 << (mark - 1));\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\tval = Math.min(val, dist(0, mark) + dist(mark, i) + dist(i, 0) + dp((msk|1 << (mark - 1))|1 << (i - 1)));\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn mem[msk] = val;\\n\\t}\\n\\n\\tprivate static int dist(int node, int i) {\\n\\t\\tString from = map.get(i);\\n\\t\\tString to = map.get(node);\\n\\t\\tString[] fromco = from.split(\\\" \\\");\\n\\t\\tString[] toco = to.split(\\\" \\\");\\n\\t\\tint xs = Integer.parseInt(fromco[0]);\\n\\t\\tint ys = Integer.parseInt(fromco[1]);\\n\\t\\tint xf = Integer.parseInt(toco[0]);\\n\\t\\tint yf = Integer.parseInt(toco[1]);\\n\\t\\treturn (xs - xf) * (xs - xf) + (ys - yf) * (ys - yf);\\n\\t}\\n\\n\\tprivate static void build(int msk) {\\n\\t\\tif (msk == (1 << n) - 1) \\n\\t\\t\\treturn;\\n\\t\\tboolean... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.util.Scanner;\\n\\npublic class A {\\n public static void main(String[] args) throws FileNotFoundException {\\n Scanner s = new Scanner(System.in);\\n int T = s.nextInt();\\n System.out.println(\\\"0 0 \\\"+T);\\n \\/*if(T==0) {\\n\\n return;\\n }\\n if(T==1) {\\n System.out.println(\\\"0 0 0\\\");\\n return;\\n }\\n System.out.println();*\\/\\n }\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\npublic class Main{\\n public static void main(String[] args){\\n InputReader reader = new InputReader(System.in);\\n PrintWriter pw = new PrintWriter(System.out);\\n int n = reader.nextInt();\\n int r = reader.nextInt();\\n int[] x = new int[n];\\n double[] y = new double[n];\\n \\n for(int i=0;i= 0)\\n\\t\\t\\t\\t\\t\\tdp[w][i][j] = Math.min(dp[w][i][j], 2 * costDown[i - 1][j] + dp[w - 2][i - 1][j]);\\n\\t\\t\\t\\t\\tif (j + 1 < m)\\n\\t\\t\\t\\t\\t\\tdp[w][i][j] = Math.min(dp[w][i][j], 2 * costRight[i][j] + dp[w - 2][i][j + 1]);\\n\\t\\t\\t\\t\\tif (j - 1 >= 0)\\n\\t\\t\\t\\t\\t\\tdp[w][i][j] = Math.min(dp[w][i][j], 2 * costRight[i][j - 1] + dp[w - 2][i][j - 1]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tfor (int j = 0; j < m; j++) {\\n\\t\\t\\t\\tpw.print(dp[k][i][j] + \\\" \\\");\\n\\t\\t\\t}\\n\\t\\t\\tpw.println();\\n\\t\\t}\\n\\t\\tpw.close();\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic Scanner(InputStream s) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(s));\\n\\t\\t}\\n\\n\\t\\tpublic Scanner(FileReader f) {\\n\\t\\t\\tbr = new BufferedReader(f);\\n\\t\\t}\\n\\n\\t\\tpublic String next() throws IOException {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() throws IOException... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.util.List;\\n\\npublic class Main {\\n private static StringTokenizer st;\\n private static BufferedReader br;\\n public static long MOD = 1000000007;\\n public static long tenFive = 100000;\\n public static int INF = 100000;\\n\\n public static void print(Object x) {\\n System.out.println(x + \\\"\\\");\\n }\\n public static void printArr(long[] x) {\\n StringBuilder s = new StringBuilder();\\n for (int i = 0; i < x.length; i++) {\\n s.append(x[i] + \\\" \\\");\\n }\\n print(s);\\n }\\n public static void printArr(int[] x) {\\n StringBuilder s = new StringBuilder();\\n for (int i = 0; i < x.length; i++) {\\n s.append(x[i] + \\\" \\\");\\n }\\n print(s);\\n }\\n public static String join(Collection x, String space) {\\n if (x.size() == 0) return \\\"\\\";\\n StringBuilder sb = new StringBuilder();\\n boolean first = true;\\n for (Object elt : x) {\\n if (first) first = false;\\n else sb.append(space);\\n sb.append(elt);\\n }\\n return sb.toString();\\n }\\n\\n public static String nextToken() throws IOException {\\n while (st == null || !st.hasMoreTokens()) {\\n String line = br.readLine();\\n st = new StringTokenizer(line.trim());\\n }\\n return st.nextToken();\\n }\\n public static int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n public static long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n public static List nextInts(int N) throws IOException {\\n List ret = new ArrayList();\\n for (int i = 0; i < N; i++) {\\n ret.add(nextInt());\\n }\\n return ret;\\n }\\n\\n public static void solve(int a, int b, List orig) {\\n boolean swap = false;\\n if (a > b) {\\n swap = true;\\n int tmp = a;\\n a = b;\\n b = tmp;\\n }\\n\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\n\\npublic class Main {\\n\\n static StringBuilder data = new StringBuilder();\\n final static FastReader in = new FastReader();\\n\\n\\n public static void main(String[] args) {\\n int n = in.nextInt();\\n int a[] = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = in.nextInt();\\n }\\n Arrays.sort(a);\\n int answ = 0;\\n for (int i = 0; i < n; i++) {\\n if (a[i] != 0) {\\n for (int j = i + 1; j < n; j++) {\\n if (a[j] % a[i] == 0) {\\n a[j] = 0;\\n }\\n }\\n answ++;\\n a[i]=0;\\n }\\n }\\n System.out.println(answ);\\n }\\n\\n\\n static void fileOut(String s) {\\n File out = new File(\\\"output.txt\\\");\\n try {\\n FileWriter fw = new FileWriter(out);\\n fw.write(s);\\n fw.flush();\\n fw.close();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n\\n }\\n\\n static class FastReader {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastReader() {\\n br = new BufferedReader(new\\n InputStreamReader(System.in));\\n }\\n\\n public FastReader(String path) {\\n try {\\n br = new BufferedReader(new\\n InputStreamReader(new FileInputStream(path)));\\n } catch (FileNotFoundException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n String next() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n long nextLong() {\\n return Long.parseLong(next());\\n }\\n\\n ... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\n\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner r = new Scanner(System.in);\\n \\n String a = r.next();\\n char[] c = a.toCharArray();\\n \\n for(int l = a.length()-1; l >= 1; l--){\\n for(int i = 0; i <= a.length()-l; i++){\\n int j = i+l-1;\\n \\n for(int s = 0; s <= a.length()-l; s++){\\n if(i == s)continue;\\n if(a.substring(i, i+l).equals(a.subSequence(s, s+l))){\\n System.out.println(l);\\n System.exit(0);\\n }\\n \\n }\\n }\\n }\\n \\n System.out.println(0);\\n \\n }\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.util.Random;\\nimport java.util.Scanner;\\n\\npublic class Main {\\n public static void main(String[] args)\\n {\\n Scanner stdin = new Scanner(System.in);\\n \\/*int n = stdin.nextInt();\\n for(int i = 0; i < n; i++)\\n {\\n \\ttest(stdin);\\n }*\\/\\n test(stdin);\\n stdin.close();\\n }\\n public static void test(Scanner stdin)\\n {\\n \\tint n = stdin.nextInt();\\n \\tint min = Integer.MAX_VALUE;\\n \\tfor(int i = 0; i < n; i++)\\n \\t{\\n \\t\\tint a = stdin.nextInt();\\n \\t\\tif((int)((1.0)*a\\/(Math.max(i, n - i - 1))) < min)\\n \\t\\t{ min = (int)((1.0)*a\\/(Math.max(i, n - i - 1))); }\\n \\t}\\n \\tSystem.out.println(min);\\n }\\n} Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport sun.reflect.generics.tree.Tree;\\n\\nimport java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\n\\n\\npublic class Main {\\n\\n\\n\\n public static void main(String[] args) throws Exception{\\n IO io = new IO(null,null);\\n int n = io.getNextInt(),ans = 0;\\n int [] A = new int[n];\\n for (int i = 0;i < n;i++) {\\n A[i] = io.getNextInt();\\n for (int j = 0;j < i;j++)\\n ans ^= (A[j] > A[i]) ? 1 : 0;\\n }\\n String [] word = {\\\"even\\\",\\\"odd\\\"};\\n int m = io.getNextInt();\\n for (int i = 0;i < m;i++) {\\n int l = io.getNextInt(),r = io.getNextInt();\\n int len = r - l + 1;\\n long tot = len*(len - 1L)\\/2;\\n ans ^= tot & 1;\\n io.println(word[ans]);\\n }\\n io.close();\\n }\\n}\\n\\n\\n\\nclass IO{\\n private BufferedReader br;\\n private StringTokenizer st;\\n private PrintWriter writer;\\n private String inputFile,outputFile;\\n\\n public boolean hasMore() throws IOException{\\n if(st != null && st.hasMoreTokens()) return true;\\n if(br != null && br.ready()) return true;\\n return false;\\n }\\n public String getNext() throws FileNotFoundException, IOException{\\n while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());\\n return st.nextToken();\\n }\\n\\n public String getNextLine() throws FileNotFoundException, IOException{\\n return br.readLine().trim();\\n }\\n\\n public int getNextInt() throws FileNotFoundException, IOException{\\n return Integer.parseInt(getNext());\\n }\\n public long getNextLong() throws FileNotFoundException, IOException{\\n return Long.parseLong(getNext());\\n }\\n\\n public void print(double x,int num_digits) throws IOException{\\n writer.printf(\\\"%.\\\" + num_digits + \\\"f\\\" ,x);\\n }\\n public void println(double x,int num_digits) throws IOException{\\n writer.printf(\\\"%.\\\" + num_digits + \\\"f\\\\n\\\" ,x);\\n }\\n public void print(Object o) throws IOException{\\n writer.print(o.toString());\\n ... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n import java.io.*;\\n import java.lang.*;\\n import java.math.*;\\n public class B {\\n public static void main(String[] args) throws Exception {\\n BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));\\n int n = Integer.parseInt(bf.readLine());\\n StringTokenizer st = new StringTokenizer(bf.readLine());\\n Integer[] a = new Integer[n]; for(int i=0; i vals = new HashSet();\\n vals.add(b[0]);\\n int valval = 0;\\n for(int i=1; i 0)) {\\n if(sum%2 == 0) out.println(\\\"cslnb\\\"); else out.println(\\\"sjfnb\\\");\\n }\\n else out.println(\\\"cslnb\\\");\\n }\\n else if(diff2) out.println(\\\"cslnb\\\");\\n else if(sum%2 == 0) out.println(\\\"cslnb\\\"); else out.println(\\\"sjfnb\\\");\\n \\/\\/ int n = Integer.parseInt(st.nextToken());\\n \\n \\n out.close(); System.exit(0);\\n }\\n } What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class ehab4 {\\n public static void main( String[] args ) {\\n Scanner in = new Scanner( System.in );\\n\\tint a = 0, b = 0;\\n\\tSystem.out.println( \\\"? 0 0 \\\" );\\n\\tSystem.out.flush();\\n\\tint c = in.nextInt();\\n\\tfor ( int i = 29; i >= 0; i-- ) {\\n\\t System.out.println( \\\"? \\\" + ( a + ( 1 << i ) ) + \\\" \\\" + b );\\n\\t System.out.flush();\\n\\t int q1 = in.nextInt();\\n\\t System.out.println( \\\"? \\\" + a + \\\" \\\" + ( b + ( 1 << i ) ) );\\n\\t System.out.flush();\\n\\t int q2 = in.nextInt();\\n\\t if ( q1 == q2 ) {\\n\\t\\tif ( c == 1 )\\n\\t\\t a += ( 1 << i );\\n\\t\\telse if ( c == -1 )\\n\\t\\t b += ( 1 << i );\\n\\t\\tc = q1;\\n\\t }\\n\\t else if ( q1 == -1 ) {\\n\\t\\ta += ( 1 << i );\\n\\t\\tb += ( 1 << i );\\n\\t }\\n\\t else if ( q1 == -2 )\\n\\t\\treturn;\\n\\t}\\n\\tSystem.out.println( \\\"! \\\" + a + \\\" \\\" + b );\\n\\tSystem.out.flush();\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Mainn {\\n\\n\\tpublic static class InputReader {\\n\\t\\tpublic BufferedReader reader;\\n\\t\\tpublic StringTokenizer tokenizer;\\n\\n\\t\\tpublic InputReader() {\\n\\t\\t\\treader = new BufferedReader(new InputStreamReader(System.in), 32768);\\n\\t\\t\\ttokenizer = null;\\n\\t\\t}\\n\\n\\t\\tpublic InputReader(InputStream stream) {\\n\\t\\t\\treader = new BufferedReader(new InputStreamReader(System.in), 32768);\\n\\t\\t\\ttokenizer = null;\\n\\t\\t}\\n\\n\\t\\tpublic String next() {\\n\\t\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn tokenizer.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic char nextChar() {\\n\\t\\t\\treturn next().charAt(0);\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic double nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tpublic int[] nextIntArr(int n) {\\n\\t\\t\\tint[] arr = new int[n];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tarr[i] = this.nextInt();\\n\\t\\t\\t}\\n\\t\\t\\treturn arr;\\n\\t\\t}\\n\\n\\t\\tpublic Integer[] nextIntegerArr(int n) {\\n\\t\\t\\tInteger[] arr = new Integer[n];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tarr[i] = new Integer(this.nextInt());\\n\\t\\t\\t}\\n\\t\\t\\treturn arr;\\n\\t\\t}\\n\\n\\t\\tpublic int[][] next2DIntArr(int n, int m) {\\n\\t\\t\\tint[][] arr = new int[n][m];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tfor (int j = 0; j < m; j++) {\\n\\t\\t\\t\\t\\tarr[i][j] = this.nextInt();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn arr;\\n\\t\\t}\\n\\n\\t\\tpublic int[] nextSortedIntArr(int n) {\\n\\t\\t\\tint[] arr = new int[n];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tarr[i] = this.nextInt();\\n\\t\\t\\t}\\n\\t\\t\\tArrays.sort(arr);\\n\\t\\t\\treturn arr;\\n\\t\\t}\\n\\n\\t\\tpublic long[] nextLongArr(int n) {\\n\\t\\t\\tlong[] arr = new long[n];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tarr[i] = this.nextLong();\\n\\t\\t\\t}\\n\\t\\t\\treturn arr;\\n\\t\\t}\\n\\n\\t\\tpublic char[] nextCharArr(int n) {\\n\\t\\t\\tchar[] arr = new char[n];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tarr[i] = this.nextChar();\\n\\t\\t\\t}\\n\\t\\t\\treturn arr;\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static InputReader scn = new... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author ankur\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n long mod = (long) 1e9 + 7;\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n char ar[] = new char[n];\\n for (int i = 0; i < n; i++) {\\n ar[i] = in.readString().charAt(0);\\n }\\n long dp[][] = new long[n + 1][n + 1];\\n for (int i = 0; i < n; i++) {\\n dp[n - 1][i] = 1;\\n }\\n long prev = n;\\n for (int i = n - 2; i >= 0; i--) {\\n if (ar[i] == 'f') {\\n if (ar[i + 1] == 's') {\\n for (int j = n - 2; j >= 0; j--) {\\n dp[i][j] = dp[i + 1][j + 1];\\n }\\n } else {\\n for (int j = n - 2; j >= 0; j--) {\\n dp[i][j] = dp[i + 1][j + 1];\\n }\\n\\n }\\n } else {\\n for (int j = n - 1; j >= 0; j--) {\\n if (prev < 0) {\\n prev += mod;\\n }\\n dp[i][j] = prev;\\n prev = prev - dp[i + 1][j];\\n }\\n }\\n prev = 0;\\n for (int j = 0; j < n; j++) {\\n prev +=... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class MainA {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n \\n int count = 0;\\n \\n count = n\\/2;\\n \\n count = count + (n - n\\/2);\\n \\n n = n - n\\/2;\\n \\n count = count + n; \\n\\n \\n System.out.println(count);\\n \\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class Main {\\n\\n public static void main(String args[]) {\\n Scanner scan = new Scanner(System.in);\\n int n=scan.nextInt();\\n int m=scan.nextInt();\\n int[] game=new int[n];\\n int[] bill=new int[m];\\n for (int i = 0; i =game[k]){\\n ans++;\\n i++;\\n j=k+1;\\n f=false;\\n break;\\n }\\n }\\n if (f){\\n break;\\n }\\n }\\n System.out.println(ans);\\n }\\n}\\n\\n\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collections;\\nimport java.util.StringTokenizer;\\n\\npublic class E {\\n\\n\\tstatic long mod;\\n\\tstatic long[][] dp;\\n\\tstatic int n;\\n\\tstatic long[] nWaysToPlaceGroupOfSize;\\n\\t\\n\\tpublic static void main(String[] args) {\\n\\t\\tFastScanner fs=new FastScanner();\\n\\t\\tn=fs.nextInt();\\n\\t\\tmod=fs.nextInt();\\n\\t\\tprecomp();\\n\\t\\tdp=new long[n+1][n+1];\\n\\t\\tfor (int i=0; i1) waysToPlaceMe=mul(waysToPlaceMe, nWaysToPlaceGroupOfSize[nPlace]);\\n\\t\\t\\tways=add(ways, mul(waysToPlaceMe, futureWays));\\n\\t\\t}\\n\\t\\treturn dp[position][nXsLeft]=ways;\\n\\t}\\n\\t\\n\\tstatic long nCk(int n, int k) {\\n\\t\\tif (k>n) throw null;\\n\\t\\treturn mul(facts[n], mul(factInvs[k], factInvs[n-k]));\\n\\t}\\n\\t\\n\\tstatic long add(long a, long b) {\\n\\t\\treturn (a+b)%mod;\\n\\t}\\n\\tstatic long sub(long a, long b) {\\n\\t\\treturn ((a-b)%mod+mod)%mod;\\n\\t}\\n\\tstatic long mul(long a, long b) {\\n\\t\\treturn (a*b)%mod;\\n\\t}\\n\\tstatic long fastPow(long base, long e) {\\n\\t\\tif (e==0) return 1;\\n\\t\\tlong half=fastPow(base, e\\/2);\\n\\t\\tif (e%2==0) return mul(half, half);\\n\\t\\treturn mul(half, mul(half, base));\\n\\t}\\n\\t\\n\\tstatic long[] facts=new long[1_000_00];\\n\\tstatic long[] factInvs=new long[1_000_00];\\n\\tstatic void precomp() {\\n\\t\\tfacts[0]=1;\\n\\t\\tfor (int 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\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\nimport java.util.Vector;\\n\\npublic class Main {\\n\\n public static void main(String[] args) {\\n\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n int m = sc.nextInt();\\n int a[] = new int[n];\\n int b[] = new int[n];\\n for (int i = 0; i < n; i++) a[i] = sc.nextInt();\\n for (int i = 0; i < n; i++) b[i] = sc.nextInt();\\n int c[] = new int[2 * n];\\n c[0] = a[0];\\n for (int i = 1; i < n; i++) {\\n c[i * 2] = a[i];\\n c[i * 2 - 1] = b[i];\\n if (a[i] == 1 || b[i] == 1) {\\n System.out.print(-1);\\n System.exit(0);\\n }\\n }\\n c[2 * n - 1] = b[0];\\n if (a[0] == 1 || b[0] == 1) {\\n System.out.print(-1);\\n System.exit(0);\\n }\\n System.out.println(bin_search(c, m));\\n }\\n\\n private static double bin_search(int[] c, int m) {\\n double start = 0;\\n double end = Integer.MAX_VALUE;\\n double mid;\\n while (start + 0.0000001 < end) {\\n mid = (start + end) \\/ 2;\\n if (test(mid, m, c)) end = mid;\\n else start = mid;\\n }\\n return end;\\n }\\n\\n private static boolean test(double fuel, int m, int[] c) {\\n for (int i = 0; i < c.length; i++) {\\n fuel -= (m + fuel) \\/ c[i];\\n if (fuel < 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class Main {\\n static int MOD = 1000000007;\\n\\n \\/\\/ After writing solution, quick scan for:\\n \\/\\/ array out of bounds\\n \\/\\/ special cases e.g. n=1?\\n \\/\\/ npe, particularly in maps\\n \\/\\/\\n \\/\\/ Big numbers arithmetic bugs:\\n \\/\\/ int overflow\\n \\/\\/ sorting, or taking max, after MOD\\n void solve() throws IOException {\\n int[] nT = ril(2);\\n int n = nT[0];\\n int T = nT[1];\\n int[][] tg = new int[n][];\\n for (int i = 0; i < n; i++) tg[i] = ril(2);\\n\\n \\/\\/ dp[t][m][g] is the number of sequences possible to be formed from\\n \\/\\/ songs indicated by mask m, having total time t, and whose last song\\n \\/\\/ is genre g.\\n int[][][] dp = new int[T+1][1 << n][3];\\n for (int ti = 1; ti <= T; ti++) {\\n for (int mask = 1; mask <= (1 << n); mask++) {\\n \\/\\/ Iterate over the possible last song. It's genre will determine\\n \\/\\/ what the third dimension should be\\n for (int j = 0; j < n; j++) {\\n if (((1 << j) & mask) == 0) continue;\\n int time = tg[j][0];\\n int genre = tg[j][1]-1;\\n if (ti - time < 0) continue;\\n long base = dp[ti][mask][genre];\\n long add = 0;\\n if (ti - time == 0) {\\n \\/\\/ Base case: there is always one way regardless of what songs are available.\\n \\/\\/ The empty playlist\\n add = 1;\\n } else {\\n for (int g = 0; g < 3; g++) add += dp[ti-time][mask ^ (1 << j)][g];\\n add -= dp[ti-time][mask ^ (1 << j)][genre];\\n }\\n dp[ti][mask][genre] = (int) ((base + add) % MOD);\\n }\\n }\\n }\\n long ans = 0;\\n for (int g = 0; g < 3; g++) ans += dp[T][(1 << n)-1][g];\\n pw.println(ans % MOD);\\n }\\n \\/\\/... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/~~~~~~~~~~~~~~~~~~~~~~~@@@@@@@@@@@@@@@_____________K_____S_____J__________@@@@@@@@@@@@@@@@@@@@@@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~~~\\n \\/\\/Date:00\\/00\\/17\\n \\/\\/-------------\\n\\n\\nimport java.util.*;\\nimport java.io.*;\\n\\n\\/*\\n\\n [[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]\\n [:::::::::::::: ::::::::::::::]\\n [:::::::::::::: ::::::::::::::]\\n [::::::[[[[[[[: :]]]]]]]::::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ CODE YOUR LIFE ]:::::]\\n [:::::[ Kripa Shankar jha ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [:::::[ ]:::::]\\n [::::::[[[[[[[: :]]]]]]]::::::]\\n [:::::::::::::: ::::::::::::::]\\n [:::::::::::::: ::::::::::::::]\\n [[[[[[[[[[[[[[[ ]]]]]]]]]]]]]]]\\n*\\/\\n\\npublic class prob3{\\n \\n\\n static Parser sc=new Parser(System.in);\\n static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));\\n \\n static int p[]=new int[100005];\\n public static void main(String[] args) throws IOException {\\n \\/\\/ use ((((((( sc ............... for input\\n\\n \\n int n=sc.nextInt();\\n\\n int arr[]=new int[n];\\n\\n for(int i=0;i 0; i--)\\n for (int j = 0; j <= s.length() - i; j++)\\n if (s.substring(0, j + i - 1).contains(s.substring(j, j + i))\\n || s.substring(j + 1).contains(s.substring(j, j + i))) {\\n System.out.println(i);\\n return;\\n }\\n System.out.println(0);\\n }\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class B {\\n\\n\\tstatic int n, t[], g[], MOD = (int) 1e9 + 7;\\n\\tstatic int[][][] memo1, memo2[], memo3[];\\n\\n\\tstatic int dp1(int idx, int remCnt, int remSum) {\\n\\t\\tif (idx == n)\\n\\t\\t\\treturn remSum == 0 && remCnt == 0 ? 1 : 0;\\n\\t\\tif (remCnt < 0 || remSum < 0)\\n\\t\\t\\treturn 0;\\n\\t\\tif (memo1[idx][remCnt][remSum] != -1)\\n\\t\\t\\treturn memo1[idx][remCnt][remSum];\\n\\t\\tint ans = dp1(idx + 1, remCnt, remSum);\\n\\t\\tif (g[idx] == 0) {\\n\\t\\t\\tans += dp1(idx + 1, remCnt - 1, remSum - t[idx]);\\n\\t\\t\\tif (ans >= MOD)\\n\\t\\t\\t\\tans -= MOD;\\n\\t\\t}\\n\\t\\treturn memo1[idx][remCnt][remSum] = ans;\\n\\t}\\n\\n\\tstatic int dp2(int idx, int remCnt1, int remCnt2, int remSum) {\\n\\n\\t\\tif (idx == n)\\n\\t\\t\\treturn remSum == 0 && remCnt1 == 0 && remCnt2 == 0 ? 1 : 0;\\n\\t\\tif (remSum < 0 || remCnt1 < 0 || remCnt2 < 0)\\n\\t\\t\\treturn 0;\\n\\t\\tif (memo2[idx][remCnt1][remCnt2][remSum] != -1)\\n\\t\\t\\treturn memo2[idx][remCnt1][remCnt2][remSum];\\n\\t\\tint ans = dp2(idx + 1, remCnt1, remCnt2, remSum);\\n\\n\\t\\tif (g[idx] == 1)\\n\\t\\t\\tans += dp2(idx + 1, remCnt1 - 1, remCnt2, remSum - t[idx]);\\n\\t\\telse if (g[idx] == 2)\\n\\t\\t\\tans += dp2(idx + 1, remCnt1, remCnt2 - 1, remSum - t[idx]);\\n\\t\\tif(ans>=MOD)\\n\\t\\t\\tans-=MOD;\\n\\t\\treturn memo2[idx][remCnt1][remCnt2][remSum] = ans;\\n\\t}\\n\\n\\tprivate static int dp3(int cnt0, int cnt1, int cnt2, int last) {\\n\\t\\tif (cnt0 < 0 || cnt1 < 0 || cnt2 < 0)\\n\\t\\t\\treturn 0;\\n\\t\\tif (cnt0 + cnt1 + cnt2 == 0)\\n\\t\\t\\treturn 1;\\n\\t\\tif (memo3[last][cnt0][cnt1][cnt2] != -1)\\n\\t\\t\\treturn memo3[last][cnt0][cnt1][cnt2];\\n\\t\\tlong ans = 0;\\n\\t\\tif (last != 0)\\n\\t\\t\\tans += dp3(cnt0 - 1, cnt1, cnt2, 0);\\n\\t\\tif (last != 1)\\n\\t\\t\\tans += dp3(cnt0, cnt1 - 1, cnt2, 1);\\n\\t\\tif (last != 2)\\n\\t\\t\\tans += dp3(cnt0, cnt1, cnt2 - 1, 2);\\n\\t\\treturn memo3[last][cnt0][cnt1][cnt2] = (int) (ans % MOD);\\n\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner sc = new Scanner();\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tn = sc.nextInt();\\n\\t\\tint[] fac = new int[n + 1];\\n\\t\\tt = new int[n];\\n\\t\\tg = new int[n];\\n\\t\\tint[] cnt = new int[3];\\n\\t\\tfac[0] = 1;\\n\\t\\tfor (int i = 1; i <= n; i++)\\n\\t\\t\\tfac[i] = (int) (i * 1L * fac[i - 1] % MOD);\\n\\t\\tint... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.text.*;\\n\\npublic class FollowTrafficRules\\n{\\n\\tpublic Scanner in = new Scanner(System.in);\\n\\tpublic PrintStream out = System.out;\\n\\n\\tpublic double len, d, w, vmax, a;\\n\\t\\n\\tDecimalFormat fmt = new DecimalFormat(\\\"0.0000000000000000\\\");\\n\\t\\n\\tpublic void main()\\n\\t{\\n\\t\\ta = in.nextDouble();\\n\\t\\tvmax = in.nextDouble();\\n\\t\\tlen = in.nextDouble();\\n\\t\\td = in.nextDouble();\\n\\t\\tw = in.nextDouble();\\n\\t\\t\\n\\t\\tout.println(fmt.format(T()));\\n\\t}\\/\\/end public void main()\\n\\t\\n\\tpublic double T()\\n\\t{\\n\\t\\tdouble t, s;\\n\\t\\t\\n\\t\\tdouble t1, s1;\\n\\t\\tt1 = vmax \\/ a;\\n\\t\\ts1 = vmax*vmax\\/(2.0*a);\\n\\t\\t\\n\\t\\tdouble t3, s3;\\n\\t\\tt3 = w\\/a;\\n\\t\\ts3 = w*w\\/(2.0*a);\\n\\t\\t\\t\\t\\n\\t\\tif(w >= vmax)\\n\\t\\t{\\n\\t\\t\\tif(s1 < len)\\n\\t\\t\\t{\\n\\t\\t\\t\\treturn t1 + (len - s1)\\/vmax;\\n\\t\\t\\t}\\n\\t\\t\\telse\\n\\t\\t\\t{\\n\\t\\t\\t\\treturn Math.sqrt(2.0*len\\/a);\\n\\t\\t\\t}\\t\\t\\t\\n\\t\\t}\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\t\\/\\/w < vmax\\n\\t\\t\\t\\n\\t\\t\\tdouble t2, s2, v2;\\n\\t\\t\\tt2 = Math.sqrt(2.0*d\\/a);\\n\\t\\t\\tv2 = a*t2;\\n\\t\\t\\t\\n\\t\\t\\tdouble tx, vx;\\n\\t\\t\\tvx = Math.sqrt((2.0*a*d + w*w)\\/2.0);\\n\\t\\t\\ttx = vx \\/ a;\\t\\n\\t\\t\\t\\n\\t\\t\\t\\/\\/vmax > w\\n\\n\\t\\t\\t\\/\\/v2 > vx > w\\n\\t\\t\\t\\n\\t\\t\\tif(v2 < w)\\n\\t\\t\\t{\\n\\t\\t\\t\\tif(v2 > vmax)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\/\\/v2 > vmax > w\\n\\t\\t\\t\\t\\tif(vmax > vx)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\treturn tx + (vx - w)\\/a + T2(w);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\tdouble ty, sy;\\n\\t\\t\\t\\t\\t\\tty = (vmax - w)\\/a;\\n\\t\\t\\t\\t\\t\\tsy = ty * (vmax + w)\\/2.0;\\n\\t\\t\\t\\t\\t\\treturn t1 + ty + (d - s1 - sy)\\/vmax + T2(w);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\/\\/v2 < w, v2 <= vmax\\n\\t\\t\\t\\t\\treturn t2 + T2(v2);\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse if(v2 > vmax) \\/\\/v2 >= w, vmax > w\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\/\\/v2 > vmax > w\\n\\t\\t\\t\\tif(vmax > vx)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\treturn tx + (vx - w)\\/a + T2(w);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tdouble ty, sy;\\n\\t\\t\\t\\t\\tty = (vmax - w)\\/a;\\n\\t\\t\\t\\t\\tsy = ty * (vmax + w)\\/2.0;\\n\\t\\t\\t\\t\\treturn t1 + ty + (d - s1 - sy)\\/vmax + T2(w);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse \\/\\/vmax >= v2 >= w\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\/\\/out.println(\\\"Questionable.\\\");\\n\\t\\t\\t\\t\\/\\/return binary() + T2(w);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\/\\/return t3 + (d-s3)\\/w + T2(w);\\n\\n\\t\\t\\t\\treturn tx + (vx - w)\\/a + T2(w);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic double binary()\\n\\t{\\n\\t\\tdouble low, high, t, s;\\n\\t\\tlow = 0.0; high = vmax\\/a;\\n\\t\\t\\n\\t\\tfor(int c=0;c<50;++c)\\n\\t\\t{\\n\\t\\t\\tt = (low+high)\\/2;\\n\\t\\t\\ts = (a*t*t)\\/2 + ((a*t - w)\\/a)*(a*t + w)\\/2.0;\\n\\t\\t\\t\\n\\t\\t\\tif(s > d)... What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collections;\\nimport java.util.HashMap;\\nimport java.util.List;\\nimport java.util.Map;\\n\\npublic class ProblemA {\\n\\t\\n\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader s = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\n\\t\\tString line = s.readLine();\\n\\t\\tint len = line.length();\\n\\t\\tint max = 0;\\n\\t\\tfor (int i = 0 ; i < len ; i++) {\\n\\t\\t\\tfor (int j = i+1 ; j <= len ; j++) {\\n\\t\\t\\t\\tString sch = line.substring(i, j);\\n\\t\\t\\t\\tfor (int k = i+1 ; k + (j - i) <= len ; k++) {\\n\\t\\t\\t\\t\\tString tch = line.substring(k, k+(j-i));\\n\\t\\t\\t\\t\\tif (sch.equals(tch)) {\\n\\t\\t\\t\\t\\t\\tmax = Math.max(max, (j-i));\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(max);\\n\\t\\tout.flush();\\n\\t}\\n\\n\\n\\tpublic static void debug(Object... os){\\n\\t\\tSystem.err.println(Arrays.deepToString(os));\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.ArrayList;\\nimport java.util.Scanner;\\nimport java.lang.StringBuilder;\\nimport java.util.Arrays;\\nimport java.util.Stack;\\nimport java.util.TreeMap;\\npublic class Test11 { \\n public static void main(String[] Args) {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n String s0 = sc.nextLine();\\n int s = 0; \\/\\/ S\\n int m = 0;\\n int l = 0;\\n int s1 = 0;\\n int l1 = 0;\\n int s2 = 0;\\n int l2 = 0;\\n int s3 = 0;\\n int l3 = 0;\\n for (int i = 0; i < n; i++) {\\n s0 = sc.nextLine();\\n if (s0.charAt(0) == 'S') s++;\\n if (s0.charAt(0) == 'M') m++;\\n if (s0.charAt(0) == 'L') l++;\\n if (s0.charAt(0) == 'X' && s0.length() == 2 && s0.charAt(s0.length() - 1) == 'S') s1++;\\n if (s0.charAt(0) == 'X' && s0.length() == 3 && s0.charAt(s0.length() - 1) == 'S') s2++;\\n if (s0.charAt(0) == 'X' && s0.length() == 4 && s0.charAt(s0.length() - 1) == 'S') s3++;\\n if (s0.charAt(0) == 'X' && s0.length() == 2 && s0.charAt(s0.length() - 1) == 'L') l1++;\\n if (s0.charAt(0) == 'X' && s0.length() == 3 && s0.charAt(s0.length() - 1) == 'L') l2++;\\n if (s0.charAt(0) == 'X' && s0.length() == 4 && s0.charAt(s0.length() - 1) == 'L') l3++;\\n } \\n int rs = 0; \\/\\/ S\\n int rm = 0;\\n int rl = 0;\\n int rs1 = 0;\\n int rl1 = 0;\\n int rs2 = 0;\\n int rl2 = 0;\\n int rs3 = 0;\\n int rl3 = 0;\\n for (int i = 0; i < n; i++) {\\n s0 = sc.nextLine();\\n if (s0.charAt(0) == 'S') rs++;\\n if (s0.charAt(0) == 'M') rm++;\\n if (s0.charAt(0) == 'L') rl++;\\n if (s0.charAt(0) == 'X' && s0.length() == 2 && s0.charAt(s0.length() - 1) == 'S') rs1++;\\n if (s0.charAt(0) == 'X' && s0.length() == 3 && s0.charAt(s0.length() - 1) == 'S') rs2++;\\n if (s0.charAt(0) == 'X' && s0.length() == 4 && s0.charAt(s0.length() - 1) == 'S') rs3++;\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.ArrayList;\\nimport java.util.Scanner;\\n\\n\\n\\npublic class primes {\\n\\npublic static void main(String [] args){\\n\\nArrayList numb=new ArrayList();\\nScanner br1 = new Scanner(System.in);\\nint n=br1.nextInt();\\nint steps=br1.nextInt();\\n\\/\\/if(n>2)numb.add(2);\\nif(n>=3)numb.add(3);\\nfor(int j=4;j<=n;j++){\\nif(chekprime(j)==0){\\n\\nnumb.add(j);\\n\\/\\/System.out.println(j);\\n}\\n\\n}\\nint counter =0;\\nfor(int give=0;give=steps)System.out.println(\\\"YES\\\");\\nelse System.out.println(\\\"NO\\\");\\n\\n\\n}\\n\\npublic static String sumup(ArrayList list,int number,int NUM){\\n\\nString ret=\\\"NO\\\";\\n ArrayList result=new ArrayList();\\n\\nArrayList[] arList=new ArrayList[number];\\nfor(int i=0;i();\\narList[i]=(ArrayList)list.clone();\\nfor(int k=0;k 0; length--) {\\n\\t\\t\\tfor (int start = 0; start + length <= line.length(); start++) {\\n\\t\\t\\t\\tif(line.indexOf(line.substring(start,start+length),start+1)>=0) {\\n\\t\\t\\t\\t\\treturn length;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn 0;\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Rishabhdeep Singh\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n int MOD = (int) 1e9 + 7;\\n\\n long power(long a, long k) {\\n long res = 1;\\n while (k > 0) {\\n if ((k & 1) != 0) {\\n res = res * a % MOD;\\n }\\n a = a * a % MOD;\\n k \\/= 2;\\n }\\n return res;\\n }\\n\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n long x = in.nextLong(), k = in.nextLong();\\n if (x == 0) {\\n out.println(0);\\n return;\\n }\\n long res = ((power(2, k + 1) % MOD) * (x % MOD)) % MOD;\\n long temp = power(2, k);\\n res = res - temp + 1;\\n while (res < 0) res += MOD;\\n out.println(res);\\n }\\n\\n }\\n\\n static class OutputWriter {\\n private final PrintWriter writer;\\n\\n public OutputWriter(OutputStream outputStream) {\\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));\\n }\\n\\n public OutputWriter(Writer writer) {\\n this.writer = new PrintWriter(writer);\\n }\\n\\n public void close() {\\n writer.close();\\n }\\n\\n public void... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.lang.*;\\nimport java.math.*;\\nimport java.io.*;\\n\\nimport static java.lang.Math.*;\\nimport static java.util.Arrays.*;\\n\\n\\/\\/ Petya and Spiders\\n\\/\\/ 2011\\/9\\/3\\npublic class P111C{\\n\\tScanner sc=new Scanner(System.in);\\n\\n\\tint INF=1<<28;\\n\\n\\tint n, m;\\n\\n\\tvoid run(){\\n\\t\\tn=sc.nextInt();\\n\\t\\tm=sc.nextInt();\\n\\t\\tsolve();\\n\\t}\\n\\n\\tvoid solve(){\\n\\t\\tif(n>1)|(i<<1))&full;\\n\\t\\t\\tint b2=i;\\n\\t\\t\\tdp[b1][b2]=Integer.bitCount(i);\\n\\t\\t}\\n\\t\\tfor(int j=0; j>1)|(i<<1))&full;\\n\\t\\t\\t\\t\\t\\tdp[b2|b][i]=min(dp[b2|b][i],\\n\\t\\t\\t\\t\\t\\t\\t\\ttmp[b1][b2]+Integer.bitCount(i));\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tint min=INF;\\n\\t\\tfor(int i=0; i<1< a = new ArrayList<>();\\n a.add(x);\\n for (int i = 0; i < k; i++) {\\n dodouble(a);\\n a = eat(a);\\n }\\n dodouble(a);\\n long sum = 0;\\n for (Long v : a) {\\n sum = (sum + v) % mod;\\n }\\n return sum * rev(a.size(), mod) % mod;\\n }\\n\\n private List eat(List a) {\\n List r = new ArrayList<>();\\n for (Long v : a) {\\n r.add(v);\\n r.add((v - 1 + mod) % mod);\\n }\\n return r;\\n }\\n\\n private void dodouble(List a) {\\n for (int i = 0; i < a.size(); i++) {\\n a.set(i, a.get(i) * 2 % mod);\\n }\\n }\\n\\n private long solveFast(long x, long k) {\\n long n = binpow(2, k, mod);\\n long ma = (binpow(2, k + 1, mod) * (x % mod)) % mod;\\n long mi = (ma - n * 2 + 2 + mod * 100) % mod;\\n return ((ma + mi) * rev(2, mod)) % mod;\\n }\\n\\n private long rev(long a, long mod) {\\n return binpow(a, mod - 2, mod);\\n }\\n\\n \\/\\/-------------------------------------------------\\n\\n final boolean ONLINE_JUDGE = !new File(\\\"input.txt\\\").exists();\\n\\n BufferedReader in;\\n PrintWriter out;\\n StringTokenizer tok;\\n\\n public void run() {\\n Runnable run = () -> {\\n try {\\n long startTime = System.currentTimeMillis();\\n Locale.setDefault(Locale.US);\\n if (ONLINE_JUDGE) {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/ \\/\\/package ;\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class A\\n{\\n\\tpublic static int sol(String n,String p)\\n\\t{\\n\\t\\tint sol=0;\\n\\t\\tfor(int i=0;ip=new ArrayList<>();\\n\\t\\tArrayListne=new ArrayList<>();\\n\\t\\tfor(int i=0;i set = new TreeSet();\\n\\n for (int i = 0; i < n; i++) {\\n set.add(nextInt());\\n }\\n set.remove(set.iterator().next());\\n PrintWriter pw = new PrintWriter(System.out);\\n if (set.isEmpty()) {\\n pw.println(\\\"NO\\\");\\n } else {\\n pw.println(set.iterator().next());\\n }\\n pw.close();\\n }\\n\\n int nextInt() throws IOException {\\n while (!st.hasMoreElements()) {\\n st = new StringTokenizer(br.readLine());\\n }\\n return Integer.parseInt(st.nextToken());\\n }\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n String input = in.nextLine();\\n if (input.equals(\\\"1\\\"))\\n System.out.println(\\\"NO\\\");\\n else {\\n if (checkNum(input))\\n System.out.println(\\\"YES\\\");\\n else {\\n int i = 2;\\n while (i < Integer.parseInt(input)) {\\n if (checkNum(i + \\\"\\\")) {\\n if (Integer.parseInt(input) % i != 0)\\n i++;\\n else\\n break;\\n } else\\n i++;\\n }\\n if (i == Integer.parseInt(input))\\n System.out.println(\\\"NO\\\");\\n else\\n System.out.println(\\\"YES\\\");\\n }\\n }\\n }\\n\\n public static boolean checkNum(String s) {\\n int i = 0;\\n int flag = 0;\\n while (i < s.length()) {\\n if (s.charAt(i) == '4' || s.charAt(i) == '7') {\\n flag = 1;\\n i++;\\n } else\\n return false;\\n }\\n if (flag == 1)\\n return true;\\n return false;\\n }\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\n\\npublic class Main {\\n\\t\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\t\\n\\t\\tint n = nextInt();\\n\\t\\tString nn = Integer.toString(n);\\n\\t\\tif(n >= 0){\\n\\t\\t\\tprintln(n);\\n\\t\\t} else {\\n\\t\\t\\tprintln(Math.max(Integer.parseInt(nn.substring(0,nn.length() - 1)), Integer.parseInt(nn.substring(0, nn.length() - 2) + nn.charAt(nn.length() - 1))));\\n\\t\\t}\\n\\t}\\n\\t\\n\\tprivate static PrintWriter out = new PrintWriter(System.out);\\n\\tprivate static BufferedReader inB = new BufferedReader(new InputStreamReader(System.in));\\t\\n\\tprivate static StreamTokenizer in = new StreamTokenizer(inB);\\n\\t\\n\\tprivate static void exit(Object o) throws Exception {\\n\\t\\tout.println(o);\\n\\t\\tout.flush();\\n\\t\\tSystem.exit(0);\\n\\t}\\n\\tprivate static void println(Object o) throws Exception{\\n\\t\\tout.println(o);\\n\\t\\tout.flush();\\n\\t}\\n\\tprivate static void print(Object o) throws Exception{\\n\\t\\tout.print(o);\\n\\t\\tout.flush();\\n\\t}\\n\\tprivate static long nextLong() throws Exception {\\n\\t\\tin.nextToken();\\n\\t\\treturn (long)in.nval;\\n\\t} \\n\\tprivate static int nextInt() throws Exception {\\n\\t\\tin.nextToken();\\n\\t\\treturn (int)in.nval;\\n\\t} \\n\\tprivate static String nextString() throws Exception {\\n\\t\\tin.nextToken();\\n\\t\\treturn in.sval; \\n\\t}\\n\\t\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Scanner;\\npublic class Main{\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n Long N = sc.nextLong();\\n Long ans;\\n sc.close();\\n if(N <= 2)\\n System.out.println(N);\\n else{\\n if(N % 6 == 0){\\n ans = (N - 1) * (N - 2) * (N - 3);}\\n else if(N % 2 == 0){\\n ans = N * (N - 1) * (N - 3);\\n }\\n else{\\n ans = N * (N - 1) * (N - 2);\\n }\\n System.out.println(ans);\\n }\\n }\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class TwentyFive {\\n\\t\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tSystem.out.println(\\\"25\\\");\\n\\t}\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n Scanner in = new Scanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskF solver = new TaskF();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskF {\\n public void solve(int testNumber, Scanner in, PrintWriter out) {\\n int n = in.nextInt();\\n int m = in.nextInt();\\n int[][] graph = new int[n][m];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < m; j++)\\n graph[i][j] = in.nextInt();\\n }\\n int[][] mn1 = new int[n][n];\\n int[][] mn2 = new int[n][n];\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < n; j++) {\\n int min_val = Integer.MAX_VALUE;\\n for (int k = 0; k < m; k++)\\n min_val = Math.min(min_val, Math.abs(graph[i][k] - graph[j][k]));\\n mn1[i][j] = min_val;\\n min_val = Integer.MAX_VALUE;\\n for (int k = 0; k < m - 1; k++) {\\n min_val = Math.min(min_val, Math.abs(graph[i][k] - graph[j][k + 1]));\\n }\\n mn2[i][j] = min_val;\\n }\\n int[][] dp = new int[(1 << (n + 2))][n];\\n int ans = 0;\\n for (int i = 0; i < n; i++) {\\n for (int[] temp : dp)\\n Arrays.fill(temp, -1);\\n for (int j = 0; j < n; j++) {\\n dp[1 << j][j] = (j == i ? Integer.MAX_VALUE : 0);\\n\\/\\/ dp[1 << j][j] = (j == i ? 0: Integer.MAX_VALUE );\\n }\\n ... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n\\tpublic static void main(String args[]) {new Main().run();}\\n\\n\\tFastReader in = new FastReader();\\n\\tPrintWriter out = new PrintWriter(System.out);\\n\\tvoid run(){\\n\\t\\tint t=in.nextInt();\\n\\t\\tfor(int i=0;i() {\\n\\t\\t\\tpublic int compare(int[] arr1,int[] arr2) {\\n\\t\\t\\t\\treturn arr2[0]-arr1[0];\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tfor(int j=0;j0) {\\n\\t\\t\\t\\t\\t\\t\\tsum+=B[(b+s)%n][j];\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\trec[j][i]=Math.max(sum, rec[j][i]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int j=0;j=1<= maxv)\\n\\t\\t\\t\\tt1 += (d-s1)\\/v1;\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdouble tt = (maxv - v1)\\/a;\\n\\t\\t\\t\\tdouble ss = v1*tt+a*tt*tt\\/2;\\n\\t\\t\\t\\tss *= 2;\\n\\t\\t\\t\\tif (s1 + ss < d)\\n\\t\\t\\t\\t\\tt1 += tt*2 + (d-s1-ss)\\/maxv;\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tss = (d-s1)\\/2;\\n\\t\\t\\t\\t\\t\\/\\/ ss = v1*t + a*t*t\\/2;\\n\\t\\t\\t\\t\\tdouble A = a\\/2;\\n\\t\\t\\t\\t\\tdouble B = v1;\\n\\t\\t\\t\\t\\tdouble C = -ss;\\n\\t\\t\\t\\t\\tdouble D = B*B - 4 * A * C;\\n\\t\\t\\t\\t\\ttt = (-B + Math.sqrt(D))\\/2\\/A;\\n\\t\\t\\t\\t\\tt1 += tt*2;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\ts1 = d;\\n\\t\\t}\\n\\t\\tif (s1 > d) {\\n\\t\\t\\ts1 = d;\\n\\t\\t\\tt1 = Math.sqrt(2*s1\\/a);\\n\\t\\t\\tv1 = a * t1;\\n\\t\\t}\\n\\t\\t\\n\\t\\tt += t1;\\n\\t\\t\\n\\t\\tdouble t2 = (maxv - v1) \\/ a;\\n\\t\\tdouble s2 = v1*t2 + a*t2*t2\\/2;\\n\\t\\tdouble v2 = maxv;\\n\\t\\tif (s1 + s2 < s) {\\n\\t\\t\\tv2 = maxv;\\n\\t\\t\\tt2 += (s-s1-s2)\\/v2;\\n\\t\\t}\\n\\t\\tif (s1 + s2 > s) {\\n\\t\\t\\ts -= s1;\\n\\t\\t\\t\\/\\/ v = v1 + a*t\\n\\t\\t\\t\\/\\/ s = v1*t + a*t*t\\/2\\n\\t\\t\\tdouble A = a\\/2;\\n\\t\\t\\tdouble B = v1;\\n\\t\\t\\tdouble C = -s;\\n\\t\\t\\tdouble D = B*B - 4*A*C;\\n\\t\\t\\t\\n\\t\\t\\tt2 = (-B + Math.sqrt(D))\\/2\\/A;\\n\\t\\t}\\n\\t\\t\\n\\t\\tt += t2;\\n\\t\\t\\n\\t\\tSystem.out.println(t);\\n \\t}\\n\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class Template implements Runnable {\\n\\n BufferedReader in;\\n PrintWriter out;\\n StringTokenizer tok = new StringTokenizer(\\\"\\\");\\n\\n void init() throws FileNotFoundException {\\n try {\\n in = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(\\\"output.txt\\\");\\n } catch (Exception e) {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n }\\n }\\n\\n class GraphBuilder {\\n int n, m;\\n int[] x, y;\\n int index;\\n int[] size;\\n\\n\\n GraphBuilder(int n, int m) {\\n this.n = n;\\n this.m = m;\\n x = new int[m];\\n y = new int[m];\\n size = new int[n];\\n }\\n\\n void add(int u, int v) {\\n x[index] = u;\\n y[index] = v;\\n size[u]++;\\n size[v]++;\\n index++;\\n }\\n\\n int[][] build() {\\n int[][] graph = new int[n][];\\n for (int i = 0; i < n; i++) {\\n graph[i] = new int[size[i]];\\n }\\n for (int i = index - 1; i >= 0; i--) {\\n int u = x[i];\\n int v = y[i];\\n graph[u][--size[u]] = v;\\n graph[v][--size[v]] = u;\\n }\\n return graph;\\n }\\n }\\n\\n String readString() throws IOException {\\n while (!tok.hasMoreTokens()) {\\n try {\\n tok = new StringTokenizer(in.readLine());\\n } catch (Exception e) {\\n return null;\\n }\\n }\\n return tok.nextToken();\\n }\\n\\n int readInt() throws IOException {\\n return Integer.parseInt(readString());\\n }\\n\\n int[] readIntArray(int size) throws IOException {\\n int[] res = new int[size];\\n for (int i = 0; i < size; i++) {\\n res[i] = readInt();\\n }\\n return res;\\n }\\n\\n long[] readLongArray(int size) throws... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Rules {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n int a = in.nextInt();\\n double maxSpeed = in.nextInt();\\n double len = in.nextInt();\\n double delayDist = in.nextInt();\\n double delaySpeed = in.nextInt();\\n \\n \\/\\/ two cases: I reach the delayPoint at a speed higher than the delaySpeed, or I don't.\\n double timeToDelayAtMax = travelS(a, 0.0, maxSpeed, delayDist);\\n double timeToDelayAtDelay = travelS(a, 0.0, delaySpeed, delayDist);\\n if (Math.abs(timeToDelayAtMax-timeToDelayAtDelay) < 0.00001) {\\n \\/\\/ I can reach the delayPoint without being delayed\\n double time = travelS(a, 0.0, maxSpeed, len);\\n System.out.printf(\\\"%.9f\\\\n\\\", time);\\n return;\\n }\\n \\n \\/\\/ binary search to find best velocity to stop acceleration in beginning\\n double lowV = delaySpeed;\\n double highV = maxSpeed;\\n int loopCount = 1000;\\n double[] initial = null;\\n double[] secondary = null;\\n while (loopCount-->0) {\\n double guessV = (lowV+highV)\\/2.0;\\n initial = travelA(a, 0.0, guessV);\\n secondary = travelA(a, guessV, Math.min(delaySpeed, maxSpeed));\\n if (initial[1] + secondary[1] < delayDist) { \\/\\/ okay, we can go faster\\n lowV = guessV;\\n } else {\\n highV = guessV;\\n }\\n }\\n double totalTime = 0.0;\\n double finalSpeed = 0.0;\\n initial = travelA(a, 0.0, lowV);\\n secondary = travelA(a, lowV, delaySpeed);\\n totalTime = initial[0] + secondary[0];\\n double totalDist = initial[1] + secondary[1];\\n totalTime += (delayDist-totalDist)\\/maxSpeed;\\n \\n \\/\\/ now we have delayDist to go, and we are at delaySpeed\\n totalTime += travelS(a, delaySpeed, maxSpeed, len-delayDist);\\n System.out.printf(\\\"%.9f\\\\n\\\", totalTime);\\n }\\n \\n \\/\\/ [0] = time in h, [1] = dist travelled, in km\\n \\/\\/ input units are in km\\/h^2, km\\/h, km\\/h\\n public static double[] travelA(int a, double startSpeed, double endSpeed) {\\n if (startSpeed > endSpeed)\\n a = -a;\\n \\n double time = (endSpeed -... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class C {\\n\\n BufferedReader br;\\n PrintWriter out;\\n StringTokenizer st;\\n boolean eof;\\n\\n final int INF = Integer.MAX_VALUE \\/ 2;\\n\\n void solve() throws IOException {\\n int n = nextInt();\\n int m = nextInt();\\n\\n if (n > m) {\\n int tmp = n;\\n n = m;\\n m = tmp;\\n }\\n \\/\\/ n < m !!!!\\n \\/\\/ n rows m columns\\n\\n if (n == 1) {\\n out.print(m - (m + 2) \\/ 3);\\n return;\\n }\\n\\n int[][] dp = new int[n * m + 1][1 << (2 * n)];\\n for (int i = 0; i < dp.length; i++)\\n Arrays.fill(dp[i], INF);\\n\\n dp[0][0] = 0;\\n for (int i = 0; i < dp.length - 1; i++) {\\n int maxNewMask = (1 << Math.min(2 * n, n * m - i)) - 1;\\n for (int mask = 0; mask < dp[i].length; mask++)\\n if (dp[i][mask] != INF) {\\n \\/\\/System.err.println(i + \\\" \\\" + mask + \\\" \\\" + dp[i][mask]);\\n if ((mask & 1) == 1) \\/\\/ already covered, skip\\n dp[i + 1][mask >> 1] = Math.min(dp[i + 1][mask >> 1],\\n dp[i][mask]);\\n \\/\\/ place on this tile\\n int newMask = mask >> 1;\\n if (i % n != n - 1)\\n newMask |= 1;\\n newMask |= 1 << (n - 1);\\n newMask &= maxNewMask;\\n dp[i + 1][newMask] = Math.min(dp[i + 1][newMask],\\n dp[i][mask] + 1);\\n\\n if (i % n != n - 1) {\\/\\/ place on next tile\\n newMask = mask >> 1;\\n newMask |= 1;\\n if (i % n != n - 2)\\n newMask |= 2;\\n newMask |= (1 << n);\\n newMask &= maxNewMask;\\n dp[i + 1][newMask] = Math.min(dp[i + 1][newMask],\\n dp[i][mask] + 1);\\n }\\n\\n \\/\\/ place on... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.PriorityQueue;\\nimport java.util.StringTokenizer;\\n\\npublic class Main {\\n\\n static ArrayList cols;\\n static int ans, n, a[][];\\n\\n public static void main(String[] args) throws Exception {\\n Scanner sc = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n int tc = sc.nextInt();\\n while (tc-- > 0) {\\n ans = 0;\\n n = sc.nextInt();\\n int m = sc.nextInt();\\n boolean[] taken = new boolean[m];\\n PriorityQueue pq = new PriorityQueue<>();\\n a = new int[n][m];\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < m; j++) {\\n int cur = sc.nextInt();\\n pq.add(new Pair(i, j, cur));\\n a[i][j] = cur;\\n }\\n cols = new ArrayList<>();\\n while (!pq.isEmpty() && cols.size() < 8) {\\n Pair cur = pq.remove();\\n if (!taken[cur.j]) cols.add(cur.j);\\n taken[cur.j] = true;\\n }\\n solve(0,new int [cols.size()]);\\n out.println(ans);\\n }\\n out.flush();\\n out.close();\\n }\\n\\n static void solve(int i, int[] p) {\\n if (i == cols.size()) {\\n int[] max = new int[n];\\n for (int k = 0; k < cols.size(); k++) {\\n int j = cols.get(k);\\n for (int ii = 0; ii < n; ii++) {\\n int idx = (ii + p[k]) % n;\\n max[idx] = Math.max(max[idx], a[ii][j]);\\n }\\n }\\n int poss = 0;\\n for (int x : max)\\n poss += x;\\n ans = Math.max(ans, poss);\\n return;\\n }\\n for (int j = 0; j < n; j++) {\\n p[i] = j;\\n solve(i + 1, p);\\n }\\n }\\n\\n\\n static class Pair implements Comparable {\\n int i, j, val;\\n\\n public Pair(int i, int j, int val) {\\n ... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n \\npublic class A {\\n \\n\\tstatic double[][] a;\\n\\tstatic int N;\\n\\tstatic double[][] memo;\\n \\n\\tstatic double[] dp(int alive)\\n\\t{\\n\\t\\tint count = Integer.bitCount(alive);\\n\\t\\tif(count == 1)\\n\\t\\t{\\n\\t\\t\\tdouble[] ret = new double[N];\\n\\t\\t\\tfor(int i = 0; i < N; ++i)\\n\\t\\t\\t\\tif((alive & (1<> 1);\\n\\t\\t\\t\\tfor(int k = 0; k < N; ++k)\\n\\t\\t\\t\\t\\tif((j & (1< 0) {\\n\\t\\t\\tint n = scn.nextInt(), m = scn.nextInt();\\n\\t\\t\\tint[][] arr = scn.next2DInt(n, m);\\n\\t\\t\\t\\n\\t\\t\\tint[][] col = new int[m][2];\\n\\t\\t\\tfor(int j = 0; j < m; j++) {\\n\\t\\t\\t\\tint max = 0;\\n\\t\\t\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\t\\t\\tmax = Math.max(max, arr[i][j]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tcol[j][0] = max;\\n\\t\\t\\t\\tcol[j][1] = j;\\n\\t\\t\\t}\\n\\t\\t\\tArrays.parallelSort(col, (o1, o2) -> o2[0] - o1[0]);\\n\\t\\t\\t\\n\\t\\t\\tint take = Math.min(n, m);\\n\\t\\t\\t\\n\\t\\t\\tint[][] lol = new int[n][take];\\n\\t\\t\\tfor(int j = 0; j < take; j++) {\\n\\t\\t\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\t\\t\\tlol[i][j] = arr[i][col[j][1]];\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tans = 0;\\n\\t\\t\\tfunc(lol, 0);\\n\\t\\t\\tout.println(ans);\\n\\t\\t}\\n\\t}\\n\\t\\n\\tint ans = 0;\\n\\t\\n\\tvoid func(int[][] arr, int col) {\\n\\t\\tint n = arr.length, m = arr[0].length;\\n\\t\\tif(col == m) {\\n\\t\\t\\tint rv = 0;\\n\\t\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\t\\tint mx = 0;\\n\\t\\t\\t\\tfor(int j = 0; j < m; j++) {\\n\\t\\t\\t\\t\\tmx = Math.max(mx, arr[i][j]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\trv += mx; \\n\\t\\t\\t}\\n\\t\\t\\tans = Math.max(ans, rv);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int rot = 0; rot < n; rot++) {\\n\\t\\t\\tint f = arr[0][col];\\n\\t\\t\\tfor(int j = 1; j < n; j++) {\\n\\t\\t\\t\\tarr[j - 1][col] = arr[j][col];\\n\\t\\t\\t}\\n\\t\\t\\tarr[n - 1][col] = f;\\n\\t\\t\\tfunc(arr, col + 1);\\n\\t\\t}\\n\\t}\\n\\n\\tpublic void run() {\\n\\t\\tlong time = System.currentTimeMillis();\\n\\t\\tboolean oj = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tscn = new FastReader(oj);\\n\\t\\tsolve();\\n\\t\\tout.flush();\\n\\t\\tif (!oj) {\\n\\t\\t\\tSystem.out.println(Arrays.deepToString(new Object[] { System.currentTimeMillis() - time + \\\" ms\\\" }));\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew Thread(null, new E(), \\\"Main\\\", 1 << 26).start();\\n\\t}\\n\\n\\tclass FastReader {\\n\\t\\tInputStream is;\\n\\n\\t\\tpublic FastReader(boolean onlineJudge) {\\n\\t\\t\\tis = onlineJudge ? System.in : new ByteArrayInputStream(INPUT.getBytes());\\n\\t\\t}\\n\\n\\t\\tbyte[] inbuf = new byte[1024];\\n\\t\\tpublic int lenbuf = 0, ptrbuf = 0;\\n\\n\\t\\tint readByte() {\\n\\t\\t\\tif (lenbuf == -1)\\n\\t\\t\\t\\tthrow new... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/Educational Codeforces Round 34\\nimport java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class TaskD {\\n\\n public static void main (String[] args) throws IOException {\\n FastScanner fs = new FastScanner(System.in);\\n PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out));\\n\\n int n = fs.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = fs.nextInt();\\n }\\n \\n HashMap h = new HashMap(n);\\n\\n BigInteger s = new BigInteger(\\\"\\\"+a[0]);\\n BigInteger x = new BigInteger(\\\"0\\\");\\n h.put(a[0], 1);\\n for (int i = 1; i < n; i++) { \\n x = x.add(new BigInteger(\\\"\\\"+(((long)i)*((long)a[i]))));\\n x = x.subtract(s);\\n s = s.add(new BigInteger(\\\"\\\"+a[i]));\\n Integer q = null;\\n q = h.get(a[i]-1); \\n if (q != null) {\\n x = x.subtract(new BigInteger(\\\"\\\"+q));\\n }\\n q = h.get(a[i]+1); \\n if (q != null) {\\n x = x.add(new BigInteger(\\\"\\\"+q));\\n }\\n q = h.get(a[i]); \\n if (q != null) {\\n h.put(a[i], q + 1);\\n } else {\\n h.put(a[i], 1);\\n }\\n }\\n\\n pw.println(x);\\n\\n pw.close();\\n }\\n\\n static class FastScanner {\\n BufferedReader reader;\\n StringTokenizer tokenizer;\\n FastScanner(InputStream i) {\\n reader = new BufferedReader(new InputStreamReader(i));\\n tokenizer = new StringTokenizer(\\\"\\\");\\n }\\n String next() throws IOException {\\n while(!tokenizer.hasMoreTokens()) tokenizer = new StringTokenizer(reader.readLine());\\n return tokenizer.nextToken();\\n }\\n int nextInt() throws IOException {\\n return Integer.parseInt(next());\\n }\\n long nextLong() throws IOException {\\n return Long.parseLong(next());\\n ... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class C {\\n\\n static int MOD = 1_000_000_007;\\n\\n public static void main(String[] args) {\\n\\n MyScanner in = new MyScanner();\\n PrintWriter out = new PrintWriter(System.out);\\n\\n int n = in.nextInt();\\n char prev = ' ';\\n\\n \\/\\/ index, maxNumOfIntents -> count\\n int[][] dp = new int[n+1][n+2];\\n\\n dp[0][0] = 1;\\n for(int i=0;i=0;--j){\\n sum = (sum + dp[i-1][j]) % MOD;\\n dp[i][j] = sum;\\n }\\n }else if(prev == 'f'){\\n for(int j=0;j= 1; l++, r--) {\\n ans[0][c] = l;\\n ans[1][c++] = left;\\n\\n ans[0][c] = r;\\n ans[1][c++] = right;\\n }\\n }\\n\\n if (m % 2 == 1) {\\n int x = m\\/2 + 1;\\n for(int l = 1, r = n;l < r;l++, r--){\\n ans[0][c] = l;\\n ans[1][c++] = x;\\n\\n ans[0][c] = r;\\n ans[1][c++] = x;\\n if(n % 2 == 1 && l + 2 == r){\\n ans[0][c] = l+1;\\n ans[1][c++] = x;\\n }\\n }\\n }\\n\\n if(n == 1 && m % 2 == 1){\\n ans[0][c] = 1;\\n ans[1][c] = m\\/2 + 1;\\n }\\n\\n return ans;\\n }\\n\\n void stress(){\\n\\n for(int i = 3;i<=5;i++){\\n for(int j = 2;j<=5;j++){\\n int[][] ans = new int[2][];\\n try{\\n ans = fast(i, j);\\n }catch(Exception e){\\n out.println(\\\"ошибка\\\");\\n out.print(i + \\\" \\\" + j);\\n return;\\n }\\n\\n boolean[][] check = new boolean[i][j];\\n for(int c = 0;cl) { System.out.print(\\\"-1\\\"); return;}\\n if ((r % 2) == 0) {\\n System.out.print(r);\\n System.out.print(\\\" \\\");\\n System.out.print(r+1);\\n System.out.print(\\\" \\\");\\n System.out.print(r+2);return; }\\n if((r+3)<=l )\\n { System.out.print(r+1);\\n System.out.print(\\\" \\\");\\n System.out.print(r+2);\\n System.out.print(\\\" \\\");\\n System.out.print(r+3);return; }\\n System.out.print(\\\"-1\\\");\\n\\n\\n }\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\n\\npublic class Main {\\npublic static void main(String args[]) throws Exception\\n {\\n \\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n int n=Integer.parseInt(br.readLine());\\n System.out.println(\\\"0 0 \\\"+n);}\\n\\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n \\n\\/**\\n * A simple template for competitive programming problems.\\n *\\/\\npublic class Solution {\\n \\/\\/InputReader in = new InputReader(\\\"input.txt\\\");\\n final InputReader in = new InputReader(System.in);\\n \\n final PrintWriter out = new PrintWriter(System.out);\\n\\n int n,m;\\n\\n void solve() {\\n n = in.nextInt();\\n m = in.nextInt();\\n int k = in.nextInt();\\n\\n int[][] hor = new int[n][m-1];\\n int[][] ver = new int[n-1][m];\\n\\n for(int i=0; i mat[i][j+1]\\n }\\n }\\n\\n for(int i=0; i mat[i+1][j]\\n }\\n }\\n\\n int[][] ans = new int[n][m];\\n\\n if(k%2==1) {\\n for(int i=0; i>1; dummy++) {\\n int[][] newAns = new int[n][m];\\n for(int i=0; i= maxv)\\n\\t\\t\\t\\tt1 += (d-s1)\\/v1;\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdouble tt = (maxv - v1)\\/a;\\n\\t\\t\\t\\tdouble ss = v1*tt+a*tt*tt\\/2;\\n\\t\\t\\t\\tss *= 2;\\n\\t\\t\\t\\tif (s1 + ss < d)\\n\\t\\t\\t\\t\\tt1 += tt*2 + (d-s1-ss)\\/maxv;\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tss = (d-s1)\\/2;\\n\\t\\t\\t\\t\\t\\/\\/ ss = v1*t + a*t*t\\/2;\\n\\t\\t\\t\\t\\tdouble A = a\\/2;\\n\\t\\t\\t\\t\\tdouble B = v1;\\n\\t\\t\\t\\t\\tdouble C = -ss;\\n\\t\\t\\t\\t\\tdouble D = B*B - 4 * A * C;\\n\\t\\t\\t\\t\\ttt = (-B + Math.sqrt(D))\\/2\\/A;\\n\\t\\t\\t\\t\\tt1 += tt*2;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\ts1 = d;\\n\\t\\t}\\n\\t\\tif (s1 > d) {\\n\\t\\t\\ts1 = d;\\n\\t\\t\\tt1 = Math.sqrt(2*s1\\/a);\\n\\t\\t\\tv1 = a * t1;\\n\\t\\t}\\n\\t\\t\\n\\t\\tt += t1;\\n\\t\\t\\n\\t\\tdouble t2 = (maxv - v1) \\/ a;\\n\\t\\tdouble s2 = v1*t2 + a*t2*t2\\/2;\\n\\t\\tdouble v2 = maxv;\\n\\t\\tif (s1 + s2 < s) {\\n\\t\\t\\tv2 = maxv;\\n\\t\\t\\tt2 += (s-s1-s2)\\/v2;\\n\\t\\t}\\n\\t\\tif (s1 + s2 > s) {\\n\\t\\t\\ts -= s1;\\n\\t\\t\\t\\/\\/ v = v1 + a*t\\n\\t\\t\\t\\/\\/ s = v1*t + a*t*t\\/2\\n\\t\\t\\tdouble A = a\\/2;\\n\\t\\t\\tdouble B = v1;\\n\\t\\t\\tdouble C = -s;\\n\\t\\t\\tdouble D = B*B - 4*A*C;\\n\\t\\t\\t\\n\\t\\t\\tt2 = (-B + Math.sqrt(D))\\/2\\/A;\\n\\t\\t}\\n\\t\\t\\n\\t\\tt += t2;\\n\\t\\t\\n\\t\\tSystem.out.println(t);\\n \\t}\\n\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class C138B\\n{\\n\\n private static StringTokenizer st;\\n \\n public static void nextLine(BufferedReader br) throws IOException\\n {\\n st = new StringTokenizer(br.readLine());\\n }\\n \\n public static int nextInt()\\n {\\n return Integer.parseInt(st.nextToken());\\n }\\n \\n public static String next()\\n {\\n return st.nextToken();\\n }\\n \\n public static long nextLong()\\n {\\n return Long.parseLong(st.nextToken());\\n }\\n \\/**\\n * @param args\\n *\\/\\n public static void main(String[] args) throws IOException\\n {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n nextLine(br);\\n int n = nextInt();\\n int k = nextInt();\\n int[] a = new int[n];\\n nextLine(br);\\n for (int i = 0; i < n; i++) a[i] = nextInt();\\n \\n int bp = 0, fp = 0, count = 0;\\n boolean good = false;\\n int[] mark = new int[100001];\\n for (fp = 0; fp < n; fp++)\\n {\\n if (mark[a[fp]] == 0)\\n {\\n count++;\\n }\\n mark[a[fp]]++;\\n if (count == k)\\n {\\n good = true;\\n break;\\n }\\n }\\n if (!good)\\n {\\n System.out.println(\\\"-1 -1\\\");\\n return;\\n }\\n for (bp = 0; bp < fp; bp++)\\n {\\n if (mark[a[bp]] > 1)\\n {\\n mark[a[bp]]--;\\n }\\n else break;\\n }\\n System.out.println((bp+1) + \\\" \\\" + (fp+1));\\n }\\n \\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/ CodeForces Round #914 B train done\\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.List;\\n\\npublic class SportMafia {\\n\\t\\n\\tint n,k;\\n\\tint nCand;\\n\\n\\tprivate void readData(BufferedReader bin) throws IOException {\\n\\t\\tString s = bin.readLine();\\n\\t\\tString []ss = s.split(\\\" \\\");\\n\\t\\tn = Integer.parseInt(ss[0]);\\n\\t\\tk = Integer.parseInt(ss[1]);\\n\\t}\\n\\n\\tvoid printRes() {\\n\\t\\tSystem.out.println(nCand);\\n\\t}\\t\\n\\t\\n\\tprivate void calculate() {\\n\\t\\t\\/\\/ count napitki\\n\\t\\tdouble p;\\n\\t\\tp = -1.5 + Math.sqrt(2.25 + 2.0*(n+k));\\n\\t\\tnCand = (int)Math.round(n-p);\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\t\\/\\/ BufferedReader bin = new BufferedReader(new FileReader(\\\"cactus.in\\\"));\\n\\t\\tBufferedReader bin = new BufferedReader(\\n\\t\\t\\t\\tnew InputStreamReader(System.in));\\n\\t\\tSportMafia l = new SportMafia();\\n\\t\\tl.readData(bin);\\n\\t\\tl.calculate();\\n\\t\\tl.printRes();\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.lang.*;\\npublic class CF1003E{\\n public static void main(String args[]) throws IOException{\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n String[] s = br.readLine().split(\\\" \\\");\\n int n = Integer.parseInt(s[0]);\\n int d = Integer.parseInt(s[1]);\\n int k = Integer.parseInt(s[2]);\\n StringBuffer sb = new StringBuffer();\\n int[] rem = new int[n];\\n int[] deg = new int[n];\\n int i = 0;\\n if(k == 1){\\n if(n <= 2){\\n\\n }else{\\n System.out.println(\\\"NO\\\");\\n return;\\n }\\n }\\n for(i=0;i=n-1){\\n System.out.println(\\\"NO\\\");\\n return;\\n }\\n sb.append((i+1) +\\\" \\\" + (i+2)+\\\"\\\\n\\\");\\n rem[i] = Math.min(i, d-i);\\n deg[i]++;\\n if(i+1=n){\\n System.out.println(\\\"NO\\\");\\n return;\\n }\\n if(rem[j] > 0 && deg[j] horisontal = new ArrayList<>();\\n int amount = 0;\\n for (int i = 0; i < m; i++) {\\n int x1 = scanner.nextInt(), x2 = scanner.nextInt(), y = scanner.nextInt();\\n if (x1 == 1) {\\n amount++;\\n horisontal.add(x2);\\n }\\n }\\n\\n Collections.sort(horisontal);\\n\\n\\n if (amount == 0) {\\n System.out.println(0);\\n return;\\n }\\n\\n\\n int minVal = amount, horSize = horisontal.size(), verLen = vertical.length;\\n int h = 0, v = 0;\\n\\n for (; v < verLen && h < horSize; ) {\\n\\n while (h < horSize && horisontal.get(h) < vertical[v]){\\n h++;\\n amount--;\\n }\\n minVal = Math.min(minVal, amount + v);\\n\\n while (h < horSize && v < verLen && horisontal.get(h) >= vertical[v]){\\n minVal = Math.min(minVal, amount + v);\\n v++;\\n }\\n\\n }\\n\\n if(horisontal.get(horSize - 1) < 1E9){\\n minVal = Math.min(minVal, v);\\n }\\n\\n\\n\\n System.out.println(minVal);\\n\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.OutputStreamWriter;\\nimport java.io.BufferedWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.FileOutputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.FileInputStream;\\nimport java.util.NoSuchElementException;\\nimport java.io.Writer;\\nimport java.math.BigInteger;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Alex\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream;\\n\\t\\ttry {\\n\\t\\t\\tinputStream = new FileInputStream(\\\"input.txt\\\");\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t}\\n\\t\\tOutputStream outputStream;\\n\\t\\ttry {\\n\\t\\t\\toutputStream = new FileOutputStream(\\\"output.txt\\\");\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t}\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tOutputWriter out = new OutputWriter(outputStream);\\n\\t\\tTaskC solver = new TaskC();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskC {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n\\t int maxdist = -1, maxrow = -1, maxcol = -1;\\n\\t int rows = in.ri(), cols = in.ri();\\n\\t int k = in.ri();\\n\\t IntPair[] points = new IntPair[k];\\n\\t for(int i = 0; i < k; i++) points[i] = new IntPair(in.ri(), in.ri());\\n\\t for(int row = 1; row <= rows; row++) {\\n\\t\\t for(int col = 1; col <= cols; col++) {\\n\\t\\t\\t int mindist = Integer.MAX_VALUE;\\n\\t\\t\\t for(int i = 0; i < k; i++)\\n\\t\\t\\t\\t mindist = Math.min(mindist, Math.abs(row - points[i].first) + Math.abs(col - points[i].second));\\n\\t\\t\\t if (mindist > maxdist){\\n\\t\\t\\t\\t maxdist = mindist;\\n\\t\\t\\t\\t maxrow = row;\\n\\t\\t\\t\\t maxcol = col;\\n\\t\\t\\t }\\n\\t\\t }\\n\\t }\\n\\t out.printLine(maxrow, maxcol);\\n }\\n}\\n\\nclass InputReader {\\n\\tprivate InputStream stream;\\n\\tprivate byte[] buf = new byte[1024];\\n\\tprivate int curChar;\\n\\tprivate int numChars;\\n\\tprivate SpaceCharFilter filter;\\n\\n\\tpublic InputReader(InputStream stream) {\\n\\t\\tthis.stream = stream;\\n\\t}\\n\\n\\tpublic int read() {\\n\\t\\tif (numChars... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\n\\npublic class Task267A {\\n\\n\\tpublic static void main(String... args) throws NumberFormatException,\\n\\t\\t\\tIOException {\\n\\t\\tSolution.main(System.in, System.out);\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\n\\t\\tprivate final BufferedReader br;\\n\\t\\tprivate String[] cache;\\n\\t\\tprivate int cacheIndex;\\n\\n\\t\\tScanner(InputStream is) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(is));\\n\\t\\t\\tcache = new String[0];\\n\\t\\t\\tcacheIndex = 0;\\n\\t\\t}\\n\\n\\t\\tint nextInt() throws IOException {\\n\\t\\t\\tif (cacheIndex >= cache.length) {\\n\\t\\t\\t\\tcache = br.readLine().split(\\\" \\\");\\n\\t\\t\\t\\tcacheIndex = 0;\\n\\t\\t\\t}\\n\\t\\t\\treturn Integer.parseInt(cache[cacheIndex++]);\\n\\t\\t}\\n\\n\\t\\tString next() throws IOException {\\n\\t\\t\\tif (cacheIndex >= cache.length) {\\n\\t\\t\\t\\tcache = br.readLine().split(\\\" \\\");\\n\\t\\t\\t\\tcacheIndex = 0;\\n\\t\\t\\t}\\n\\t\\t\\treturn cache[cacheIndex++];\\n\\t\\t}\\n\\n\\t\\tvoid close() throws IOException {\\n\\t\\t\\tbr.close();\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic class Solution {\\n\\n\\t\\tpublic static void main(InputStream is, OutputStream os)\\n\\t\\t\\t\\tthrows NumberFormatException, IOException {\\n\\t\\t\\tPrintWriter pw = new PrintWriter(os);\\n\\t\\t\\tScanner sc = new Scanner(is);\\n\\n\\t\\t\\tint n = sc.nextInt();\\n\\n\\t\\t\\twhile (n-- > 0) {\\n\\t\\t\\t\\tint ai = sc.nextInt();\\n\\t\\t\\t\\tint bi = sc.nextInt();\\n\\t\\t\\t\\tint retVal = 0;\\n\\n\\t\\t\\t\\twhile (ai > 0 && bi > 0) {\\n\\t\\t\\t\\t\\tif (ai > bi) {\\n\\t\\t\\t\\t\\t\\tretVal += ai \\/ bi;\\n\\t\\t\\t\\t\\t\\tai = ai % bi;\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tretVal += bi \\/ ai;\\n\\t\\t\\t\\t\\t\\tbi = bi % ai;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tpw.println(retVal);\\n\\t\\t\\t}\\n\\n\\t\\t\\tpw.flush();\\n\\t\\t\\tsc.close();\\n\\t\\t}\\n\\t}\\n\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.Reader;\\nimport java.io.IOException;\\nimport java.util.StringTokenizer;\\n\\/*\\n * @author Tnascimento \\n *\\/\\n\\npublic class MaeDosDragoes {\\n\\t\\/\\/ public static StringTokenizer tokenizer;\\n\\t\\/\\/ public static BufferedReader reader;\\n\\tpublic static PrintWriter saida = new PrintWriter(System.out, false);\\n\\t\\/\\/ public static String proximo() {\\n\\t\\/\\/ \\twhile (tokenizer == null || !tokenizer.hasMoreElements()) {\\n\\t\\/\\/ \\t\\ttry {\\n\\t\\/\\/ \\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\/\\/ \\t\\t} catch (RuntimeException e) {\\n\\t\\/\\/ \\t\\t\\te.printStackTrace();\\n\\t\\/\\/ \\t\\t}\\n\\t\\/\\/ \\t}\\n\\t\\/\\/ \\treturn tokenizer.nextToken();\\n\\t\\/\\/ }\\n\\n\\tpublic static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n \\n public FastScanner(Reader in) {\\n br = new BufferedReader(in);\\n }\\n \\n public FastScanner() {\\n this(new InputStreamReader(System.in));\\n }\\n \\n String next() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n \\n int nextInt() {\\n return Integer.parseInt(next());\\n }\\n }\\n\\n\\n\\n public static void main(String[] args) {\\n\\t\\tFastScanner fastScanner = new FastScanner();\\n int proximoInt = fastScanner.nextInt();\\n double proximoDouble = fastScanner.nextInt();\\n long[] graph = new long[proximoInt];\\n for(Integer i = 0; i < proximoInt; i++) {\\n for(Integer j =0; j < proximoInt; j++) {\\n Integer val = fastScanner.nextInt();\\n if (val.equals(1) || i.equals(j)) {\\n\\t\\t\\t\\t graph[i] |= 1L << j;\\n\\t\\t\\t\\t}\\n }\\n }\\n\\n int szLeft = proximoInt\\/2;\\n int szRight = proximoInt - szLeft;\\n\\n int[] dp = new int[1 << szLeft];\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.io.FilterInputStream;\\nimport java.io.BufferedInputStream;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Jenish\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n ScanReader in = new ScanReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n C489 solver = new C489();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class C489 {\\n int mod = 1000000007;\\n\\n public void solve(int testNumber, ScanReader in, PrintWriter out) {\\n long x = in.scanLong();\\n long k = in.scanLong();\\n if (x == 0) {\\n out.println(0);\\n return;\\n }\\n long p = CodeX.power(2, k, mod);\\n long ans = (2 * p * (x % mod)) % mod;\\n ans = (ans + 1) % mod;\\n ans = (ans - p + mod) % mod;\\n out.println(ans);\\n }\\n\\n }\\n\\n static class CodeX {\\n public static long power(long x, long y, long p) {\\n long res = 1;\\n x = x % p;\\n while (y > 0) {\\n if ((y & 1) != 0)\\n res = (res * x) % p;\\n y = y >> 1;\\n x = (x * x) % p;\\n }\\n return res;\\n }\\n\\n }\\n\\n static class ScanReader {\\n private byte[] buf = new byte[4 * 1024];\\n private int INDEX;\\n private BufferedInputStream in;\\n private int TOTAL;\\n\\n public ScanReader(InputStream inputStream) {\\n in = new BufferedInputStream(inputStream);\\n }\\n\\n private int scan() {\\n if (INDEX >= TOTAL) {\\n INDEX = 0;\\n try {\\n TOTAL = in.read(buf);\\n } catch (Exception e) {\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.BigInteger;\\nimport java.util.Map.Entry;\\n\\nimport static java.lang.Math.*;\\n\\npublic class G extends PrintWriter {\\n\\n void run() {\\n long mod = 1_000_000_000 + 7;\\n int n = nextInt();\\n int m = nextInt();\\n\\n int[] t = new int[n];\\n int[] g = new int[n];\\n\\n for (int i = 0; i < n; i++) {\\n t[i] = nextInt();\\n g[i] = nextInt() - 1;\\n }\\n\\n int k = 1 << n;\\n\\n long[][] dp = new long[k][n];\\n\\n for (int i = 0; i < n; i++) {\\n dp[1 << i][i] = 1;\\n }\\n\\n for (int mask = 0; mask < k; mask++) {\\n if (Integer.bitCount(mask) <= 1) {\\n continue;\\n }\\n\\n for (int i = 0; i < n; i++) {\\n if ((mask & (1 << i)) != 0) {\\n for (int j = 0; j < n; j++) {\\n if ((mask & (1 << j)) == 0 || g[i] == g[j]) {\\n continue;\\n }\\n dp[mask][i] = (dp[mask][i] + dp[mask ^ (1 << i)][j]) % mod;\\n }\\n }\\n }\\n }\\n\\n long ans = 0;\\n for (int mask = 0; mask < k; mask++) {\\n int sum = 0;\\n for (int i = 0; i < n; i++) {\\n if ((mask & (1 << i)) != 0) {\\n sum += t[i];\\n }\\n }\\n if (sum == m) {\\n\\n for (int i = 0; i < n; i++) {\\n if ((mask & (1 << i)) != 0) {\\n ans = (ans + dp[mask][i]) % mod;\\n }\\n }\\n\\n }\\n\\n }\\n\\n println(ans);\\n\\n }\\n\\n boolean skip() {\\n while (hasNext()) {\\n next();\\n }\\n return true;\\n }\\n\\n int[][] nextMatrix(int n, int m) {\\n int[][] matrix = new int[n][m];\\n for (int i = 0; i < n; i++)\\n for (int j = 0; j < m; j++)\\n matrix[i][j] = nextInt();\\n return matrix;\\n }\\n\\n String next() {\\n while... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class first\\n{\\n\\tint max(int a1,int a2,int a3)\\n\\t{\\n\\t\\tint max=a1;\\n\\t\\tif(a2>=max)\\n\\t\\t\\tmax=a2;\\n\\t\\tif(a3>=max)\\n\\t\\t\\tmax = a3;\\n\\t\\treturn max;\\t\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tint num=0;\\n\\t\\t\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tnum = sc.nextInt();\\n\\t\\tint num2 = num\\/10;\\n\\t\\tint num3 = num%10;\\n\\t\\tint num4 = (num2\\/10)*10+num3;\\n\\t\\tfirst fs = new first();\\n\\t\\tint result = fs.max(num,num2,num4);\\n\\t\\tSystem.out.println(result);\\n\\t}\\n}\\t\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Solution {\\n\\t\\n\\tprivate BufferedReader in;\\n\\tprivate PrintWriter out;\\n\\tprivate StringTokenizer st;\\n\\n\\tstatic class House implements Comparable {\\n\\t\\tint x, a;\\n\\n\\t\\t@Override\\n\\t\\tpublic int compareTo(House o) {\\n\\t\\t\\treturn x - o.x;\\n\\t\\t}\\n\\n\\t\\tpublic House(int x, int a) {\\n\\t\\t\\tthis.x = x;\\n\\t\\t\\tthis.a = a;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tvoid solve() throws IOException {\\n\\t\\tint n = nextInt();\\n\\t\\tint t = nextInt();\\n\\t\\tHouse[] hs = new House[n];\\n\\t\\tfor (int i = 0; i < n; ++i) {\\n\\t\\t\\ths[i] = new House(nextInt(), nextInt());\\n\\t\\t}\\n\\t\\tArrays.sort(hs);\\n\\t\\tint ans = 2;\\n\\t\\tfor (int i = 0; i < n - 1; ++i) {\\n\\t\\t\\tif (hs[i].a + hs[i + 1].a + 2 * t < 2 * (hs[i + 1].x - hs[i].x)) {\\n\\t\\t\\t\\tans += 2;\\n\\t\\t\\t} else if (hs[i].a + hs[i + 1].a + 2 * t == 2 * (hs[i + 1].x - hs[i].x)) {\\n\\t\\t\\t\\tans++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(ans);\\n\\t}\\n\\n\\tSolution() throws IOException {\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\teat(\\\"\\\");\\n\\t\\t\\n\\t\\tsolve();\\n\\t\\t\\n\\t\\tin.close();\\n\\t\\tout.close();\\n\\t}\\n\\t\\n\\tprivate void eat(String str) {\\n\\t\\tst = new StringTokenizer(str);\\n\\t}\\n\\t\\n\\tString next() throws IOException {\\n\\t\\twhile (!st.hasMoreTokens()) {\\n\\t\\t\\tString line = in.readLine();\\n\\t\\t\\tif (line == null) {\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t\\teat(line);\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\t\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\t\\n\\tlong nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\t\\n\\tdouble nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tnew Solution();\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.File;\\nimport java.io.FileReader;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\n\\npublic class e_g14 {\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\n\\t\\tFastScanner in = new FastScanner(System.in);\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\t\\n\\t\\tint T = 1;\\n\\t\\tSolver A = new Solver(in, out); \\n\\t\\t\\n\\t\\tfor(int aa = 0; aa < T; aa++) {\\n\\t\\t\\tA.answer(aa + 1);\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\n\\t\\tout.close();\\n\\t}\\n\\t\\n\\tstatic class Solver {\\n\\t\\tFastScanner in;\\n\\t\\tPrintWriter out;\\n\\t\\t\\n\\t\\tint n;\\n\\t\\tlong m;\\n\\t\\t\\n\\t\\tlong [] fact, pow, choose [], dp[];\\n\\n\\t\\tpublic Solver(FastScanner in, PrintWriter out) {\\n\\t\\t\\tthis.in = in;\\n\\t\\t\\tthis.out = out;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic void answer(int aa) throws Exception {\\n\\t\\t\\tn = in.nextInt();\\n\\t\\t\\tm = in.nextLong();\\n\\t\\t\\t\\n\\t\\t\\tfact = new long [n+5];\\n\\t\\t\\tchoose = new long [n+5][n+5];\\n\\t\\t\\tdp = new long [n+2][n+2];\\n\\t\\t\\tpow = new long [n+2];\\n\\t\\t\\t\\n\\t\\t\\tinit();\\n\\t\\t\\t\\n\\t\\t\\tdp[0][0] = 1;\\n\\t\\t\\tfor(int i = 0; i <= n; i++) {\\n\\t\\t\\t\\tfor(int j = 0; j <= i; j++) {\\n\\t\\t\\t\\t\\tfor(int k = 1; i+k <= n; k++) {\\n\\t\\t\\t\\t\\t\\tdp[i+k+1][j+k] += (dp[i][j]*choose[j+k][k]%m)*pow[k-1];\\n\\t\\t\\t\\t\\t\\tdp[i+k+1][j+k] %= m;\\n\\t\\t\\t\\t\\t}\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\tlong ans = 0;\\n\\t\\t\\tfor(int i = 0; i <= n; i++) {\\n\\t\\t\\t\\tans += dp[n+1][i];\\n\\t\\t\\t\\tans %= m;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tout.println(ans);\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic void init() {\\n\\t\\t\\tfact[0] = 1;\\n\\t\\t\\tfor(int i = 1; i <= n+4; i++) {\\n\\t\\t\\t\\tfact[i] = (i*fact[i-1])%m;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tpow[0] = 1;\\n\\t\\t\\tfor(int i = 1; i <= n+1; i++) {\\n\\t\\t\\t\\tpow[i] = (2*pow[i-1])%m;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tfor(int i = 0; i <= n+4; i++) {\\n\\t\\t\\t\\tfor(int j = 0; j <= i; j++) {\\n\\t\\t\\t\\t\\tchoose[i][j] = choose(i, j);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tprivate long choose(int a, int b) {\\n\\t\\t\\tlong res = (fact[a] * inv((fact[b] * fact[a-b])%m))%m;\\n\\t\\t\\treturn res;\\n\\t\\t}\\n\\t\\t\\n\\t\\tprivate long power (long x, long y) {\\n\\t\\t\\tlong res = 1;\\n\\t\\t\\twhile(y > 0) {\\n\\t\\t\\t\\tif(y%2 == 1) res = (res*x)%m;\\n\\t\\t\\t\\tx = (x*x)%m;\\n\\t\\t\\t\\ty \\/= 2;\\n\\t\\t\\t}\\n\\t\\t\\treturn... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.PrintWriter;\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n boolean[] b;\\n int[] r;\\n ArrayList> q;\\n\\n public void dfs(int u, int p) {\\n for (int i = 0; i < q.get(u).size(); i++) {\\n int v = q.get(u).get(i);\\n if (v != p) {\\n r[v] = r[u] + 1;\\n if (b[u]) {\\n b[v] = b[u];\\n }\\n dfs(v, u);\\n }\\n }\\n }\\n\\n public void solve() throws IOException {\\n long n = nextLong();\\n long s = nextLong();\\n long t = 0;\\n if(s + 200 < n){\\n t = n - s - 200;\\n }\\n for(long i = s; i <= Math.min(s + 200,n); i++){\\n long p = 0;\\n long u = i;\\n while (u > 0){\\n p += u % 10;\\n u \\/= 10;\\n }\\n if(i - p >= s){\\n t++;\\n }\\n }\\n out.print(t);\\n }\\n\\n BufferedReader br;\\n StringTokenizer sc;\\n PrintWriter out;\\n\\n public String nextToken() throws IOException {\\n while (sc == null || !sc.hasMoreTokens()) {\\n try {\\n sc = new StringTokenizer(br.readLine());\\n } catch (Exception e) {\\n return null;\\n }\\n }\\n return sc.nextToken();\\n }\\n\\n public Integer nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n public Long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n\\n public static void main(String[] args) throws IOException {\\n try {\\n Locale.setDefault(Locale.US);\\n } catch (Exception e) {\\n }\\n new Main().run();\\n }\\n\\n public void run() {\\n try {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n\\/\\/ br = new BufferedReader(new FileReader(\\\"lesson.in\\\"));\\n\\/\\/ out = new PrintWriter(new... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Solution {\\n static class Data{\\n int x,i;\\n Data(int x,int i){\\n this.x = x;\\n this.i = i;\\n }\\n }\\n public static void main(String[] args) throws IOException {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n String[] s = br.readLine().split(\\\"\\\\\\\\s\\\");\\n int N = Integer.parseInt(s[0]);\\n int K = Integer.parseInt(s[1]);\\n s = br.readLine().split(\\\"\\\\\\\\s\\\");\\n int[] arr = new int[N];\\n for(int i=0;i pq = new PriorityQueue(2000,(a,b) -> a.x - b.x == 0 ? b.i - a.i : b.x - a.x);\\n for(int i=0;i ls = new ArrayList<>();\\n Set set = new HashSet<>();\\n \\n for(int i=1;i<=K;++i){\\n Data t = pq.poll();\\n tot_sum += t.x;\\n set.add(t.i);\\n }\\n int last = -1;\\n for(int i =0;i{\\n\\t\\tint p, t;\\n\\t\\tpublic Team(int p, int t) {\\n\\t\\t\\tthis.p = p;\\n\\t\\t\\tthis.t = t;\\n\\t\\t}\\n\\t\\tpublic int compareTo(Team other) {\\n\\t\\t\\tif (this.p != other.p) return other.p - this.p;\\n\\t\\t\\treturn this.t - other.t;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic void solve() throws IOException {\\n\\t\\tint n = nextInt();\\n\\t\\tint K = nextInt() - 1;\\n\\t\\tTeam[] team = new Team[n];\\n\\t\\tfor (int i = 0; i < n; i++) \\n\\t\\t\\tteam[i] = new Team(nextInt(), nextInt());\\n\\t\\t\\n\\t\\tArrays.sort(team);\\n\\t\\tint ans = -1;\\n\\t\\tint pre = 0;\\n\\t\\tfor (int i = 1; i < n; i++)\\n\\t\\t\\tif (team[i].compareTo(team[i - 1]) != 0) {\\n\\t\\t\\t\\tif (K >= pre && K < i) {\\n\\t\\t\\t\\t\\tans = i - pre;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tpre = i;\\n\\t\\t\\t}\\n\\t\\tif (ans == -1) ans = n - pre;\\n\\t\\twriter.println(ans);\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws FileNotFoundException {\\n\\t\\tnew A().run();\\n\\t}\\n\\n\\tBufferedReader reader;\\n\\tStringTokenizer tokenizer;\\n\\tPrintWriter writer;\\n\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tlong tbegin = System.currentTimeMillis();\\n\\t\\t\\treader = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\t\\/\\/reader = new BufferedReader(new InputStreamReader(new FileInputStream(\\\"test.inp\\\")));\\n\\t\\t\\ttokenizer = null;\\n\\t\\t\\twriter = new PrintWriter(System.out);\\n\\t\\t\\t\\/\\/writer = new PrintWriter(new FileOutputStream(\\\"test.out\\\"));\\n\\t\\t\\tsolve();\\n\\t\\t\\t\\/\\/reader.close();\\n\\t\\t\\t\\/\\/System.out.println(System.currentTimeMillis() - tbegin + \\\"ms\\\");\\n\\t\\t\\twriter.close();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(1);\\n\\t\\t}\\n\\t}\\n\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tlong nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tdouble nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n\\n\\tString nextToken() throws IOException {\\n\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\t}\\n\\t\\treturn tokenizer.nextToken();\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.text.*;\\nimport java.math.*;\\nimport static java.lang.Integer.*;\\nimport static java.lang.Double.*;\\nimport java.lang.Math.*;\\n\\npublic class A {\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tnew A().run();\\n\\t}\\n\\n\\tpublic void run() throws Exception {\\n\\t\\tFastIO file = new FastIO();\\n\\t\\tint n = file.nextInt();\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) a[i] = file.nextInt();\\n\\t\\tArrays.sort(a);\\n\\t\\tboolean[] used = new boolean[n];\\n\\t\\tint count = 0;\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tif (!used[i]) {\\n\\t\\t\\t\\tcount++;\\n\\t\\t\\t\\tfor (int j = i; j < n; j++) {\\n\\t\\t\\t\\t\\tif (a[j] % a[i] == 0) {\\n\\t\\t\\t\\t\\t\\tused[j] = true;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(count);\\n\\t}\\n\\n\\tpublic static class FastIO {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic FastIO() {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\n\\t\\tString next() {\\n\\t\\t\\twhile (st == null || !st.hasMoreElements()) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tint nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tlong nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tString nextLine() {\\n\\t\\t\\tString str = \\\"\\\";\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tstr = br.readLine();\\n\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t\\treturn str;\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static long pow(long n, long p, long mod) {\\n\\t\\tif (p == 0)\\n\\t\\t\\treturn 1;\\n\\t\\tif (p == 1)\\n\\t\\t\\treturn n % mod;\\n\\t\\tif (p % 2 == 0) {\\n\\t\\t\\tlong temp = pow(n, p \\/ 2, mod);\\n\\t\\t\\treturn (temp * temp) % mod;\\n\\t\\t} else {\\n\\t\\t\\tlong temp = pow(n, (p - 1) \\/ 2, mod);\\n\\t\\t\\ttemp = (temp * temp) % mod;\\n\\t\\t\\treturn (temp * n) % mod;\\n\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static long pow(long n, long p) {\\n\\t\\tif (p == 0)\\n\\t\\t\\treturn 1;\\n\\t\\tif (p == 1)\\n\\t\\t\\treturn n;\\n\\t\\tif (p % 2 == 0) {\\n\\t\\t\\tlong temp = pow(n, p \\/ 2);\\n\\t\\t\\treturn (temp * temp);\\n\\t\\t} else {\\n\\t\\t\\tlong temp = pow(n, (p - 1) \\/ 2);\\n\\t\\t\\ttemp = (temp * temp);\\n\\t\\t\\treturn (temp * n);\\n\\n\\t\\t}\\n\\t}\\n\\n\\tpublic... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A558 {\\n static BufferedReader in = null;\\n static PrintWriter out = null;\\n static StringTokenizer st = new StringTokenizer(\\\"\\\");\\n\\n public static void main(String[] args) {\\n try {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n solve();\\n out.close();\\n } catch (Exception e) {\\n e.printStackTrace();\\n }\\n }\\n\\n public static String readString() {\\n while (!st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(in.readLine(), \\\" \\\\n\\\\r\\\\t:\\\");\\n } catch (Exception e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n\\n public static int readInt() {\\n return Integer.parseInt(readString());\\n }\\n\\n public static long readLong() {\\n return Long.parseLong(readString());\\n }\\n\\n private static int MAX_VALUE = Integer.MAX_VALUE - 10000000;\\n private static int[] dp;\\n private static int[] parents;\\n private static int[] powers;\\n private static int[] x;\\n private static int[] y;\\n private static int[][] dist;\\n private static int[] distFrom0;\\n\\n private static void solve() throws IOException {\\n int x0 = readInt();\\n int y0 = readInt();\\n int n = readInt();\\n long time = System.currentTimeMillis();\\n x = new int[n];\\n y = new int[n];\\n for (int i = 0; i < n; i++) {\\n x[i] = readInt() - x0;\\n y[i] = readInt() - y0;\\n }\\n dist = new int[n][n];\\n distFrom0 = new int[n];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) {\\n dist[i][j] = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]);\\n }\\n }\\n for (int i = 0; i < n; i++) {\\n distFrom0[i] = x[i] * x[i] + y[i] * y[i];\\n }\\n powers = new int[n + 1];\\n powers[0] = 1;\\n for (int i = 1; i < n + 1; i++) {\\n powers[i] = powers[i - 1] * 2;\\n }\\n int maxMask = 1 << n;\\n dp = new int[maxMask];\\n parents = new int[maxMask];\\n Arrays.fill(dp, MAX_VALUE);\\n dp[0] = 0;\\n for (int i = 0; i < maxMask; i++) {\\n ... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Codeforces\\n{\\n public static void main(String args[])throws Exception\\n {\\n BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));\\n StringBuilder sb=new StringBuilder();\\n int t=Integer.parseInt(bu.readLine());\\n while(t-->0)\\n {\\n int n=Integer.parseInt(bu.readLine());\\n int cur[]=new int[n],i,cr=-1;\\n for(i=0;i=0;j--)\\n if(cur[j]==d-1) {f=j; break;}\\n\\n if(f==-1)\\n {\\n cr++;\\n f=cr;\\n }\\n cur[f]=d;\\n cr=f;\\n for(j=f+1;j 0)\\n solve();\\n out.flush();\\n out.close();\\n }\\n void solve(){\\n int n = h.ni();\\n long[] arr = new long[n];\\n int i = 0, j = 0;\\n for(i = 0; i < n; i++)\\n arr[i] = h.nl();\\n HashMap hmap = new HashMap();\\n int cnt = 0;\\n for(i = 0; i < n; i++){\\n long sum = 0;\\n for(j = i; j < n; j++){\\n sum += arr[j];\\n Integer x = hmap.get(sum);\\n if(x == null)\\n hmap.put(sum, cnt++);\\n }\\n }\\n TreeSet[] tset = new TreeSet[cnt];\\n for(i = 0; i < cnt; i++)\\n tset[i] = new TreeSet(com);\\n for(i = 0; i < n; i++){\\n long sum = 0;\\n for(j = i; j < n; j++){\\n sum += arr[j];\\n tset[hmap.get(sum)].add(new Pair(i, j));\\n }\\n }\\n int max = 0;\\n int ind = -1;\\n int max_x = 0, max_y = 0;\\n for(i = 0; i < cnt; i++){\\n \\tint curr_y = tset[i].first().y;\\n \\tint cnt1 = 1;\\n for(Pair yo : tset[i]){\\n if(yo.x > curr_y) {\\n \\tcnt1++;\\n \\tcurr_y = yo.y;\\n }\\n }\\n if(max < cnt1) {\\n \\tmax = cnt1;\\n \\tind = i;\\n }\\n }\\n h.pn(max);\\n Pair hola_yee = new... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n static Map mp = new HashMap();\\n\\n public static void main(String[] args) {\\n mp.clear();\\n Scanner cin = new Scanner(new BufferedInputStream(System.in));\\n BigInteger n = cin.nextBigInteger();\\n BigInteger x = cin.nextBigInteger();\\n mp.put(x, BigInteger.ONE);\\n BigInteger sum = x;\\n BigInteger ans = BigInteger.ZERO;\\n for (int i = 2;i <= n.intValue(); i++) {\\n x=cin.nextBigInteger();\\n BigInteger tmp = x.multiply(BigInteger.valueOf(i-1)).subtract(sum);\\n if (mp.containsKey(x.subtract(BigInteger.ONE))) tmp = tmp.subtract(mp.get(x.subtract(BigInteger.ONE)));\\n if (mp.containsKey(x.add(BigInteger.ONE))) tmp = tmp.add(mp.get(x.add(BigInteger.ONE)));\\n ans = ans.add(tmp);\\n sum = sum.add(x);\\n BigInteger xx;\\n if (mp.containsKey(x)) xx = mp.get(x);\\n else xx = BigInteger.ZERO;\\n mp.put(x, xx.add(BigInteger.ONE));\\n }\\n System.out.println(ans);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\/\\/\\tstatic Scanner in;\\n\\tstatic PrintWriter out;\\n\\tstatic BufferedReader in;\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\/\\/\\t\\tin = new Scanner(System.in);\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\n\\t\\tint n = new Integer(in.readLine());\\n\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tString s = in.readLine();\\n\\t\\t\\tint x = 0;\\n\\t\\t\\twhile (s.charAt(x) - 'A' >= 0 && s.charAt(x) - 'Z' <= 0) x++;\\n\\t\\t\\tint y = s.length() - 1;\\n\\t\\t\\twhile (s.charAt(y) - '0' >= 0 && s.charAt(y) - '9' <= 0) y--;\\n\\n\\t\\t\\tif (x > y) {\\n\\t\\t\\t\\tint k = 1;\\n\\t\\t\\t\\tint a = 1;\\n\\t\\t\\t\\tfor (int j = 1; j < x; j++) {\\n\\t\\t\\t\\t\\tk *= 26;\\n\\t\\t\\t\\t\\ta += k;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tfor (int j = 0; j < x; j++) {\\n\\t\\t\\t\\t\\ta += k*(s.charAt(j) - 'A');\\n\\t\\t\\t\\t\\tk \\/= 26;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tint b = Integer.parseInt(s.substring(x));\\n\\t\\t\\t\\tout.println(\\\"R\\\" + b + \\\"C\\\" + a);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\twhile (s.charAt(x) - '0' >= 0 && s.charAt(x) - '9' <= 0) x++;\\n\\t\\t\\t\\tint b = Integer.parseInt(s.substring(1, x));\\n\\t\\t\\t\\tint a = Integer.parseInt(s.substring(x + 1));\\n\\t\\t\\t\\tint num = 0;\\n\\t\\t\\t\\tint k = 1;\\n\\t\\t\\t\\twhile (a >= k) {\\n\\t\\t\\t\\t\\ta -= k;\\n\\t\\t\\t\\t\\tk *= 26;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tk \\/= 26;\\n\\t\\t\\t\\twhile (k > 0) {\\t\\n\\t\\t\\t\\t\\tout.print((char)('A' + (a\\/k)));\\n\\t\\t\\t\\t\\ta %= k;\\n\\t\\t\\t\\t\\tk \\/= 26;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tout.println(b);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.close();\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.OutputStreamWriter;\\nimport java.io.BufferedWriter;\\nimport java.util.Comparator;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.Writer;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.math.BigInteger;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Egor Kulikov (egor@egork.net)\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tOutputWriter out = new OutputWriter(outputStream);\\n\\t\\tTaskA solver = new TaskA();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskA {\\n\\tpublic void solve(int testNumber, InputReader in, OutputWriter out) {\\n\\t\\tint count = in.readInt();\\n\\t\\tint[] array = IOUtils.readIntArray(in, count);\\n\\t\\tint[] sorted = array.clone();\\n\\t\\tArrayUtils.sort(sorted, IntComparator.DEFAULT);\\n\\t\\tint differs = 0;\\n\\t\\tfor (int i = 0; i < count; i++) {\\n\\t\\t\\tif (array[i] != sorted[i])\\n\\t\\t\\t\\tdiffers++;\\n\\t\\t}\\n\\t\\tif (differs <= 2)\\n\\t\\t\\tout.printLine(\\\"YES\\\");\\n\\t\\telse\\n\\t\\t\\tout.printLine(\\\"NO\\\");\\n\\t}\\n}\\n\\nclass InputReader {\\n\\n\\tprivate InputStream stream;\\n\\tprivate byte[] buf = new byte[1024];\\n\\tprivate int curChar;\\n\\tprivate int numChars;\\n\\tprivate SpaceCharFilter filter;\\n\\n\\tpublic InputReader(InputStream stream) {\\n\\t\\tthis.stream = stream;\\n\\t}\\n\\n\\tpublic int read() {\\n\\t\\tif (numChars == -1)\\n\\t\\t\\tthrow new InputMismatchException();\\n\\t\\tif (curChar >= numChars) {\\n\\t\\t\\tcurChar = 0;\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tnumChars = stream.read(buf);\\n\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t}\\n\\t\\t\\tif (numChars <= 0)\\n\\t\\t\\t\\treturn -1;\\n\\t\\t}\\n\\t\\treturn buf[curChar++];\\n\\t}\\n\\n\\tpublic int readInt() {\\n\\t\\tint c = read();\\n\\t\\twhile (isSpaceChar(c))\\n\\t\\t\\tc = read();\\n\\t\\tint sgn = 1;\\n\\t\\tif (c == '-') {\\n\\t\\t\\tsgn = -1;\\n\\t\\t\\tc = read();\\n\\t\\t}\\n\\t\\tint res = 0;\\n\\t\\tdo {\\n\\t\\t\\tif (c < '0' || c > '9')\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\tres *= 10;\\n\\t\\t\\tres += c - '0';\\n\\t\\t\\tc = read();\\n\\t\\t} while... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class B {\\n static int n;\\n static double A;\\n static int[] L;\\n static int[] B;\\n static double max = 0;\\n\\n public static void rec(int index, int k) {\\n if (k < 0)\\n return;\\n if (index == n) {\\n double prob = 0;\\n for (int i = 0; i < (1 << n); i++) {\\n double b = 0;\\n double temp = 1.0;\\n for (int j = 0; j < n; j++) {\\n if (L[j] > 100)\\n return;\\n if ((i & (1 << j)) == 0) {\\n b += B[j];\\n temp *= (100 - L[j]) \\/ 100.0;\\n } else\\n temp *= L[j] \\/ 100.0;\\n }\\n if (Integer.bitCount(i) * 2 <= n)\\n temp *= A \\/ (A + b);\\n prob += temp;\\n\\n }\\n max = Math.max(max, prob);\\n return;\\n }\\n L[index] += 10;\\n rec(index, k - 1);\\n L[index] -= 10;\\n rec(index + 1, k);\\n }\\n\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n n = in.nextInt();\\n int k = in.nextInt();\\n A = in.nextDouble();\\n B = new int[n];\\n L = new int[n];\\n for (int i = 0; i < n; i++) {\\n B[i] = in.nextInt();\\n L[i] = in.nextInt();\\n }\\n rec(0, k);\\n System.out.println(max);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.util.Map.Entry;\\nimport java.io.*;\\nimport java.lang.reflect.Array;\\nimport java.math.*;\\nimport java.security.SecureRandom;\\n\\npublic class WCS {\\n\\t\\n\\tpublic static class Vector implements Comparable {\\n\\t\\tlong x, y;\\n\\t\\tint position;\\n\\t\\tVector first, second;\\n\\t\\tboolean toReverse;\\n\\t\\t\\n\\t\\tpublic Vector(long xx, long yy, int p) {\\n\\t\\t\\tx = xx;\\n\\t\\t\\ty = yy;\\n\\t\\t\\tposition = p;\\n\\t\\t\\tfirst = null;\\n\\t\\t\\tsecond = null;\\n\\t\\t\\ttoReverse = false;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic Vector negate() {\\n\\t\\t\\tVector vv = new Vector(-x, -y, position);\\n\\t\\t\\tvv.first = first;\\n\\t\\t\\tvv.second = second;\\n\\t\\t\\tvv.toReverse = !toReverse;\\n\\t\\t\\treturn vv;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic Vector add(Vector v) {\\n\\t\\t\\tVector sum = new Vector(this.x + v.x, this.y + v.y, position);\\n\\t\\t\\tsum.first = this;\\n\\t\\t\\tsum.second = v;\\n\\t\\t\\treturn sum;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic Vector subtract(Vector v) {\\n\\t\\t\\treturn this.add(v.negate());\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic double euclideanNorm() {\\n\\t\\t\\treturn Math.sqrt(x * x + y * y);\\n\\t\\t}\\n\\t\\t\\n\\t\\t@Override\\n\\t\\tpublic int compareTo(Vector v) {\\n\\t\\t\\tdouble thisa = Math.atan2(this.y, this.x);\\n\\t\\t\\tdouble va = Math.atan2(v.y, v.x);\\n\\t\\t\\tif(thisa < 0)\\n\\t\\t\\t\\tthisa += 2 * Math.PI;\\n\\t\\t\\tif(va < 0)\\n\\t\\t\\t\\tva += 2 * Math.PI;\\n\\t\\t\\tif(thisa < va)\\n\\t\\t\\t\\treturn -1;\\n\\t\\t\\tif(thisa > va)\\n\\t\\t\\t\\treturn 1;\\n\\t\\t\\treturn Integer.compare(this.position, v.position);\\n\\t\\t}\\n\\t\\t\\n\\t\\t@Override\\n\\t\\tpublic String toString() {\\n\\t\\t\\treturn x + \\\" \\\" + y;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static void dfs(Vector curr, int[] ans) {\\n\\t\\tif(curr.first == null) {\\n\\t\\t\\tans[curr.position] = curr.toReverse ? -1 : 1;\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tcurr.first.toReverse ^= curr.toReverse;\\n\\t\\tcurr.second.toReverse ^= curr.toReverse;\\n\\t\\tdfs(curr.first, ans);\\n\\t\\tdfs(curr.second, ans);\\n\\t}\\n\\t\\n\\tpublic static boolean ok(Vector v1, Vector v2) {\\n\\t\\treturn v1.add(v2).euclideanNorm() <= Math.max(v1.euclideanNorm(), v2.euclideanNorm());\\n\\t}\\n\\t\\n\\tpublic static void stop(long k) {\\n\\t\\tlong time = System.currentTimeMillis();\\n\\t\\twhile(System.currentTimeMillis() - time < k);\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tint n = in.nextInt();\\n\\t\\tTreeSet vectors = new TreeSet <>... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedInputStream;\\nimport java.io.PrintStream;\\nimport java.util.Scanner;\\n\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner in=new Scanner(new BufferedInputStream(System.in));\\n\\t\\tPrintStream out=System.out;\\n\\t\\tint n=in.nextInt();\\n\\t\\tif (n>=0) out.println(n);\\n\\t\\telse out.println(Math.max(-((-n)\\/10), -((-n)\\/100*10+(-n)%10)));\\n\\t\\tout.close();\\n\\t\\tin.close();\\n\\t}\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.math.*;\\npublic class codeforces {\\n\\t public static void main(String[] args)\\n\\t{\\n\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\tint n=sc.nextInt();\\n\\t\\tint[] data=new int[n];\\n\\t\\tfor(int i=0;i() { \\n\\t\\t\\t\\t@Override public int compare(Pair p1, Pair p2) \\n\\t\\t\\t\\t{ \\n\\t\\t\\t\\t\\tif(p1.start>p2.start)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\treturn 1;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse if(p1.start==p2.start)\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\treturn 0;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\t\\treturn -1;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t} \\n\\t\\t\\t}); *\\/\\n\\t\\t}\\n\\t\\t\\n\\t}\\n\\t\\n\\t\\n\\tpublic static long pow(long a, long b)\\n\\t{\\n\\t\\tlong result=1;\\n\\t\\twhile(b>0)\\n\\t\\t{\\n\\t\\t\\tif (b % 2 != 0)\\n\\t\\t\\t{\\n\\t\\t\\t\\tresult=(result*a)%998244353;\\n\\t\\t\\t\\tb--;\\n\\t\\t\\t} \\n\\t\\t\\ta=(a*a)%998244353;\\n\\t\\t\\tb \\/= 2;\\n\\t\\t} \\n\\t\\treturn result;\\n\\t}\\n\\tpublic static long fact(long num)\\n\\t{\\n\\t\\t\\t\\tlong value=1;\\n\\t\\t\\t\\tint i=0;\\n\\t\\t\\t\\tfor(i=2;i= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new UnknownError();\\n }\\n if (numChars <= 0) {\\n return -1;\\n... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/* \\n * UMANG PANCHAL\\n * DAIICT\\n *\\/\\nimport java.util.*;\\nimport java.io.*;\\nimport java.math.BigInteger;\\npublic class Main\\n{\\n \\n\\tstatic LinkedList adj[];\\n\\tstatic ArrayList adj1[];\\n\\tstatic int[] color,visited1;\\n\\tstatic boolean b[],visited[],possible;\\n\\tstatic int level[];\\n\\tstatic Map> s;\\n\\tstatic int totalnodes,colored;\\n\\tstatic int count[];\\n\\tstatic long sum[];\\n\\tstatic int nodes;\\n\\tstatic double ans=0;\\n\\tstatic long[] as=new long[10001];\\n\\tstatic long c1=0,c2=0;\\n\\tstatic int[] a,d,k;\\n\\tstatic int max=100000000;\\n\\tstatic long MOD = (long)1e9 + 7,sm=0,m=Long.MIN_VALUE;\\n\\tstatic boolean[] prime=new boolean[1000005];\\n\\tstatic int[] levl;\\n static int[] eat;\\n static int price[];\\n static int size[],res[],par[];\\n static int result=0;\\n\\t\\/\\/ --------------------My Code Starts Here----------------------\\n\\t\\n\\tpublic static void main(String[] args) throws IOException\\n\\t{\\n\\t\\tin=new InputReader(System.in);\\n\\t\\tw=new PrintWriter(System.out);\\n\\t\\t int n=ni();\\n\\t\\t int[] a=na(n);\\n\\t\\t int ans=0;\\n\\t\\t for(int i=0;i0)\\n\\t\\t {\\n\\t\\t\\t int l=ni(),r=ni();\\n\\t\\t\\t int range=r-l+1;\\n\\t\\t\\t range=range*(range-1)\\/2;\\n\\t\\t\\t range=range%2;\\n\\t\\t\\t ans=(ans+range)%2;\\n\\t\\t\\t if(ans==1)\\n\\t\\t\\t\\t w.println(\\\"odd\\\");\\n\\t\\t\\t else\\n\\t\\t\\t\\t w.println(\\\"even\\\");\\n\\t\\t }\\n w.close();\\n }\\n\\t\\n\\t\\n\\t\\n\\tpublic static long nCrModp(long n, long r, long p)\\n\\t{\\n\\t \\n\\t long[] C=new long[(int)r+1];\\n\\t \\n\\t \\n\\t C[0] = 1; \\n\\t \\n\\t for (long i = 1; i <= n; i++)\\n\\t {\\n\\t \\n\\t for (long j = Math.min(i, r); j > 0; j--)\\n\\t \\n\\t \\n\\t C[(int)j] = (C[(int)j] + C[(int)(j-1)])%p;\\n\\t }\\n\\t return C[(int)r];\\n\\t}\\n\\tpublic static long nCr(long n, long r)\\n\\t{\\n\\t\\tlong x=1;\\n\\t\\tfor(long i=n;i>=n-r+1;i--)\\n\\t\\t\\tx=((x)*(i));\\n\\t\\tfor(long i=r;i>=1;i--)\\n\\t\\t\\tx=((x)\\/(i));\\n\\t\\t\\n\\t\\treturn x%MOD;\\n\\t}\\n\\tpublic static long nCrModpDP(long n, long r, long p)\\n\\t{\\n\\t\\n\\t long[] C=new long[(int)r+1];\\n\\t \\n\\t C[0] = 1; \\n\\t \\n\\t \\n\\t for (long i = 1; i <= n;... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.text.DecimalFormat;\\nimport java.util.Scanner;\\n\\n\\/**\\n *\\n * @author Alvaro\\n *\\/\\npublic class Main{\\n public static int n;\\n public static double [] dp;\\n public static double [][] p;\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n n = in.nextInt();\\n dp = new double[1<-0.5) return dp[mask];\\n dp[mask] = 0;\\n int vivos = 1;\\n for (int i = 0; i < n; i++) \\n if((mask>>i)%2==1) vivos++;\\n double pares = (vivos*(vivos-1))\\/2;\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) {\\n if((mask&(1< 0) {\\n int n = in.ni();\\n LinkedList l = new LinkedList<>();\\n ArrayList> al = new ArrayList<>();\\n for (int i = 0; i < n; i++) {\\n int p = in.ni();\\n if (p == 1) {\\n l.addFirst(1);\\n } else {\\n while (true) {\\n if (l.peekFirst() == p - 1) {\\n l.addFirst(l.removeFirst() + 1);\\n break;\\n } else {\\n l.removeFirst();\\n }\\n }\\n }\\n al.add(new LinkedList<>(l));\\n }\\n for (LinkedList ll : al) {\\n while (ll.size() > 1) {\\n System.out.print(ll.removeLast() + \\\".\\\");\\n }\\n System.out.println(ll.remove());\\n }\\n System.out.println();\\n }\\n in.bw.flush();\\n }\\n\\n static boolean willbealive(int i, int a[]) {\\n if (i < 0 || i >= a.length)\\n return false;\\n if (a.length == 1)\\n return false;\\n if (a[i] == 1)\\n return false;\\n if (i == 0)\\n return a[1] == 1;\\n else if (i == a.length - 1)\\n return a[i - 1] == 1;\\n else\\n return (a[i - 1] == 1) ^ (a[i... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n FastReader in = new FastReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n E2RotateColumnsHardVersion solver = new E2RotateColumnsHardVersion();\\n int testCount = Integer.parseInt(in.next());\\n for (int i = 1; i <= testCount; i++)\\n solver.solve(i, in, out);\\n out.close();\\n }\\n\\n static class E2RotateColumnsHardVersion {\\n public void solve(int testNumber, FastReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int m = in.nextInt();\\n E2RotateColumnsHardVersion.Column[] columns = new E2RotateColumnsHardVersion.Column[m];\\n for (int i = 0; i < columns.length; ++i) columns[i] = new E2RotateColumnsHardVersion.Column(new int[n]);\\n for (int i = 0; i < n; ++i) {\\n for (int j = 0; j < m; ++j) {\\n columns[j].v[i] = in.nextInt();\\n if (i == n - 1) columns[j].initMax();\\n }\\n }\\n Arrays.sort(columns, (o1, o2) -> o2.max - o1.max);\\n if (columns.length > n)\\n columns = Arrays.copyOf(columns, n);\\n\\n long[] dp = new long[1 << n];\\n for (E2RotateColumnsHardVersion.Column c : columns) {\\n long[] ndp = new long[1 << n];\\n System.arraycopy(dp, 0, ndp, 0, dp.length);\\n\\n for (int rot = 0; rot < n; ++rot) {\\n long[] temp = new long[1 << n];\\n System.arraycopy(dp, 0, temp, 0, dp.length);\\n for (int i = 0, pos = rot; i < n; ++i, ++pos) {\\n if (pos >= n)... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class RGBSubstring {\\n public static void main(String[] args) {\\n FastScanner scanner = new FastScanner();\\n PrintWriter out = new PrintWriter(System.out);\\n int Q = scanner.nextInt();\\n while(Q-->0) {\\n int N = scanner.nextInt();\\n int K = scanner.nextInt();\\n String s1 = \\\"RGB\\\";\\n String s2 = \\\"GBR\\\";\\n String s3 = \\\"BRG\\\";\\n char[] arr = scanner.next().toCharArray();\\n int[] cnts = new int[3];\\n for(int i = 0; i < K; i++) {\\n int ind = i % 3;\\n if (arr[i] != s1.charAt(ind)) cnts[0]++;\\n if (arr[i] != s2.charAt(ind)) cnts[1]++;\\n if (arr[i] != s3.charAt(ind)) cnts[2]++;\\n }\\n int ans = Math.min(Math.min(cnts[0], cnts[1]), cnts[2]);\\n for(int i = K; i < N; i++) {\\n int ind = (K-1)%3;\\n int[] nextCnts = new int[3];\\n nextCnts[1] = cnts[0];\\n nextCnts[2] = cnts[1];\\n nextCnts[0] = cnts[2];\\n if ('R' != arr[i-K]) nextCnts[1]--;\\n if ('G' != arr[i-K]) nextCnts[2]--;\\n if ('B' != arr[i-K]) nextCnts[0]--;\\n if (arr[i] != s1.charAt(ind)) nextCnts[0]++;\\n if (arr[i] != s2.charAt(ind)) nextCnts[1]++;\\n if (arr[i] != s3.charAt(ind)) nextCnts[2]++;\\n cnts = nextCnts;\\n for(int j = 0; j < 3; j++) ans = Math.min(ans, cnts[j]);\\n }\\n out.println(ans);\\n }\\n out.flush();\\n }\\n \\n public static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n \\n public FastScanner(Reader in) {\\n br = new BufferedReader(in);\\n }\\n \\n public FastScanner() {\\n this(new InputStreamReader(System.in));\\n }\\n \\n String next() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.util.List;\\nimport java.util.Scanner;\\nimport java.util.Vector;\\n\\npublic class Main {\\n\\t\\n\\tprivate static final int SIM = 1;\\n\\tprivate static final int NAO = 2;\\n\\t\\n\\tpublic static void main(String[] args) {\\n\\n\\t\\tScanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\\n\\t\\t\\n\\t\\tint n = in.nextInt();\\n\\t\\tint m = in.nextInt();\\n\\t\\tint[][] a = new int[n][m];\\n\\t\\tint[][] graphVerticial = null;\\n\\t\\tint[][] graphDiagonal = null;\\n\\t\\t\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\tfor(int j = 0; j < m; j++) {\\n\\t\\t\\t\\ta[i][j] = in.nextInt();\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tgraphVerticial = createGraphVertical(n, m, a);\\n\\t\\tgraphDiagonal = createGraphDiagonal(n, m, a);\\n\\t\\t\\n\\/\\/\\t\\tprint(graphVerticial);\\n\\/\\/\\t\\tSystem.out.println(\\\"##########################\\\");\\n\\/\\/\\t\\tprint(graphDiagonal);\\n\\t\\t\\n\\t\\tint result = 0;\\n\\t\\tint k = 1;\\n\\t\\tint piso = 0;\\n\\t\\tint teto = 1000000000;\\n\\t\\t\\n\\t\\twhile(true) {\\n\\t\\t\\t\\n\\t\\t\\tk = (int) Math.ceil((teto - piso) \\/ 2.0) + piso;\\n\\t\\t\\t\\n\\t\\t\\tif(isOk(n, k, graphVerticial, graphDiagonal)) {\\n\\t\\t\\t\\tresult = Math.max(result, k);\\n\\t\\t\\t\\tpiso = k;\\n\\t\\t\\t}\\n\\t\\t\\telse{\\n\\t\\t\\t\\tteto = k - 1;\\n\\t\\t\\t}\\n\\n\\t\\t\\t\\/\\/System.out.println(piso + \\\", \\\" + teto);\\n\\t\\t\\t\\n\\t\\t\\tif(teto <= piso) break;\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(result);\\n\\t\\t\\n\\t}\\n\\t\\n\\tpublic static int[][] createGraphVertical(int n, int m, int[][] a){\\n\\t\\t\\n\\t\\tint[][] graph = new int[n][n];\\n\\t\\t\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\t\\n\\t\\t\\tfor(int j = 0; j < n; j++) {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif(i == j) continue;\\n\\t\\t\\t\\tif(i > j) {graph[i][j] = graph[j][i]; continue;}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tgraph[i][j] = Integer.MAX_VALUE;\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tfor(int k = 0; k < m; k++) {\\n\\t\\t\\t\\t\\tgraph[i][j] = Math.min(graph[i][j], Math.abs(a[i][k] - a[j][k]));\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn graph;\\n\\t}\\n\\t\\n\\tpublic static int[][] createGraphDiagonal(int n, int m, int[][] a){\\n\\t\\t\\n\\t\\tint[][] graph = new int[n][n];\\n\\t\\t\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\t\\n\\t\\t\\tfor(int j = 0; j < n; j++) {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tgraph[i][j] = Integer.MAX_VALUE;\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tfor(int k = 0; k < m - 1; k++) {\\n\\t\\t\\t\\t\\tgraph[i][j] = Math.min(graph[i][j], Math.abs(a[j][k] - a[i][k + 1]));\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.FileInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.StringTokenizer;\\n\\npublic class Main {\\n\\n public static void main(String[] args) throws Exception {\\n \\/\\/System.setIn(new FileInputStream(\\\"1\\\"));\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n\\n solve();\\n\\n in.close();\\n out.close();\\n }\\n\\n private static void solve() throws Exception {\\n int n = nextInt();\\n boolean[] use = new boolean[500];\\n ArrayList a = new ArrayList();\\n for (int i = 0; i < n; i++) {\\n int v = nextInt();\\n if (!use[250 + v]) {\\n use[250 + v] = true;\\n a.add(v);\\n }\\n }\\n Collections.sort(a);\\n if (a.size() < 2) {\\n out.println(\\\"NO\\\");\\n } else {\\n out.println(a.get(1));\\n }\\n }\\n\\n static BufferedReader in;\\n static PrintWriter out;\\n static StringTokenizer st;\\n\\n static String nextString() throws IOException {\\n while (st == null || !st.hasMoreTokens()) {\\n st = new StringTokenizer(in.readLine());\\n }\\n return st.nextToken();\\n }\\n\\n static int nextInt() throws IOException {\\n return Integer.parseInt(nextString());\\n }\\n\\n static double nextDouble() throws IOException {\\n return Double.parseDouble(nextString());\\n }\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.File;\\nimport java.io.FileInputStream;\\nimport java.io.FileNotFoundException;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\n\\npublic class Main {\\n\\n\\tpublic static void main(String[] args) throws FileNotFoundException {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\t\\tScanner read = new Scanner(new FileInputStream(new File(\\\"input.txt\\\")));\\n\\t\\tPrintWriter out = new PrintWriter(new File(\\\"output.txt\\\"));\\n\\t\\tint n = read.nextInt(), m = read.nextInt(), k = read.nextInt(), tree[][] = new int[n][m], a[] = new int[k],\\n\\t\\t\\t\\tb[] = new int[k], x = 0, y = 0, max = -1, d = 0;\\n\\n\\t\\tfor (int i = 0; i < k; i++) {\\n\\t\\t\\ta[i] = read.nextInt() - 1;\\n\\t\\t\\tb[i] = read.nextInt() - 1;\\t\\n\\t\\t\\ttree[a[i]][b[i]] = 0;\\n\\t\\t}\\n\\t\\tfor(int i = 0; i < n; i++){\\n\\t\\t\\tArrays.fill(tree[i], Integer.MAX_VALUE);\\n\\t\\t}\\n\\t\\tfor (int o = 0; o < k; o++) {\\n\\t\\t\\tfor(int i = 0; i < n; i++){\\n\\t\\t\\t\\tfor(int j = 0; j < m; j++){\\n\\t\\t\\t\\t\\td = Math.abs(a[o] - i) + Math.abs(b[o] - j);\\n\\t\\t\\t\\t\\tif(d < tree[i][j])\\n\\t\\t\\t\\t\\t\\ttree[i][j] = d;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor(int i = 0; i max){\\n\\t\\t\\t\\t\\tmax= tree[i][j];\\n\\t\\t\\t\\t\\tx= i;\\n\\t\\t\\t\\t\\ty = j;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(x + 1 + \\\" \\\" + (y + 1));\\n\\t\\tout.close();\\n\\t}\\n\\n} What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class MainClass {\\n\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n int arr[] = {4,7,47,74,447,474,477,744,747,774};\\n int i=0, x = in.nextInt();\\n while (i=0) {\\n\\t\\t\\t\\t\\tdouble del= Math.sqrt(rr);\\n\\t\\t\\t\\t\\tres[i]= Math.max(res[i], res[j]+del);\\n\\t\\t\\t\\t\\tfound= true;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif(!found) {\\n\\t\\t\\t\\tres[i]= r;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor (int i = 0; i < res.length; i++) {\\n\\t\\t\\tout.print(res[i]+\\\" \\\");\\n\\t\\t}\\n\\t\\tout.close();\\n\\t\\t\\n\\t}\\n\\tstatic class FastScanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic FastScanner(InputStream in) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(in));\\n\\t\\t\\tst = new StringTokenizer(\\\"\\\");\\n\\t\\t}\\n\\n\\t\\tpublic String next() throws IOException {\\n\\t\\t\\tif (!st.hasMoreTokens()) {\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t\\treturn next();\\n\\t\\t\\t}\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\t\\tpublic double nextDouble() throws NumberFormatException, IOException {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\t\\tpublic long nextLong() throws IOException {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\t}\\n}\\n Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public int mod = 1000000007;\\n public int MAXN = 333;\\n public int[][] w1;\\n public long[] fact;\\n public long[] ifact;\\n\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n long[][] e = Factorials.getFIF(MAXN, mod);\\n fact = e[0];\\n ifact = e[1];\\n w1 = new int[MAXN][MAXN];\\n w1[0][0] = 1;\\n for (int i = 1; i < MAXN; i++) {\\n for (int j = 1; j < MAXN; j++) {\\n for (int k = 1; k <= i; k++) {\\n w1[i][j] += w1[i - k][j - 1];\\n if (w1[i][j] >= mod) w1[i][j] -= mod;\\n }\\n }\\n }\\n\\n int n = in.nextInt();\\n int[] arr = in.readIntArray(n);\\n boolean[] marked = new boolean[n];\\n int[] fs = new int[n];\\n int fidx = 0;\\n for (int i = 0; i < n; i++) {\\n if (marked[i]) continue;\\n int count = 0;\\n for (int j = 0; j < n; j++) {\\n if (isSquare(1L * arr[i] * arr[j])) {\\n if (marked[j]) System.exit(1);\\n marked[j] = true;\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\n\\/\\/ VK Cup 2012 Round2 Unofficial Div2 Edition\\npublic class Main {\\n\\t\\n\\tvoid A(){\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tint n = sc.nextInt();\\n\\t\\tint a = sc.nextInt();\\n\\t\\tint b = sc.nextInt();\\n\\t\\tint[] h = new int[n];\\n\\t\\tfor(int i=0; i> 1;\\n cnt += divide(b, mid);\\n cnt += divide(mid + 1, e);\\n cnt += merge(b, mid, e);\\n return cnt;\\n }\\n\\n static long merge(int b, int mid, int e) {\\n long cnt = 0;\\n int len = e - b + 1;\\n int[] tmp = new int[len];\\n int i = b, j = mid + 1;\\n for (int k = 0; k < len; k++) {\\n if (i == mid + 1 || (j != e + 1 && a[i] > a[j])) {\\n tmp[k] = a[j++];\\n cnt += (mid + 1 - i);\\n } else tmp[k] = a[i++];\\n }\\n for (int k = 0; k < len; k++)\\n a[b + k] = tmp[k];\\n return cnt;\\n }\\n\\n static class Scanner {\\n\\n StringTokenizer st;\\n BufferedReader br;\\n\\n public Scanner(InputStream system) {\\n br = new BufferedReader(new InputStreamReader(system));\\n }\\n\\n\\n public String next() throws IOException {\\n while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());\\n return st.nextToken();\\n }\\n\\n public String nextLine() throws IOException {\\n return br.readLine();\\n }\\n\\n public int nextInt() throws IOException {\\n return Integer.parseInt(next());\\n ... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.awt.Checkbox;\\nimport java.awt.Point;\\nimport java.io.*;\\n import java.math.*;\\n import java.util.*;\\nimport java.util.Map.Entry;\\n\\nimport javax.print.attribute.SetOfIntegerSyntax;\\nimport javax.swing.plaf.FontUIResource;\\n\\n\\n \\n public class CODE2{\\n private static InputStream stream;\\n private static byte[] buf = new byte[1024];\\n private static int curChar,MAX;\\n private static int numChars;\\n private static SpaceCharFilter filter;\\n private static PrintWriter pw;\\n private static long count = 0,mod=1000000007;\\n static int BIT[];\\n private static boolean primer[];\\n \\/\\/ private static TreeSet ts=new TreeSet[200000];\\npublic final static int INF = (int) 1E9;\\n\\npublic static void main(String args[]) {\\n InputReader(System.in);\\n pw = new PrintWriter(System.out); \\n new Thread(null ,new Runnable(){\\n public void run(){\\n try{\\n solve();\\n \\n pw.close();\\n } catch(Exception e){\\n e.printStackTrace();\\n }\\n }\\n },\\\"1\\\",1<<26).start();\\n }\\n static StringBuilder sb;\\n public static void test(){\\n sb=new StringBuilder();\\n int t=nextInt();\\n while(t-->0){\\n \\n solve();\\n \\n }\\n pw.println(sb);\\n }\\n public static long pow(long n, long p,long mod) {\\n if(p==0)\\n return 1;\\n if(p==1)\\n return n%mod;\\n if(p%2==0){\\n long temp=pow(n, p\\/2,mod);\\n return (temp*temp)%mod;\\n }else{\\n long temp=pow(n,p\\/2,mod);\\n temp=(temp*temp)%mod;\\n return(temp*n)%mod;\\n \\n }\\n }\\n public static long pow(long n, long p) {\\n if(p==0)\\n 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.util.Queue;\\nimport java.util.Scanner;\\nimport java.util.Stack;\\n\\npublic class C{\\n public static void main(String args[])\\n {\\n Scanner sc=new Scanner(System.in);\\n long mod=1000000007l;\\n int cases=sc.nextInt();\\n\\n\\n while(cases>0)\\n {\\n cases--;\\n Stack stack=new Stack<>();\\n\\n int n=sc.nextInt();\\n\\n for(int j=0;j temp=new Stack<>();\\n\\n while(stack.isEmpty()==false)\\n {\\n temp.add(stack.pop());\\n }\\n\\n while(temp.isEmpty()==false)\\n {\\n int z=temp.pop();\\n f.append(z+\\\".\\\");\\n stack.add(z);\\n }\\n\\n\\n System.out.println(f.substring(0,f.length()-1));\\n\\n }\\n\\n }\\n\\n }\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\n\\n\\npublic class First {\\n StreamTokenizer in;\\n PrintWriter out;\\n\\n int nextInt() throws IOException {\\n in.nextToken();\\n return (int)in.nval;\\n }\\n\\n long nextLong() throws IOException {\\n in.nextToken();\\n return (long) in.nval;\\n }\\n\\n String nextString() throws IOException {\\n in.nextToken();\\n return in.sval;\\n }\\n\\n\\n\\n void run() throws IOException {\\n in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n out = new PrintWriter(System.out);\\n solve();\\n out.flush();\\n }\\n\\n void solve() throws IOException {\\n int n = nextInt(), k = nextInt(), sum = 0, count = 0;\\n String str = nextString();\\n char[] arr = str.toCharArray();\\n boolean[] bool = new boolean[26];\\n for(char ch: arr){\\n bool[((int)ch)-97] = true;\\n }\\n for(int i = 0; i < 26; i++){\\n if(bool[i]){\\n sum += i+1;\\n count++;\\n i += 1;\\n }\\n if(count == k) break;\\n }\\n if(count == k) out.println(sum);\\n else out.println(-1);\\n }\\n\\n public static void main(String[] args) throws IOException {\\n new First().run();\\n }\\n} Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.HashMap;\\nimport java.util.Locale;\\nimport java.util.Map;\\nimport java.util.StringTokenizer;\\n\\npublic class Array implements Runnable {\\n\\n void solve() throws IOException {\\n int n = readInt();\\n int k = readInt();\\n int a[] = new int[n];\\n int startIdx = 0;\\n int endIdx = -1;\\n Map map = new HashMap();\\n for(int i = 0; i < n; i ++) {\\n a[i] = readInt();\\n if(map.containsKey(a[i]))\\n map.put(a[i], map.get(a[i]) + 1);\\n else\\n map.put(a[i], 1);\\n if(map.size() == k && endIdx == -1) {\\n endIdx = i;\\n break;\\n }\\n }\\n\\n if(endIdx != -1) {\\n while(startIdx < n && map.get(a[startIdx])>1) {\\n map.put(a[startIdx], map.get(a[startIdx]) - 1);\\n startIdx ++;\\n }\\n startIdx ++;\\n endIdx ++;\\n } else\\n startIdx = -1;\\n\\n out.println((startIdx)+\\\" \\\"+(endIdx));\\n\\n\\n }\\n\\n\\n\\n BufferedReader in;\\n PrintWriter out;\\n StringTokenizer tok = new StringTokenizer(\\\"\\\");\\n\\n public static void main(String[] args) {\\n new Array().run();\\n }\\n\\n public void run() {\\n try {\\n long t1 = System.currentTimeMillis();\\n if (System.getProperty(\\\"ONLINE_JUDGE\\\") != null) {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n } else {\\n in = new BufferedReader(new FileReader(\\\"\\/Users\\/shenchen\\/input.txt\\\"));\\n out = new PrintWriter(\\\"\\/Users\\/shenchen\\/output.txt\\\");\\n }\\n Locale.setDefault(Locale.US);\\n solve();\\n in.close();\\n out.close();\\n long t2 = System.currentTimeMillis();\\n System.err.println(\\\"Time = \\\" + (t2 - t1));\\n } catch (Throwable t) {\\n t.printStackTrace(System.err);\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.HashMap;\\nimport java.util.PriorityQueue;\\nimport java.util.StringTokenizer;\\nimport java.io.*;\\n \\npublic class ExplorerSpace {\\n\\t\\n\\tprivate static class MyScanner {\\n\\t BufferedReader br;\\n\\t StringTokenizer st;\\n\\n\\t public MyScanner() {\\n\\t br = new BufferedReader(new InputStreamReader(System.in));\\n\\t }\\n\\n\\t String next() {\\n\\t while (st == null || !st.hasMoreElements()) {\\n\\t try {\\n\\t st = new StringTokenizer(br.readLine());\\n\\t } catch (IOException e) {\\n\\t e.printStackTrace();\\n\\t }\\n\\t }\\n\\t return st.nextToken();\\n\\t }\\n\\n\\t int nextInt() {\\n\\t return Integer.parseInt(next());\\n\\t }\\n\\n\\t long nextLong() {\\n\\t return Long.parseLong(next());\\n\\t }\\n\\n\\t double nextDouble() {\\n\\t return Double.parseDouble(next());\\n\\t }\\n\\n\\t String nextLine(){\\n\\t String str = \\\"\\\";\\n\\t\\t try {\\n\\t\\t str = br.readLine();\\n\\t\\t } catch (IOException e) {\\n\\t\\t e.printStackTrace();\\n\\t\\t }\\n\\t\\t return str;\\n\\t }\\n\\n\\t }\\n\\t\\n \\n\\tpublic static int[][][] dp; \\n\\t\\n\\tpublic static boolean valid(int i, int j, int n, int m)\\n\\t{\\n\\t\\treturn i>=0 && i=0 && j 1)\\n has_more_than_one = true;\\n }\\n\\n Arrays.sort(a);\\n\\n if (n == 1) {\\n if (a[0] == 1)\\n out.print(2);\\n else\\n out.print(1);\\n } else {\\n out.print(1 + \\\" \\\");\\n for (int i = 1; i < n; i++) {\\n if (has_more_than_one || i < n - 1)\\n out.print(a[i - 1] + \\\" \\\");\\n else\\n out.println(2);\\n }\\n }\\n\\n out.close();\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\nimport java.io.*;\\npublic class Solution\\n{\\n public static void main(String [] args) throws IOException\\n {\\n PrintWriter pw=new PrintWriter(System.out);\\/\\/use pw.println() not pw.write();\\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer st=new StringTokenizer(br.readLine());\\n \\/*\\n inputCopy\\n5 3\\nxyabd\\noutputCopy\\n29\\ninputCopy\\n7 4\\nproblem\\noutputCopy\\n34\\ninputCopy\\n2 2\\nab\\noutputCopy\\n-1\\ninputCopy\\n12 1\\nabaabbaaabbb\\noutputCopy\\n1\\n *\\/\\n int n=Integer.parseInt(st.nextToken());\\n int k=Integer.parseInt(st.nextToken());\\n st=new StringTokenizer(br.readLine());\\n String str=st.nextToken();\\n char [] arr=str.toCharArray();\\n Arrays.sort(arr);\\n int weight=arr[0]-96;\\n char a=arr[0];\\n int included=1;\\n for(int i=1;i hs = new HashSet();\\n for(i=0; i=1 && r>l && arr[r]==arr[r-1])\\n --r;\\n for(i=l;i<=r;++i)\\n freq[arr[i]]++;\\n while(freq[arr[l]]>1){\\n freq[arr[l]]--;\\n l++;\\n }\\n while(freq[arr[r]]>1){\\n freq[arr[r]]--;\\n r--;\\n }\\n System.out.println((l+1)+\\\" \\\" +(r+1));\\n }\\n } catch (Exception e) {\\n\\n }\\n }\\n public static void main(String[] args) {\\n new Array().run();\\n }\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.InputStream;\\nimport java.util.InputMismatchException;\\nimport java.util.Stack;\\npublic class D527A2 {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tFastScanner in = new FastScanner(System.in);\\n\\t\\tint N = in.nextInt();\\n\\t\\tStack stack = new Stack<>();\\n\\t\\tfor(int i = 0; i < N; i++) {\\n\\t\\t\\tint num = in.nextInt() % 2;\\n\\t\\t\\tif(stack.size() >= 1 && stack.lastElement() == num)\\n\\t\\t\\t\\tstack.pop();\\n\\t\\t\\telse\\n\\t\\t\\t\\tstack.add(num);\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(stack.size() <= 1 ? \\\"YES\\\" : \\\"NO\\\");\\n\\t}\\n\\t\\n\\t\\/**\\n\\t * Source: Matt Fontaine\\n\\t *\\/\\n\\tstatic class FastScanner {\\n\\t\\tprivate InputStream stream;\\n\\t\\tprivate byte[] buf = new byte[1024];\\n\\t\\tprivate int curChar;\\n\\t\\tprivate int chars;\\n\\n\\t\\tpublic FastScanner(InputStream stream) {\\n\\t\\t\\tthis.stream = stream;\\n\\t\\t}\\n\\n\\t\\tint read() {\\n\\t\\t\\tif (chars == -1)\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\tif (curChar >= chars) {\\n\\t\\t\\t\\tcurChar = 0;\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\tchars = stream.read(buf);\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (chars <= 0)\\n\\t\\t\\t\\t\\treturn -1;\\n\\t\\t\\t}\\n\\t\\t\\treturn buf[curChar++];\\n\\t\\t}\\n\\n\\t\\tboolean isSpaceChar(int c) {\\n\\t\\t\\treturn c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1;\\n\\t\\t}\\n\\n\\t\\tboolean isEndline(int c) {\\n\\t\\t\\treturn c == '\\\\n' || c == '\\\\r' || c == -1;\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic double nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tpublic String next() {\\n\\t\\t\\tint c = read();\\n\\t\\t\\twhile (isSpaceChar(c))\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\tStringBuilder res = new StringBuilder();\\n\\t\\t\\tdo {\\n\\t\\t\\t\\tres.appendCodePoint(c);\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\t} while (!isSpaceChar(c));\\n\\t\\t\\treturn res.toString();\\n\\t\\t}\\n\\n\\t\\tpublic String nextLine() {\\n\\t\\t\\tint c = read();\\n\\t\\t\\twhile (isEndline(c))\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\tStringBuilder res = new StringBuilder();\\n\\t\\t\\tdo {\\n\\t\\t\\t\\tres.appendCodePoint(c);\\n\\t\\t\\t\\tc = read();\\n\\t\\t\\t} while (!isEndline(c));\\n\\t\\t\\treturn res.toString();\\n\\t\\t}\\n\\t}\\n\\n}\\n\\/*\\n5\\n2 1 1 2 5\\noutputCopy\\nYES\\ninputCopy\\n3\\n4 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\n\\/**\\n __ __\\n ( _) ( _)\\n \\/ \\/ \\\\\\\\ \\/ \\/\\\\_\\\\_\\n \\/ \\/ \\\\\\\\ \\/ \\/ | \\\\ \\\\\\n \\/ \\/ \\\\\\\\ \\/ \\/ |\\\\ \\\\ \\\\\\n \\/ \\/ , \\\\ , \\/ \\/ \\/| \\\\ \\\\\\n \\/ \\/ |\\\\_ \\/| \\/ \\/ \\/ \\\\ \\\\_\\\\\\n \\/ \\/ |\\\\\\/ _ '_| \\\\ \\/ \\/ \\/ \\\\ \\\\\\\\\\n | \\/ |\\/ 0 \\\\0\\\\ \\/ | | \\\\ \\\\\\\\\\n | |\\\\| \\\\_\\\\_ \\/ \\/ | \\\\ \\\\\\\\\\n | | |\\/ \\\\.\\\\ o\\\\o) \\/ \\\\ | \\\\\\\\\\n \\\\ | \\/\\\\\\\\`v-v \\/ | | \\\\\\\\\\n | \\\\\\/ \\/_| \\\\\\\\_| \\/ | | \\\\ \\\\\\\\\\n | | \\/__\\/_ `-` \\/ _____ | | \\\\ \\\\\\\\\\n \\\\| [__] \\\\_\\/ |_________ \\\\ | \\\\ ()\\n \\/ [___] ( \\\\ \\\\ |\\\\ | | \\/\\/\\n | [___] |\\\\| \\\\| \\/ |\\/\\n \\/| [____] \\\\ |\\/\\\\ \\/ \\/ ||\\n ( \\\\ [____ \\/ ) _\\\\ \\\\ \\\\ \\\\| | ||\\n \\\\ \\\\ [_____| \\/ \\/ __\\/ \\\\ \\/ \\/ \\/\\/\\n | \\\\ [_____\\/ \\/ \\/ \\\\ | \\\\\\/ \\/\\/\\n | \\/ '----| \\/=\\\\____ _\\/ | \\/ \\/\\/\\n __ \\/ \\/ | \\/ ___\\/ _\\/\\\\ \\\\ | ||\\n (\\/-(\\/-\\\\) \\/ \\\\ (\\/\\\\\\/\\\\)\\/ | \\/ | \\/\\n (\\/\\\\\\/\\\\) \\/ \\/ \\/\\/\\n _________\\/ \\/ \\/\\n \\\\____________\\/ (\\n\\n\\n @author NTUDragons-Reborn\\n *\\/\\n\\npublic class C{\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n Task solver = new Task();\\n solver.solve(in, out);\\n out.close();\\n }\\n \\/\\/ main solver\\n static class Task{\\n\\n double eps= 0.00000001;\\n static final int MAXN = 10000001;\\n\\n \\/\\/ stores smallest prime factor for every number\\n static int spf[] = new int[MAXN];\\n\\n Map> dp= new HashMap<>();\\n\\n \\/\\/ Calculating SPF (Smallest Prime Factor) for every\\n \\/\\/ number till MAXN.\\n \\/\\/ Time Complexity : O(nloglogn)\\n public void sieve()\\n {\\n spf[1] = 1;\\n for (int i=2; i=0) return f[mask];\\n f[mask] = 0;\\n double k = getBits(mask);\\n k*=(k-1)\\/2.0;\\n\\n for(int i=0;i 0)\\n for(int j=0;j 0){\\n x&=(x-1);\\n cnt++;\\n }\\n return cnt+1;\\n }\\n\\n public static void main(String args[]){\\n new e().run();\\n }\\n} Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n\\tpublic static void main(String args[]) {new Main().run();}\\n\\n\\tFastReader in = new FastReader();\\n\\tPrintWriter out = new PrintWriter(System.out);\\n\\tvoid run(){\\n\\t\\tint t=in.nextInt();\\n\\t\\tfor(int i=0;i() {\\n\\t\\t\\tpublic int compare(int[] arr1,int[] arr2) {\\n\\t\\t\\t\\treturn arr2[0]-arr1[0];\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tfor(int j=0;j0) {\\n\\t\\t\\t\\t\\t\\t\\tsum+=B[(b+s)%n][j];\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\trec[j][i]=Math.max(sum, rec[j][i]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int j=0;j n \\/ 2) {\\n\\t\\t\\tans += prob;\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tprob *= killProb;\\n\\t\\tans += prob;\\n\\t}\\n\\n\\tstatic void rec(int sum, int i) {\\n\\t\\tif (i == n || sum == 0) {\\n\\t\\t\\tans = 0;\\n\\t\\t\\tcheck(0);\\n\\t\\t\\tmax = max(ans, max);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tfor (int j = 0; j <= sum; j = j + 10) {\\n\\t\\t\\tif (loy[i] + j > 100)\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\tloy[i] += j;\\n\\t\\t\\trec(sum - j, i + 1);\\n\\t\\t\\tloy[i] -= j;\\n\\t\\t}\\n\\t}\\n\\n\\tpublic void run() {\\n\\t\\tn = nextInt();\\n\\t\\tk = nextInt() * 10;\\n\\t\\ta = nextInt();\\n\\t\\tmax = 0;\\n\\t\\tb = new int[n];\\n\\t\\tloy = new int[n];\\n\\t\\tdecision = new boolean[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tb[i] = nextInt();\\n\\t\\t\\tloy[i] = nextInt();\\n\\t\\t}\\n\\t\\t\\/\\/ System.out.println(Arrays.toString(loy));\\n\\t\\trec(k, 0);\\n\\t\\tlong pow = (long) pow(100, n);\\n\\t\\tout.print((double) max \\/ pow);\\n\\n\\t\\t\\/\\/ --------------------------------------------------------------------------------------------\\n\\t\\tout.close();\\n\\t\\tSystem.exit(0);\\n\\t}\\n\\n\\tprivate static boolean fileIOMode = false;\\n\\tprivate static String problemName = \\\"harmful\\\";\\n\\tprivate static BufferedReader in;\\n\\tprivate static PrintWriter out;\\n\\tprivate static StringTokenizer tokenizer;\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tLocale.setDefault(Locale.ENGLISH);\\n\\t\\tif (fileIOMode) {\\n\\t\\t\\tin = new BufferedReader(new FileReader(problemName + \\\".in\\\"));\\n\\t\\t\\tout = new PrintWriter(problemName + \\\".out\\\");\\n\\t\\t} else {\\n\\t\\t\\tin = 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author prakhar897\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n String arr1[] = new String[n];\\n String arr2[] = new String[n];\\n int i, j, count = 0;\\n for (i = 0; i < n; i++) {\\n arr1[i] = in.nextString();\\n }\\n for (i = 0; i < n; i++) {\\n arr2[i] = in.nextString();\\n for (j = 0; j < n; j++) {\\n if (arr2[i].equals(arr1[j])) {\\n arr1[j] = \\\"\\\";\\n count++;\\n break;\\n }\\n }\\n }\\n out.println(n - count);\\n }\\n\\n }\\n\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private InputReader.SpaceCharFilter filter;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1) {\\n throw new InputMismatchException();\\n }\\n if (curChar >= numChars) {\\n curChar =... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Solution {\\n\\n public static void main(String[] args) throws Exception {\\n MyReader reader = new MyReader(System.in);\\n\\/\\/ MyReader reader = new MyReader(new FileInputStream(\\\"input.txt\\\"));\\n MyWriter writer = new MyWriter(System.out);\\n new Solution().run(reader, writer);\\n writer.close();\\n }\\n\\n private void run(MyReader reader, MyWriter writer) throws IOException, InterruptedException {\\n int n = reader.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = reader.nextString().charAt(0);\\n }\\n long[][] d = new long[n + 1][n + 1];\\n d[0][0] = 1;\\n long mod = 1_000_000_007;\\n for (int i = 1; i < n; i++) {\\n for (int j = n - 1; j >= 0; j--) {\\n if (a[i - 1] == 'f') {\\n d[i][j + 1] = d[i - 1][j];\\n } else {\\n d[i][j] = (d[i - 1][j] + d[i][j + 1]) % mod;\\n }\\n }\\n }\\n long ans = 0;\\n for (int i = 0; i <= n; i++) {\\n ans += d[n - 1][i];\\n }\\n writer.print(ans % mod);\\n }\\n\\n static class MyReader {\\n\\n final BufferedInputStream in;\\n final int bufSize = 1 << 16;\\n final byte buf[] = new byte[bufSize];\\n int i = bufSize;\\n int k = bufSize;\\n boolean end = false;\\n final StringBuilder str = new StringBuilder();\\n\\n MyReader(InputStream in) {\\n this.in = new BufferedInputStream(in, bufSize);\\n }\\n\\n int nextInt() throws IOException {\\n return (int) nextLong();\\n }\\n\\n int[] nextIntArray(int n) throws IOException {\\n int[] m = new int[n];\\n for (int i = 0; i < n; i++) {\\n m[i] = nextInt();\\n }\\n return m;\\n }\\n\\n int[][] nextIntMatrix(int n, int m) throws IOException {\\n int[][] a = new int[n][0];\\n for (int j = 0; j < n; j++) {\\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.InputStreamReader;\\nimport java.math.BigInteger;\\nimport java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.HashMap;\\nimport java.util.Map;\\nimport java.util.Scanner;\\n\\n\\/**\\n *\\n * @author Fuad\\n *\\/\\npublic class Codeforces {\\n\\n private static boolean greater(long mid, long s) {\\n\\n int sum = 0;\\n long num = mid;\\n\\n while (num != 0) {\\n sum += (num % 10);\\n num \\/= 10;\\n\\n }\\n\\n return mid - sum >= s;\\n }\\n\\n static class pair {\\n\\n int first;\\n int second;\\n\\n pair(int f, int s) {\\n first = f;\\n second = s;\\n }\\n\\n pair() {\\n\\n }\\n\\n }\\n\\n public static void main(String[] args) throws Exception {\\n \\/\\/ TODO code application logic here\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\n long n, s;\\n\\n String arr[] = br.readLine().split(\\\" \\\");\\n\\n n = Long.parseLong(arr[0]);\\n s = Long.parseLong(arr[1]);\\n\\n long l = 1;\\n long h = n;\\n\\n while (l < h) {\\n long mid = (l + h) \\/ 2;\\n if (greater(mid, s)) {\\n h = mid;\\n } else {\\n l = mid + 1;\\n }\\n }\\n\\n System.out.println(greater(h, s) ? n - h + 1 : 0);\\n\\n }\\n\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/ No sorceries shall previal. \\/\\/\\n \\nimport java.util.Scanner; \\nimport java.io.PrintWriter;\\nimport java.util.*;\\nimport java.util.Arrays;\\n \\npublic class InVoker {\\n \\n public static void main(String args[]) {\\n \\t\\t\\n \\tScanner inp = new Scanner(System.in);\\n \\tPrintWriter out= new PrintWriter(System.out);\\n \\t\\n \\tint n=inp.nextInt();\\n \\tint a[]=new int[n];\\n \\tfor(int i=0;i=0){\\n\\t\\t\\tcnt += a[ind]-1;\\n\\t\\t\\t--ind;\\n\\t\\t\\tret++;\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tif(cnt>=m) System.out.println(ret);\\n\\t\\telse System.out.println(-1);\\n\\t}\\n\\n\\tpublic static void main(String[] args)throws IOException {\\n\\t\\tnew A().run();\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.util.Scanner;\\n\\npublic class Round313A {\\n\\tprivate static final int LOCAL_ENV = 0;\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner in = new Scanner(System.in);\\n\\t\\ttry {\\n\\t\\t\\tif (LOCAL_ENV == 1) {\\n\\t\\t\\t\\tin = new Scanner(new File(\\\"input.txt\\\"));\\n\\t\\t\\t}\\n\\t\\t} catch (FileNotFoundException e) {\\n\\t\\t\\tin = new Scanner(System.in);\\n\\t\\t}\\n\\n\\t\\tlong n = in.nextLong();\\n\\n\\t\\tif (n >= -9) {\\n\\t\\t\\tSystem.out.println(n);\\n\\t\\t} else {\\n\\t\\t\\tlong absN = Math.abs(n);\\n\\t\\t\\tlong m1 = -(absN \\/ 10);\\n\\t\\t\\tlong last = absN % 10;\\n\\t\\t\\tlong m2 = -((absN \\/ 100) * 10 + last);\\n\\t\\t\\tSystem.out.println(Math.max(m1, m2));\\n\\t\\t}\\n\\t}\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\nimport java.awt.Point;\\nimport java.math.BigDecimal;\\nimport java.math.BigInteger;\\n\\nimport static java.lang.Math.*;\\n\\n\\/\\/ Solution is at the bottom of code\\n\\npublic class B implements Runnable{\\n\\t\\n\\tfinal boolean ONLINE_JUDGE = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n\\t\\n\\tBufferedReader in;\\n\\tOutputWriter out;\\n\\tStringTokenizer tok = new StringTokenizer(\\\"\\\");\\n\\t\\n\\tpublic static void main(String[] args){\\n\\t\\tnew Thread(null, new B(), \\\"\\\", 128 * (1L << 20)).start();\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tvoid init() throws FileNotFoundException{\\n\\t\\tLocale.setDefault(Locale.US);\\n\\t\\t\\n\\t\\tif (ONLINE_JUDGE){\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new OutputWriter(System.out);\\n\\t\\t}else{\\n\\t\\t\\tin = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t\\tout = new OutputWriter(\\\"output.txt\\\");\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tlong timeBegin, timeEnd;\\n\\n\\tvoid time(){\\n\\t\\ttimeEnd = System.currentTimeMillis();\\n\\t\\tSystem.err.println(\\\"Time = \\\" + (timeEnd - timeBegin));\\n\\t}\\n\\t\\n\\tvoid debug(Object... objects){\\n\\t\\tif (ONLINE_JUDGE){\\n\\t\\t\\tfor (Object o: objects){\\n\\t\\t\\t\\tSystem.err.println(o.toString());\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tpublic void run(){\\n\\t\\ttry{\\n\\t\\t\\ttimeBegin = System.currentTimeMillis();\\n\\t\\t\\tLocale.setDefault(Locale.US);\\n\\t\\t\\t\\n\\t\\t\\tinit();\\n\\t\\t\\tsolve();\\n\\t\\t\\t\\n\\t\\t\\tout.close();\\n\\t\\t\\ttime();\\n\\t\\t}catch (Exception e){\\n\\t\\t\\te.printStackTrace(System.err);\\n\\t\\t\\tSystem.exit(-1);\\n\\t\\t}\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tString delim = \\\" \\\";\\n\\t\\n\\tString readString() throws IOException{\\n\\t\\twhile(!tok.hasMoreTokens()){\\n\\t\\t\\ttry{\\n\\t\\t\\t\\ttok = new StringTokenizer(in.readLine());\\n\\t\\t\\t}catch (Exception e){\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn tok.nextToken(delim);\\n\\t}\\n\\t\\n\\tString readLine() throws IOException{\\n\\t\\treturn in.readLine();\\n\\t}\\n\\t\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\t\\n\\tfinal char NOT_A_SYMBOL = '\\\\0';\\n\\t\\n\\tchar... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import sun.reflect.generics.tree.Tree;\\n\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport java.net.Inet4Address;\\nimport java.util.*;\\n\\npublic class l {\\n \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEEEEEEEEEE MMMM MMMM OOOOOO SSSSSSS EEEEEEEEEEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEEEEEEEEEE MMMMMM MMMMMM OOO OOO SSSS SSS EEEEEEEEEEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMM MMM MMMM OOO OOO SSSS SSS EEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMMMMM MMMM OOO OOO SSSS EEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMMM OOO OOO SSSSSSS EEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHHHHHHHHHHHHHH EEEEEEEEEEE MMMM MMMM OOO OOO SSSSSS EEEEEEEEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHHHHHHHHHHHHHH EEEEEEEEEEE MMMM MMMM OOO OOO SSSSSSS EEEEEEEEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ HHHH HHHH EEEEE MMMM MMMM OOO OOO SSSS EEEEE \\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\/\\/\\/\\/\\/\\/\\/\\/ 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Scanner;\\n\\npublic class AAA {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n int n = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++)\\n a[i] = in.nextInt();\\n int max = a[0];\\n int ind = 0;\\n for (int k = 1; k < n; k++) {\\n if (a[k] > max) {\\n max = a[k];\\n ind = k;\\n }\\n }\\n if (max != 1) {\\n a[ind] = 1;\\n Arrays.sort(a);\\n for (int i = 0; i < a.length - 1; i++)\\n System.out.print(a[i] + \\\" \\\");\\n System.out.println(a[a.length - 1]);\\n } else {\\n a[0] = 2;\\n Arrays.sort(a);\\n for (int i = 0; i < a.length - 1; i++)\\n System.out.print(a[i] + \\\" \\\");\\n System.out.println(a[a.length - 1]);\\n }\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class P1177A {\\n\\t\\t\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\n\\t\\ttry (Scanner sc = new Scanner(System.in)) {\\n\\t\\t\\t\\n\\t\\t\\tlong k = sc.nextLong();\\n\\t\\t\\tint pow = 1;\\n\\t\\t\\t\\n\\t\\t\\twhile ((long) ((Math.pow(10, pow) - Math.pow(10, pow - 1)) * pow) < k) {\\n\\t\\t\\t\\tk -= (long) ((Math.pow(10, pow) - Math.pow(10, pow - 1)) * pow);\\n\\t\\t\\t\\tpow++;\\n\\t\\t\\t}\\n\\t\\t\\t\\/\\/ System.out.println(k + \\\" \\\" + pow);\\n\\t\\t\\t\\n\\t\\t\\tk--;\\n\\t\\t\\tlong n = (long) Math.pow(10, pow - 1) + k \\/ pow;\\n\\t\\t\\tk %= pow;\\n\\t\\t\\t\\/\\/ System.out.println(k + \\\" \\\" + n);\\n\\t\\t\\t\\n\\t\\t\\tSystem.out.println(String.valueOf(n).charAt((int) k));\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\tcatch (Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t}\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Solution {\\n static BufferedReader br=null;\\n static PrintWriter pw=null;\\n static StringTokenizer st=null;\\n static String FILENAME=\\\"\\\";\\n \\n void nline(){\\n try {\\n st=new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n }\\n int ni(){\\n while(st==null || !st.hasMoreTokens()) nline();\\n return Integer.parseInt(st.nextToken());\\n }\\n long nl(){\\n while(st==null || !st.hasMoreTokens()) nline();\\n return Long.parseLong(st.nextToken());\\n }\\n double nd(){\\n while(st==null || !st.hasMoreTokens()) nline();\\n return Double.parseDouble(st.nextToken());\\n }\\n String ns(){\\n while(st==null || !st.hasMoreTokens()) nline();\\n return st.nextToken();\\n }\\n String nstr(){\\n String s=\\\"\\\";\\n try {\\n s=br.readLine();\\n } catch (IOException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n return s;\\n }\\n\\n public void solve(){\\n int n = ni();\\n String s = nstr();\\n int[] a = new int[n];\\n for (int i=0;i0){\\n if((p&1)==1)o = mul(a,o);\\n a = mul(a,a);\\n p>>=1;\\n }\\n return o;\\n }\\n \\n \\n long mul(long a, long b){\\n if(a>=mod)a%=mod;\\n if(b>=mod)b%=mod;\\n a*=b;\\n if(a>=mod)a%=mod;\\n return a;\\n }\\n \\n long c(long c){\\n return (c*c+c)\\/2;\\n }\\n \\n int[] reverse(int[] a){\\n int[] o = new int[a.length];\\n for(int i = 0; i< a.length; i++)o[i] = a[a.length-i-1];\\n return o; \\n }\\n\\n int[] sort(int[] a){\\n if(a.length==1)return a;\\n int mid = a.length\\/2;\\n int[] b = sort(Arrays.copyOfRange(a,0,mid)), c =... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\n\\npublic class ProblemA {\\n\\t\\n\\tstatic final int INF = 100000000;\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tString[] nmd = in.readLine().split(\\\" \\\");\\n\\t\\tlong a = Long.valueOf(nmd[0]);\\n\\t\\tlong b = Long.valueOf(nmd[1]);\\n\\n\\t\\tlong cnt = 0;\\n\\t\\twhile (true) {\\n\\t\\t\\tif (a == 0) {\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t\\tif (a >= b) {\\n\\t\\t\\t\\tcnt += a \\/ b;\\n\\t\\t\\t\\ta = a % b;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tif (b % a == 0) {\\n\\t\\t\\t\\t\\tcnt += b \\/ a - 1;\\n\\t\\t\\t\\t\\tb = a;\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tcnt += b \\/ a;\\n\\t\\t\\t\\t\\tb = b % a;\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(cnt);\\n\\t\\tout.flush();\\n\\t}\\n\\n\\t\\n\\tpublic static void debug(Object... o) {\\n\\t\\tSystem.err.println(Arrays.deepToString(o));\\n\\t}\\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author John Martin\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n ASubtractions solver = new ASubtractions();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class ASubtractions {\\n public void solve(int testNumber, InputReader c, OutputWriter w) {\\n int tc = c.readInt();\\n while (tc-- > 0) {\\n int a = c.readInt(), b = c.readInt();\\n int res = 0;\\n while (a != 0 && b != 0) {\\n res += b \\/ a;\\n b = b % a;\\n int t = b;\\n b = a;\\n a = t;\\n }\\n w.printLine(res);\\n }\\n }\\n\\n }\\n\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private InputReader.SpaceCharFilter filter;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1) {\\n throw new InputMismatchException();\\n }\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.util.Scanner;\\n\\n\\npublic class Main {\\n static double[] dp;\\n static double[][] P;\\n public static void main(String[] args) {\\n Scanner r = new Scanner(System.in);\\n \\n int n = r.nextInt();\\n \\n double[][] g = new double[n][n];\\n for(int i = 0; i < n; i++)\\n for(int j = 0; j < n; j++)\\n g[i][j] = r.nextDouble();\\n \\n dp = new double[1 << n];\\n P = new double[1 << n][n];\\n for(int mask = 0; mask < 1 << n; mask++){\\n for(int d = 0; d < n; d++)if((mask & (1 << d)) == 0)\\n for(int i = 0; i < n; i++)if((mask & (1 << i)) == 0){\\n if(i == d)continue;\\n \\n P[mask][d] += g[i][d];\\n }\\n }\\n \\n for(int i = 0; i < n; i++){\\n Arrays.fill(dp, -1);\\n \\n double res = go(i, 0, g, n, n);\\n System.out.println(res);\\n }\\n }\\n\\n private static double go(int a, int v, double[][] g, int cnt, int n) {\\n if(dp[v] != -1)return dp[v];\\n \\n if(cnt == 1){\\n return 1;\\n }else{\\n double ret = 0;\\n for(int d = 0; d < n; d++)if((v & (1 << d)) == 0 && d != a){\\n double current = P[v][d] * go(a, v | 1 << d, g, cnt-1, n);\\n ret += current;\\n }\\n \\n return dp[v] = ret\\/(cnt * (cnt-1) \\/2);\\n } \\n }\\n}\\n Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class Task122A {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tint n = sc.nextInt();\\n\\t\\tsc.close();\\n\\t\\t\\n\\t\\tif ( (n % 4 == 0) ||\\n\\t\\t\\t (n % 7 == 0) ||\\n\\t\\t\\t (n % 44 == 0) ||\\n\\t\\t\\t (n % 47 == 0) ||\\n\\t\\t\\t (n % 74 == 0) ||\\n\\t\\t\\t (n % 77 == 0) ||\\n\\t\\t \\t (n % 444 == 0) ||\\n\\t\\t\\t (n % 447 == 0) ||\\n\\t\\t\\t (n % 474 == 0) ||\\n\\t\\t\\t (n % 477 == 0) ||\\n\\t\\t\\t (n % 744 == 0) ||\\n\\t\\t\\t (n % 747 == 0) ||\\n\\t\\t\\t (n % 774 == 0) ||\\n\\t\\t\\t (n % 777 == 0) )\\n\\t\\t{\\n\\t\\t\\tSystem.out.println(\\\"YES\\\");\\n\\t\\t} else {\\n\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t\\t}\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Iterator;\\nimport java.util.Set;\\nimport java.util.HashMap;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.List;\\nimport java.util.StringTokenizer;\\nimport java.util.Map;\\nimport java.util.Map.Entry;\\nimport java.io.BufferedReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskF solver = new TaskF();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskF {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) { a[i] = in.nextInt(); }\\n\\n Map> rgs = new HashMap>();\\n\\n for (int i = 0; i < n; i++) {\\n int s = 0;\\n for (int j = i; j < n; j++) {\\n s += a[j];\\n\\n if (rgs.get(s) == null) { rgs.put(s, new ArrayList()); }\\n\\n rgs.get(s).add(new Range(i, j));\\n }\\n }\\n\\n Iterator it = rgs.entrySet().iterator();\\n List ans = new ArrayList();\\n\\n while (it.hasNext()) {\\n Map.Entry pair = (Map.Entry) it.next();\\n int sum = (int) pair.getKey();\\n List ranges = rgs.get(sum);\\n\\n List cand = new ArrayList();\\n\\n for (Range r : ranges) {\\n if (cand.size() == 0) {\\n cand.add(r);\\n continue;\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.ArrayList;\\nimport java.util.Scanner;\\nimport java.io.BufferedReader;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.FileWriter;\\nimport java.io.IOException;\\nimport java.io.PrintWriter;\\nimport java.nio.*;\\n public class Main {\\n\\n\\n public static void main(String[] args) throws NumberFormatException, IOException \\n {\\n Scanner sc = new Scanner(new File(\\\"input.txt\\\"));\\n \\n int n = sc.nextInt();\\n int m =sc.nextInt();\\n sc.nextLine();\\n int k =sc.nextInt();\\n int les[][] = new int[n][m];\\n PrintWriter out = new PrintWriter(new FileWriter(\\\"output.txt\\\")); \\n \\/\\/sc.nextLine();\\n ArrayList list = new ArrayList();\\n sc.nextLine();\\n for(int i = 0;i st, PrintWriter pw) {\\n\\t\\tfor (int i = 0; i < st.size(); i++) {\\n\\t\\t\\tpw.print(st.get(i));\\n\\t\\t\\tif (i != st.size() - 1) {\\n\\t\\t\\t\\tpw.print(\\\".\\\");\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tpw.println();\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tPrintWriter pw = new PrintWriter(System.out);\\n\\t\\tint t = sc.nextInt();\\n\\t\\twhile (t-- > 0) {\\n\\t\\t\\tint n = sc.nextInt();\\n\\t\\t\\tint[] arr = sc.nextIntArr(n);\\n\\t\\t\\tStack st = new Stack();\\n\\t\\t\\tst.add(arr[0]);\\n\\t\\t\\tprint(st, pw);\\n\\t\\t\\tfor (int i = 1; i < n; i++) {\\n\\t\\t\\t\\tif (arr[i] == 1) {\\n\\t\\t\\t\\t\\tst.add(arr[i]);\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\twhile (st.peek() != arr[i] - 1) {\\n\\t\\t\\t\\t\\t\\tst.pop();\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tst.pop();\\n\\t\\t\\t\\t\\tst.add(arr[i]);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tprint(st, pw);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tpw.close();\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic Scanner(InputStream s) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(s));\\n\\t\\t}\\n\\n\\t\\tpublic Scanner(FileReader f) {\\n\\t\\t\\tbr = new BufferedReader(f);\\n\\t\\t}\\n\\n\\t\\tpublic String next() throws IOException {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() throws IOException {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic double nextDouble() throws IOException {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tpublic int[] nextIntArr(int n) throws IOException {\\n\\t\\t\\tint[] arr = new int[n];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tarr[i] = Integer.parseInt(next());\\n\\t\\t\\t}\\n\\t\\t\\treturn arr;\\n\\t\\t}\\n\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class A {\\n FastScanner in;\\n PrintWriter out;\\n\\n public void run() {\\n try {\\n in = new FastScanner(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n solve();\\n out.close();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n public void solve() throws IOException {\\n long l = new Long(in.next());\\n long r = new Long(in.next());\\n if (r - l < 2 || (r - l == 2 && l % 2 != 0)) {\\n out.println(\\\"-1\\\");\\n } else {\\n if (l % 2 != 0) {\\n l++;\\n }\\n out.println(l);\\n out.println(l+1);\\n out.println(l+2);\\n }\\n }\\n\\n class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n FastScanner(InputStreamReader in) {\\n br = new BufferedReader(in);\\n }\\n\\n String nextLine() {\\n String str = null;\\n try {\\n str = br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n\\n return str;\\n }\\n\\n String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() {\\n return Integer.parseInt(next());\\n }\\n }\\n\\n public static void main(String[] arg) {\\n A o = new A();\\n o.run();\\n }\\n\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\n\\npublic class Main{\\n public static void main(String[] args) {\\n Scanner input = new Scanner(System.in);\\n long num = input.nextLong();\\n if(num==0){\\n System.out.println(num);\\n }else if(num==1||num==2){\\n System.out.println(num);}\\n else if(num%2==0&&num>2&&num%3!=0){\\n System.out.println(num*(num-1)*(num-3));\\n }\\n else if(num%2==0&&num%3==0){\\n System.out.println((num-1)*(num-2)*(num-3));\\n }\\n else{\\n System.out.println(num*(num-1)*(num-2));}\\n }\\n \\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\npublic class Main {\\n InputStream is;\\n PrintWriter out;\\n String INPUT = \\\"\\\" ;\\n boolean local = false;\\n int inf=0x7FFFFFFF;\\n int MOD=(int)(1e9+7);\\n double eps=1e-5;\\n double PI=Math.acos(-1);\\n void solve() {\\n long maxn=nl();\\n long L=1,R=maxn,ans=-1;\\n while (L<=R){\\n long mid=(L+R)\\/2;\\n if(ask(1,1,mid,maxn)<1)L=mid+1;\\n else{\\n R=mid-1;\\n ans=mid;\\n }\\n }\\n if(ask(1,1,ans,maxn)==1 && ask(ans+1,1,maxn,maxn)==1){\\n Yts1999 a1=gao(1,1,ans,maxn);\\n Yts1999 a2=gao(ans+1,1,maxn,maxn);\\n answer(a1,a2);\\n }else{\\n L=1;R=maxn;ans=-1;\\n while (L<=R){\\n long mid=(L+R)\\/2;\\n if(ask(1,1,maxn,mid)<1)L=mid+1;\\n else{\\n R=mid-1;\\n ans=mid;\\n }\\n }\\n Yts1999 a1=gao(1,1,maxn,ans);\\n Yts1999 a2=gao(1,ans+1,maxn,maxn);\\n answer(a1,a2);\\n }\\n }\\n void answer(Yts1999 a1,Yts1999 a2){\\n out.print(\\\"!\\\");\\n a1.print();\\n a2.print();\\n out.flush();\\n }\\n int ask(long a,long b,long c,long d){\\n out.printf(\\\"? %d %d %d %d\\\",a,b,c,d);\\n out.println();\\n out.flush();\\n return ni();\\n }\\n Yts1999 gao(long x1,long x2,long y1,long y2){\\n long a1=0,a2=0,a3=0,a4=0;\\n long L,R;\\n L=x1;R=y1;\\n while(L<=R){\\n long mid=(L+R)\\/2;\\n if(ask(mid,x2,y1,y2)==1){\\n a1=mid;\\n L=mid+1;\\n }else R=mid-1;\\n }\\n L=x1;R=y1;\\n while(L<=R){\\n long mid=(L+R)\\/2;\\n if(ask(x1,x2,mid,y2)==1){\\n a3=mid;\\n R=mid-1;\\n }else L=mid+1;\\n }\\n L=x2;R=y2;\\n while(L<=R){\\n long mid=(L+R)\\/2;\\n if(ask(x1,mid,y1,y2)==1){\\n a2=mid;\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\nimport java.math.*;\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class Test5 {\\n public static void main(String[] z){\\n StreamTokenizer st = new StreamTokenizer(new InputStreamReader(System.in));\\n PrintWriter pw = new PrintWriter(System.out);\\n Scanner s = new Scanner(System.in);\\n int a = s.nextInt(), o=0;\\n String i = \\\"\\\";\\n ArrayList l1 = new ArrayList<>(), l2 = new ArrayList<>();\\n for(int q=0; q 1) {\\n swap(a, 0, heapSize - 1);\\n heapSize--;\\n heapify(a, 0);\\n }\\n }\\n\\n private static void buildHeap(int[] a) {\\n heapSize = a.length;\\n for (int i = a.length \\/ 2; i >= 0; i--) {\\n heapify(a, i);\\n }\\n }\\n\\n private static void heapify(int[] a, int i) {\\n int l = 2 * i + 2;\\n int r = 2 * i + 1;\\n int largest = i;\\n if (l < heapSize && a[i] < a[l]) {\\n largest = l;\\n }\\n if (r < heapSize && a[largest] < a[r]) {\\n largest = r;\\n }\\n if (i != largest) {\\n swap(a, i, largest);\\n heapify(a, largest);\\n }\\n }\\n\\n private static void swap(int[] a, int i, int j) {\\n a[i] ^= a[j] ^= a[i];\\n a[j] ^= a[i];\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.BigDecimal;\\nimport java.math.BigInteger;\\nimport java.math.MathContext;\\n\\n\\npublic class Main {\\n\\n private void solve() {\\n int n = in.nextInt();\\n int k = in.nextInt();\\n final int[] p = new int[n];\\n final int[] t = new int[n];\\n for(int i =0 ; i < n; ++i) {\\n p[i] = in.nextInt();\\n t[i] = in.nextInt();\\n }\\n Integer[] ord = new Integer[n];\\n for(int i = 0; i < n; ++i)\\n ord[i] = i;\\n for(int i = 0; i < n; ++i) {\\n for(int j = 0; j < n - 1; ++j) {\\n if (Less(ord[j], ord[j + 1], p, t)) {\\n Integer tx = ord[j];\\n ord[j] = ord[j + 1];\\n ord[j + 1] = tx;\\n }\\n }\\n }\\n \\n \\n \\n for(int i = 0, j = 0; i < n; i = j) {\\n for(j = i; j < n && p[ord[i]] == p[ord[j]] && t[ord[i]] == t[ord[j]]; ++j) ;\\n int first = i+1;\\n int second = j;\\n if (first <= k && k <= second) {\\n out.print(j - i);\\n return ;\\n }\\n }\\n out.print(0);\\n }\\n private boolean Less(Integer i, Integer j, int[] p, int[] t) {\\n return p[i] < p[j] || p[i] == p[j] && t[i] > t[j];\\n }\\n private void run() {\\n try {\\n in = new FastScanner();\\n out = new PrintWriter(new OutputStreamWriter(System.out));\\n solve();\\n out.flush();\\n } catch (Exception e) {\\n e.printStackTrace();\\n }\\n }\\n \\n public static void main(String[] args) {\\n new Main().run();\\n }\\n FastScanner in;\\n PrintWriter out;\\n class FastScanner {\\n public BufferedReader reader;\\n private StringTokenizer tokenizer;\\n public FastScanner(String file) {\\n try {\\n reader = new BufferedReader(new FileReader(new File(file)));\\n tokenizer = null;\\n } catch (FileNotFoundException e) {\\n... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collections;\\nimport java.util.Scanner;\\nimport java.util.StringTokenizer;\\n\\npublic class c {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tFastScanner in = new FastScanner(System.in);\\n\\t\\tint n = in.nextInt(), m = in.nextInt();\\n\\t\\tlong bounty = in.nextInt(), increase = in.nextInt();\\n\\t\\tint damage = in.nextInt();\\n\\t\\tint[] mh = new int[n];\\n\\t\\tint[] sh = new int[n];\\n\\t\\tint[] reg = new int[n];\\n\\t\\tlong countKilled = 0;\\n\\t\\tArrayList es = new ArrayList<>();\\n\\t\\tEvent[] regen = new Event[n];\\n\\t\\tfor(int i=0;i 0) {\\n\\t\\t\\t\\tint time = (damage+1 - sh[i]+reg[i]-1)\\/reg[i];\\n\\t\\t\\t\\tif(time > 0 && mh[i] >= damage+1) {\\n\\t\\t\\t\\t\\tEvent e2 = new Event(time, i, damage+1);\\n\\t\\t\\t\\t\\tregen[i] = e2;\\n\\t\\t\\t\\t\\tes.add(e2);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor(int i=0;i 0) {\\n\\t\\t\\t\\tint time = (damage+1 - e.h+reg[e.e]-1)\\/reg[e.e];\\n\\t\\t\\t\\tif(time > 0 && mh[e.e] >= damage+1) {\\n\\t\\t\\t\\t\\tEvent e2 = new Event(e.t + time, e.e, damage+1);\\n\\t\\t\\t\\t\\te.regen = e2;\\n\\t\\t\\t\\t\\tes.add(e2);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tCollections.sort(es, (a,b) -> a.t-b.t);\\n\\t\\tlong ans = countKilled*bounty;\\n\\t\\tint lastTime = 0;\\n\\t\\tfor(Event e : es) {\\n\\t\\t\\tif(e.t == -1) continue;\\n\\t\\t\\tif(regen[e.e] != e && regen[e.e] != null) {\\n\\t\\t\\t\\tregen[e.e].t = -1;\\n\\t\\t\\t\\tregen[e.e] = null;\\n\\t\\t\\t}\\n\\t\\t\\tif(lastTime != e.t) {\\n\\t\\t\\t\\tans = Math.max(ans, countKilled*(bounty+(e.t-1)*increase));\\n\\t\\t\\t}\\n\\t\\t\\tif(sh[e.e] <= damage)\\n\\t\\t\\t\\tcountKilled--;\\n\\t\\t\\tsh[e.e] = e.h;\\n\\t\\t\\tif(sh[e.e] <= damage)\\n\\t\\t\\t\\tcountKilled++;\\n\\t\\t\\tif(e.regen != null) {\\n\\t\\t\\t\\tregen[e.e] = e.regen;\\n\\t\\t\\t}\\n\\t\\t\\tlastTime = e.t;\\n\\t\\t}\\n\\t\\tif(countKilled != 0) {\\n\\t\\t\\tif(increase > 0)\\n\\t\\t\\t\\tans = -1;\\n\\t\\t\\telse\\n\\t\\t\\t\\tans = Math.max(ans,... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package global14;\\nimport java.io.*;\\nimport java.util.ArrayDeque;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.util.Queue;\\n\\npublic class B {\\n\\tInputStream is;\\n\\tFastWriter out;\\n\\tString INPUT = \\\"\\\";\\n\\t\\n\\tvoid solve()\\n\\t{\\n\\t\\tfor(int T = ni();T > 0;T--)go();\\n\\t}\\n\\n\\tvoid go()\\n\\t{\\n\\t\\tint n = ni();\\n\\t\\tif(n % 2 == 0){\\n\\t\\t\\tint u = (int)Math.sqrt(n\\/2);\\n\\t\\t\\tif(u*u == n\\/2){\\n\\t\\t\\t\\tout.println(\\\"YES\\\");\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif(n % 4 == 0){\\n\\t\\t\\tint u = (int)Math.sqrt(n\\/4);\\n\\t\\t\\tif(u*u == n\\/4){\\n\\t\\t\\t\\tout.println(\\\"YES\\\");\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.println(\\\"NO\\\");\\n\\t}\\n\\t\\n\\tvoid run() throws Exception\\n\\t{\\n\\t\\tis = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());\\n\\t\\tout = new FastWriter(System.out);\\n\\t\\t\\n\\t\\tlong s = System.currentTimeMillis();\\n\\t\\tsolve();\\n\\t\\tout.flush();\\n\\t\\ttr(System.currentTimeMillis()-s+\\\"ms\\\");\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) throws Exception { new B().run(); }\\n\\t\\n\\tprivate byte[] inbuf = new byte[1024];\\n\\tpublic int lenbuf = 0, ptrbuf = 0;\\n\\t\\n\\tprivate int readByte()\\n\\t{\\n\\t\\tif(lenbuf == -1)throw new InputMismatchException();\\n\\t\\tif(ptrbuf >= lenbuf){\\n\\t\\t\\tptrbuf = 0;\\n\\t\\t\\ttry { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }\\n\\t\\t\\tif(lenbuf <= 0)return -1;\\n\\t\\t}\\n\\t\\treturn inbuf[ptrbuf++];\\n\\t}\\n\\t\\n\\tprivate boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }\\n\\tprivate int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }\\n\\t\\n\\tprivate double nd() { return Double.parseDouble(ns()); }\\n\\tprivate char nc() { return (char)skip(); }\\n\\t\\n\\tprivate String ns()\\n\\t{\\n\\t\\tint b = skip();\\n\\t\\tStringBuilder sb = new StringBuilder();\\n\\t\\twhile(!(isSpaceChar(b))){ \\/\\/ when nextLine, (isSpaceChar(b) && b != ' ')\\n\\t\\t\\tsb.appendCodePoint(b);\\n\\t\\t\\tb = readByte();\\n\\t\\t}\\n\\t\\treturn sb.toString();\\n\\t}\\n\\t\\n\\tprivate char[] ns(int n)\\n\\t{\\n\\t\\tchar[] buf = new char[n];\\n\\t\\tint b = skip(), p = 0;\\n\\t\\twhile(p < n && !(isSpaceChar(b))){\\n\\t\\t\\tbuf[p++] = (char)b;\\n\\t\\t\\tb = readByte();\\n\\t\\t}\\n\\t\\treturn n == p ? buf : Arrays.copyOf(buf, p);\\n\\t}\\n\\n\\tprivate int[] na(int n)\\n\\t{\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor(int i =... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\npublic class Success {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner scan = new Scanner(System.in);\\n\\t\\tint n = scan.nextInt();\\n\\t\\tint a = scan.nextInt();\\n\\t\\tint b=scan.nextInt();\\n\\t\\tint[] t=new int[n];\\n\\t\\tfor(int i=0;i= 0; i--) {\\n if(arr[i] == -1) {\\n cnt++;\\n continue;\\n }\\n res += (((neg.read(arr[i]))*cnt)%MOD)*invertNum1;\\n res %= MOD;\\n }\\n System.out.println(res);\\n }\\n \\n \\/\\/@\\n static class BIT {\\n int n;\\n int[] tree;\\n public BIT(int n) {\\n this.n = n;\\n tree = new int[n + 1];\\n }\\n\\n int read(int i) {\\n int sum = 0;\\n ... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.PrintWriter;\\nimport java.util.Scanner;\\n\\npublic class Solution {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n\\n String s = in.nextLine();\\n\\n int ans = 0;\\n\\n outer: for (int i = s.length() - 1; i >= 1; i--)\\n for (int j = 0; j < s.length() - i; j++) {\\n String sub = s.substring(j, j + i);\\n String str = s.substring(j + 1);\\n\\n if (str.contains(sub)) {\\n ans = i;\\n break outer;\\n }\\n }\\n\\n out.print(ans);\\n out.close();\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Codeforces913F {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner input = new Scanner(System.in);\\n\\t\\tint n = input.nextInt();\\n\\t\\tint a = input.nextInt();\\n\\t\\tint b = input.nextInt();\\n\\t\\tinput.close();\\n\\t\\tfinal int mod = 998244353;\\n\\t\\t\\n\\t\\tint frac = multiply(a, inverse(b, mod), mod);\\n\\t\\tint reverse = (mod+1-frac)%mod;\\n\\t\\t\\n\\t\\tint[] fracpower = new int[n+1];\\n\\t\\tint[] reversepower = new int[n+1];\\n\\t\\tfracpower[0] = 1;\\n\\t\\treversepower[0] = 1;\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tfracpower[i] = multiply(fracpower[i-1], frac, mod);\\n\\t\\t\\treversepower[i] = multiply(reversepower[i-1], reverse, mod);\\n\\t\\t}\\n\\t\\t\\n\\t\\tint[][] dp1 = new int[n+1][n+1];\\n\\t\\tdp1[2][1] = 1;\\n\\t\\tfor (int i = 3; i <= n; i++) {\\n\\t\\t\\tfor (int j = 1; j < i; j++) {\\n\\t\\t\\t\\tif (j == 1) {\\n\\t\\t\\t\\t\\tdp1[i][j] = fracpower[i-1];\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tdp1[i][j] = multiply(dp1[i-1][j-1], fracpower[i-j], mod);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (j == i-1) {\\n\\t\\t\\t\\t\\tdp1[i][j] += reversepower[i-1];\\n\\t\\t\\t\\t\\tdp1[i][j] %= mod;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tdp1[i][j] += multiply(dp1[i-1][j], reversepower[j], mod);\\n\\t\\t\\t\\t\\tdp1[i][j] %= mod;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tint[][] dp2 = new int[n+1][n+1];\\n\\t\\tdp2[1][1] = 1;\\n\\t\\tdp2[2][1] = 1;\\n\\t\\tdp2[2][2] = 0;\\n\\t\\tfor (int i = 3; i <= n; i++) {\\n\\t\\t\\tint val = 0;\\n\\t\\t\\tfor (int j = 1; j < i; j++) {\\n\\t\\t\\t\\tdp2[i][j] = multiply(dp2[j][j], dp1[i][j], mod);\\n\\t\\t\\t\\tval += dp2[i][j];\\n\\t\\t\\t\\tval %= mod;\\n\\t\\t\\t}\\n\\t\\t\\tdp2[i][i] = (mod+1-val)%mod;\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\/*for (int i = 2; i <= n; i++) {\\n\\t\\t\\tfor (int j = 1; j <= i; j++) {\\n\\t\\t\\t\\tSystem.out.print(dp2[i][j] + \\\" \\\");\\n\\t\\t\\t}\\n\\t\\t\\tSystem.out.println();\\n\\t\\t}*\\/\\n\\t\\t\\n\\t\\tint[] EV = new int[n+1];\\n\\t\\tEV[1] = 0;\\n\\t\\tEV[2] = 1;\\n\\t\\tfor (int i = 3; i <= n; i++) {\\n\\t\\t\\tint val = 0;\\n\\t\\t\\tfor (int j = 1; j < i; j++) {\\n\\t\\t\\t\\tint r = j*(i-j) + (j*(j-1))\\/2 + EV[i-j] + EV[j];\\n\\t\\t\\t\\tr %= mod;\\n\\t\\t\\t\\tval += multiply(dp2[i][j], r, mod);\\n\\t\\t\\t\\tval %= mod;\\n\\t\\t\\t}\\n\\t\\t\\tval += multiply((i*(i-1))\\/2, dp2[i][i], mod);\\n\\t\\t\\tval %= mod;\\n\\t\\t\\t\\n\\t\\t\\tint s = (mod+1-dp2[i][i])%mod;\\n\\t\\t\\tEV[i] = multiply(val, inverse(s, mod), mod);\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(EV[n]);\\n\\t}\\n\\t\\n\\tpublic static int... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\nimport java.util.regex.*;\\n\\n\\/**\\n *\\n * @author jon\\n *\\/\\npublic class Fish {\\n double memo[] = new double[(1<<18)];\\n int N, FULL;\\n double prob[][] = new double[18][18];\\n Fish() {\\n Scanner in = new Scanner(System.in);\\n Arrays.fill(memo, -1);\\n\\n N = in.nextInt();\\n FULL = (1<= 0) return memo[mask];\\n double ret = 0;\\n double mult = Integer.bitCount(mask) + 1;\\n mult *= (mult-1)\\/2.0;\\n\\n\\n for(int i = 0; i < N; i++) {\\n if(((1< k)\\n\\t\\t\\t\\ts = m+1;\\n\\t\\t\\telse {\\n\\t\\t\\t\\tans = m;\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t} \\n\\t\\t}\\n\\n\\t\\twriter.println(ans);\\n\\t\\twriter.close();\\n\\t}\\n\\n\\tstatic class FastReader\\n\\t{\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic FastReader()\\n\\t\\t{\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\n\\t\\tString next()\\n\\t\\t{\\n\\t\\t\\twhile (st == null || !st.hasMoreElements())\\n\\t\\t\\t{\\n\\t\\t\\t\\ttry\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tcatch (IOException e)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tint nextInt()\\n\\t\\t{\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tlong nextLong()\\n\\t\\t{\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble()\\n\\t\\t{\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tString nextLine()\\n\\t\\t{\\n\\t\\t\\tString str = \\\"\\\";\\n\\t\\t\\ttry\\n\\t\\t\\t{\\n\\t\\t\\t\\tstr = br.readLine();\\n\\t\\t\\t}\\n\\t\\t\\tcatch (IOException e)\\n\\t\\t\\t{\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t\\treturn str;\\n\\t\\t}\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.*;\\npublic class hackerearth {\\n\\n public static void main(String[] args) {\\n\\n Scanner sc=new Scanner(System.in);\\n int n=sc.nextInt();\\n\\n HashMap map=new HashMap<>();\\n HashMap map2=new HashMap<>();\\n for(int i=0;i entry:map.entrySet())\\n {\\n ans+=entry.getValue();\\n }\\n System.out.println(ans);\\n\\n\\n }\\n\\n\\n\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStreamReader;\\n\\npublic class Main{\\n public static void main(String[] args)throws IOException{\\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n String s=br.readLine();\\n int max=0;\\n for(int i=0;i>();\\n for (int i = 1; i <= N; i++) {\\n for (int j = i; j <= N; j++) {\\n int sum = pre[j] - pre[i - 1];\\n sumMap.computeIfAbsent(sum, val -> new ArrayList<>()).add(new Pair(i, j));\\n }\\n }\\n var ans = new ArrayList();\\n for (var list : sumMap.values()) {\\n Collections.sort(list, Comparator.comparingInt(p -> p.r));\\n \\/\\/ greedily schedule the intervals\\n int last = 0;\\n var group = new ArrayList();\\n for (Pair p : list) {\\n if (p.l > last) {\\n group.add(p);\\n last = p.r;\\n }\\n }\\n if (group.size() > ans.size()) {\\n ans = group;\\n }\\n }\\n out.println(ans.size());\\n for (Pair p : ans) {\\n out.println(p);\\n }\\n out.close();\\n }\\n\\n static class Pair {\\n int l, r;\\n public Pair(int ll, int rr) {\\n l = ll; r = rr;\\n }\\n public String toString() {\\n return l + \\\" \\\" + r;\\n }\\n }\\n\\n static class FastScanner {\\n private int BS = 1<<16;\\n private char NC = (char)0;\\n private byte[] buf = new byte[BS];\\n private int bId = 0, size = 0;\\n private char c = NC;\\n private double cnt = 1;\\n private BufferedInputStream in;\\n\\n public FastScanner() {\\n in = new BufferedInputStream(System.in, BS);\\n }\\n\\n public FastScanner(String s) {\\n try {\\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\nimport java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\nimport java.io.PrintWriter;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author @zhendeaini6001\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tScanner in = new Scanner(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tTaskA solver = new TaskA();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskA {\\n\\n public void solve(int testNumber, Scanner in, PrintWriter out) {\\n int n = in.nextInt();\\n int a = in.nextInt();\\n int b = in.nextInt();\\n int[] input = IOUtils.readIntArray(in, n);\\n Arrays.sort(input);\\n int x = input[b-1];\\n int y = input[b];\\n out.println(y - x);\\n }\\n}\\n\\nclass IOUtils {\\n\\n public static int[] readIntArray(Scanner in, int size) {\\n int[] array = new int[size];\\n for (int i = 0; i < size; i++)\\n array[i] = in.nextInt();\\n return array;\\n }\\n\\n }\\n\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\n\\npublic class Main {\\n\\n\\tBufferedReader in;\\n\\tStringTokenizer str = null;\\n\\tPrintWriter out;\\n\\t\\n\\tprivate String next() throws Exception{\\n\\t\\twhile (str == null || !str.hasMoreElements())\\n\\t\\t\\tstr = new StringTokenizer(in.readLine());\\n\\t\\treturn str.nextToken();\\n\\t}\\n\\t\\n\\tprivate int nextInt() throws Exception{\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\t\\n\\tprivate long nextLong() throws Exception{\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\t\\n\\tprivate double nextDouble() throws Exception{\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\n\\tfinal int oo = Integer.MAX_VALUE;\\n\\t\\n\\tint [][]s;\\n\\tint n, ALL;\\n\\tpublic void run() throws Exception{\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tn = nextInt();\\n\\t\\tchar []a = next().toCharArray();\\n\\t\\ts = new int[n][52];\\n\\t\\tboolean []set = new boolean[52];\\n\\n\\t\\tfor(int i = 0; i < n; ++i) {\\n\\t\\t\\tint pos = get(a[i]);\\n\\t\\t\\tif (!set[pos]) {\\n\\t\\t\\t\\t++ALL;\\n\\t\\t\\t\\tset[pos] = true;\\n\\t\\t\\t}\\n\\t\\t\\tfor(int j = 0; j < 52; ++j) {\\n\\t\\t\\t\\tif (i > 0) {\\n\\t\\t\\t\\t\\ts[i][j] += s[i-1][j];\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (j == pos) {\\n\\t\\t\\t\\t\\ts[i][j]++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tint ret = oo;\\n\\t\\tfor(int i = 0; i < n; ++i) {\\n\\t\\t\\tret = Math.min(ret, get(i));\\n\\t\\t}\\n\\n\\t\\tout.println(ret);\\n\\t\\tout.close();\\n\\t}\\n\\n\\tprivate int get(int i) {\\n\\t\\tint lo = i - 1, hi = n;\\n\\t\\twhile(hi - lo > 1) {\\n\\t\\t\\tint m = lo + (hi - lo) \\/ 2;\\n\\t\\t\\tint c = 0;\\n\\t\\t\\tfor(int j = 0; j < 52; ++j) {\\n\\t\\t\\t\\tif (sum(j, i, m) > 0) {\\n\\t\\t\\t\\t\\t++c;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif (c < ALL) {\\n\\t\\t\\t\\tlo = m;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\thi = m;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tif (hi != n) {\\n\\t\\t\\treturn hi - i + 1;\\n\\t\\t}\\n\\t\\treturn oo;\\n\\t}\\n\\n\\tprivate int sum(int pos, int l, int r) {\\n\\t\\tint ret = s[r][pos];\\n\\t\\tif (l > 0) ret -= s[l - 1][pos];\\n\\t\\treturn ret;\\n\\t}\\n\\n\\tprivate int get(char x) {\\n\\t\\tif ('a' <= x && x <= 'z') return (int)(x - 'a');\\n\\t\\treturn (int)(x - 'A' + 26);\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tnew Main().run();\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.StreamTokenizer;\\nimport java.util.Arrays;\\n\\n\\/* Template for TopCoder and ACMonline. *\\/\\npublic class A {\\n private static StreamTokenizer in = null;\\n private static PrintWriter out = null;\\n \\n static int nextInt() throws IOException {\\n in.nextToken();\\n return (int) in.nval;\\n }\\n \\n static long nextLong() throws IOException {\\n in.nextToken();\\n return (long) in.nval;\\n }\\n\\n static double nextDouble() throws IOException {\\n in.nextToken();\\n return (double) in.nval;\\n }\\n \\n static String nextString() throws IOException {\\n in.nextToken();\\n return in.sval;\\n }\\n \\n public static void main(String[] args) throws IOException {\\n in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n out = new PrintWriter(System.out);\\n \\/\\/ Here is the solution:\\n new A().solve();\\n out.flush();\\n }\\n \\n public void solve() throws IOException {\\n int n = nextInt();\\n int min = Integer.MAX_VALUE;\\n int res = Integer.MAX_VALUE;\\n for (int i=0; imin && d2&&graph[first][i]){\\n res+=dp[mask][i];\\n }\\n }\\n }\\n \\n System.out.println(res\\/2);\\n }\\n \\n} What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class PythonIndentation {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint N = Integer.parseInt(in.readLine());\\n\\t\\tint[][] dp = new int[N][N];\\n\\t\\tdp[0][0] = 1;\\n\\t\\tfor(int i = 1; i < N; ++i) {\\n\\t\\t\\tchar lastCmd = in.readLine().charAt(0);\\n\\t\\t\\tint[] sum = new int[N];\\n\\t\\t\\tsum[N - 1] = dp[i - 1][N - 1];\\n\\t\\t\\tfor(int j = N - 2; j >= 0; --j)\\n\\t\\t\\t\\tsum[j] = (sum[j + 1] + dp[i - 1][j]) % 1000000007;\\n\\t\\t\\tfor(int j = 0; j < N; ++j) {\\n\\t\\t\\t\\tif(lastCmd == 'f' && j > 0)\\n\\t\\t\\t\\t\\tdp[i][j] = dp[i - 1][j - 1];\\n\\t\\t\\t\\telse if(lastCmd == 's')\\n\\t\\t\\t\\t\\tdp[i][j] = sum[j];\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint ans = 0;\\n\\t\\tfor(int i = 0; i < N; ++i)\\n\\t\\t\\tans = (ans + dp[N - 1][i]) % 1000000007;\\n\\t\\tSystem.out.println(ans);\\n\\t}\\n}\\n Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.LinkedList;\\nimport java.util.Locale;\\nimport java.util.Scanner;\\n\\npublic class A{\\n\\n void exe(){\\n LinkedList list=new LinkedList();\\n for(int i=2;i<=1000;i++)\\n if(isPrime(i))\\n list.add(i);\\n Object[] primes=list.toArray();\\n \\n Scanner sc=new Scanner(System.in);\\n int n=sc.nextInt();\\n int k=sc.nextInt();\\n int cnt=0;\\n for(int c=2;c<=n;c++){\\n if(!isPrime(c))\\n continue;\\n for(int i=0;i=k){\\n System.out.println(\\\"YES\\\");\\n }else{\\n System.out.println(\\\"NO\\\");\\n }\\n }\\n\\n boolean isPrime(int n){\\n if(n<=1)return false;\\n if(n==2)return true;\\n if(n%2==0)return false;\\n int m=(int)Math.sqrt(n)+1;\\n for(int i=3;i<=m;i+=2)\\n if(n%i==0)\\n return false;\\n return true;\\n }\\n \\n public static void main(String[] args){\\n Locale.setDefault(Locale.US);\\n new A().exe();\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\nimport java.lang.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Main implements Runnable {\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private SpaceCharFilter filter;\\n private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars==-1)\\n throw new InputMismatchException();\\n\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n }\\n catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n\\n if(numChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n public String nextLine() {\\n String str = \\\"\\\";\\n try {\\n str = br.readLine();\\n }\\n catch (IOException e) {\\n e.printStackTrace();\\n }\\n return str;\\n }\\n public int nextInt() {\\n int c = read();\\n\\n while(isSpaceChar(c))\\n c = read();\\n\\n int sgn = 1;\\n\\n if (c == '-') {\\n sgn = -1;\\n c = read();\\n }\\n\\n int res = 0;\\n do {\\n if(c<'0'||c>'9')\\n throw new InputMismatchException();\\n res *= 10;\\n res += c - '0';\\n c = read();\\n }\\n while (!isSpaceChar(c));\\n\\n return res * sgn;\\n }\\n\\n public long nextLong() {\\n int c = read();\\n while (isSpaceChar(c))\\n c = read();\\n int sgn = 1;\\n if (c == '-') {\\n... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class helloWorld \\n{\\n\\tpublic static void main(String[] args) \\n\\t{\\t\\t\\n\\t\\tScanner in = new Scanner(System.in);\\n\\t\\tint a = in.nextInt();\\n\\t\\tint b = in.nextInt();\\n\\t\\tint c = in.nextInt();\\n\\t\\tint n = in.nextInt();\\n\\n\\t\\tint ans = n - (a + b - c);\\n\\t\\tif(ans < 1 || a >= n || b >= n || c > a || c > b)\\n\\t\\t\\tans = -1;\\n\\t\\t\\n\\t\\tSystem.out.println(ans);\\n\\t\\t\\n\\t\\tin.close();\\n\\t}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n long n = in.nextLong();\\n long k = in.nextLong();\\n\\n long res = solve(n, k);\\n System.out.println(res);\\n }\\n\\n private static long solve(long n, long k) {\\n return solveEq(1, -3 - 2 * n, n * n + n - 2 * k);\\n }\\n\\n private static long solveEq(long a, long b, long c) {\\n long delta = b * b - 4 * a * c;\\n return (-b - (long)Math.sqrt(delta)) \\/ (2 * a);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Main {\\n static int n;\\n static long TotalTime;\\n static Problem[] problems;\\n static StringBuilder sb;\\n public static void main(String[] args) {\\n FastScanner sc = new FastScanner();\\n sb = new StringBuilder();\\n n = sc.nextInt();\\n TotalTime = sc.nextLong();\\n problems = new Problem[n];\\n for (int i = 0; i < n; i++) {\\n problems[i] = new Problem (sc.nextInt(), sc.nextLong(), i);\\n }\\n Arrays.sort(problems);\\n long num = -1;\\n long high = n;\\n long low = 0;\\n int iter = 0;\\n while (high - low > 1) {\\n num = (high + low) \\/ 2;\\n if (test(num, false)) {\\n low = num;\\n }\\n else {\\n high = num;\\n }\\n }\\n if (test(high, false))\\n num = high;\\n else\\n num = low;\\n test(num, true);\\n System.out.print(sb);\\n }\\n\\n public static boolean test (long num, boolean print) {\\n int count = 0;\\n long sum = 0L;\\n if (print) sb.append(num + \\\"\\\\n\\\" + num + \\\"\\\\n\\\");\\n for (int i = 0; i < n && count < num; i++) {\\n if (problems[i].a >= num) {\\n count++;\\n sum += problems[i].t;\\n if (print) sb.append((problems[i].index + 1) + \\\" \\\");\\n }\\n }\\n return (count == num) && (sum <= TotalTime);\\n }\\n\\n public static class Problem implements Comparable {\\n int a;\\n long t;\\n int index;\\n \\n public int compareTo(Problem o) {\\n return Long.compare(t, o.t);\\n }\\n public Problem (int a, long t, int index) {\\n this.a = a;\\n this.t = t;\\n this.index = index;\\n }\\n }\\n\\n\\n public static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner(Reader in) {\\n br = new BufferedReader(in);\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\nimport java.util.regex.Matcher;\\nimport java.util.regex.Pattern;\\n\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner scn = new Scanner(System.in);\\n\\t\\t\\n\\t\\tint t = scn.nextInt();\\n\\t\\twhile(t-- >0){\\n\\t\\t\\tString str = scn.next();\\n\\t\\t\\tPattern p = Pattern.compile(\\\"R[0-9]+C[0-9]+\\\");\\n\\t\\t\\tMatcher m = p.matcher(str);\\n\\t\\t\\tif (m.matches()){\\n\\t\\t\\t\\tString nums[] = str.split(\\\"[RC]\\\");\\n\\t\\t\\t\\tString first = nums[1];\\n\\t\\t\\t\\tString second = nums[2];\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tString ans = \\\"\\\";\\n\\t\\t\\t\\tlong num = Integer.parseInt(second);\\n\\t\\t\\t\\twhile(num >0){\\n\\t\\t\\t\\t\\tif (num % 26 > 0){\\n\\t\\t\\t\\t\\t\\tans += (char)(num%26+'A'-1);\\n\\t\\t\\t\\t\\t\\tnum\\/=26;\\n\\t\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\t\\tans += 'Z';\\n\\t\\t\\t\\t\\t\\tnum\\/=26;\\n\\t\\t\\t\\t\\t\\tnum--;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tfor (int i = ans.length()-1; i>=0;--i){\\n\\t\\t\\t\\t\\tSystem.out.print(ans.charAt(i));\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tSystem.out.println(first);\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tString first = str.split(\\\"[0-9]+\\\")[0];\\n\\t\\t\\t\\tString second = str.split(\\\"[A-Z]+\\\")[1];\\n\\t\\t\\t\\tSystem.out.print(\\\"R\\\"+second);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tlong num = 0, pow = 1;\\n\\t\\t\\t\\tfor (int i = first.length()-1; i>=0; --i){\\n\\t\\t\\t\\t\\tnum += (long)(first.charAt(i)-'A'+1) * pow;\\n\\t\\t\\t\\t\\tpow*=26;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tSystem.out.println(\\\"C\\\"+num);\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t}\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.Scanner;\\n\\n\\/**\\n * 2013.07.27 No.1 235A LCM Challenge\\n * 数论 n%2 == 0? n%3 == 0?\\n * @author Administrator * \\n *\\/\\n\\npublic class Main {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n int n = in.nextInt();\\n if (n < 3)\\n System.out.println(n);\\n else if (n % 2 != 0)\\n System.out.println((long)n * (n - 1) * (n - 2));\\n else if(n % 3 != 0)\\n System.out.println((long)n * (n - 1) * (n - 3));\\n else \\n System.out.println((long)(n - 1) * (n - 2) * (n - 3));\\n in.close();\\n \\n\\n }\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class Main {\\n \\n Scanner in;\\n PrintWriter out;\\n \\n static class House implements Comparable {\\n int len;\\n int pos;\\n \\n House(Scanner in){\\n pos = in.nextInt() * 2;\\n len = in.nextInt() * 2; \\n }\\n \\n public int compareTo(House arg0) {\\n return this.pos-arg0.pos;\\n }\\n \\n }\\n \\n void solve(){\\n int n = in.nextInt();\\n int size = in.nextInt();\\n House []h = new House[n];\\n for (int i = 0; i < h.length; i++){\\n h[i] = new House(in);\\n }\\n Arrays.sort(h);\\n int ans = 2;\\n for (int i = 0; i < h.length - 1; i++){\\n int next = i + 1;\\n int sz = h[next].pos - h[i].pos - (h[next].len + h[i].len) \\/ 2;\\n if (sz == size * 2) {\\n ans ++;\\n } else if (sz > size * 2) {\\n ans += 2;\\n }\\n }\\n out.println(ans);\\n }\\n \\n public void run(){\\n in = new Scanner(System.in);\\n out = new PrintWriter(System.out);\\n \\n try {\\n solve();\\n } finally {\\n out.close();\\n }\\n }\\n \\n void asserT(boolean e){\\n if (!e){\\n throw new Error();\\n }\\n }\\n\\n public static void main(String[] args) {\\n new Main().run();\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.lang.*;\\nimport java.math.*;\\nimport java.util.*;\\nimport java.io.*;\\npublic class Main {\\n void solve() {\\n int n=ni(),m=ni();\\n int a[][]=new int[n+1][m+1];\\n for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) a[i][j]=ni();\\n\\n if(n==1){\\n int mn=Integer.MAX_VALUE;\\n for(int i=1;in){\\n \\/\\/ if(mn2[first][prev]==0) pw.println(prev+\\\" \\\"+first+\\\" \\\"+mn2[first][prev]);\\n return mn2[first][prev];\\n }\\n if(dp[first][mask][prev]!=-1) return dp[first][mask][prev];\\n int cc=0;\\n for(int k=1;k<=n;k++){\\n if((mask&(1<<(k-1)))==0){\\n cc=Math.max(cc,Math.min(mn1[prev][k],go(i+1,mask|(1<<(k-1)),k,first,n)));\\n \\/\\/if(mn1[prev][k]==0) pw.println(mn1[prev][k]+\\\" \\\"+prev+\\\" \\\"+k);\\n }\\n }\\n dp[first][mask][prev]=cc;\\n return cc;\\n }\\n\\n\\n\\n long M= (long)1e9+7;\\n... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\n\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\n\\n\\npublic class Main {\\n\\n \\n public static void main(String[] args)throws java.lang.Exception {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n String s = br.readLine();\\n int max = 0;\\n for (int i = 0; i < s.length(); i++) {\\n for (int j = i+1; j < s.length(); j++) {\\n if(s.substring(i+1).contains(s.substring(i,j)))\\n max = Math.max(max, j-i);\\n\\n }}\\n System.out.println(max);\\n\\n\\n\\n \\n }\\n\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class a{\\n static BufferedReader br;\\n static PrintWriter pw;\\n static int N, M, K;\\n static ArrayList graph[][];\\n public static void main(String args[]) throws IOException{\\n br = new BufferedReader(new InputStreamReader(System.in));\\n pw = new PrintWriter(System.out);\\n StringTokenizer st = new StringTokenizer(br.readLine());\\n N = Integer.parseInt(st.nextToken());\\n M = Integer.parseInt(st.nextToken());\\n K = Integer.parseInt(st.nextToken());\\n if(K % 2 == 1){\\n for(int i = 0; i < N; i++){\\n for(int j = 0; j < M; j++){\\n pw.print(\\\"-1 \\\");\\n }\\n pw.println();\\n }\\n br.close(); pw.close();\\n return;\\n }\\n graph = new ArrayList[N][M];\\n for(int i = 0; i < N; i++){\\n for(int j = 0; j < M; j++){\\n graph[i][j] = new ArrayList();\\n }\\n }\\n for(int i = 0; i < N; i++){\\n st = new StringTokenizer(br.readLine());\\n for(int j = 0; j < M-1; j++){\\n int w = Integer.parseInt(st.nextToken());\\n graph[i][j].add(w);\\n }\\n }\\n for(int i = 0; i < N; i++){\\n graph[i][M-1].add(0);\\n }\\n for(int i = 0; i < N-1; i++){\\n st = new StringTokenizer(br.readLine());\\n for(int j = 0; j < M; j++){\\n int w = Integer.parseInt(st.nextToken());\\n graph[i][j].add(w);\\n }\\n }\\n K \\/= 2;\\n for(int i = 0; i < M; i++) graph[N-1][i].add(0);\\n long ans[][][] = new long[K+1][N][M];\\n for(int i = 0; i < N; i++){\\n Arrays.fill(ans[0][i], 0);\\n }\\n for(int i = 1; i <= K; i++){\\n for(int x = 0; x < N; x++){\\n for(int y = 0; y < M; y++){\\n long cur = (long)1e17;\\n if(x < N-1){\\n cur =... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic final class PythonIndentation\\n{\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tnew PythonIndentation(System.in, System.out);\\n\\t}\\n\\n\\tstatic class Solver implements Runnable\\n\\t{\\n\\t\\tstatic final int MOD = (int) 1e9 + 7;\\n\\t\\tint n;\\n\\t\\tchar[] arr;\\n\\t\\tlong[][] dp;\\n\\t\\tBufferedReader in;\\n\\t\\tPrintWriter out;\\n\\n\\t\\tvoid solve() throws IOException\\n\\t\\t{\\n\\t\\t\\tn = Integer.parseInt(in.readLine());\\n\\t\\t\\tarr = new char[n];\\n\\t\\t\\tdp = new long[n + 1][n + 1];\\n\\n\\t\\t\\tfor (int i = 0; i < n; i++)\\n\\t\\t\\t\\tarr[i] = in.readLine().charAt(0);\\n\\n\\t\\t\\tfor (int i = 0; i <= n; i++)\\n\\t\\t\\t\\tArrays.fill(dp[i], -1);\\n\\n\\t\\t\\tdp[0][0] = 1;\\n\\n\\t\\t\\tif (arr[0] == 's')\\n\\t\\t\\t\\tout.println(find(1, 0));\\n\\t\\t\\telse\\n\\t\\t\\t\\tout.println(find(1, 1));\\n\\t\\t}\\n\\n\\t\\tlong find(int curr, int backIndents)\\n\\t\\t{\\n\\t\\t\\tif (backIndents < 0)\\n\\t\\t\\t\\treturn 0;\\n\\n\\t\\t\\tif (curr == n)\\n\\t\\t\\t\\treturn 1;\\n\\n\\t\\t\\tif (dp[curr][backIndents] != -1)\\n\\t\\t\\t\\treturn dp[curr][backIndents];\\n\\n\\t\\t\\tlong ans;\\n\\n\\t\\t\\tif (arr[curr] == 's')\\n\\t\\t\\t\\tans = find(curr + 1, backIndents);\\n\\t\\t\\telse\\n\\t\\t\\t\\tans = find(curr + 1, backIndents + 1);\\n\\n\\t\\t\\tif (arr[curr - 1] != 'f')\\n\\t\\t\\t\\tans = CMath.mod(ans + find(curr, backIndents - 1), MOD);\\n\\n\\t\\t\\treturn dp[curr][backIndents] = ans;\\n\\t\\t}\\n\\n\\t\\tpublic Solver(BufferedReader in, PrintWriter out)\\n\\t\\t{\\n\\t\\t\\tthis.in = in;\\n\\t\\t\\tthis.out = out;\\n\\t\\t}\\n\\n\\t\\t@Override public void run()\\n\\t\\t{\\n\\t\\t\\ttry\\n\\t\\t\\t{\\n\\t\\t\\t\\tsolve();\\n\\t\\t\\t}\\n\\t\\t\\tcatch (IOException e)\\n\\t\\t\\t{\\n\\t\\t\\t\\te.printStackTrace();\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic class CMath\\n\\t{\\n\\t\\tstatic long mod(long number, long mod)\\n\\t\\t{\\n\\t\\t\\treturn number - (number \\/ mod) * mod;\\n\\t\\t}\\n\\n\\t}\\n\\n\\tprivate PythonIndentation(InputStream inputStream, OutputStream outputStream)\\n\\t{\\n\\t\\tBufferedReader in = new BufferedReader(new InputStreamReader(inputStream));\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tThread thread = new Thread(null, new Solver(in, out), \\\"PythonIndentation\\\", 1 << 29);\\n\\n\\t\\ttry\\n\\t\\t{\\n\\t\\t\\tthread.start();\\n\\t\\t\\tthread.join();\\n\\t\\t}\\n\\t\\tcatch (InterruptedException e)\\n\\t\\t{\\n\\t\\t\\te.printStackTrace();\\n\\t\\t}\\n\\t\\tfinally\\n\\t\\t{\\n\\t\\t\\ttry\\n\\t\\t\\t{\\n\\t\\t\\t\\tin.close();\\n\\t\\t\\t}\\n\\t\\t\\tcatch (IOException... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class A015 {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner in = new Scanner(System.in);\\n\\t\\tint n = in.nextInt(), t = in.nextInt();\\n\\t\\tint[] centers = new int[n], sides = new int[n];\\n\\t\\tfor (int x = 0; x < n; x++) {\\n\\t\\t\\tcenters[x] = in.nextInt();\\n\\t\\t\\tsides[x] = in.nextInt();\\n\\t\\t}\\n\\t\\tint count = 0;\\n\\n\\t\\tbig: for (int x = -4000; x <= 4000; x++) {\\n\\t\\t\\tboolean touch = false;\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tint d = 2*centers[i] - x;\\n\\t\\t\\t\\td = d > 0 ? d : -d;\\n\\t\\t\\t\\tint s = t + sides[i];\\n\\t\\t\\t\\tif (s == d) {\\n\\t\\t\\t\\t\\ttouch = true;\\n\\t\\t\\t\\t} else if (s > d) {\\n\\t\\t\\t\\t\\tcontinue big;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tif (touch)\\n\\t\\t\\t\\tcount++;\\n\\t\\t}\\n\\t\\tSystem.out.println(count);\\n\\t}\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.HashSet;\\nimport java.util.PriorityQueue;\\nimport java.util.StringTokenizer;\\n\\npublic class Main {\\n\\n\\tfinal static int mod = 1_000_000_007;\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\n\\t\\tSTDIN scan = new STDIN();\\n\\t\\tPrintWriter pw = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tint n = scan.nextInt();\\n\\t\\tboolean even = true;\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\ta[i] = scan.nextInt();\\n\\t\\t\\tfor(int j = 0; j < i; j++)\\n\\t\\t\\t\\tif(a[i] < a[j]) even = !even;\\n\\t\\t}\\n\\t\\tint q = scan.nextInt();\\n\\t\\twhile(q-- > 0) {\\n\\t\\t\\tint l = scan.nextInt(), r = scan.nextInt();\\n\\t\\t\\tint len = r - l + 1;\\n\\t\\t\\tint permutations = len * (len - 1) \\/ 2;\\n\\t\\t\\tif(permutations % 2 != 0) even = !even;\\n\\t\\t\\tpw.println(even ? \\\"even\\\" : \\\"odd\\\");\\n\\t\\t}\\n\\t\\t\\n\\t\\tpw.flush();\\n\\t}\\n\\t\\t\\n\\tstatic class STDIN {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tpublic STDIN() {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tst = null;\\n\\t\\t}\\n\\n\\t\\tboolean hasNext() throws Exception {\\n\\t\\t\\tif (!st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.hasMoreTokens();\\n\\t\\t}\\n\\n\\t\\tint nextInt() throws Exception {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tlong nextLong() throws Exception {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble() throws Exception {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tString next() throws Exception {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tString nextLine() throws Exception {\\n\\t\\t\\treturn br.readLine();\\n\\t\\t}\\n\\t}\\n} Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/*(c) gorlum0 [at] gmail.com*\\/\\nimport java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class E\\n{\\n int bitcount(int x) {\\n int c = 0;\\n for ( ; x != 0; c++)\\n x &= x-1;\\n return c;\\n }\\n\\n boolean bit(int x, int i)\\n {\\n if (i < 0) return false;\\n return (x>>i & 1) == 1 ? true : false;\\n }\\n\\n int solve(int n, int m)\\n {\\n if (m > n) { int x = m; m = n; n = x; }\\n int maxmask = 1< 0)\\n {\\tif((y & 1)==1)\\n res = (res * x) % p;\\n y = y >> 1; \\n x = (x * x) % p; \\n }\\n return res;\\n }\\n\\t\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\tlong x=sc.nextLong();\\n\\t\\tlong k=sc.nextLong();\\n\\t\\tlong mod=1000000007;\\n\\t\\tif(k==0 || x==0)\\n\\t\\t\\tSystem.out.println((2*x)%mod);\\n\\t\\telse\\n\\t\\t{\\tlong answer=1;\\n\\t\\t\\tanswer+=(power(2,k,mod))*(((2*x)-1)%mod);\\n\\t\\t\\tSystem.out.println(answer%mod);\\n\\t\\t}\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\npublic class B {\\n static class Scan {\\n private byte[] buf=new byte[1024];\\n private int index;\\n private InputStream in;\\n private int total;\\n public Scan()\\n {\\n in=System.in;\\n }\\n public int scan()throws IOException\\n {\\n if(total<0)\\n throw new InputMismatchException();\\n if(index>=total)\\n {\\n index=0;\\n total=in.read(buf);\\n if(total<=0)\\n return -1;\\n }\\n return buf[index++];\\n }\\n public int scanInt()throws IOException\\n {\\n int integer=0;\\n int n=scan();\\n while(isWhiteSpace(n))\\n n=scan();\\n int neg=1;\\n if(n=='-')\\n {\\n neg=-1;\\n n=scan();\\n }\\n while(!isWhiteSpace(n))\\n {\\n if(n>='0'&&n<='9')\\n {\\n integer*=10;\\n integer+=n-'0';\\n n=scan();\\n }\\n else throw new InputMismatchException();\\n }\\n return neg*integer;\\n }\\n public double scanDouble()throws IOException\\n {\\n double doub=0;\\n int n=scan();\\n while(isWhiteSpace(n))\\n n=scan();\\n int neg=1;\\n if(n=='-')\\n {\\n neg=-1;\\n n=scan();\\n }\\n while(!isWhiteSpace(n)&&n!='.')\\n {\\n if(n>='0'&&n<='9')\\n {\\n doub*=10;\\n doub+=n-'0';\\n n=scan();\\n }\\n else throw new InputMismatchException();\\n }\\n if(n=='.')\\n {\\n n=scan();\\n double temp=1;\\n while(!isWhiteSpace(n))\\n {\\n if(n>='0'&&n<='9')\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskD solver = new TaskD();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskD {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = in.nextInt();\\n }\\n int inv = 0;\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < i; j++) {\\n if (a[j] > a[i]) {\\n inv++;\\n }\\n }\\n }\\n int m = in.nextInt();\\n for (int i = 0; i < m; i++) {\\n int l = in.nextInt();\\n int r = in.nextInt();\\n int s = (r - l + 1) * (r - l) \\/ 2;\\n inv = (inv + s) % 2;\\n out.println(inv % 2 == 0 ? \\\"even\\\" : \\\"odd\\\");\\n }\\n }\\n\\n }\\n\\n static class InputReader {\\n private BufferedReader reader;\\n private StringTokenizer stt;\\n\\n public InputReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream));\\n }\\n\\n public String nextLine() {\\n try {\\n return reader.readLine();\\n } catch (IOException e) {\\n return null;\\n }\\n }\\n\\n public String next() {\\n while (stt == null ||... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.PrintWriter;\\nimport java.io.FileInputStream;\\nimport java.io.FileOutputStream;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.util.Arrays;\\nimport java.util.Random;\\nimport java.util.StringTokenizer;\\n\\npublic class Task {\\n\\n\\tprivate static final boolean readFromFile = false;\\n\\t\\n\\tpublic static void main(String args[]){\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tFileOutputStream fileOutputStream;\\n\\t\\tFileInputStream fileInputStream;\\n\\t\\tif (readFromFile){\\n\\t\\t\\ttry{\\n\\t\\t\\t\\tfileInputStream = new FileInputStream(new File(\\\"input.txt\\\"));\\n\\t\\t\\t\\tfileOutputStream = new FileOutputStream(new File(\\\"output.txt\\\"));\\n\\t\\t\\t}catch (FileNotFoundException e){\\n\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tPrintWriter out = new PrintWriter((readFromFile)?fileOutputStream:outputStream);\\n\\t\\tInputReader in = new InputReader((readFromFile)?fileInputStream:inputStream);\\n\\t\\t\\n\\t\\tSolver s = new Solver(in,out);\\n\\t\\ts.solve();\\n\\t\\t\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass Solver{\\n\\tInputReader in;\\n\\tPrintWriter out;\\n\\t\\n\\tpublic void solve(){\\n\\t\\tString s = in.nextLine();\\n\\t\\tfor (int len=s.length()-1;len>=1;len--)\\n\\t\\t\\tfor (int i=0;i sset = new TreeSet();\\n for (int i = 0; i < n; i++)\\n {\\n int a = nextInt();\\n sset.add(a);\\n }\\n\\n if (sset.size() < 2)\\n out.println(\\\"NO\\\");\\n else\\n {\\n Integer v[] = (Integer[]) sset.toArray(new Integer[sset.size()]);\\n sort(v);\\n out.println(v[1]);\\n }\\n }\\n\\n \\/\\/ -------------- Input\\/Output routines below ---------------\\/\\/\\n private BufferedReader in;\\n PrintWriter out;\\n StringTokenizer tokenizer;\\n\\n public void run()\\n {\\n \\/\\/ String problem = this.getClass().getName();\\n try\\n {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(new BufferedOutputStream(System.out));\\n solve();\\n out.flush();\\n in.close();\\n out.close();\\n }\\n catch (Exception e)\\n {\\n e.printStackTrace();\\n \\/\\/ System.exit(1);\\n }\\n }\\n\\n String nextToken() throws IOException\\n {\\n while (tokenizer == null || !tokenizer.hasMoreTokens())\\n {\\n tokenizer = new StringTokenizer(in.readLine());\\n }\\n return tokenizer.nextToken();\\n }\\n\\n int nextInt() throws IOException\\n {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() throws IOException\\n {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() throws IOException\\n {\\n return Double.parseDouble(nextToken());\\n }\\n\\n} Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\n\\npublic class R111_D2_A {\\n\\n public static void main(String[] args) {\\n InputReader in = new InputReader(System.in);\\n \\/\\/ BufferedReader in = new BufferedReader(new\\n \\/\\/ InputStreamReader(System.in));\\n int n = in.readInt();\\n int[] inp = new int[n];\\n for (int i = 0; i < inp.length; i++) {\\n inp[i] = in.readInt();\\n }\\n Arrays.sort(inp);\\n int sum1 = 0;\\n int res = 0;\\n for (int i = inp.length - 1; i >= 0; i--) {\\n sum1 += inp[i];\\n res++;\\n int sum2 = 0;\\n for (int j = 0; j < i; j++) {\\n sum2 += inp[j];\\n }\\n if (sum1 > sum2) {\\n break;\\n }\\n }\\n System.out.println(res);\\n }\\n\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1000];\\n private int curChar, numChars;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n private int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n if (numChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n public int readInt() {\\n int c = read();\\n while (isSpaceChar(c))\\n c = read();\\n int sgn = 1;\\n if (c == '-') {\\n sgn = -1;\\n c = read();\\n }\\n int res = 0;\\n do {\\n if (c < '0' || c > '9')\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.Scanner;\\nimport java.util.TreeMap;\\n\\n\\/**\\n *\\n * @author camoroh13\\n *\\/\\npublic class Solution {\\n\\n public static void main(String[] args) throws IOException {\\n Scanner sc = new Scanner(System.in);\\n \\/\\/ Scanner sc = new Scanner(new FileInputStream(\\\"\\/home\\/camoroh13\\/NetBeansProjects\\/JavaApplication1\\/src\\/input.txt\\\"));\\n int n = sc.nextInt();\\n int t = sc.nextInt();\\n\\/\\/ int[][] h = new int[n][2];\\n TreeMap h = new TreeMap();\\n for (int i=0; i < n; i++) {\\n int key = sc.nextInt();\\n h.put(key, sc.nextInt());\\n }\\n\\n int ans = 2;\\n Integer lastKey = h.firstKey();\\n Integer last = h.get(lastKey);\\n h.remove(lastKey);\\n for (int i=1; i < n; i++) {\\n int key = h.firstKey();\\n int val = h.get(key);\\n \\/\\/System.out.println(Math.abs(key-val*1.0\\/2 - (lastKey + last*1.0\\/2)) + \\\"-\\\" + key + \\\"-\\\"+val);\\n if (Math.abs(key-val*1.0\\/2 - (lastKey + last*1.0\\/2)) == t) {\\n ans++;\\n } else if (Math.abs(key-val*1.0\\/2 - (lastKey + last*1.0\\/2)) > t) {\\n ans += 2;\\n }\\n lastKey = key;\\n last = val;\\n h.remove(lastKey);\\n }\\n\\n System.out.println(ans);\\n \\n sc.close();\\n }\\n\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class LightItUp {\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t StringTokenizer st = new StringTokenizer(br.readLine());\\n\\t\\t\\n\\t\\tint n = Integer.parseInt(st.nextToken());\\n\\t\\tint m = Integer.parseInt(st.nextToken());\\n\\t\\tint previous = 0;\\n\\t\\tint array[] = new int[n+1];\\n\\t\\tint answer = 0;\\n\\t\\t\\n\\t\\tStringTokenizer st1 = new StringTokenizer(br.readLine());\\n\\t\\tfor(int i = 0; i < n; i++){\\n\\t\\t\\tarray[i] = Integer.parseInt(st1.nextToken());\\n\\t\\t\\tif(i % 2 == 0){\\n\\t\\t\\t\\tanswer += (array[i] - previous);\\n\\t\\t\\t}\\n\\t\\t\\tprevious = array[i];\\n\\t\\t}\\n\\t\\t\\n\\t\\tif(n % 2 == 0){\\n\\t\\t\\tanswer += (m - previous);\\n\\t\\t}\\n\\t\\tprevious = m;\\n\\t\\tint max = Integer.MAX_VALUE;\\n\\t\\t\\n\\t\\twhile(n-- != 0){\\n\\t\\t\\tint temp = array[n];\\n\\t\\t\\tif(n%2 == 0){\\n\\t\\t\\t\\tarray[n] = array[n+1] - (previous - array[n]);\\n\\t\\t\\t}\\n\\t\\t\\telse{\\n\\t\\t\\t\\tarray[n] = array[n+1] + (previous - array[n]);\\n\\t\\t\\t}\\n\\t\\t\\tprevious = temp;\\n\\t\\t\\tmax = Math.min(max, array[n]);\\n\\t\\t}\\n\\t\\tif(max>=-1){\\n\\t\\t\\tSystem.out.println(answer);\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tSystem.out.println(answer - (max+1));\\n\\t\\t}\\n\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.math.BigDecimal;\\nimport java.math.MathContext;\\nimport java.math.RoundingMode;\\nimport java.nio.charset.Charset;\\nimport java.util.*;\\n\\nimport static java.lang.System.gc;\\nimport static java.lang.System.out;\\n\\npublic class Main {\\n\\n Scanner scanner = new Scanner(System.in);\\n\\n public static void main(String[] args) {\\n new Main().solve();\\n }\\n\\n\\n void solve() {\\n\\n int n = scanner.nextInt();\\n scanner.nextLine();\\n String s1 = scanner.nextLine();\\n String s2 = scanner.nextLine();\\n\\n\\n int ans = 0;\\n boolean a[] = new boolean[30];\\n boolean b[] = new boolean[30];\\n\\n for (int i = 0; i < n; i++) {\\n if (s1.charAt(i) != s2.charAt(i)) {\\n ans ++;\\n a[s1.charAt(i) - 'a'] = true;\\n b[s2.charAt(i) - 'a'] = true;\\n }\\n }\\n for (int i = 0; i < n; i++) {\\n if (s1.charAt(i) != s2.charAt(i) && a[s2.charAt(i) - 'a'] && b[s1.charAt(i) - 'a']) {\\n for (int j = i + 1; j < n; j ++) {\\n if (s1.charAt(i) == s2.charAt(j) && s1.charAt(j) == s2.charAt(i)) {\\n out.println(ans - 2);\\n out.println((i + 1) + \\\" \\\" + (j + 1));\\n return;\\n }\\n }\\n }\\n }\\n\\n for (int i = 0; i < n; i++) {\\n if (s1.charAt(i) != s2.charAt(i) && (a[s2.charAt(i) - 'a'] || b[s1.charAt(i) - 'a'])) {\\n for (int j = i + 1; j < n; j ++) {\\n if (s1.charAt(j) != s2.charAt(j) && (s1.charAt(i) == s2.charAt(j) || s1.charAt(j) == s2.charAt(i))) {\\n out.println(ans - 1);\\n out.println((i + 1) + \\\" \\\" + (j + 1));\\n return;\\n }\\n }\\n }\\n }\\n\\n out.println(ans);\\n out.println(-1 + \\\" \\\" + -1);\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/ package Practice1.CF35;\\n\\nimport java.io.*;\\nimport java.util.LinkedList;\\nimport java.util.Queue;\\nimport java.util.Scanner;\\n\\npublic class CF035C {\\n public static void main(String[] args) throws IOException {\\n Scanner s = new Scanner(new File(\\\"input.txt\\\")\\/*System.in*\\/);\\n int n = s.nextInt();\\n int m = s.nextInt();\\n int k = s.nextInt();\\n\\/\\/ pair[] arr = new pair[n];\\n Queue q = new LinkedList<>();\\n PrintWriter out = new PrintWriter(new FileWriter(\\\"output.txt\\\"));\\n boolean[][] visited = new boolean[n][m];\\n for (int i = 0; i < k; i++) {\\n int x = s.nextInt() - 1;\\n int y = s.nextInt() - 1;\\n visited[x][y] = true;\\n pair p = new pair(x,y);\\n\\/\\/ arr[i] = p;\\n q.add(p);\\n }\\n\\n q.add(null);\\n int[] dx = {0,0,1,-1};\\n int[] dy = {1,-1,0,0};\\n int ansX = q.peek().x;\\n int ansY = q.peek().y;\\n while(true){\\n if(q.peek() == null){\\n q.poll();\\n q.add(null);\\n }\\n pair p = q.poll();\\n if(p == null){\\n break;\\n }\\n for (int i = 0; i < 4; i++) {\\n if(isValid(p.x + dx[i],p.y+dy[i],n,m) && !visited[p.x + dx[i]][p.y+dy[i]]){\\n q.add(new pair(p.x + dx[i],p.y+dy[i]));\\n ansX = p.x + dx[i];\\n ansY = p.y + dy[i];\\n visited[ansX][ansY] = true;\\n }\\n }\\n }\\n out.println((ansX+1) + \\\" \\\" + (ansY+1));\\n out.close();\\n\\n }\\n\\n public static boolean isValid(int x, int y,int n, int m){\\n return x >= 0 && x < n && y >= 0 && y < m;\\n }\\n\\n private static class pair{\\n int x;\\n int y;\\n\\n public pair(int x, int y) {\\n this.x = x;\\n this.y = y;\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.lang.*;\\nimport java.math.*;\\n\\npublic class C {\\n\\tstatic final long MOD = 1_000_000_007;\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tFastScanner sc = new FastScanner();\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tint N = sc.nextInt();\\n\\t\\tlong[][] dp = new long[N][N];\\n\\t\\tdp[0][0] = 1L;\\n\\t\\tfor(int i = 0; i < N-1; i++) {\\n\\t\\t\\tchar oper = sc.next().charAt(0);\\n\\t\\t\\tif(oper == 'f') {\\n\\t\\t\\t\\tdp[i+1][0] = 0L;\\n\\t\\t\\t\\tfor(int j = 1; j < N; j++) {\\n\\t\\t\\t\\t\\tdp[i+1][j] = dp[i][j-1];\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdp[i+1][N-1] = dp[i][N-1];\\n\\t\\t\\t\\tfor(int j = N-2; j >= 0; j--) {\\n\\t\\t\\t\\t\\tdp[i+1][j] = (dp[i+1][j+1] + dp[i][j]) % MOD;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tlong res = 0;\\n\\t\\tfor(int i = 0; i < N; i++) {\\n\\t\\t\\tres += dp[N-1][i];\\n\\t\\t\\tres %= MOD;\\n\\t\\t}\\n\\t\\tout.println(res);\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tstatic class FastScanner {\\n\\t\\tpublic BufferedReader reader;\\n\\t\\tpublic StringTokenizer tokenizer;\\n\\n\\t\\tpublic FastScanner() {\\n\\t\\t\\treader = new BufferedReader(new InputStreamReader(System.in), 32768);\\n\\t\\t\\ttokenizer = null;\\n\\t\\t}\\n\\n\\t\\tpublic String next() {\\n\\t\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn tokenizer.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tpublic double nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t\\tpublic String nextLine() {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\treturn reader.readLine();\\n\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class codeforces {\\n\\n public static long cnt = 0;\\n\\n public static void f(int g1, int g2, int g3, int last) {\\n if (g1 == 0 && g2 == 0 && g3 == 0) cnt++;\\n if (g1 > 0 && last != 1) f(g1 - 1, g2, g3, 1);\\n if (g2 > 0 && last != 2) f(g1, g2 - 1, g3, 2);\\n if (g3 > 0 && last != 3) f(g1, g2, g3 - 1, 3);\\n }\\n\\n public static void main(String[] args) throws IOException {\\n BufferedReader scan = new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer st = new StringTokenizer(scan.readLine());\\n int n = Integer.parseInt(st.nextToken());\\n int t = Integer.parseInt(st.nextToken());\\n int T[] = new int[n];\\n int G[] = new int[n];\\n for (int i = 0; i < n; i++) {\\n st = new StringTokenizer(scan.readLine());\\n T[i] = Integer.parseInt(st.nextToken());\\n G[i] = Integer.parseInt(st.nextToken());\\n }\\n long ans = 0;\\n for (int mask = 1; mask < (1 << n); mask++) {\\n int sum = 0;\\n int g1 = 0;\\n int g2 = 0;\\n int g3 = 0;\\n\\n for (int i = 0; i < n; i++) {\\n if (((1 << i) & mask) > 0) {\\n sum += T[i];\\n if (G[i] == 1) g1++;\\n if (G[i] == 2) g2++;\\n if (G[i] == 3) g3++;\\n }\\n }\\n cnt = 0;\\n if (sum == t) f(g1, g2, g3, -1);\\n for (long i = 1; i <= g1; i++) cnt *= i;\\n for (long i = 1; i <= g2; i++) cnt *= i;\\n for (long i = 1; i <= g3; i++) cnt *= i;\\n ans += cnt;\\n }\\n System.out.println(ans % 1000000007);\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\/\\/\\tstatic Scanner in;\\n\\tstatic PrintWriter out;\\n\\tstatic StreamTokenizer in; static int next() throws Exception {in.nextToken(); return (int) in.nval;}\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\/\\/\\t\\tin = new Scanner(System.in);\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n\\n\\t\\tint n = next();\\n\\t\\tint t = 2*next();\\n\\n\\t\\tint[] x = new int[n];\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tx[i] = 2* next() + 2000;\\n\\t\\t\\ta[i] = next();\\n\\t\\t}\\n\\n\\t\\tint[] srt = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) srt[i] = 10000 * x[i] + a[i];\\n\\t\\tArrays.sort(srt);\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tx[i] = srt[i] \\/ 10000;\\n\\t\\t\\ta[i] = srt[i] % 10000;\\n\\t\\t}\\n\\n\\t\\tint answ = 2;\\n\\t\\tfor (int i = 0; i < n - 1; i++) {\\n\\t\\t\\tif (x[i + 1] - x[i] > a[i] + a[i + 1] + t) answ++;\\n\\t\\t\\tif (x[i + 1] - x[i] >= a[i] + a[i + 1] + t) answ++;\\n\\t\\t}\\n\\n\\t\\tout.println(answ);\\n\\n\\t\\tout.close();\\n\\t}\\n} Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\n\\n\\n public class Main {\\n\\tprivate InputStream is;\\n\\tprivate PrintWriter out;\\n\\tint time = 0, dp[][], DP[][], start[], parent[], end[], val[], black[], MOD = (int)(1e9+7), arr[], arr1[];\\n\\tint MAX = 10000000, N, K, p;\\n\\tArrayList[] amp, amp1;\\n\\tboolean b[], b1[];\\n\\tPair prr[];\\n\\tchar ch[][];\\n\\tHashSet hs = new HashSet<>();\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tnew Thread(null, new Runnable() {\\n\\t\\tpublic void run() {\\n\\t\\t\\ttry {\\n\\n\\t\\t\\/\\/new Main().soln();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\tSystem.out.println(e);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}, \\\"1\\\", 1 << 26).start();\\n\\t\\tnew Main().soln();\\n\\t}\\n\\tvoid solve() {\\n\\t\\tlong n = nl(), s = nl();\\n\\t\\tlong low = 1, high = n+1;\\n\\t\\tlong ans = high;\\n\\t\\twhile(low<=high){\\n\\t\\t\\tlong mid = (high+low)\\/2;\\n\\t\\t\\tif((mid - getSum(mid))>=s){\\n\\t\\t\\t\\thigh = mid-1;\\n\\t\\t\\t\\tans = mid;\\n\\t\\t\\t}\\n\\t\\t\\telse{\\n\\t\\t\\t\\tlow = mid+1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(Math.max(0, n-ans+1));\\n\\t}\\n\\tint getSum(long s){\\n\\t\\tString str = Long.toString(s);\\n\\t\\tint ans = 0;\\n\\t\\tfor(char ch : str.toCharArray()) ans += (ch-'0');\\n\\t\\treturn ans;\\n\\t}\\n\\tint recur(int x){\\n\\t\\t\\/\\/System.out.println(x);\\n\\t\\tint ans = 0;\\n\\t\\tb[x] = true;\\n\\t\\tfor(int i : amp[x]){\\n\\t\\t\\tif(!b[i]){\\n\\t\\t\\t\\tb[i] = true;\\n\\t\\t\\t\\tans = Math.max(recur(i), ans);\\n\\t\\t\\t\\tb[i] = false;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn 1+ans;\\n\\t}\\n\\tint max = 0;\\n\\tint getParent(int x){\\n\\t\\t\\/\\/System.out.println(x+\\\" \\\"+parent[x]);\\n\\t\\tif(parent[x]!=x){\\n\\t\\t\\tparent[x] = getParent(parent[x]);\\n\\t\\t}\\n\\t\\treturn parent[x];\\n\\t}\\n\\tint bfs(int x){\\n\\t\\tb[x] = true;\\n\\t\\tQueue q = new LinkedList<>();\\n\\t\\tq.add(x);\\n\\t\\twhile(!q.isEmpty()){\\n\\t\\t\\tint y = q.poll();\\n\\t\\t\\tfor(int i : amp[y]){\\n\\t\\t\\t\\tif(!b[i]){\\n\\t\\t\\t\\t\\tb[i] = true;\\n\\t\\t\\t\\t\\tval[i] = val[y]+1;\\n\\t\\t\\t\\t\\tmax = Math.max(val[i], max);\\n\\t\\t\\t\\t\\tq.add(i);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn max;\\n\\t}\\n\\tclass Pair implements Comparable{\\n\\t\\tint u, v, r;\\n\\t\\tPair(int u, int v){\\n\\t\\t\\tthis.u = u;\\n\\t\\t\\tthis.v = v;\\n\\t\\t}public int hashCode() {\\n\\t\\t\\treturn Objects.hash();\\n\\t\\t}\\n\\t\\tpublic boolean equals(Object o) {\\n\\t\\t\\tPair other = (Pair) o;\\n\\t\\t\\treturn ((u == other.u && v == other.v));\\/\\/ || (v == other.u && u ==... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\npublic class A {\\n public static void main(String[] args) throws IOException {\\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n String s = in.readLine();\\n for (int i = s.length() - 1; i > 0; i--)\\n for (int j = 0; j <= s.length() - i; j++)\\n if (s.substring(0, j + i - 1).contains(s.substring(j, j + i))\\n || s.substring(j + 1).contains(s.substring(j, j + i))) {\\n System.out.println(i);\\n return;\\n }\\n System.out.println(0);\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\n\\n\\/**\\n *\\n * @Har_Har_Mahadev\\n *\\/\\n\\npublic class D {\\n\\n\\tprivate static long INF = 2000000000000000000L, M = 1000000007, MM = 998244353;\\n\\tprivate static int N = 0;\\n\\tprivate static long[][][] dp;\\n\\tprivate static long[][] ff;\\n\\tprivate static long[][] ss;\\n\\n\\tpublic static void process() throws IOException {\\n\\n\\t\\tint n = sc.nextInt(),m = sc.nextInt(),k = sc.nextInt();\\n\\t\\t\\n\\t\\tff = new long[n][m];\\n\\t\\tss = new long[n][m];\\n\\t\\tfor(int i = 0; i=0) {\\n\\t\\t\\tans = min(ans,ss[i-1][j] + solve(i-1, j, k-1, n, m));\\n\\t\\t}\\n\\t\\tif(j+1=0) {\\n\\t\\t\\tans = min(ans,ff[i][j-1] + solve(i, j-1, k-1, n, m));\\n\\t\\t}\\n\\t\\t\\n\\t\\treturn dp[i][j][k] = ans;\\n\\t}\\n\\n\\t\\/\\/=============================================================================\\n\\t\\/\\/--------------------------The End---------------------------------\\n\\t\\/\\/=============================================================================\\n\\n\\tstatic FastScanner sc;\\n\\tstatic PrintWriter out;\\n\\n\\tpublic... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n G1PleilistDlyaPolikarpaUproshennayaVersiya solver = new G1PleilistDlyaPolikarpaUproshennayaVersiya();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class G1PleilistDlyaPolikarpaUproshennayaVersiya {\\n\\n static final int MOD = (int) 1e9 + 7;\\n int n;\\n int t;\\n int[][] a = new int[15][2];\\n long[][] mem = new long[1 << 15][4];\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n for (int i = 0; i < (1 << 15); i++) {\\n for (int h = 0; h < 4; h++) {\\n mem[i][h] = -1;\\n }\\n }\\n n = in.nextInt();\\n t = in.nextInt();\\n for (int i = 0; i < n; i++) {\\n a[i][0] = in.nextInt();\\n a[i][1] = in.nextInt();\\n }\\n out.println(doit(0, 0, 0));\\n }\\n\\n private long doit(int mask, int genre, int sum) {\\n if (mem[mask][genre] != -1) {\\n return mem[mask][genre];\\n }\\n if (sum > t) {\\n mem[mask][genre] = 0;\\n return mem[mask][genre];\\n }\\n if (sum == t) {\\n mem[mask][genre] = 1;\\n return mem[mask][genre];\\n }\\n long ct = 0;\\n for (int i = 0; i < n; i++) {\\n if ((mask & (1 << i)) > 0 || genre == a[i][1]) {\\n ... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.HashMap;\\nimport java.util.StringTokenizer;\\n\\/*\\n\\n2\\n3 5\\n\\n2\\n6 5\\n1 11\\n-10 12\\n\\n3\\n3 6 2\\n\\n\\n1 8 5 3\\n-7 9 5 3\\n-7 4 14 3\\n\\n\\n1 8 5 3\\n1 3 13 3\\n-2 4 13 3\\n \\n\\n3\\n1 3 6\\n\\n3 3 6\\n\\n5 12\\n-7 19\\n\\n\\n3 5 7 11 13\\n-2 8\\n\\n\\n5 9\\n\\n\\n5 9\\n\\n\\n3 6 7\\n-3 9 7\\n\\n6 3 7\\n\\n\\n*\\/\\n\\npublic class c {\\n\\tstatic int n;\\n\\tstatic int[] fs;\\n\\tstatic int[] cfs;\\n\\tstatic long[][] choose = chooseTable(1001);\\n\\tstatic long[] fact;\\n\\tstatic final long MOD = (long) (1e9 + 7);\\n\\tstatic long[][] memo;\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tFastScanner in = new FastScanner(System.in);\\n\\t\\tn = in.nextInt();\\n\\t\\tfact = new long[301];\\n\\t\\tfact[0] = 1;\\n\\t\\tfor (int i = 1; i < fact.length; i++) {\\n\\t\\t\\tfact[i] = fact[i - 1] * i;\\n\\t\\t\\tfact[i] %= MOD;\\n\\t\\t}\\n\\t\\tHashMap map = new HashMap();\\n\\t\\tfs = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tlong v = in.nextLong();\\n\\t\\t\\tlong r = 1;\\n\\t\\t\\tfor (int d = 2; d * d <= v; d++) {\\n\\t\\t\\t\\tint cnt = 0;\\n\\t\\t\\t\\twhile (v % d == 0) {\\n\\t\\t\\t\\t\\tv \\/= d;\\n\\t\\t\\t\\t\\tcnt ^= 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (cnt == 1) {\\n\\t\\t\\t\\t\\tr *= d;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tr *= v;\\n\\t\\t\\tif (!map.containsKey(r)) {\\n\\t\\t\\t\\tmap.put(r, map.size());\\n\\t\\t\\t}\\n\\t\\t\\tfs[map.get(r)]++;\\n\\t\\t}\\n\\t\\tcfs = new int[n];\\n\\t\\tfor (int i = 1; i < n; i++) {\\n\\t\\t\\tcfs[i] = cfs[i - 1] + fs[i - 1];\\n\\t\\t}\\n\\t\\tmemo = new long[n+1][n+1];\\n\\t\\tfor(long[] arr : memo)\\n\\t\\t\\tArrays.fill(arr, -1);\\n\\t\\tSystem.out.println(go(0, 0));\\n\\t}\\n\\n\\tstatic long go(int color, int priorities) {\\n\\t\\tif (color == n)\\n\\t\\t\\treturn priorities == 0 ? 1 : 0;\\n\\/\\/\\t\\tSystem.out.println(color + \\\" \\\"+ priorities);\\n\\t\\tif(memo[color][priorities] != -1)\\n\\t\\t\\treturn memo[color][priorities];\\n\\t\\tint nonpriorities = cfs[color] - priorities + 1;\\n\\t\\tlong ans = 0;\\n\\t\\tfor (int cntPrio = 0; cntPrio <= priorities && cntPrio <= fs[color]; cntPrio++) {\\n\\t\\t\\tfor (int cntNonPrio = 0; cntNonPrio <= nonpriorities && cntNonPrio + cntPrio <= fs[color]; cntNonPrio++) {\\n\\t\\t\\t\\tif(cntPrio + cntNonPrio == 0 && fs[color] != 0)... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/*\\nRoses are red\\nMemes are neat\\nAll my test cases time out\\nLmao yeet\\n*\\/\\nimport java.util.*;\\nimport java.io.*;\\n\\n public class B\\n {\\n public static void main(String args[]) throws Exception\\n {\\n BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); \\n StringTokenizer st = new StringTokenizer(infile.readLine());\\n int N = Integer.parseInt(st.nextToken());\\n int K = Integer.parseInt(st.nextToken());\\n \\/\\/bin search\\n \\/\\/ugh I'm shafting\\n long x = (long)N;\\n long low = 0L;\\n long high = N;\\n while(low != high)\\n {\\n x = (low+high+1)\\/2;\\n long add = (x*(x+1))\\/2;\\n long y = N-x;\\n if(add-y > K)\\n high = x;\\n else if(add-y == K)\\n {\\n System.out.println(y);\\n break;\\n }\\n else\\n low = x;\\n }\\n \\/\\/run time?\\n }\\n public static void sort(int[] arr)\\n {\\n PriorityQueue pq = new PriorityQueue();\\n for(int a: arr)\\n pq.add(a);\\n for(int i=0; i < arr.length; i++)\\n arr[i] = pq.poll();\\n }\\n } What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import static java.lang.Math.*;\\nimport java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\n\\npublic class Solution implements Runnable {\\n\\n\\tpublic static void main(String... strings) throws InterruptedException {\\n\\t\\tnew Thread(new Solution()).start();\\n\\t}\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\n\\tString next() throws Exception {\\n\\t\\tif (st == null || !st.hasMoreElements())\\n\\t\\t\\tst = new StringTokenizer(in.readLine());\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws Exception {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\n\\tdouble nextDouble() throws Exception {\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\n\\tlong nextLong() throws Exception {\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\n\\t@Override\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t\\tout = new PrintWriter(new FileWriter(\\\"output.txt\\\"));\\n\\t\\t\\tsolve();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t} finally {\\n\\t\\t\\tout.close();\\n\\t\\t}\\n\\t}\\n\\tint n, m, k, xor = 0;\\n\\tboolean[][] used;\\n\\tHashSet [] set;\\n\\tvoid solve() throws Exception {\\n\\t\\tn = nextInt();\\n\\t\\tm = nextInt();\\n\\t\\tk = nextInt();\\n\\t\\tused = new boolean[n][m];\\n\\t\\tset = new HashSet[2];\\n\\t\\tfor(int i = 0; i < 2; set[i++] = new HashSet());\\n\\t\\t\\n\\t\\tfor(int i = 0; i < k; i++){\\n\\t\\t\\tint x = nextInt()-1, y = nextInt()-1;\\n\\t\\t\\tused[x][y] = true;\\n\\t\\t\\tset[0].add(10000L*x + y);\\n\\t\\t}\\n\\t\\tfor (;;xor ^= 1){\\n\\t\\t\\tset[xor^1].clear();\\n\\t\\t\\tint ansx = -1, ansy = -1;\\n\\t\\t\\tfor (long i : set[xor]){\\n\\t\\t\\t\\tint x = (int)(i\\/10000), y = (int)(i%10000);\\n\\t\\t\\t\\tif (ansx < 0){\\n\\t\\t\\t\\t\\tansx = x+1;\\n\\t\\t\\t\\t\\tansy = y+1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tadd(x+1, y);\\n\\t\\t\\t\\tadd(x-1, y);\\n\\t\\t\\t\\tadd(x, y+1);\\n\\t\\t\\t\\tadd(x, y-1);\\n\\t\\t\\t}\\n\\t\\t\\tif (set[xor^1].size() == 0){\\n\\t\\t\\t\\tout.println(ansx + \\\" \\\" + ansy);\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\tpublic void add(int x, int y){\\n\\t\\tif (!( x >= 0 && y >= 0 && x < n && y < m && !used[x][y])) return;\\n\\t\\tset[xor^1].add(10000L*x + y);\\n\\t\\tused[x][y] = true;\\n\\t}\\n\\n} What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\nimport java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\nimport java.io.PrintWriter;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author codeKNIGHT\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tScanner in = new Scanner(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tTaskA solver = new TaskA();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskA {\\n\\tpublic void solve(int testNumber, Scanner in, PrintWriter out) {\\n int n=in.nextInt(),k=in.nextInt()-1,i;\\n scores a[]=new scores[n];\\n for(i=0;i=0;i--)\\n {\\n if(a[i].p==a[k].p&&a[i].t==a[k].t)\\n c++;\\n else break;\\n }\\n for(i=k+1;i\\n {\\n int p,t;\\n public scores(int p,int t)\\n {\\n this.p=p;\\n this.t=t;\\n }\\n public int compareTo(scores a)\\n {\\n if(a.p>this.p)\\n return 1;\\n if(a.p==this.p&&a.t x = new ArrayList();\\n for(int i = 0; i < N; i++) {\\n x.add(i);\\n }\\n\\n Collections.sort(x, new Comp());\\n\\n int places = 0;\\n for(int i = 0; i < N-1; i++) {\\n double space = (X[x.get(i+1)]-X[x.get(i)]-A[x.get(i+1)]\\/2.0-A[x.get(i)]\\/2.0);\\n if(space < T) {\\n continue;\\n } if(space - T < 1e-9) {\\n places++;\\n } else if(space > T) {\\n places+=2;\\n }\\n }\\n System.out.println(places+2);\\n }\\n\\n public class Comp implements Comparator {\\n public int compare(Integer i1, Integer i2) {\\n return X[i1]-X[i2];\\n }\\n }\\n\\n public static void main(String[] args)\\n {\\n new village().solve();\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A {\\n\\n BufferedReader br;\\n PrintWriter out;\\n StringTokenizer st;\\n boolean eof;\\n \\n class Team implements Comparable{\\n int ac;\\n int penalty;\\n \\n public Team(int ac, int penalty) {\\n this.ac = ac;\\n this.penalty = penalty;\\n }\\n\\n @Override\\n public int compareTo(Team o) {\\n if (ac != o.ac)\\n return ac > o.ac ? -1 : 1;\\n return (penalty == o.penalty) ? 0 : (penalty < o.penalty ? -1 : 1);\\n }\\n \\n }\\n\\n void solve() throws IOException {\\n int n = nextInt();\\n int k = nextInt() - 1;\\n \\n Team[] a = new Team[n];\\n for (int i = 0; i < n; i++)\\n a[i] = new Team(nextInt(), nextInt());\\n \\n Arrays.sort(a);\\n for (int i = 0; i < n;) {\\n int j = i;\\n while (j < n && a[j].compareTo(a[i]) == 0)\\n j++;\\n if (i <= k && k < j) {\\n out.println(j - i);\\n return;\\n }\\n i = j;\\n }\\n }\\n\\n void inp() throws IOException {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n solve();\\n out.close();\\n }\\n\\n public static void main(String[] args) throws IOException {\\n new A().inp();\\n }\\n\\n String nextToken() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (Exception e) {\\n eof = true;\\n return null;\\n }\\n }\\n return st.nextToken();\\n }\\n\\n String nextString() {\\n try {\\n return br.readLine();\\n } catch (IOException e) {\\n eof = true;\\n return null;\\n }\\n }\\n\\n int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() throws IOException {\\n return... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.*;\\n\\npublic class Main {\\n\\n public static void main(String[] args) {\\n Scanner input = new Scanner(System.in);\\n int n = input.nextInt();\\n int a = input.nextInt();\\n int b = input.nextInt();\\n int x[] = new int[n];\\n for (int i=0; i map = new HashMap();\\n\\t\\tmap.put(mas[l], 1);\\n\\t\\tint cur = 1;\\n\\t\\twhile (true) {\\n\\t\\t\\tif (cur == k) {\\n\\t\\t\\t\\tprint(l + 1, r + 1);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tr++;\\n\\t\\t\\tif (r >= n)\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\tint kol = map.containsKey(mas[r]) ? map.remove(mas[r]) : 0;\\n\\t\\t\\tif (kol == 0) {\\n\\t\\t\\t\\tcur++;\\n\\t\\t\\t\\tmap.put(mas[r], 1);\\n\\t\\t\\t} else\\n\\t\\t\\t\\tmap.put(mas[r], kol + 1);\\n\\t\\t\\twhile (true) {\\n\\t\\t\\t\\tkol = map.remove(mas[l]);\\n\\t\\t\\t\\tif (kol == 1) {\\n\\t\\t\\t\\t\\tmap.put(mas[l], 1);\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t} else\\n\\t\\t\\t\\t\\tmap.put(mas[l++], kol - 1);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tprint(-1, -1);\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew B().run();\\n\\t}\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer tokenizer;\\n\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\tSolution();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(0);\\n\\t\\t}\\n\\t}\\n\\n\\tvoid print(Object... obj) {\\n\\t\\tfor (int i = 0; i < obj.length; i++) {\\n\\t\\t\\tif (i != 0)\\n\\t\\t\\t\\tout.print(\\\" \\\");\\n\\t\\t\\tout.print(obj[i]);\\n\\t\\t}\\n\\t}\\n\\n\\tvoid println(Object... obj) {\\n\\t\\tprint(obj);\\n\\t\\tout.println();\\n\\t}\\n\\n\\tvoid halt() {\\n\\t\\tout.close();\\n\\t\\tSystem.exit(0);\\n\\t}\\n\\n\\tString nextLine() throws IOException {\\n\\t\\treturn in.readLine();\\n\\t}\\n\\n\\tString next() throws IOException {\\n\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens())\\n\\t\\t\\ttokenizer = new StringTokenizer(nextLine());\\n\\t\\treturn tokenizer.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws NumberFormatException, IOException {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\n\\tlong nextLong() throws NumberFormatException, IOException {\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\n\\tdouble nextDouble() throws NumberFormatException, IOException {\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class D\\n{\\n\\n public static void main(String[] args)\\n {\\n new D();\\n }\\n \\n D()\\n {\\n Scanner in = new Scanner(System.in);\\n double a = in.nextDouble();\\n double v = in.nextDouble();\\n double l = in.nextDouble();\\n double d = in.nextDouble();\\n double w = in.nextDouble();\\n \\n if (w>v) w=v;\\n \\n double dx=(v*v-w*w)\\/(2*a);\\n double d0=(w*w)\\/(2*a);\\n \\n double t=0;\\n if (d0>d) \\/\\/ doesn't make it to speed w before reaching d\\n {\\n if (d0>=l) \\/\\/ never gets to speed w\\n {\\n t=Math.sqrt(2*a*l)\\/a;\\n }\\n else\\n {\\n t=w\\/a;\\n if (d0+dx>=l) \\/\\/ never gets to speed v\\n {\\n t+=(-w+Math.sqrt(w*w+2*a*(l-d0)))\\/a;\\n }\\n else \\/\\/ makes it to speed v\\n {\\n t+=(v-w)\\/a;\\n t+=(l-(d0+dx))\\/v;\\n }\\n }\\n }\\n else \\/\\/ makes it to speed w before reachig d\\n {\\n t=w\\/a; \\/\\/ get up to speed w \\n \\n \\/\\/ get time after reaching d\\n if (d+dx>l) \\/\\/ never makes it back to v after reaching d\\n {\\n t+=(-w+Math.sqrt(w*w+2*a*(l-d)))\\/a;\\n }\\n else \\/\\/ makes it to speed v after reaching d\\n {\\n t+=(v-w)\\/a;\\n t+=(l-(d+dx))\\/v;\\n }\\n \\n \\/\\/ handle getting to d\\n if (d0+2*dx>d) \\/\\/ can't get to v before reaching d\\n {\\n double half=(d-d0)\\/2;\\n t+=2*(-w+Math.sqrt(w*w+2*a*half))\\/a;\\n }\\n else \\/\\/ can get to v before reaching d\\n {\\n t+=2*(v-w)\\/a;\\n t+=(d-2*dx-d0)\\/v;\\n }\\n }\\n \\n System.out.printf(\\\"%.12f%n\\\", t+1e-11);\\n }\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\nimport javax.lang.model.util.ElementScanner6;\\npublic class codef\\n{\\n public static void main(String ar[]) throws IOException\\n {\\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer nk=new StringTokenizer(br.readLine());\\n int n=Integer.parseInt(nk.nextToken());\\n int k=Integer.parseInt(nk.nextToken());\\n String st[]=br.readLine().split(\\\" \\\");\\n \\n int ans[]=new int[n];\\n int a[]=new int[n];\\n for(int i=0;i0 && i>=0)\\n {\\n if(a[i]>-1)\\n {\\n sum=sum-a[i];\\n k--;\\n }\\n i--;\\n }\\n System.out.println(sum);\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\n\\npublic class ER23C {\\n static long s;\\n public static void main (String[] args) throws java.lang.Exception {\\n InputReader in = new InputReader(System.in);\\n PrintWriter w = new PrintWriter(System.out);\\n long n = in.nextLong();\\n s = in.nextLong();\\n long l = 0, h = n;\\n while (l < h) {\\n long mid = (l + h ) \\/ 2;\\n \\/\\/ System.out.println(\\\"mid is : \\\" + mid);\\n \\/\\/ System.out.println(\\\"high is : \\\" + h);\\n \\/\\/System.out.println(\\\"low is : \\\" + l);\\n if (Ok(mid))\\n h = mid;\\n else\\n l = mid + 1;\\n }\\n if (Ok(h))\\n w.println(n - h + 1);\\n else\\n w.println(n - h);\\n\\n w.close();\\n\\n }\\n static boolean Ok(long n) {\\n int sum = 0;\\n long temp = n;\\n while (n > 0) {\\n sum += (n % 10);\\n n = n \\/ 10;\\n }\\n \\/\\/System.out.println(\\\"n is :\\\" + n + \\\" sum is : \\\" + sum);\\n return (temp - sum >= s);\\n }\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new UnknownError();\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new UnknownError();\\n }\\n if (numChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n public int peek() {\\n if (numChars == -1)\\n return -1;\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars =... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.PrintWriter;\\nimport java.util.*;\\n\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner in = new Scanner(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\t\\/\\/ 1 = H, 0 = T\\n\\t\\t\\n\\t\\tint n = in.nextInt();\\n\\t\\tString line = in.next();\\n\\t\\tint h = 0;\\n\\t\\tfor (int i = 0; i < line.length(); i++) {\\n\\t\\t\\tif(line.charAt(i)=='H') h++;\\n\\t\\t}\\n\\t\\tline = line + line;\\n\\t\\t\\n\\t\\tint min = Integer.MAX_VALUE;\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tint ans = 0;\\n\\t\\t\\tfor (int j = i; j < i+h; j++) {\\n\\t\\t\\t\\tif(line.charAt(j)!='H') ans++;\\n\\t\\t\\t}\\n\\t\\t\\tif(min>ans) min = ans;\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.print(min);\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\tin.close();\\n\\t\\tout.close();\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\n\\npublic class A {\\n\\tpublic static boolean ok(int []x,int d,int X)\\n\\t{\\n\\t\\tfor(int i=0;i set=new TreeSet();\\n\\t\\tint []x=new int [n];\\n\\t\\tfor(int i=0;i0) {\\n int N = sc.nextInt();\\n int K = sc.nextInt();\\n int[] a = new int[N + 1];\\n for (int i = 1; i <= N; i++) {\\n a[i] = canonical[sc.nextInt()];\\n }\\n int[][] transition = new int[K + 1][N + 1];\\n\\/\\/ HashMap freq = new HashMap<>();\\n for (int k = 0; k <= K; k++) {\\n int l = N + 1;\\n int duplicates = 0;\\n for (int r = N; r >= 1; r--) {\\n while (l - 1 >= 1) {\\n int nextDuplicates = duplicates;\\n if (freq[a[l - 1]] >= 1) {\\n nextDuplicates++;\\n }\\n if (nextDuplicates <= k) {\\n duplicates = nextDuplicates;\\n freq[a[l - 1]]++;\\n l--;\\n } else {\\n break;\\n ... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class Main {\\n\\n public static void main(String args[]) {\\n (new Main()).solve();\\n }\\n\\n void solve() {\\n\\n Scanner cin = new Scanner(System.in);\\n\\n while( cin.hasNextInt() ) {\\n\\n int n = cin.nextInt();\\n int arr[] = new int[n];\\n for(int i=0; i=tab[j] && tab[i]%tab[j]==0) {\\n\\t\\t\\t\\t\\ttab[i] = max;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tint res = 0;\\n\\t\\tfor(int i=0;i= 0) {\\n d += a[cur] - 1;\\n cur--;\\n ans++;\\n }\\n if (d >= m)\\n out.println(ans);\\n else\\n out.println(\\\"-1\\\");\\n }\\n \\n ProblemA(){\\n boolean oj = System.getProperty(\\\"ONLINE_JUDGE\\\") != null;\\n try {\\n if (oj) {\\n in = new InputReader(System.in);\\n out = new PrintWriter(System.out);\\n }\\n else {\\n Writer w = new FileWriter(\\\"output.txt\\\");\\n in = new InputReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(w);\\n }\\n } catch(Exception e) {\\n throw new RuntimeException(e);\\n }\\n solve();\\n out.close();\\n }\\n public static void main(String[] args){\\n new ProblemA();\\n }\\n}\\n\\nclass InputReader {\\n private BufferedReader reader;\\n private StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream));\\n tokenizer = null;\\n }\\n \\n public InputReader(FileReader fr) {\\n reader = new BufferedReader(fr);\\n tokenizer = null;\\n }\\n\\n public String next() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n try {\\n tokenizer = new StringTokenizer(reader.readLine());\\n } catch (IOException e) {\\n throw new RuntimeException(e);\\n }\\n }\\n return tokenizer.nextToken();\\n }\\n public int nextInt() {\\n return Integer.parseInt(next());\\n }\\n public long nextLong() {\\n... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import static java.lang.Math.*;\\nimport static java.util.Arrays.* ;\\n\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class D\\n{\\n int [][] adjList ;\\n int dfs(int u , int p )\\n {\\n int size = 1 ;\\n for(int v : adjList[u])\\n if(v != p )\\n {\\n int curr = dfs(v, u) ;\\n size += curr ;\\n }\\n return size ;\\n }\\n\\n void main() throws Exception\\n {\\n Scanner sc = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n int n = sc.nextInt() ;\\n int [] a = new int [n] ;\\n boolean [] vis = new boolean[n] ;\\n int cnt = 0 ;\\n for(int i = 0 ;i < n ; i++)\\n a[i] = sc.nextInt() ;\\n sort(a);\\n for(int i = 0 ;i < n ; i ++)\\n {\\n if(!vis[i])\\n {\\n for(int j= i ; j < n ; j++)\\n if(a[j] % a[i] == 0)\\n vis[j] = true ;\\n\\n cnt ++ ;\\n }\\n }\\n\\n out.println(cnt);\\n out.flush();\\n out.close();\\n }\\n\\n class SegmentTree\\n {\\n int [] sTree ;\\n int [] lazy ;\\n int N ;\\n\\n SegmentTree(int n)\\n {\\n N = 1 << (32 - Integer.numberOfLeadingZeros(n - 1)) ;\\n sTree = new int [N << 1] ;\\n lazy= new int [N << 1] ;\\n }\\n void push(int node , int b , int e , int mid)\\n {\\n sTree[node << 1] += (mid - b + 1) * lazy[node] ;\\n sTree[node << 1 | 1] += (e - mid) * lazy[node] ;\\n lazy[node << 1] += lazy[node] ;\\n lazy[node << 1 | 1] += lazy[node] ;\\n lazy[node] = 0 ;\\n }\\n void updateRange(int node , int b , int e , int i , int j , int val)\\n {\\n if(i > e || j < b)return;\\n\\n if(i <= b && e <= j)\\n {\\n sTree[node] += (e - b + 1) * val ;\\n lazy[node] += val ;\\n return;\\n }\\n\\n int mid = b + e >> 1 ;\\n ... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/*\\n * Created on 17.05.2019\\n *\\/\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\n\\/**\\n * @author Wolfgang Weck\\n *\\/\\npublic class C01Easy {\\n\\tpublic static void main(String[] args) {\\n\\t\\ttry (BufferedReader r = new BufferedReader(new InputStreamReader(System.in))) {\\n\\t\\t\\tfinal String[] line = r.readLine().split(\\\" \\\");\\n\\t\\t\\tfinal int N = Integer.parseInt(line[0]), P = Integer.parseInt(line[1]);\\n\\t\\t\\tfinal String[] numS = r.readLine().split(\\\" \\\");\\n\\t\\t\\tif (numS.length != N) throw new IllegalArgumentException();\\n\\t\\t\\tfinal int[] n = new int[N];\\n\\t\\t\\tint sum1 = 0, sum2 = 0;\\n\\t\\t\\tfor (int i = 0; i < N; i++) {\\n\\t\\t\\t\\tn[i] = Integer.parseInt(numS[i]) % P;\\n\\t\\t\\t\\tsum2 += n[i];\\n\\t\\t\\t\\tif (sum2 >= P) sum2 -= P;\\n\\t\\t\\t}\\n\\t\\t\\tint max = sum2;\\n\\t\\t\\tfor (int i = 0; i < N; i++) {\\n\\t\\t\\t\\tsum1 += n[i];\\n\\t\\t\\t\\tif (sum1 >= P) sum1 -= P;\\n\\t\\t\\t\\tsum2 -= n[i];\\n\\t\\t\\t\\tif (sum2 < 0) sum2 += P;\\n\\t\\t\\t\\tfinal int s = sum1 + sum2;\\n\\t\\t\\t\\tif (s > max) max = s;\\n\\t\\t\\t}\\n\\t\\t\\tSystem.out.println(max);\\n\\t\\t}\\n\\t\\tcatch (IOException e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t}\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n \\npublic class pillar {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\tint n=sc.nextInt();\\n\\t\\tint a[]=new int[200005];\\n\\t\\tfor (int i=1;i<=n;i++) \\n\\t\\ta[i]=sc.nextInt();\\n\\t\\tfor (int i=2;ia[i]&&a[i] 0) {\\n s = n2+1;\\n f = n-1;\\n }\\n while (s <= f) {\\n int m = (s+f)\\/2;\\n int v = compare(m);\\n if (v == 0) return m+1;\\n else if (v < 0) s = m+1;\\n else f = m-1;\\n }\\n return -1;\\n }\\n\\n public int compare(int z) {\\n out.print(\\\"? \\\");\\n out.println(z+1);\\n out.flush();\\n int r1 = in.readInt();\\n out.print(\\\"? \\\");\\n out.println((z+n2)%n+1);\\n out.flush();\\n int r2 = in.readInt();\\n return r1-r2;\\n }\\n\\n }\\n\\n static class InputReader {\\n private BufferedReader reader;\\n private StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream) {\\n this.reader = new BufferedReader(new InputStreamReader(stream));\\n }\\n\\n public... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/ Author : RegalBeast\\n\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n static final FastReader FR = new FastReader();\\n static final BufferedWriter BW = new BufferedWriter(new OutputStreamWriter(System.out));\\n\\n public static void main(String[] args) throws IOException {\\n StringBuilder solution = new StringBuilder();\\n int rows = FR.nextInt();\\n int cols = FR.nextInt();\\n int moves = FR.nextInt();\\n\\n Map horizontalEdgeWeights = new HashMap();\\n for (int r = 0; r < rows; r++) {\\n for (int c = 0; c < cols - 1; c++) {\\n int hash = getHash(r, c);\\n horizontalEdgeWeights.put(hash, FR.nextInt());\\n }\\n }\\n\\n Map verticalEdgeWeights = new HashMap();\\n for (int r = 0; r < rows - 1; r++) {\\n for (int c = 0; c < cols; c++) {\\n int hash = getHash(r, c);\\n verticalEdgeWeights.put(hash, FR.nextInt());\\n }\\n }\\n \\n List> result = getResult(rows, cols, moves, horizontalEdgeWeights, verticalEdgeWeights);\\n for (int r = 0; r < rows; r++) {\\n for (int c = 0; c < cols; c++) {\\n int value = (result != null ? result.get(r).get(c) : -1);\\n solution.append(value + \\\" \\\");\\n }\\n solution.append(\\\"\\\\n\\\");\\n }\\n\\n\\t\\tBW.write(solution.toString());\\n BW.close();\\n }\\n\\n static List> getResult(int rows, int cols, int moves, Map horizontalEdgeWeights, Map verticalEdgeWeights) {\\n if ((moves & 1) == 1) {\\n return null;\\n }\\n\\n int mid = moves >> 1;\\n List>> minForDistance = new ArrayList>>(rows);\\n for (int r = 0; r < rows; r++) {\\n minForDistance.add(new ArrayList>(cols));\\n\\n for (int c = 0; c < cols; c++) {\\n minForDistance.get(r).add(new ArrayList(Collections.nCopies(mid+1, Integer.MAX_VALUE)));\\n minForDistance.get(r).get(c).set(0, 0);\\n }\\n }\\n\\n for (int m = 1; m <= mid; m++) {\\n for (int r = 0; r <... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\n\\npublic class A23 implements Runnable {\\n\\n\\tprivate void Solution() throws IOException {\\n\\t\\tString s = in.readLine();\\n\\t\\tint n = s.length(), ans = 0;\\n\\t\\tfor (int i = 0; i < n; i ++) {\\n\\t\\t\\tfor (int j = i; j < n; j ++) {\\n\\t\\t\\t\\tfor (int k = i+1; k <= n; k ++) {\\n\\t\\t\\t\\t\\tfor (int g = k; g <= n; g ++) {\\n\\t\\t\\t\\t\\t\\tif (s.substring(i,j).equals(s.substring(k,g))) {\\n\\t\\t\\t\\t\\t\\t\\tint l = s.substring(i,j).length();\\n\\t\\t\\t\\t\\t\\t\\tans = Math.max(ans, l);\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(ans);\\n\\t}\\n\\t\\n\\tpublic static void main(String args[]) {\\n\\t\\tnew A23().run();\\n\\t}\\n\\t\\n\\tBufferedReader in;\\n\\tStringTokenizer tokenizer;\\n\\t\\n\\tpublic void run() {\\n\\t\\ttry {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n tokenizer = null;\\n Solution();\\n in.close();\\n } catch (Exception e) {\\n e.printStackTrace();\\n System.exit(1);\\n }\\n\\t}\\n\\n\\tint nextInt() throws NumberFormatException, IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\t\\n\\tString nextToken() throws IOException {\\n\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens())\\n\\t\\t\\ttokenizer = new StringTokenizer(in.readLine());\\n\\t\\treturn tokenizer.nextToken();\\n\\t}\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.PrintWriter;\\nimport java.util.Scanner;\\n\\npublic class Main {\\n \\n public static void main(String[] args) {\\n \\n var sc = new Scanner(System.in);\\n var pw = new PrintWriter(System.out);\\n \\n int T = Integer.parseInt(sc.next());\\n for(int t = 0; t < T; t++){\\n int n = Integer.parseInt(sc.next());\\n boolean ok = false;\\n if(n%2 == 0){\\n int a = n\\/2;\\n int b = (int) Math.sqrt(a);\\n if(b*b == a){\\n ok = true;\\n }\\n }\\n if(n%4 == 0){\\n int a = n\\/4;\\n int b = (int) Math.sqrt(a);\\n if(b*b == a){\\n ok = true;\\n }\\n }\\n if(ok){\\n pw.println(\\\"YES\\\");\\n }else{\\n pw.println(\\\"NO\\\");\\n }\\n }\\n pw.flush();\\n }\\n} Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\npublic class A {\\n\\tFastScanner in;\\n\\tPrintWriter out;\\n\\tboolean systemIO = true;\\n\\n\\tpublic class Fenvik {\\n\\t\\tint[] sum;\\n\\n\\t\\tpublic Fenvik(int n) {\\n\\t\\t\\tsum = new int[n];\\n\\t\\t}\\n\\n\\t\\tpublic void add(int x) {\\n\\t\\t\\tfor (; x < sum.length; x = (x | (x + 1))) {\\n\\t\\t\\t\\tsum[x]++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tpublic int sum(int r) {\\n\\t\\t\\tint ans = 0;\\n\\t\\t\\tfor (; r >= 0; r = (r & (r + 1)) - 1) {\\n\\t\\t\\t\\tans += sum[r];\\n\\t\\t\\t}\\n\\t\\t\\treturn ans;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic int gcd(int x, int y) {\\n\\t\\tif (y == 0) {\\n\\t\\t\\treturn x;\\n\\t\\t}\\n\\t\\tif (x == 0) {\\n\\t\\t\\treturn y;\\n\\t\\t}\\n\\t\\treturn gcd(y, x % y);\\n\\t}\\n\\t\\n\\t\\n\\tpublic class Edge {\\n\\t\\tint to;\\n\\t\\tlong s;\\n\\n\\t\\tpublic Edge(int to, long s) {\\n\\t\\t\\tthis.to = to;\\n\\t\\t\\tthis.s = s;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic long dfs(int v, int prev, long sumth, long minsum, long s) {\\n\\t\\ttin[v] = timer;\\n\\t\\ttimer++;\\n\\t\\tup[v][0] = new Edge(prev, s);\\n\\t\\tfor (int i = 1; i <= l; i++) {\\n\\t\\t\\tEdge e = up[v][i - 1];\\n\\t\\t\\tup[v][i] = new Edge(up[e.to][i - 1].to, up[e.to][i - 1].s + e.s);\\n\\t\\t}\\n\\t\\tminsum = Math.min(minsum, sumth);\\n\\t\\tmaxup[v] = sumth - minsum;\\n\\t\\tlong mxdown = sumth;\\n\\t\\tfor (Edge e : list[v]) {\\n\\t\\t\\tif (e.to != prev) {\\n\\t\\t\\t\\tmxdown = Math.max(mxdown, dfs(e.to, v, sumth + e.s, minsum, e.s));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\ttout[v] = timer;\\n\\t\\ttimer++;\\n\\t\\tmaxdown[v] = mxdown - sumth;\\n\\t\\treturn mxdown;\\n\\t}\\n\\t\\n\\tpublic boolean upper(int a1, int b1) {\\n\\t\\treturn tin[a1] <= tin[b1] && tout[a1] >= tout[b1];\\n\\t}\\n\\t\\n\\tpublic Edge lca(int a, int b) {\\n\\t\\tif (a == b) {\\n\\t\\t\\treturn new Edge(a, 0);\\n\\t\\t}\\n\\t\\tint v = -1;\\n\\t\\tint a1 = a;\\n\\t\\tint b1 = b;\\n\\t\\tif (tin[a] <= tin[b] && tout[a] >= tout[b]) {\\n\\t\\t\\tv = b;\\n\\t\\t\\tlong lenb = 0;\\n\\t\\t\\tfor (int i = l; i >= 0; i--) {\\n\\t\\t\\t\\ta1 = up[v][i].to;\\n\\t\\t\\t\\tb1 = a;\\n\\t\\t\\t\\tif (!(tin[a1] <= tin[b1] && tout[a1] >= tout[b1])) {\\n\\t\\t\\t\\t\\tlenb += up[v][i].s;\\n\\t\\t\\t\\t\\tv = up[v][i].to;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tlenb += up[v][0].s;\\n\\t\\t\\tv =... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedOutputStream;\\nimport java.io.InputStream;\\nimport java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.HashMap;\\nimport java.util.List;\\nimport java.util.Map;\\n\\npublic class Task {\\n\\n public static void solve() throws Exception {\\n\\tint n = nextInt();\\n\\tint[] S = new int[n];\\n\\tfor(int i=0;i 0) {\\n\\t\\tS[i] += S[i-1];\\n\\t }\\n\\t}\\n\\tMap> map = new HashMap<>();\\n\\tfor(int j=0;j=0;i--) {\\n\\t\\tint sum = S[j];\\n\\t\\tif(i > 0) {\\n\\t\\t sum -= S[i-1];\\n\\t\\t}\\n\\t\\tL l = new L();\\n\\t\\tl.a = i;\\n\\t\\tl.b = j;\\n\\t\\tList list = map.get(sum);\\n\\t\\tif(list == null) {\\n\\t\\t list = new ArrayList<>();\\n\\t\\t map.put(sum, list);\\n\\t\\t}\\n\\t\\tlist.add(l);\\n\\t }\\n\\t}\\n\\tList longest = null;\\n\\tfor(Integer sum: map.keySet()) {\\n\\t List list = map.get(sum);\\n\\t Collections.sort(list);\\n\\t List list2 = new ArrayList<>(list.size());\\n\\t int from = list.get(0).a;\\n\\t for(L l: list) {\\n\\t\\tif(l.a >= from) {\\n\\t\\t list2.add(l);\\n\\t\\t from = l.b + 1;\\n\\t\\t}\\n\\t }\\n\\t if(longest == null || longest.size() < list2.size()) {\\n\\t\\tlongest = list2;\\n\\t }\\n\\t}\\n\\t\\n\\tprintln(longest.size());\\n\\tfor(int i=0;i{\\n\\tint a;\\n\\tint b;\\n\\t\\n\\t@Override\\n\\tpublic int compareTo(L l2) {\\n\\t return Integer.valueOf(b).compareTo(l2.b);\\n\\t}\\n }\\n \\n public static void main(String[] args) throws Exception {\\n\\ttry {\\n\\t fastReader = new FastReader(System.in);\\n\\t systemOut = new BufferedOutputStream(System.out);\\n\\t solve();\\n\\t} finally {\\n\\t systemOut.close();\\n\\t}\\n }\\n\\n private static FastReader fastReader = null;\\n private static BufferedOutputStream systemOut = null;\\n\\n public static void print(Object obj) {\\n\\tprint(obj.toString());\\n }\\n\\n public static void print(String str) {\\n\\ttry {\\n\\t systemOut.write(str.getBytes(\\\"utf-8\\\"));\\n\\t} catch (Exception ex) {\\n\\t throw new RuntimeException(ex);\\n\\t}\\n }\\n\\n public static void... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class Solution {\\n public static void main(String[] args) throws Exception {\\n Scanner sc = new Scanner(new InputStreamReader(System.in));\\n int n = sc.nextInt();\\n String s = sc.next();\\n sc.close();\\n \\n int cH = 0;\\n for (int i=0; i < s.length(); i++)\\n if (s.charAt(i) == 'H')\\n cH++;\\n \\n int best = cH;\\n \\n for (int st=0; st < s.length(); st++) {\\n int cur = st;\\n int cnt = cH;\\n for (int i=0; i < cH; i++) {\\n if (s.charAt(cur) == 'H')\\n cnt--;\\n cur++;\\n if (cur == s.length()) cur = 0;\\n }\\n best = Math.min(best, cnt);\\n }\\n \\n System.out.println(best);\\n }\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class Prob023A\\n{\\n public static void main( String[] Args )\\n {\\n Scanner scan = new Scanner( System.in );\\n String s = scan.next();\\n\\n all: for ( int x = s.length() - 1; x >= 0; x-- )\\n for ( int y = 0; x + y <= s.length(); y++ )\\n {\\n String sub = s.substring( y, y + x );\\n if ( s.indexOf( sub, y + 1 ) >= 0 )\\n {\\n System.out.println( x );\\n break all;\\n }\\n }\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n \\nimport java.math.*;\\nimport java.awt.Point;\\n \\npublic class Main {\\n \\/\\/static final long MOD = 1000000007L;\\n \\/\\/static final long MOD2 = 1000000009L;\\n static final long MOD = 998244353L;\\n \\/\\/static final long INF = 500000000000L;\\n static final int INF = 1000000005;\\n static final int NINF = -1000000005;\\n \\/\\/static final long NINF = -1000000000000000000L;\\n static FastScanner sc;\\n static PrintWriter pw;\\n static final int[][] dirs = {{-1,0},{1,0},{0,-1},{0,1}};\\n\\n\\n public static void main(String[] args) {\\n sc = new FastScanner();\\n pw = new PrintWriter(System.out);\\n \\n\\n\\n int Q = sc.ni();\\n for (int q = 0; q < Q; q++) {\\n int N = sc.ni();\\n String ans = \\\"NO\\\";\\n if (N%2==0 && isSquare(N\\/2))\\n ans = \\\"YES\\\";\\n if (N%4==0 && isSquare(N\\/4))\\n ans = \\\"YES\\\";\\n pw.println(ans);\\n }\\n pw.close();\\n }\\n\\n public static boolean isSquare(int x) {\\n int s = (int)Math.round(Math.sqrt(x));\\n return s*s==x;\\n }\\n\\n \\n public static void sort(int[] arr) {\\n Random rgen = new Random();\\n for (int i = 0; i < arr.length; i++) {\\n int r = rgen.nextInt(arr.length);\\n int temp = arr[i];\\n arr[i] = arr[r];\\n arr[r] = temp;\\n }\\n Arrays.sort(arr);\\n }\\n \\n public static void sort(long[] arr) {\\n Random rgen = new Random();\\n for (int i = 0; i < arr.length; i++) {\\n int r = rgen.nextInt(arr.length);\\n long temp = arr[i];\\n arr[i] = arr[r];\\n arr[r] = temp;\\n }\\n Arrays.sort(arr);\\n }\\n \\n \\/\\/Sort an array (immune to quicksort TLE)\\n public static void sort(int[][] arr) {\\n Random rgen = new Random();\\n for (int i = 0; i < arr.length; i++) {\\n int r = rgen.nextInt(arr.length);\\n int[] temp = arr[i];\\n arr[i] = arr[r];\\n arr[r] = temp;\\n }\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\npublic class Main {\\n public static void main(String[] args) throws IOException {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n int n = Integer.parseInt(br.readLine());\\n int[] arr = new int[n];\\n HashMap map = new HashMap<>();\\n StringTokenizer st = new StringTokenizer(br.readLine());\\n for (int i = 0; i < n; i++) {\\n int x = Integer.parseInt(st.nextToken());\\n arr[i] = x;\\n if (!map.containsKey(x)) {\\n map.put(x, 1);\\n } else {\\n map.replace(x, map.get(x) + 1);\\n }\\n }\\n int[] power = new int[31];\\n for (int i = 0; i < 31; i++) {\\n power[i] = 1 << i; \\/\\/ 0 100=4 1000=8 10000=16\\n }\\n int c = 0;\\n for (int i = 0; i < n; i++) {\\n boolean f = false;\\n for (int j = 0; j <= 30; j++) {\\n int check = power[j] - arr[i];\\n if ((map.containsKey(check) && check != arr[i])) {\\n f = true; break;}\\n if((map.containsKey(check) && check == arr[i] && map.get(check) >=2)) {\\n f = true; break;\\n }\\n }\\n if (!f) {\\n c++;\\n }\\n }\\n System.out.println(c);\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\n\\npublic class LuckyDivision\\n{\\n public LuckyDivision(Scanner in)\\n {\\n int n;\\n\\n n = in.nextInt();\\n\\n if ( (n % 4 == 0) ||\\n (n % 7 == 0) ||\\n (n % 44 == 0) ||\\n (n % 47 == 0) ||\\n (n % 74 == 0) ||\\n (n % 77 == 0) ||\\n (n % 444 == 0) ||\\n (n % 447 == 0) ||\\n (n % 474 == 0) ||\\n (n % 477 == 0) ||\\n (n % 744 == 0) ||\\n (n % 747 == 0) ||\\n (n % 774 == 0) ||\\n (n % 777 == 0) )\\n System.out.printf(\\\"YES%n\\\");\\n else\\n System.out.printf(\\\"NO%n\\\");\\n }\\n\\n\\n public static void main(String[] args)\\n {\\n new LuckyDivision(new Scanner(System.in));\\n }\\n}\\n\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\n\\n\\npublic class First {\\n StreamTokenizer in;\\n PrintWriter out;\\n\\n int nextInt() throws IOException {\\n in.nextToken();\\n return (int)in.nval;\\n }\\n\\n long nextLong() throws IOException {\\n in.nextToken();\\n return (long) in.nval;\\n }\\n\\n String nextString() throws IOException {\\n in.nextToken();\\n return in.sval;\\n }\\n\\n\\n\\n void run() throws IOException {\\n in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n out = new PrintWriter(System.out);\\n solve();\\n out.flush();\\n }\\n\\n void solve() throws IOException {\\n int n = nextInt(), k = nextInt(), sum = 0, count = 0;\\n String str = nextString();\\n char[] arr = str.toCharArray();\\n boolean[] bool = new boolean[26];\\n for(char ch: arr){\\n bool[((int)ch)-97] = true;\\n }\\n for(int i = 0; i < 26; i++){\\n if(bool[i]){\\n sum += i+1;\\n count++;\\n i += 1;\\n }\\n if(count == k) break;\\n }\\n if(count == k) out.println(sum);\\n else out.println(-1);\\n }\\n\\n public static void main(String[] args) throws IOException {\\n new First().run();\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\nimport java.util.HashMap;\\n\\npublic class Main\\n{\\n static class Reader \\n { \\n private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;} \\n 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++];} \\n 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() ;} \\n 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();} \\n 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;} \\n 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;} \\n public double d() throws IOException {return Double.parseDouble(s()) ;}\\n public boolean isSpaceChar(int c) { return c == ' ' || c == '\\\\n' || c == '\\\\r' || c == '\\\\t' || c == -1; } \\n public boolean isEndOfLine(int c) { return c == '\\\\n' || c == '\\\\r' || c == -1; } \\n } \\n \\n \\n \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n \\n public static void main(String args[])\\n {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Template implements Runnable {\\n\\n BufferedReader in;\\n PrintWriter out;\\n StringTokenizer tok = new StringTokenizer(\\\"\\\");\\n\\n void init() throws FileNotFoundException {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n }\\n\\n String readString() throws IOException {\\n while (!tok.hasMoreTokens()) {\\n try {\\n tok = new StringTokenizer(in.readLine(), \\\" :\\\");\\n } catch (Exception e) {\\n return null;\\n }\\n }\\n return tok.nextToken();\\n }\\n\\n int readInt() throws IOException {\\n return Integer.parseInt(readString());\\n }\\n\\n int[] readIntArray(int size) throws IOException {\\n int[] res = new int[size];\\n for (int i = 0; i < size; i++) {\\n res[i] = readInt();\\n }\\n return res;\\n }\\n\\n long readLong() throws IOException {\\n return Long.parseLong(readString());\\n }\\n\\n double readDouble() throws IOException {\\n return Double.parseDouble(readString());\\n }\\n\\n List[] createGraphList(int size) {\\n List[] list = new List[size];\\n for (int i = 0; i < size; i++) {\\n list[i] = new ArrayList<>();\\n }\\n return list;\\n }\\n\\n public static void main(String[] args) {\\n new Thread(null, new Template(), \\\"\\\", 1l * 200 * 1024 * 1024).start();\\n }\\n\\n long timeBegin, timeEnd;\\n\\n void time() {\\n timeEnd = System.currentTimeMillis();\\n System.err.println(\\\"Time = \\\" + (timeEnd - timeBegin));\\n }\\n\\n long memoryTotal, memoryFree;\\n\\n void memory() {\\n memoryFree = Runtime.getRuntime().freeMemory();\\n System.err.println(\\\"Memory = \\\" + ((memoryTotal - memoryFree) >> 10)\\n + \\\" KB\\\");\\n }\\n\\n public void run() {\\n try {\\n timeBegin = System.currentTimeMillis();\\n memoryTotal = Runtime.getRuntime().freeMemory();\\n init();\\n solve();\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author prakhar897\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskA {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n String arr1[] = new String[n];\\n String arr2[] = new String[n];\\n int i, j, count = 0;\\n for (i = 0; i < n; i++) {\\n arr1[i] = in.nextString();\\n }\\n for (i = 0; i < n; i++) {\\n arr2[i] = in.nextString();\\n for (j = 0; j < n; j++) {\\n if (arr2[i].equals(arr1[j])) {\\n arr1[j] = \\\"\\\";\\n count++;\\n break;\\n }\\n }\\n }\\n out.println(n - count);\\n }\\n\\n }\\n\\n static class InputReader {\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private InputReader.SpaceCharFilter filter;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1) {\\n throw new InputMismatchException();\\n }\\n if (curChar >= numChars) {\\n curChar =... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collections;\\nimport java.util.StringTokenizer;\\n\\npublic class A {\\n\\n private static final int INF = (int) 1e9 + 7;\\n\\n public static void main(String[] args) {\\n FastScanner fs=new FastScanner();\\n PrintWriter pr = new PrintWriter(System.out);\\n\\/\\/ int T=fs.nextInt();\\n\\/\\/ for (int tt=1; tt<=T; tt++) {\\n int n = fs.nextInt(), m = fs.nextInt(), k = fs.nextInt();\\n int[][] right = new int[n][m -1], down = new int[n - 1][m];\\n for(int i = 0; i < n; i++) right[i] = fs.readArray(m - 1);\\n for(int i = 0; i < n - 1; i++) down[i] = fs.readArray(m);\\n if (k % 2 == 1) {\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < m; j++) pr.print(-1 + \\\" \\\");\\n pr.println();\\n }\\n } else {\\n int[][][] dp = new int[k \\/ 2 + 1][n][m];\\n\\n for(int r = 1; 2 * r <= k; r++) {\\n for(int i = 0; i < n; i++) Arrays.fill(dp[r][i], INF);\\n for(int i = 0; i < n; i++)\\n for(int j = 0; j + 1 < m; j++) {\\n int cost = right[i][j];\\n dp[r][i][j] = Integer.min(dp[r][i][j], dp[r - 1][i][j + 1] + cost);\\n dp[r][i][j + 1] = Integer.min(dp[r][i][j + 1], dp[r - 1][i][j] + cost);\\n }\\n for(int i = 0; i + 1 < n; i++)\\n for(int j = 0; j < m; j++) {\\n int cost = down[i][j];\\n dp[r][i][j] = Integer.min(dp[r][i][j], dp[r - 1][i + 1][j] + cost);\\n dp[r][i + 1][j] = Integer.min(dp[r][i + 1][j], dp[r - 1][i][j] + cost);\\n }\\n }\\n for(int i = 0; i < n; i++) {\\n ... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\npublic class C {\\n public static void main(String[] args) {\\n Scanner scan = new Scanner(System.in);\\n\\n int n, r;\\n n = scan.nextInt();\\n r = scan.nextInt();\\n\\n int[] locs = new int[n];\\n\\n for (int i = 0; i < n; i++) {\\n locs[i] = scan.nextInt();\\n }\\n\\n double[] yPos = new double[n];\\n Arrays.fill(yPos, 10e100);\\n\\n yPos[0] = r;\\n for (int i = 1; i < n; i++) {\\n double pos = r;\\n for (int j = 0; j < i; j++) {\\n int xDist = Math.abs(locs[i] - locs[j]);\\n if (xDist <= 2 * r) {\\n double y = (2.0 * r) * (2.0 * r) - (xDist * xDist);\\n if (Math.abs(y - 0.0) < 0.0000000001) {\\n y = 0;\\n } else {\\n y = Math.sqrt(y);\\n }\\n y += yPos[j];\\n pos = Math.max(pos, y);\\n\\n } else {\\n continue;\\n }\\n }\\n yPos[i] = pos;\\n }\\n String[] ans = new String[n];\\n\\n for (int i = 0; i < n; i++) {\\n ans[i] = \\\"\\\" + yPos[i];\\n }\\n\\n System.out.println(String.join(\\\" \\\", ans));\\n\\n }\\n} Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class LookingForOrder {\\n\\tstatic int[][] pos;\\n\\tstatic int[] dp;\\n\\tstatic int[] nextstate;\\n\\tstatic int[][] dist;\\n\\tstatic int r;\\n\\tstatic int v;\\n\\n\\tstatic void print(int mask) {\\n\\t\\tif (mask < v) {\\n\\t\\t\\tint c = 0;\\n\\t\\t\\tint x = mask ^ nextstate[mask];\\n\\t\\t\\tfor (int i = 0; i < dist.length - 1; i++) {\\n\\t\\t\\t\\tif((x & (1<0) {\\n\\t\\t\\t\\t\\tSystem.out.print(i+1 + \\\" \\\");\\n\\t\\t\\t\\t\\tc++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tSystem.out.print(\\\"0 \\\");\\n\\t\\t\\tprint(nextstate[mask]);\\n\\t\\t}\\n\\t}\\n\\n\\tstatic int distace(int x1, int x2, int y1, int y2) {\\n\\t\\treturn (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);\\n\\t}\\n\\n\\tstatic int solve(int mask) {\\n\\t\\tif (mask == v) {\\n\\t\\t\\tnextstate[mask] = r;\\n\\n\\t\\t\\treturn 0;\\n\\t\\t}\\n\\t\\tif (nextstate[mask] != 0) {\\n\\t\\t\\treturn dp[mask];\\n\\t\\t}\\n\\n\\t\\tdp[mask] = (int) 1e9;\\n\\t\\tfor (int i = 1; i < pos.length; i++) {\\n\\t\\t\\tint u = (1 << (i - 1));\\n\\t\\t\\tint z = mask | u;\\n\\t\\t\\tif ((mask & u) == 0) {\\n\\t\\t\\t\\tint x = 2 * dist[i][0] + solve(z);\\n\\t\\t\\t\\tif (dp[mask] > x) {\\n\\t\\t\\t\\t\\tdp[mask] = x;\\n\\t\\t\\t\\t\\tnextstate[mask] = z;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tfor (int j = 1; j < pos.length; j++) {\\n\\t\\t\\t\\t\\tint m = (1 << j - 1);\\n\\t\\t\\t\\t\\tint y = z | m;\\n\\t\\t\\t\\t\\tif ((z & m) == 0) {\\n\\t\\t\\t\\t\\t\\tx = dist[i][0] + solve(y) + dist[i][j] + dist[j][0];\\n\\n\\t\\t\\t\\t\\t\\tif (dp[mask] > x) {\\n\\t\\t\\t\\t\\t\\t\\tdp[mask] = x;\\n\\t\\t\\t\\t\\t\\t\\tnextstate[mask]= y;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn dp[mask];\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputReader0 in = new InputReader0(System.in);\\n\\t\\tint x = in.nextInt(), y = in.nextInt();\\n\\t\\tint n = in.nextInt();\\n\\t\\tr = 1 << n;\\n\\t\\tv = r - 1;\\n\\t\\tdp = new int[r];\\n\\t\\tnextstate = new int[r];\\n\\t\\tpos = new int[n + 1][2];\\n\\t\\tpos[0][0] = x;\\n\\t\\tpos[0][1] = y;\\n\\t\\tfor (int i = 1; i < pos.length; i++) {\\n\\t\\t\\tpos[i][0] = in.nextInt();\\n\\t\\t\\tpos[i][1] = in.nextInt();\\n\\t\\t}\\n\\t\\tdist = new int[n + 1][n + 1];\\n\\t\\tfor (int i = 0; i < dist.length; i++) {\\n\\t\\t\\tfor (int j = i + 1; j < dist.length; j++) {\\n\\t\\t\\t\\tdist[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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/*\\nIf you want to aim high, aim high\\nDon't let that studying and grades consume you\\nJust live life young\\n******************************\\nWhat do you think? What do you think?\\n1st on Billboard, what do you think of it\\nNext is a Grammy, what do you think of it\\nHowever you think, I’m sorry, but shit, I have no fcking interest\\n*******************************\\nI'm standing on top of my Monopoly board\\nThat means I'm on top of my game and it don't stop\\ntil my hip don't hop anymore\\nhttps:\\/\\/www.a2oj.com\\/Ladder16.html\\n*******************************\\n300iq as writer = Sad!\\n*\\/\\nimport java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\n\\n public class x35C\\n {\\n public static void main(String hi[]) throws Exception\\n {\\n BufferedReader infile = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n StringTokenizer st = new StringTokenizer(infile.readLine());\\n int N = Integer.parseInt(st.nextToken());\\n int M = Integer.parseInt(st.nextToken());\\n int K = Integer.parseInt(infile.readLine());\\n int[][] grid = new int[N][M];\\n for(int i=0; i < N; i++)\\n Arrays.fill(grid[i], -1);\\n ArrayDeque q = new ArrayDeque();\\n st = new StringTokenizer(infile.readLine());\\n while(K-->0)\\n {\\n int a = Integer.parseInt(st.nextToken())-1;\\n int b = Integer.parseInt(st.nextToken())-1;\\n grid[a][b] = 0;\\n q.add(a); q.add(b);\\n }\\n while(q.size() > 0)\\n {\\n int x = q.poll();\\n int y = q.poll();\\n if(x > 0 && grid[x-1][y] == -1)\\n {\\n grid[x-1][y] = grid[x][y]+1;\\n q.add(x-1); q.add(y);\\n }\\n if(y > 0 && grid[x][y-1] == -1)\\n {\\n grid[x][y-1] = grid[x][y]+1;\\n q.add(x); q.add(y-1);\\n }\\n if(x+1 < N && grid[x+1][y] == -1)\\n {\\n grid[x+1][y] = grid[x][y]+1;\\n q.add(x+1); q.add(y);\\n }\\n ... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class D {\\n\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n int m = sc.nextInt();\\n int[][]a = new int[n][n];\\n for (int i = 1; i <= m; i++) {\\n int v1 = sc.nextInt();\\n int v2 = sc.nextInt();\\n v1--;\\n v2--;\\n a[v1][v2] = a[v2][v1] = 1;\\n }\\n long[][]dp = new long[1 << n][n];\\n for (int i = 0; i < n; i++) {\\n dp[1 << i][i] = 1;\\n }\\n for (int mask = 0; mask < (1 << n); mask++) {\\n if (Integer.bitCount(mask) > 1) {\\n for (int i = 0; i < n; i++) {\\n if (i==Integer.numberOfTrailingZeros(mask))\\n continue;\\n if ((mask & (1 << i)) != 0) {\\n for (int j = 0; j < n; j++) {\\n if ((mask & (1 << j)) != 0 && a[j][i]==1) {\\n dp[mask][i] += dp[(mask ^ (1 << i))][j];\\n }\\n }\\n }\\n }\\n }\\n }\\n long ans = 0;\\n for (int mask = 0; mask < (1 << n); mask++) {\\n if (Integer.bitCount(mask) >= 3) {\\n int t = Integer.numberOfTrailingZeros(mask);\\n for (int i = 0; i < n; i++) {\\n if (a[t][i]==1)\\n ans += dp[mask][i];\\n }\\n }\\n }\\n ans \\/= 2;\\n System.out.println(ans);\\n }\\n} \\n What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.util.Scanner;\\n\\npublic class CF495A {\\n public static void main(String[] args) {\\n Scanner s = new Scanner(System.in);\\n int n = s.nextInt();\\n long d = s.nextLong();\\n long[] arr = new long[n];\\n for (int i = 0; i < n; i++) {\\n arr[i] = s.nextLong();\\n }\\n Arrays.sort(arr);\\n long ans = 2;\\n for (int i = 0; i < n - 1; i++) {\\n if(arr[i + 1] - arr[i] > 2 * d){\\n ans += 2;\\n }else if(arr[i + 1] - arr[i] == 2 * d){\\n ans += 1;\\n }\\n }\\n System.out.println(ans);\\n }\\n}\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\n\\n\\/**\\n * Created by hama_du on 15\\/09\\/10.\\n *\\/\\npublic class A {\\n private static final long MOD = 1000000009;\\n\\n public static void main(String[] args) {\\n InputReader in = new InputReader(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n\\n long n = in.nextInt();\\n long correct = in.nextInt();\\n long k = in.nextInt();\\n long wrong = n - correct;\\n long set = wrong * k + k - 1;\\n if (set >= n) {\\n out.println(correct);\\n } else {\\n long needExtraCorrect = n - (wrong * k + k - 1);\\n long firstSet = needExtraCorrect + k - 1;\\n long otherSet = correct - firstSet;\\n\\n long firstDouble = firstSet \\/ k;\\n otherSet += firstSet % k;\\n long[][] mat = new long[][]{ {2, 2*k}, {0, 1}};\\n long[][] A = pow(mat, firstDouble, MOD);\\n long score = (A[0][1] + otherSet) % MOD;\\n out.println(score);\\n }\\n out.flush();\\n }\\n\\n public static long[][] pow(long[][] a, long n, long mod) {\\n long i = 1;\\n long[][] res = E(a.length);\\n long[][] ap = mul(E(a.length), a, mod);\\n while (i <= n) {\\n if ((n & i) >= 1) {\\n res = mul(res, ap, mod);\\n }\\n i *= 2;\\n ap = mul(ap, ap, mod);\\n }\\n return res;\\n }\\n\\n public static long[][] E(int n) {\\n long[][] a = new long[n][n];\\n for (int i = 0 ; i < n ; i++) {\\n a[i][i] = 1;\\n }\\n return a;\\n }\\n\\n public static long[][] mul(long[][] a, long[][] b, long mod) {\\n long[][] c = new long[a.length][b[0].length];\\n if (a[0].length != b.length) {\\n System.err.print(\\\"err\\\");\\n }\\n for (int i = 0 ; i < a.length ; i++) {\\n for (int j = 0 ; j < b[0].length ; j++) {\\n long sum = 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\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\nimport java.io.*;\\npublic class C{\\n\\t\\tpublic static void main(String args[]) {\\n\\t\\tScanner in = new Scanner(System.in);\\n\\t\\tint n=in.nextInt(),key=in.nextInt(),ans=0;\\n\\t\\tint[] a = new int[101], b = new int[101];\\n\\t\\tfor (int i=1;i<=n;i++) {a[i]=in.nextInt();b[i]=in.nextInt();}\\n\\t\\tfor (int i=1;ib[j])) {\\n\\t\\tint yed = a[i];a[i]=a[j];\\t\\t\\ta[j]=yed;\\n\\t\\tyed = b[i];b[i]=b[j];b[j]=yed;\\n\\t\\t\\t\\t}\\n\\t\\tint k=0;\\n\\t\\t\\n\\t\\t\\n\\t\\tfor (int i=1;i<=n;i++) {\\n\\t\\t\\tif (a[i]==a[i-1] && b[i]==b[i-1]) k++; else \\n\\t\\t\\t\\t{if (i>key && ans==0) ans = k;k=1;}\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\tif (ans == 0) ans = k;\\n\\t\\tSystem.out.println(ans);\\n\\t\\t\\n\\t\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import javax.sound.sampled.Line;\\nimport java.awt.Point;\\nimport java.awt.geom.Line2D;\\nimport java.awt.geom.Point2D;\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport static java.math.BigInteger.*;\\nimport java.util.*;\\npublic class A{\\n\\n\\n void solve()throws Exception\\n {\\n int n=nextInt();\\n int[]a=new int[n];\\n for(int i=0;i dq = new ArrayDeque<>();\\n\\t\\tint max = -1;\\n\\t\\tfor(int i = 0; i < n; ++i) {\\n\\t\\t\\tint x = in.nextInt();\\n\\t\\t\\tdq.add(x);\\n\\t\\t\\tmax = Math.max(max, x);\\n\\t\\t}\\n\\t\\tArrayList ans = new ArrayList<>();\\n\\t\\twhile(dq.peekFirst() != max) {\\n\\t\\t\\tint a = dq.pollFirst();\\n\\t\\t\\tint b = dq.pollFirst();\\n\\t\\t\\tans.add(new Pair(a, b));\\n\\t\\t\\tif(a > b) {\\n\\t\\t\\t\\tdq.addFirst(a);\\n\\t\\t\\t\\tdq.addLast(b);\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdq.addFirst(b);\\n\\t\\t\\t\\tdq.addLast(a);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tArrayList a = new ArrayList<>();\\n\\t\\tdq.pollFirst();\\n\\t\\tfor(int x : dq)\\n\\t\\t\\ta.add(x);\\n\\t\\twhile(q --> 0) {\\n\\t\\t\\tlong m = in.nextLong() - 1;\\n\\t\\t\\tif(m < ans.size()) {\\n\\t\\t\\t\\tSystem.out.println(ans.get((int)m).first + \\\" \\\" + ans.get((int)m).second);\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tint idx = (int)((m - ans.size()) % a.size());\\n\\t\\t\\t\\tSystem.out.println(max + \\\" \\\" + a.get(idx));\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.close();\\n\\t}\\n\\t\\n\\t\\n\\t\\n\\tstatic long lcm(long a, long b) {\\n\\t\\treturn a * b \\/ gcd(a, b);\\n\\t}\\n\\t\\n\\tstatic boolean nextPermutation(int[] a) {\\n\\t\\tfor(int i = a.length - 2; i >= 0; --i) {\\n\\t\\t\\tif(a[i] < a[i+1]) {\\n\\t\\t\\t\\tfor(int j = a.length - 1; ; --j) {\\n\\t\\t\\t\\t\\tif(a[i] < a[j]) {\\n\\t\\t\\t\\t\\t\\tint t = a[i];\\n\\t\\t\\t\\t\\t\\ta[i] = a[j];\\n\\t\\t\\t\\t\\t\\ta[j] = t;\\n\\t\\t\\t\\t\\t\\tfor(i++, j = a.length - 1; i < j; ++i, --j) {\\n\\t\\t\\t\\t\\t\\t\\tt = a[i];\\n\\t\\t\\t\\t\\t\\t\\ta[i] = a[j];\\n\\t\\t\\t\\t\\t\\t\\ta[j] = t;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\treturn true;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn false;\\n\\t}\\n\\t\\n\\t\\n\\tstatic void shuffle(int[] a) {\\n\\t\\tRandom r = new Random();\\n\\t\\tfor(int i = a.length - 1; i > 0; --i) {\\n\\t\\t\\tint si = r.nextInt(i);\\n\\t\\t\\tint t = a[si];\\n\\t\\t\\ta[si] = a[i];\\n\\t\\t\\ta[i] = t;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tstatic void shuffle(long[] a) {\\n\\t\\tRandom r = new Random();\\n\\t\\tfor(int i = a.length - 1; i > 0; --i) {\\n\\t\\t\\tint si = r.nextInt(i);\\n\\t\\t\\tlong t = a[si];\\n\\t\\t\\ta[si] = a[i];\\n\\t\\t\\ta[i] = t;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tstatic 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.HashSet;\\nimport java.util.Set;\\nimport java.util.StringTokenizer;\\n\\npublic class Houses implements Runnable {\\n private void solve() throws IOException {\\n int n = nextInt();\\n int t = nextInt();\\n int[] x = new int[n];\\n int[] a = new int[n];\\n for (int i = 0; i < n; ++i) {\\n x[i] = nextInt() * 2;\\n a[i] = nextInt();\\n }\\n Set res = new HashSet();\\n for (int i = 0; i < n; ++i) {\\n if (valid(n, t, x, a, x[i] + a[i] + t))\\n res.add(x[i] + a[i] + t);\\n if (valid(n, t, x, a, x[i] - a[i] - t))\\n res.add(x[i] - a[i] - t);\\n }\\n writer.println(res.size());\\n }\\n\\n private boolean valid(int n, int t, int[] x, int[] a, int pos) {\\n for (int i = 0; i < n; ++i) {\\n if (Math.abs(pos - x[i]) < a[i] + t)\\n return false;\\n }\\n return true;\\n }\\n\\n public static void main(String[] args) {\\n new Houses().run();\\n }\\n\\n BufferedReader reader;\\n StringTokenizer tokenizer;\\n PrintWriter writer;\\n\\n public void run() {\\n try {\\n reader = new BufferedReader(new InputStreamReader(System.in));\\n tokenizer = null;\\n writer = new PrintWriter(System.out);\\n solve();\\n reader.close();\\n writer.close();\\n } catch (Exception e) {\\n e.printStackTrace();\\n System.exit(1);\\n }\\n }\\n\\n int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() throws IOException {\\n return Double.parseDouble(nextToken());\\n }\\n\\n String nextToken() throws IOException {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n tokenizer = new... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.math.BigInteger;\\nimport java.util.Scanner;\\n\\n\\npublic class Main {\\n\\tstatic Scanner sc = new Scanner (System.in);\\n public static void main(String[] args) {\\n \\tint n = sc.nextInt();\\n \\tint k = sc.nextInt();\\n \\tchar str[][] = new char[5][n];\\n for(int i = 0;i < 4;i ++){\\n \\tfor(int j = 0;j < n;j ++)\\n str[i][j] = '.';\\n }\\n if(k % 2 == 0){\\n k \\/= 2;\\n for(int i = 1;i <= 2;i++){\\n for(int j = 1;j <= k;j++)\\n str[i][j] = '#'; \\n }\\n }\\n else{\\n str[1][n \\/ 2] = '#';\\n if(k != 1){\\n int tmp = n \\/ 2;\\n if(k <= n - 2){\\n for(int i = 1;i<= (k - 1) \\/ 2;i++){\\n str[1][i] = '#';\\n str[1][n - 1 - i] = '#';\\n }\\n }\\n else{\\n for(int i = 1;i <= n - 2;i++) str[1][i] = '#';\\n k -= n - 2;\\n for(int i = 1;i <= k\\/2;i++){\\n str[2][i] = '#';\\n str[2][n - 1 - i]='#';\\n }\\n }\\n \\n }\\n }\\n System.out.println(\\\"YES\\\");\\n for(int i = 0;i < 4;i ++){\\n \\tSystem.out.println(str[i]);\\n }\\n }\\n } Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.File;\\nimport java.io.FileInputStream;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileOutputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.BitSet;\\nimport java.util.Calendar;\\nimport java.util.Collections;\\nimport java.util.Comparator;\\nimport java.util.HashMap;\\nimport java.util.HashSet;\\nimport java.util.LinkedList;\\nimport java.util.PriorityQueue;\\nimport java.util.SortedSet;\\nimport java.util.Stack;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\nimport java.util.TreeSet;\\n\\n\\/**\\n * #\\n * @author pttrung\\n *\\/\\npublic class B_Round_371_Div1 {\\n\\n public static long MOD = 1000000007;\\n static int c = 0;\\n\\n public static void main(String[] args) throws FileNotFoundException {\\n \\/\\/ PrintWriter out = new PrintWriter(new FileOutputStream(new File(\\n \\/\\/ \\\"output.txt\\\")));\\n\\n Scanner in = new Scanner();\\n int n = in.nextInt();\\n int minX = -1;\\n int start = 1;\\n int end = n;\\n c = 0;\\n while (start <= end) {\\n int mid = (start + end) >> 1;\\n c = increaseC(c);\\n System.out.println(\\\"? \\\" + mid + \\\" 1 \\\" + n + \\\" \\\" + n);\\n System.out.flush();\\n\\n int v = in.nextInt();\\n if (v == 2) {\\n minX = mid;\\n start = mid + 1;\\n } else {\\n end = mid - 1;\\n }\\n }\\n \\/\\/System.out.println(\\\"Minx \\\" + minX);\\n int maxX = -1;\\n start = minX;\\n end = n;\\n while (start <= end) {\\n int mid = (start + end) >> 1;\\n c = increaseC(c);\\n System.out.println(\\\"? \\\" + minX + \\\" 1 \\\" + mid + \\\" \\\" + n);\\n System.out.flush();\\n int v = in.nextInt();\\n if (v == 2) {\\n maxX = mid;\\n end = mid - 1;\\n } else {\\n start = mid + 1;\\n }\\n }\\n \\/\\/... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A {\\n\\t\\n\\tint n;\\n\\t\\n\\tvoid run()throws IOException{\\n\\t\\tScanner sc = new Scanner(new InputStreamReader(System.in));\\t\\t\\n\\t\\tn = sc.nextInt();\\n\\t\\tint i,tmp,even,odd,e,o;\\n\\t\\teven=odd=e=o=0;\\n\\t\\tfor(i=1;i<=n;i++){\\n\\t\\t\\ttmp = sc.nextInt();\\n\\t\\t\\tif(tmp%2==0){\\n\\t\\t\\t\\te++;\\n\\t\\t\\t\\tif(even==0) even=i;\\n\\t\\t\\t} else{\\n\\t\\t\\t\\to++;\\n\\t\\t\\t\\tif(odd==0) odd=i;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif(e>1) System.out.println(odd);\\n\\t\\telse System.out.println(even);\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args)throws IOException {\\n\\t\\tnew A().run();\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\npublic class algo93\\n{\\n public static void main(String args[])\\n {\\n Scanner ex=new Scanner(System.in);\\n long x=ex.nextLong();\\n long k=ex.nextLong();\\n long mod=1000000007;\\n if(k==0)\\n System.out.println((2*x)%mod);\\n else if(x==0)\\n System.out.println(\\\"0\\\");\\n else\\n {\\n long pow=power(2,k);\\n long pow1=(2*pow)%mod;\\n long ans=(pow1*(x%mod))-pow+1;\\n if(ans<0)\\n ans=ans+mod;\\n ans=ans%mod;\\n System.out.println(ans);\\n }\\n }\\n public static long power(long x,long y)\\n {\\n if (y == 0)\\n return 1;\\n long mod=1000000007;\\n long pow=power(x,y\\/2);\\n pow=(pow*pow)%mod;\\n if(y%2==0)\\n return pow;\\n else\\n return ((x%mod)*pow)%mod;\\n }\\n} Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*; \\nimport java.util.*; \\nimport java.util.Map.*;\\nimport java.math.*;\\n\\/\\/import java.lang.*;\\n\\npublic class q1 \\n{ \\n static int MOD=1000000007;\\n static class Reader \\n { \\n final private int BUFFER_SIZE = 1 << 16; \\n private DataInputStream din; \\n private byte[] buffer; \\n private int bufferPointer, bytesRead; \\n \\n public Reader() \\n { \\n din = new DataInputStream(System.in); \\n buffer = new byte[BUFFER_SIZE]; \\n bufferPointer = bytesRead = 0; \\n } \\n \\n public Reader(String file_name) throws IOException \\n { \\n din = new DataInputStream(new FileInputStream(file_name)); \\n buffer = new byte[BUFFER_SIZE]; \\n bufferPointer = bytesRead = 0; \\n } \\n \\n public String readLine() throws IOException \\n { \\n byte[] buf = new byte[1000000]; \\/\\/ line length \\n int cnt = 0, c; \\n while ((c = read()) != -1) \\n { \\n if (c == '\\\\n') \\n break; \\n buf[cnt++] = (byte) c; \\n } \\n return new String(buf, 0, cnt); \\n } \\n \\n public int nextInt() throws IOException \\n { \\n int ret = 0; \\n byte c = read(); \\n while (c <= ' ') \\n c = read(); \\n boolean neg = (c == '-'); \\n if (neg) \\n c = read(); \\n do\\n { \\n ret = ret * 10 + c - '0'; \\n } while ((c = read()) >= '0' && c <= '9'); \\n \\n if (neg) \\n return -ret; \\n return ret; \\n } \\n \\n public long nextLong() throws IOException \\n { \\n long ret = 0; \\n byte c = read(); \\n while (c <= ' ') \\n c = read(); \\n boolean neg = (c == '-'); \\n if (neg) \\n c = read(); \\n do { \\n ret = ret * 10 + c - '0'; \\n } \\n 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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStreamWriter;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.Scanner;\\nimport java.util.StringTokenizer;\\n\\npublic class Main {\\n static BufferedReader in=new BufferedReader(new InputStreamReader(System.in));\\n static StringTokenizer tok;\\n static boolean hasNext()\\n {\\n while(tok==null||!tok.hasMoreTokens())\\n try{\\n tok=new StringTokenizer(in.readLine());\\n }\\n catch(Exception e){\\n return false;\\n }\\n return true;\\n }\\n static String next()\\n {\\n hasNext();\\n return tok.nextToken();\\n }\\n static long nextLong()\\n {\\n return Long.parseLong(next());\\n }\\n static int nextInt()\\n {\\n return Integer.parseInt(next());\\n }\\n static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));\\n\\n public static void main(String args []){\\n long x = nextLong();\\n long a = 2, b = nextLong(), c = 1000000000+7;\\n long res = 1;\\n a %= c;\\n if (x==0){\\n out.println(0);\\n out.flush();\\n return;\\n }\\n for (; b != 0; b \\/= 2) {\\n if (b % 2 == 1)\\n res = (res * a) % c;\\n a = (a * a) % c;\\n }\\n BigInteger r = new BigInteger(String.valueOf(res));\\n BigInteger y = new BigInteger(String.valueOf(x));\\n BigInteger ans = y.multiply(new BigInteger(\\\"2\\\")).subtract(new BigInteger(\\\"1\\\")).multiply(r).add(new BigInteger(\\\"1\\\")).mod(new BigInteger(String.valueOf(c)));\\n out.println(ans);\\n out.flush();\\n }\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class p23a {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n char[] x = in.next().toCharArray();\\n \\n int min = 0;\\n int max = x.length;\\n while(true) {\\n if(max-min == 1)\\n break;\\n int mid = (max+min)\\/2;\\n boolean eq = false;\\n for (int i = 0; i <= x.length-mid; i++) {\\n for (int j = 0; j <= x.length-mid; j++) {\\n if(j == i)\\n continue;\\n eq = true;\\n for (int k = 0; k < mid; k++) {\\n if(x[i+k] != x[j+k]) { \\n eq = false;\\n break;\\n }\\n }\\n if(eq)\\n break;\\n }\\n if(eq) break;\\n }\\n if(eq) {\\n min = mid;\\n } else {\\n max = mid;\\n }\\n }\\n System.out.println(min);\\n \\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.io.PrintStream;\\nimport java.util.StringTokenizer;\\nimport java.util.Scanner;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Wolfgang Beyer\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskD solver = new TaskD();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskD {\\n int found = 0;\\n int queryCount = 0;\\n int[] result = new int[8];\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n \\/\\/int n = 100;\\n \\/\\/int n = 65536;\\n\\n\\n int left = 1;\\n int right = n + 1;\\n while (left + 1 < right) {\\n int middle = (left + right) \\/ 2;\\n int res = query(middle, 1, n, n);\\n if (res == 2) left = middle;\\n else if (res == 1) {\\n \\/\\/System.out.println(\\\"Searching single: \\\");\\n findSingle(middle, 1, n, n);\\n found++;\\n break;\\n } else {\\n right = middle;\\n }\\n }\\n\\n int top = 1;\\n int bottom = n + 1;\\n while (top + 1 < bottom) {\\n int middle = (top + bottom) \\/ 2;\\n int res = query(1, middle, n, n);\\n if (res == 2) top = middle;\\n else if (res == 1) {\\n if ((found == 0) || (!containsRect(1, middle, n, n, result[0], result[1], result[2], result[3]))) {\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/**\\n * Author: Ridam Nagar\\n * Date: 27 February 2019\\n * Time: 01:17:36\\n**\\/\\n\\/* \\npackage codechef; \\/\\/ don't place package name! *\\/\\n\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\nimport java.math.BigInteger;\\n\\n\\/* Name of the class has to be \\\"Main\\\" only if the class is public. *\\/\\npublic class Codechef\\n{ \\n static String reverse(String s){\\n String reverse=\\\"\\\";\\n for(int i=s.length()-1;i>=0;i--){\\n reverse=reverse + s.charAt(i);\\n }\\n return reverse;\\n }\\n\\n \\n public static void main (String[] args) throws java.lang.Exception\\n {\\n Scanner sc=new Scanner(System.in);\\n int n=sc.nextInt();\\n int m=sc.nextInt();\\n int x=m%(int)Math.pow(2,n);\\n System.out.println(x);\\n\\n\\n\\n}\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class A implements Runnable {\\n\\n public void run() {\\n long startTime = System.nanoTime();\\n\\n int n = nextInt();\\n\\n String[] all = new String[9];\\n all[0] = \\\"M\\\";\\n for (int i = 0; i < 4; i++) {\\n String s = \\\"\\\";\\n for (int j = 0; j < i; j++) {\\n s += \\\"X\\\";\\n }\\n all[2 * i + 1] = s + \\\"S\\\";\\n all[2 * i + 2] = s + \\\"L\\\";\\n }\\n\\n Map map1 = new HashMap<>();\\n Map map2 = new HashMap<>();\\n for (String s : all) {\\n map1.put(s, 0);\\n map2.put(s, 0);\\n }\\n for (int i = 0; i < n; i++) {\\n String s = nextToken();\\n map1.put(s, map1.get(s) + 1);\\n }\\n for (int i = 0; i < n; i++) {\\n String s = nextToken();\\n map2.put(s, map2.get(s) + 1);\\n }\\n\\n int res = 0;\\n for (String s : all) {\\n int a = map1.get(s);\\n int b = map2.get(s);\\n\\n if (a > b) {\\n res += a - b;\\n }\\n }\\n println(res);\\n\\n if (fileIOMode) {\\n System.out.println((System.nanoTime() - startTime) \\/ 1e9);\\n }\\n out.close();\\n }\\n\\n \\/\\/-----------------------------------------------------------------------------------\\n\\n private static boolean fileIOMode;\\n private static BufferedReader in;\\n private static PrintWriter out;\\n private static StringTokenizer tokenizer;\\n\\n public static void main(String[] args) throws Exception {\\n fileIOMode = args.length > 0 && args[0].equals(\\\"!\\\");\\n if (fileIOMode) {\\n in = new BufferedReader(new FileReader(\\\"a.in\\\"));\\n out = new PrintWriter(\\\"a.out\\\");\\n } else {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n }\\n tokenizer = new StringTokenizer(\\\"\\\");\\n\\n new Thread(new A()).start();\\n }\\n\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A {\\n FastScanner in;\\n PrintWriter out;\\n\\n void solve() {\\n int n = in.nextInt();\\n int[] a = new int[n];\\n for (int i = 0; i < n; i++) {\\n a[i] = in.nextInt();\\n }\\n Arrays.sort(a);\\n int res = 0;\\n for (int i = 0; i < n; i++) {\\n boolean ok = false;\\n for (int j = 0; j < i; j++) {\\n if (a[i] % a[j] == 0) {\\n ok = true;\\n }\\n }\\n if (!ok) {\\n res++;\\n }\\n }\\n out.println(res);\\n }\\n\\n void run() {\\n try {\\n in = new FastScanner(new File(\\\"A.in\\\"));\\n out = new PrintWriter(new File(\\\"A.out\\\"));\\n\\n solve();\\n\\n out.close();\\n } catch (FileNotFoundException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n void runIO() {\\n\\n in = new FastScanner(System.in);\\n out = new PrintWriter(System.out);\\n\\n solve();\\n\\n out.close();\\n }\\n\\n class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner(File f) {\\n try {\\n br = new BufferedReader(new FileReader(f));\\n } catch (FileNotFoundException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n public FastScanner(InputStream f) {\\n br = new BufferedReader(new InputStreamReader(f));\\n }\\n\\n String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n String s = null;\\n try {\\n s = br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n if (s == null)\\n return null;\\n st = new StringTokenizer(s);\\n }\\n return st.nextToken();\\n }\\n\\n boolean hasMoreTokens() {\\n while (st == null || !st.hasMoreTokens()) {\\n String s = null;\\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class A{\\n\\n void solve(){\\n int n=ni();\\n s=new char[n+1];\\n s[0]='.';\\n for(int i=1;i<=n;i++) s[i]=ns().charAt(0);\\n dp=new long[5001][5001];\\n\\n dp[1][0]=1;\\n long sum[]=new long[n+2];\\n sum[0]=1;\\n for(int i=2;i<=n;i++){\\n for(int j=0;j<=n;j++) {\\n if (s[i - 1] == 'f') {\\n if(j-1>=0) dp[i][j]=dp[i-1][j-1];\\n else dp[i][j]=0;\\n }else {\\n dp[i][j]=sum[j];\\n }\\n }\\n for(int j=n;j>=0;j--){\\n sum[j]=(sum[j+1]+dp[i][j])%M;\\n }\\n }\\n long ans=0;\\n for(int i=0;i<=n;i++){\\n ans+=dp[n][i];\\n if(ans>=M) ans%=M;\\n }\\n pw.println(ans);\\n\\n }\\n char s[];\\n long dp[][];\\n long go(int x,int cnt,int n){\\n \\/\\/ pw.println(x+\\\" \\\"+cnt);\\n if(x>n) return 1;\\n long cc=0;\\n if(dp[x][cnt]!=-1) return dp[x][cnt];\\n if(s[x]=='f'){\\n cc=(cc+go(x+1,cnt+1,n))%M;\\n }else {\\n\\n for(int j=cnt;j>=0;j--) cc=(cc+go(x+1,j,n))%M;\\n if(x==n) cc=(cc-cnt+M)%M;\\n }\\n cc%=M;\\n\\n dp[x][cnt]=cc;\\n return cc;\\n }\\n\\n\\n\\n long M=(long)1e9+7;\\n InputStream is;\\n PrintWriter pw;\\n String INPUT = \\\"\\\";\\n void run() throws Exception {\\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\\n pw = new PrintWriter(System.out);\\n long s = System.currentTimeMillis();\\n solve();\\n pw.flush();\\n if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+\\\"ms\\\");\\n }\\n\\n public static void main(String[] args) throws Exception { new A().run(); }\\n\\n private byte[] inbuf = new byte[1024];\\n public int lenbuf = 0, ptrbuf = 0;\\n\\n private int readByte() {\\n if(lenbuf == -1)throw new InputMismatchException();\\n if(ptrbuf >= lenbuf){\\n ptrbuf = 0;\\n try { lenbuf... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class p481a {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n long l = sc.nextLong();\\n long r = sc.nextLong();\\n if (r - l <= 1) {\\n System.out.println(\\\"-1\\\");\\n } else if (r - l >= 3) {\\n if (l % 2 == 0) {\\n System.out.println(l + \\\" \\\" + (l + 1) + \\\" \\\" + (l + 2));\\n } else {\\n System.out.println((l + 1) + \\\" \\\" + (l + 2) + \\\" \\\" + (l + 3));\\n }\\n } else {\\n long g1 = GCD(l, (l + 1));\\n long g2 = GCD((l + 1), (l + 2));\\n long g3 = GCD(l, r);\\n if (g1 == 1 && g2 == 1 && g3 != 1) {\\n System.out.println(l + \\\" \\\" + (l + 1) + \\\" \\\" + r);\\n } else {\\n System.out.println(\\\"-1\\\");\\n }\\n }\\n }\\n\\n public static long GCD(long a, long b) {\\n if (b == 0) return a;\\n return GCD(b, a % b);\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class aaaaaaaaaaaaaaaa {\\n\\tpublic void run() throws Exception {\\n\\t\\tScanner file = new Scanner(System.in);\\n\\t\\tint a = file.nextInt(), b= file.nextInt(), c = file.nextInt(), n = file.nextInt();\\n\\t\\ta -= c;\\n\\t\\tb -= c;\\n\\t\\tif (a < 0 || b < 0) System.out.println(-1);\\n\\t\\telse {\\n\\t\\t\\tint x = a + b + c;\\n\\t\\t\\tif (x >= n) System.out.println(-1);\\n\\t\\t\\telse System.out.println(n - x);\\n\\t\\t}\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tnew aaaaaaaaaaaaaaaa().run();\\n\\t}\\n\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.lang.reflect.*;\\n\\npublic class D {\\n\\n\\tfinal int MOD = (int)1e9 + 7;\\n\\tfinal double eps = 1e-12;\\n\\tfinal int INF = (int)1e9;\\n\\t\\n\\tpublic D () {\\n\\t\\tlong L = sc.nextLong();\\n\\t\\tlong R = sc.nextLong();\\n\\t\\t\\n\\t\\tfor (int i = 60; i >= 0; --i) {\\n\\t\\t\\tlong b = (1L << i);\\n\\t\\t\\tlong A = (L & b), B = (R & b);\\n\\t\\t\\tif (A != B)\\n\\t\\t\\t\\texit(2*b-1);\\n\\t\\t}\\n\\t\\texit(0);\\n\\t}\\n\\n\\t\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\n\\t\\/* Dear hacker, don't bother reading below this line, unless you want to help me debug my I\\/O routines :-) *\\/\\n\\t\\n\\tstatic MyScanner sc = new MyScanner();\\n\\t\\n\\tstatic class MyScanner {\\n\\t\\tpublic String next() {\\n\\t\\t\\tnewLine();\\n\\t\\t\\treturn line[index++];\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic char nextChar() {\\n\\t\\t\\treturn next().charAt(0);\\n\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\tpublic int nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic long nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic double nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic String nextLine() {\\n\\t\\t\\tline = null;\\n\\t\\t\\treturn readLine();\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic String [] nextStrings() {\\n\\t\\t\\tline = null;\\n\\t\\t\\treturn readLine().split(\\\" \\\");\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic char [] nextChars() {\\n\\t\\t\\treturn next().toCharArray();\\n\\t\\t}\\n\\n\\t\\tpublic Integer [] nextInts() {\\n\\t\\t\\tString [] L = nextStrings();\\n\\t\\t\\tInteger [] res = new Integer [L.length];\\n\\t\\t\\tfor (int i = 0; i < L.length; ++i)\\n\\t\\t\\t\\tres[i] = Integer.parseInt(L[i]);\\n\\t\\t\\treturn res;\\n\\t\\t}\\t\\n\\t\\t\\n\\t\\tpublic Long [] nextLongs() {\\n\\t\\t\\tString [] L = nextStrings();\\n\\t\\t\\tLong [] res = new Long [L.length];\\n\\t\\t\\tfor (int i = 0; i < L.length; ++i)\\n\\t\\t\\t\\tres[i] = Long.parseLong(L[i]);\\n\\t\\t\\treturn res;\\n\\t\\t}\\n\\n\\t\\tpublic Double [] nextDoubles() {\\n\\t\\t\\tString [] L = nextStrings();\\n\\t\\t\\tDouble [] res = new Double [L.length];\\n\\t\\t\\tfor (int i = 0; i < L.length; ++i)\\n\\t\\t\\t\\tres[i] = Double.parseDouble(L[i]);\\n\\t\\t\\treturn res;\\n\\t\\t}\\n\\n\\t\\tpublic String [] next (int N) {\\n\\t\\t\\tString [] res = new String [N];\\n\\t\\t\\tfor (int i = 0; i < N; ++i)\\n\\t\\t\\t\\tres[i] = sc.next();\\n\\t\\t\\treturn res;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic Integer [] nextInt (int N) {\\n\\t\\t\\tInteger [] res = new Integer... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/*\\n * To change this license header, choose License Headers in Project Properties.\\n * To change this template file, choose Tools | Templates\\n * and open the template in the editor.\\n *\\/\\n\\n\\/**\\n *\\n * @author wilso\\n *\\/\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.*;\\npublic class codeforces {\\n static final long MOD2 = 998_244_353;\\n public static void main(String[] args) {\\n FastScanner sc = new FastScanner();\\n PrintWriter pw = new PrintWriter(System.out);\\n \\n int tc = sc.ni();\\n\\/\\/ int tc = 1;\\n for (int rep = 0; rep < tc; rep++) {\\n int N = sc.ni();\\n int[] arr = sc.intArray(N);\\n pw.println(solve(arr));\\n }\\n \\n pw.close();\\n }\\n \\n \\n static String solve(int[] arr) {\\n StringBuilder sb = new StringBuilder();\\n List list = new ArrayList();\\n list.add(0);\\n for (int i = 0; i < arr.length; i++) {\\n int x = arr[i];\\n for (int j = list.size() - 1; j >= 0; j--) {\\n if (x - 1 == list.get(j)) {\\n list.set(j, x);\\n while (list.size() > j+1) {\\n list.remove(list.size() - 1);\\n }\\n list.add(0);\\n \\n \\/\\/append\\n for (int idx = 0; idx < list.size() - 1; idx++) {\\n sb.append(list.get(idx) + \\\".\\\");\\n }\\n sb.setLength(sb.length() - 1);\\n sb.append(\\\"\\\\n\\\");\\n break;\\n }\\n }\\n }\\n sb.setLength(sb.length() - 1);\\n return sb.toString();\\n }\\n \\n static int summation(int x) {\\n return x * (x+1) \\/ 2;\\n } \\n static long pow(long num, long exp, long mod){\\n long ans=1;\\n for(int i=1;i<=exp;i++){\\n ans=(ans*num)%mod;\\n }\\n return ans;\\n }\\n static boolean... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class B {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\n\\t\\t\\/**\\/\\n\\t\\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\\n\\t\\t\\/*\\/\\n\\t\\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(new FileInputStream(\\\"src\\/b.in\\\"))));\\n\\t\\t\\/**\\/\\n\\t\\t\\n\\t\\tint t = sc.nextInt();\\n\\t\\tfor (int z = 0; z < t; ++z) {\\n\\t\\t\\tint n = sc.nextInt();\\n\\t\\t\\tif (n%2==1) {\\n\\t\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\t}\\n\\t\\t\\tn\\/=2;\\n\\t\\t\\tint sqrt = (int)Math.sqrt(n);\\n\\t\\t\\tif (sqrt*sqrt==n) {\\n\\t\\t\\t\\tSystem.out.println(\\\"YES\\\");\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\t}\\n\\t\\t\\tif (n%2==1) {\\n\\t\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\t}\\n\\t\\t\\tn\\/=2;\\n\\t\\t\\tsqrt = (int)Math.sqrt(n);\\n\\t\\t\\tif (sqrt*sqrt==n) {\\n\\t\\t\\t\\tSystem.out.println(\\\"YES\\\");\\n\\t\\t\\t\\tcontinue;\\n\\t\\t\\t}\\n\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t\\t}\\n\\t}\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\npublic class village {\\n static int[] X, A;\\n public void solve()\\n {\\n Scanner in = new Scanner(System.in);\\n int N = in.nextInt(), T = in.nextInt();\\n X = new int[N];\\n A = new int[N];\\n\\n for(int i = 0; i < N; i++) {\\n X[i] = in.nextInt(); A[i] = in.nextInt();\\n }\\n\\n if(N == 1) {\\n System.out.println(\\\"2\\\");\\n return; \\n }\\n\\n List x = new ArrayList();\\n for(int i = 0; i < N; i++) {\\n x.add(i);\\n }\\n\\n Collections.sort(x, new Comp());\\n\\n int places = 0;\\n for(int i = 0; i < N-1; i++) {\\n double space = (X[x.get(i+1)]-X[x.get(i)]-A[x.get(i+1)]\\/2.0-A[x.get(i)]\\/2.0);\\n if(space < T) {\\n continue;\\n } if(space - T < 1e-9) {\\n places++;\\n } else if(space > T) {\\n places+=2;\\n }\\n }\\n System.out.println(places+2);\\n }\\n\\n public class Comp implements Comparator {\\n public int compare(Integer i1, Integer i2) {\\n return X[i1]-X[i2];\\n }\\n }\\n\\n public static void main(String[] args)\\n {\\n new village().solve();\\n }\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\n\\npublic class Main {\\n \\n public static void main(String[] args) throws Exception {\\n int i,j,k;\\n int counter[] = new int[2];\\n int a[] = new int[200];\\n int needed;\\n \\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n \\n int N = Integer.parseInt(br.readLine());\\n StringTokenizer st = new StringTokenizer(br.readLine());\\n \\n for (i=1;i<=N;i++) {\\n a[i] = Integer.parseInt(st.nextToken());\\n counter[a[i]%2]++;\\n }\\n \\n if (counter[0] == 1) {\\n needed = 0;\\n } else {\\n needed = 1;\\n }\\n \\n for (i=1;i<=N;i++) {\\n if (a[i]%2 == needed) {\\n System.out.println(i);\\n return;\\n }\\n }\\n \\n }\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class A {\\n\\n\\tBufferedReader br;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\tboolean eof;\\n\\n\\tvoid solve() throws IOException {\\n\\t\\tint tot = nextInt();\\n\\t\\tint ok = nextInt();\\n\\t\\t\\n\\t\\tint k = nextInt();\\n\\t\\t\\n\\t\\tint maxBad = tot \\/ k;\\n\\t\\tif (tot - maxBad >= ok) {\\n\\t\\t\\tout.println(ok);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\n\\t\\tint\\tdbl = ok + tot \\/ k - tot;\\n\\n\\t\\t\\n\\t\\tint dblPoints = pow(2, dbl + 1) - 2;\\n\\t\\twhile (dblPoints < 0)\\n\\t\\t\\tdblPoints += MOD;\\n\\t\\t\\n\\t\\tdblPoints = (int)((long)dblPoints * k % MOD);\\n\\t\\t\\n\\t\\tint rest = ok - dbl * k;\\n\\t\\t\\n\\t\\tint ans = dblPoints + rest;\\n\\t\\t\\n\\t\\tif (ans >= MOD)\\n\\t\\t\\tans -= MOD;\\n\\t\\t\\n\\t\\tout.println(ans);\\n\\t}\\n\\t\\n\\tstatic int pow(int a, int b) {\\n\\t\\tint ret = 1;\\n\\t\\twhile (b != 0) {\\n\\t\\t\\tif ((b & 1) == 1)\\n\\t\\t\\t\\tret = (int)((long)ret * a % MOD);\\n\\t\\t\\ta = (int)((long)a * a % MOD);\\n\\t\\t\\tb >>= 1;\\n\\t\\t}\\n\\t\\treturn ret;\\n\\t}\\n\\t\\n\\tstatic final int MOD = 1000000009;\\n\\n\\tA() throws IOException {\\n\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\tsolve();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tnew A();\\n\\t}\\n\\n\\tString nextToken() {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\teof = true;\\n\\t\\t\\t\\treturn null;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tString nextString() {\\n\\t\\ttry {\\n\\t\\t\\treturn br.readLine();\\n\\t\\t} catch (IOException e) {\\n\\t\\t\\teof = true;\\n\\t\\t\\treturn null;\\n\\t\\t}\\n\\t}\\n\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tlong nextLong() throws IOException {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tdouble nextDouble() throws IOException {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n} What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedOutputStream;\\nimport java.io.BufferedReader;\\nimport java.io.FileInputStream;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileOutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\npublic class ElongatedMatrix {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream input;\\n\\t\\tOutputStream output;\\n\\t\\ttry {\\n\\t\\t\\tinput = new FileInputStream(\\\"input.txt\\\");\\n\\t\\t\\toutput = new FileOutputStream(\\\"output.txt\\\");\\n\\t\\t} catch (FileNotFoundException e) {\\n\\t\\t\\tinput = System.in;\\n\\t\\t\\toutput = System.out;\\n\\t\\t}\\n\\t\\tKattio io = new Kattio(input, output);\\n\\t\\t(new Solve(io)).main();\\n\\t\\tio.close();\\n\\n\\t\\tif (input instanceof FileInputStream)\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tinput.close();\\n\\t\\t\\t} catch (IOException e) {\\n\\n\\t\\t\\t}\\n\\t\\tif (output instanceof FileOutputStream)\\n\\t\\t\\ttry {\\n\\t\\t\\t\\toutput.close();\\n\\t\\t\\t} catch (IOException e) {\\n\\n\\t\\t\\t}\\n\\t}\\n}\\n\\nclass Solve {\\n\\tstatic final int oo = (int) 1e9;\\n\\tKattio io;\\n\\tint n, m;\\n\\tint[][] a;\\n\\tint[][][] dp;\\n\\tint[][] diff;\\n\\tint[][] slant;\\n\\n\\tSolve(Kattio io) {\\n\\t\\tthis.io = io;\\n\\t}\\n\\n\\tint getbit(int x, int n) {\\n\\t\\tn--;\\n\\t\\treturn (x >> n) & 1;\\n\\t}\\n\\n\\tint setbit(int x, int n) {\\n\\t\\tn--;\\n\\t\\treturn x | (1 << n);\\n\\t}\\n\\n\\tint caldp(int currentRow, int firstRow, int mask) {\\n\\t\\tif (dp[currentRow][firstRow][mask] != -1)\\n\\t\\t\\treturn dp[currentRow][firstRow][mask];\\n\\t\\tdp[currentRow][firstRow][mask] = 0;\\n\\t\\tif (mask == (1 << n) - 1)\\n\\t\\t\\tdp[currentRow][firstRow][mask] = slant[currentRow][firstRow];\\n\\t\\telse {\\n\\t\\t\\tfor (int i = 1; i <= n; i++)\\n\\t\\t\\t\\tif (getbit(mask, i) == 0) {\\n\\t\\t\\t\\t\\tdp[currentRow][firstRow][mask] = Math.max(\\n\\t\\t\\t\\t\\t\\t\\tMath.min(caldp(i, firstRow, setbit(mask, i)), diff[currentRow][i]),\\n\\t\\t\\t\\t\\t\\t\\tdp[currentRow][firstRow][mask]);\\n\\n\\t\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn dp[currentRow][firstRow][mask];\\n\\n\\t}\\n\\n\\tvoid main() {\\n\\t\\tn = io.getInt();\\n\\t\\tm = io.getInt();\\n\\t\\ta = new int[n+1][m+1];\\n\\t\\tdp = new int[n+1][n+1][1< vis = new TreeSet();\\n Arrays.sort(a);\\n int ans = 0;\\n for (int i = 0; i < n; i++) {\\n if (!(a[i] % k == 0 && vis.contains(a[i] \\/ k))) {\\n ++ans;\\n vis.add(a[i]);\\n }\\n }\\n\\n out.println(ans);\\n }\\n}\\n\\nclass Scanner {\\n BufferedReader in;\\n StringTokenizer tok;\\n\\n public Scanner(InputStream in) {\\n this.in = new BufferedReader(new InputStreamReader(in));\\n tok = new StringTokenizer(\\\"\\\");\\n }\\n\\n public String nextToken() {\\n if (!tok.hasMoreTokens()) {\\n try {\\n String newLine = in.readLine();\\n if (newLine == null)\\n throw new InputMismatchException();\\n tok = new StringTokenizer(newLine);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n return nextToken();\\n }\\n\\n return tok.nextToken();\\n }\\n\\n public int nextInt() {\\n return... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\n\\npublic class Main {\\n\\n\\t\\/**\\n\\t * @param args\\n\\t *\\/\\n\\tstatic long[] dx = new long[]{0, 1, 0, -1};\\n\\tstatic long[] dy = new long[]{-1, 0, 1, 0};\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner r = new Scanner(System.in);\\n\\t\\t\\n\\t\\tlong N = r.nextLong();\\n\\t\\tlong X = r.nextLong();\\n\\t\\tlong Y = r.nextLong();\\n\\t\\tlong C = r.nextLong();\\n\\t\\t\\n\\t\\tlong lo = 0, hi = N * 2;\\n\\t\\t\\n\\t\\twhile(lo < hi){\\n\\t\\t\\tlong T = (lo + hi) \\/ 2;\\n\\t\\t\\t\\n\\t\\t\\tlong[] NX = new long[4];\\n\\t\\t\\tlong[] NY = new long[4];\\n\\t\\t\\t\\n\\t\\t\\tfor(int d = 0; d < 4; d++){\\n\\t\\t\\t\\tNX[d] = X + dx[d] * T;\\n\\t\\t\\t\\tNY[d] = Y + dy[d] * T;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tlong ret = (T + 1) * (T + 1) + T * T;\\n\\t\\t\\t\\n\\t\\t\\tret -= half(1 - NY[0]);\\n\\t\\t\\tret -= half(NY[2] - N);\\n\\t\\t\\tret -= half(NX[1] - N);\\n\\t\\t\\tret -= half(1 - NX[3]);\\n\\t\\t\\t\\n\\t\\t\\tret += quarter(1 - NY[0] - (N - X + 1));\\n\\t\\t\\tret += quarter(1 - NY[0] - (X));\\n\\t\\t\\tret += quarter(NY[2] - N - (N - X + 1));\\n\\t\\t\\tret += quarter(NY[2] - N - (X));\\n\\t\\t\\t\\n\\t\\t\\tif(ret < C)lo = T + 1;\\n\\t\\t\\telse hi = T;\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(lo);\\n\\t\\t\\n\\t}\\n\\tprivate static long half(long x) {\\n\\t\\tif(x <= 0)return 0;\\n\\t\\telse return 2 * quarter(x) - x;\\n\\t}\\n\\tprivate static long quarter(long x){\\n\\t\\tif(x <= 0)return 0;\\n\\t\\treturn x * (x + 1) \\/ 2;\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\n\\npublic class Main {\\n static int n=5;\\n static int[] arr=new int[5];\\n\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n int n=sc.nextInt();\\n int arr[]=new int[n];\\n for (int i=0;i=0)\\n {\\n arr[i]=-arr[i]-1;\\n }\\n }\\n if (n%2!=0)\\n {\\n int min=0;\\n for (int i=1;i n) return binSearch(n, k, mid + 1, to);\\n else return binSearch(n, k, from, mid);\\n }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package CF489; \\/\\/comment this line\\n\\nimport java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\npublic class B\\n{\\n private static long MOD=1000000007;\\n private static BigInteger m=new BigInteger(1000000007+\\\"\\\");\\n \\n private static long pow(long x, long a)\\n {\\n if(a==0)\\n return 1;\\n \\n long ans=pow(x,a\\/2);\\n \\n ans=(ans*ans)%MOD;\\n \\n if(a%2==1)\\n ans=(ans*x)%MOD;\\n \\n return ans%MOD;\\n }\\n public static void main(String args[]) throws IOException\\n {\\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n \\n long N,K,ans;\\n \\n \\/\\/System.out.println(); \\/\\/comment this line\\n String s[]=br.readLine().trim().split(\\\" \\\");\\n \\n N=Long.parseLong(s[0]);\\n K=Long.parseLong(s[1]);\\n \\n BigInteger bi=new BigInteger(N+\\\"\\\");\\n BigInteger a=new BigInteger(N+\\\"\\\");\\n BigInteger two=new BigInteger(2+\\\"\\\");\\n \\n if(N==0)\\n {\\n System.out.println(0);\\n System.exit(0);\\n }\\n if(K==0)\\n {\\n a=a.multiply(two);\\n a=a.mod(m);\\n \\n System.out.println(a);\\n System.exit(0);\\n }\\n \\n long p=pow(2,K);\\n \\n BigInteger p2=new BigInteger(p+\\\"\\\");\\n BigInteger tmp=p2.subtract(BigInteger.ONE);\\n tmp=tmp.mod(m);\\n \\n p2=p2.multiply(two);\\n p2=p2.mod(m);\\n \\n a=a.multiply(p2);\\n a=a.mod(m);\\n \\n a=a.subtract(tmp);\\n a=a.mod(m);\\n \\n if(!(a.signum()==1)&&!(a.signum()==0))\\n a.add(m);\\n \\n System.out.println(a);\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class Subtractions {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\t\\tScanner s=new Scanner(System.in);\\n\\t\\tint t=s.nextInt();\\n\\t\\twhile(t--!=0){\\n\\t\\t\\tint a=s.nextInt();\\n\\t\\t\\tint b=s.nextInt();\\n\\t\\t\\tint min=Math.min(a, b);\\n\\t\\t\\tint max=Math.max(a, b);\\n\\t\\t\\tint ops=0;\\n\\t\\t\\twhile(true){\\n\\t\\t\\t\\tint quo=max\\/min;\\n\\t\\t\\t\\tops+=quo;\\n\\t\\t\\t\\tint rem=max%min;\\n\\t\\t\\t\\tmax=Math.max(rem, min);\\n\\t\\t\\t\\tmin=Math.min(min, rem);\\n\\t\\t\\t\\tif(rem==0) break;\\n\\t\\t\\t}\\n\\t\\t\\tSystem.out.println(ops);\\n\\t\\t}\\n\\t}\\n\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\/**\\n *\\n * @author oleksiys\\n *\\/\\npublic class A {\\n public static void main(String [] args){\\n try(Scanner s = new Scanner(System.in)){\\n final int n = s.nextInt();\\n final int m = s.nextInt();\\n final int k = s.nextInt();\\n final int [] a = new int [n];\\n for (int i = 0; i < a.length; ++i){\\n a[i] = s.nextInt();\\n }\\n Arrays.sort(a);\\n int i = a.length - 1;\\n int available = k;\\n int filters = 0;\\n while (available < m && i >= 0){\\n available -= 1;\\n available += a[i];\\n filters++;\\n i--;\\n }\\n if (available < m){\\n System.out.println(-1);\\n }else{\\n System.out.println(filters);\\n }\\n }\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\n\\/**\\n * Created by IntelliJ IDEA.\\n * User: Administrator\\n * Date: 13.05.11\\n * Time: 23:21\\n * To change this template use File | Settings | File Templates.\\n *\\/\\npublic class ToyArmies {\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n long n = in.nextLong();\\n System.out.print(String.format(\\\"%d\\\",(long)(n*1.5)));\\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\npublic class B {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tFastScanner sc = new FastScanner();\\n\\t\\tint T = sc.nextInt();\\n\\t\\twhile(T-->0) {\\n\\t\\t\\tint n = sc.nextInt();\\n\\t\\t\\tif(n % 2 == 0 && issq(n\\/2)) {\\n\\t\\t\\t\\tSystem.out.println(\\\"YES\\\");\\n\\t\\t\\t}\\n\\t\\t\\telse if(n % 4 == 0 && issq(n\\/4)) {\\n\\t\\t\\t\\tSystem.out.println(\\\"YES\\\");\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\tSystem.out.println(\\\"NO\\\");\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic boolean issq(long x) {\\n\\t\\tlong rx = (long)Math.sqrt(x);\\n\\t\\treturn rx * rx == x;\\n\\t}\\n\\t\\n\\tstatic class FastScanner {\\n\\t\\tpublic BufferedReader reader;\\n\\t\\tpublic StringTokenizer tokenizer;\\n\\t\\tpublic FastScanner() {\\n\\t\\t\\treader = new BufferedReader(new InputStreamReader(System.in), 32768);\\n\\t\\t\\ttokenizer = null;\\n\\t\\t}\\n\\t\\tpublic String next() {\\n\\t\\t\\twhile (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ttokenizer = new StringTokenizer(reader.readLine());\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\treturn tokenizer.nextToken();\\n\\t\\t}\\n\\t\\tpublic int nextInt() {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\t\\tpublic long nextLong() {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\t\\tpublic double nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\t\\tpublic String nextLine() {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\treturn reader.readLine();\\n\\t\\t\\t} catch(IOException e) {\\n\\t\\t\\t\\tthrow new RuntimeException(e);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\n\\npublic class B {\\n\\t\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner qwe = new Scanner(System.in);\\n\\t\\t\\n\\t\\tint n = qwe.nextInt();\\n\\t\\t\\n\\t\\t\\/\\/! x11 y11 x12 y12 x21 y21 x22 y22\\\" \\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\tint x11 = bins(true,1,2,n,qwe,true);\\n\\t\\tint y11 = bins(true,1,2,n,qwe,false);\\n\\t\\tint x12 = bins(false,0,1,n,qwe,true);\\n\\t\\tint y12 = bins(false,0,1,n,qwe,false);\\n\\t\\tint x21 = bins(true,0,1,n,qwe,true);\\n\\t\\tint y21 = bins(true,0,1,n,qwe,false);\\n\\t\\tint x22 = bins(false,1,2,n,qwe,true);\\n\\t\\tint y22 = bins(false,1,2,n,qwe,false);\\n\\t\\t\\n\\t\\tint[] xsl = {x11,x21};\\n\\t\\tint[] xsr = {x12,x22};\\n\\t\\tint[] ysl = {y11,y21};\\n\\t\\tint[] ysr = {y12,y22};\\n\\t\\t\\n\\t\\t\\n\\t\\tint[] ans = new int[8];\\n\\t\\t\\n\\t\\tfor(int xpl = 0; xpl < 2; xpl++){\\n\\t\\t\\tfor(int xpr = 0; xpr < 2; xpr++)\\n\\t\\t\\t\\tfor(int ypl = 0; ypl < 2; ypl++){\\n\\t\\t\\t\\t\\tfor(int ypr = 0; ypr < 2; ypr++){\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\tif(xsl[xpl] <= xsr[xpr] && xsl[1-xpl] <= xsr[1-xpr] && ysl[ypl] <= ysr[ypr] && ysl[1-ypl] <= ysr[1-ypr]){\\n\\t\\t\\t\\t\\t\\t\\tSystem.out.printf(\\\"? %d %d %d %d\\\",xsl[xpl],ysl[ypl],xsr[xpr],ysr[ypr]);\\n\\t\\t\\t\\t\\t\\t\\tSystem.out.println();\\n\\t\\t\\t\\t\\t\\t\\tSystem.out.flush();\\n\\t\\t\\t\\t\\t\\t\\tint response1 = qwe.nextInt();\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\tSystem.out.printf(\\\"? %d %d %d %d\\\",xsl[1-xpl],ysl[1-ypl],xsr[1-xpr],ysr[1-ypr]);\\n\\t\\t\\t\\t\\t\\t\\tSystem.out.println();\\n\\t\\t\\t\\t\\t\\t\\tSystem.out.flush();\\n\\t\\t\\t\\t\\t\\t\\tint response2 = qwe.nextInt();\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\tif(response1 == 1 && response2 == 1){\\n\\t\\t\\t\\t\\t\\t\\t\\tans = new int[]{xsl[xpl],ysl[ypl],xsr[xpr],ysr[ypr],xsl[1-xpl],ysl[1-ypl],xsr[1-xpr],ysr[1-ypr]};\\n\\t\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\t\\n\\t\\tSystem.out.printf(\\\"! %d %d %d %d %d %d %d %d\\\",ans[0],ans[1],ans[2],ans[3],ans[4],ans[5],ans[6],ans[7]);\\n\\t\\tSystem.out.println();\\n\\t\\tSystem.out.flush();\\n\\t\\t\\n\\t\\tqwe.close();\\n\\t}\\n\\t\\n\\tstatic int bins(boolean leftbound, int small, int big, int n, Scanner qwe, boolean isx){\\n\\t\\t\\n\\t\\tint min = 0;\\n\\t\\tint max = n;\\n\\t\\t\\n\\t\\tif(leftbound){\\n\\t\\t\\tmin++;\\n\\t\\t\\tmax++;\\n\\t\\t}\\n\\t\\t\\n\\t\\tint y1 = 1;\\n\\t\\tint y2 = n;\\n\\t\\tint x1 = 1;\\n\\t\\tint x2 = n;\\n\\t\\t\\/\\/\\\"? x1 y1 x2 y2\\\"\\n\\t\\twhile(min+1 < max){\\n\\t\\t\\t\\n\\t\\t\\tint med = (min+max)\\/2;\\n\\t\\t\\tif(isx){\\n\\t\\t\\t\\tif(!leftbound) x2 =... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.List;\\nimport java.util.LinkedList;\\nimport java.util.StringTokenizer;\\n\\npublic class Problem {\\n\\t\\n\\tpublic static Pair solve(Forest f, List queue){\\n\\t\\tPair current = null, next = null;\\n\\t\\tint index = 0;\\n\\t\\twhile(queue.size() > 0){\\n\\t\\t\\tcurrent = queue.remove(0);\\n\\t\\t\\tindex = f.desk[current.x][current.y];\\n\\t\\t\\t\\tif(current.x>0){\\n\\t\\t\\t\\t\\tnext = new Pair(current.x-1,current.y);\\n\\t\\t\\t\\t\\tif(f.desk[next.x][next.y]==0){\\n\\t\\t\\t\\t\\t\\tf.desk[next.x][next.y] = index+1;\\n\\t\\t\\t\\t\\t\\tqueue.add(next);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(current.x0){\\n\\t\\t\\t\\t\\tnext = new Pair(current.x,current.y-1);\\n\\t\\t\\t\\t\\tif(f.desk[next.x][next.y]==0){\\n\\t\\t\\t\\t\\t\\tf.desk[next.x][next.y] = index+1;\\n\\t\\t\\t\\t\\t\\tqueue.add(next);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif(current.y pairs = new LinkedList();\\n\\t\\tInteger N,M,K,x,y;\\n\\t\\ttry {\\n\\t\\t\\tBufferedReader in = new BufferedReader(\\n\\t\\t\\t\\t\\t\\t\\tnew FileReader(\\\"input.txt\\\")\\n\\t\\t\\t\\t\\t\\t\\t);\\n\\t\\t\\tFileWriter out = new FileWriter(\\\"output.txt\\\");\\n\\t\\t\\tbuffer = in.readLine();\\n\\t\\t\\tst = new StringTokenizer(buffer);\\n\\t\\t\\tN = new Integer(st.nextToken());\\n\\t\\t\\tM = new Integer(st.nextToken());\\n\\t\\t\\tf = new Forest(N,M);\\n\\t\\t\\tbuffer = in.readLine();\\n\\t\\t\\tst = new StringTokenizer(buffer);\\n\\t\\t\\tK = new Integer(st.nextToken());\\n\\t\\t\\tbuffer = in.readLine();\\n\\t\\t\\tst = new StringTokenizer(buffer);\\n\\t\\t\\tfor(int i = 0; i set = new HashMap(n);\\n while(i < n && set.size() < k) {\\n if(set.containsKey(arr[i])) set.put(arr[i], set.get(arr[i]) + 1);\\n else set.put(arr[i], 1);\\n i += 1;\\n }\\n if(set.size() < k) writer.println(-1 + \\\" \\\" + -1);\\n else {\\n while(l < i && i - l > k && set.get(arr[l]) > 1) {\\n set.put(arr[l], set.get(arr[l]) - 1);\\n l += 1;\\n }\\n writer.println((l + 1) + \\\" \\\" + i);\\n }\\n }\\n }\\n }\\n\\n private class Pair implements Comparable> {\\n public Pair(E first, V second) {\\n this.first = first;\\n this.second = second;\\n }\\n\\n @Override\\n public int compareTo(Pair obj) {\\n if(first.equals(obj.first)) return second.compareTo(obj.second);\\n return first.compareTo(obj.first);\\n }\\n\\n @Override\\n public boolean equals(Object obj) {\\n Pair... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.HashMap;\\nimport java.util.LinkedList;\\nimport java.util.StringTokenizer;\\nimport javafx.util.Pair;\\n\\npublic class Solve6 {\\n\\n public static void main(String[] args) throws IOException {\\n PrintWriter pw = new PrintWriter(System.out);\\n new Solve6().solve(pw);\\n pw.flush();\\n pw.close();\\n }\\n\\n public void solve(PrintWriter pw) throws IOException {\\n FastReader sc = new FastReader();\\n int n = sc.nextInt();\\n int[] a = new int[n + 1];\\n for (int i = 1; i <= n; i++) {\\n a[i] = sc.nextInt();\\n }\\n HashMap>> h = new HashMap();\\n for (int i = 1; i <= n; i++) {\\n int s = 0;\\n for (int j = i; j >= 1; j--) {\\n s += a[j];\\n LinkedList> l;\\n if (!h.containsKey(s)) {\\n l = new LinkedList();\\n } else {\\n l = h.get(s);\\n }\\n l.add(new Pair(j, i));\\n h.put(s, l);\\n }\\n }\\n LinkedList>[] l = new LinkedList[h.size() + 1];\\n for (int i = 1; i <= h.size(); i++) {\\n l[i] = new LinkedList();\\n }\\n int k = 0, max = 0, index = 0;\\n for (LinkedList> temp : h.values()) {\\n k++;\\n int i = 0, size = 0;\\n for (Pair pair : temp) {\\n if (pair.getKey() > i) {\\n i = pair.getValue();\\n l[k].add(pair);\\n size++;\\n if (size > max) {\\n max = size;\\n index = k;\\n }\\n }\\n }\\n }\\n pw.println(l[index].size());\\n for (Pair pair : l[index]) {\\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class r584p5 {\\n private static BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\\n private static PrintWriter pw = new PrintWriter(System.out);\\n private static int n, m, arr[][];\\n private static ArrayList> chls;\\n\\n private static void gench(){\\n chls.add(new HashSet<>());\\n chls.get(0).add(0);\\n\\n for(int i=1; i<(1< st = new HashSet<>();\\n for(int z : chls.get(des)){\\n st.add(z);\\n st.add(z|Integer.highestOneBit(i));\\n }\\n chls.add(st);\\n }\\n }\\n\\n private static void cal(){\\n int val[][] = new int[(1< 0)\\n sum += arr[ptr][j];\\n }\\n max = Math.max(max, sum);\\n }\\n val[mask][j] = max;\\n }\\n }\\n\\n int dp[][] = new int[(1<= numChars) {\\n\\t\\t\\t\\tcurChar = 0;\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\tnumChars = stream.read(buf);\\n\\t\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (numChars <= 0)\\n\\t\\t\\t\\t\\treturn -1;\\n\\t\\t\\t}\\n\\t\\t\\treturn buf[curChar++];\\n\\t\\t}\\n\\n\\t\\tboolean... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.util.Queue;\\nimport java.util.LinkedList;\\nimport java.util.Stack;\\n\\npublic class Main\\n{\\n @SuppressWarnings(\\\"unchecked\\\")\\n public static void main(String args[])throws IOException\\n {\\n Reader ob=new Reader();\\n Writer out=new Writer(System.out);\\n Random oo=new Random();\\n long k=ob.nL(),ans=0,p=9,num=0;\\n for(int i=1;i<18;i++)\\n {\\n if(num+i*p0)\\n {\\n String s=Long.toString(ans+1);\\n \\n out.pln(s.charAt((int)left-1));\\n }\\n else\\n {\\n \\n String s=Long.toString(ans);\\n \\n out.pln(s.charAt(i-1-(int)left));\\n }\\n break;\\n }\\n \\n }\\nout.flush();\\n}\\nstatic void sort(int a[])\\n{\\n RA(a);\\n Arrays.sort(a);\\n}\\n public static Pairs[] RA(Pairs [] array){\\n\\t\\tRandom rgen = new Random(); \\/\\/ Random number generator\\t\\t\\t\\n \\n\\t\\tfor (int i=0; i t ) ans += 2;\\n\\t\\t\\telse if( d == t ) ans++;\\n\\t\\t}\\n\\t\\tSystem.out.println( ans );\\n\\t}\\n\\n\\tstatic class Comp implements Comparator { public int compare( int[] a, int[] b ) { return a[0]-b[0]; } }\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class D {\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\tint n=sc.nextInt();\\n\\t\\tint inv=0;\\n\\t\\tint []a=new int [n];\\n\\t\\tfor(int i=0;ia[i])\\n\\t\\t\\t\\t\\tinv=1-inv;\\n\\n\\t\\tint m=sc.nextInt();\\n\\t\\tStringBuilder sb=new StringBuilder();\\n\\t\\twhile(m-->0)\\n\\t\\t{\\n\\t\\t\\tint l=sc.nextInt();\\n\\t\\t\\tint r=sc.nextInt();\\n\\t\\t\\tint s=r-l+1;\\n\\t\\t\\tif(s*(s-1)\\/2%2==1)\\n\\t\\t\\t\\tinv=1-inv;\\n\\t\\t\\tif(inv==1)\\n\\t\\t\\t\\tsb.append(\\\"odd\\\\n\\\");\\n\\t\\t\\telse\\n\\t\\t\\t\\tsb.append(\\\"even\\\\n\\\");\\n\\t\\t}\\n\\t\\tSystem.out.print(sb);\\n\\n\\t}\\n\\tstatic class Scanner \\n\\t{\\n\\t\\tStringTokenizer st;\\n\\t\\tBufferedReader br;\\n\\n\\t\\tpublic Scanner(InputStream s){\\tbr = new BufferedReader(new InputStreamReader(s));}\\n\\n\\t\\tpublic String next() throws IOException \\n\\t\\t{\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens()) \\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {return Integer.parseInt(next());}\\n\\t\\t\\n\\t\\tpublic long nextLong() throws IOException {return Long.parseLong(next());}\\n\\n\\t\\tpublic String nextLine() throws IOException {return br.readLine();}\\n\\t\\t\\n\\t\\tpublic double nextDouble() throws IOException\\n\\t\\t{\\n\\t\\t\\tString x = next();\\n\\t\\t\\tStringBuilder sb = new StringBuilder(\\\"0\\\");\\n\\t\\t\\tdouble res = 0, f = 1;\\n\\t\\t\\tboolean dec = false, neg = false;\\n\\t\\t\\tint start = 0;\\n\\t\\t\\tif(x.charAt(0) == '-')\\n\\t\\t\\t{\\n\\t\\t\\t\\tneg = true;\\n\\t\\t\\t\\tstart++;\\n\\t\\t\\t}\\n\\t\\t\\tfor(int i = start; i < x.length(); i++)\\n\\t\\t\\t\\tif(x.charAt(i) == '.')\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tres = Long.parseLong(sb.toString());\\n\\t\\t\\t\\t\\tsb = new StringBuilder(\\\"0\\\");\\n\\t\\t\\t\\t\\tdec = true;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tsb.append(x.charAt(i));\\n\\t\\t\\t\\t\\tif(dec)\\n\\t\\t\\t\\t\\t\\tf *= 10;\\n\\t\\t\\t\\t}\\n\\t\\t\\tres += Long.parseLong(sb.toString()) \\/ f;\\n\\t\\t\\treturn res * (neg?-1:1);\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic boolean ready() throws IOException {return br.ready();}\\n\\n\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.awt.*;\\nimport java.awt.geom.*;\\nimport java.math.*;\\nimport java.text.*;\\nimport java.math.BigInteger.*;\\nimport java.util.Arrays; \\n\\npublic class CF111111\\n{\\n BufferedReader in;\\n StringTokenizer as;\\n int nums[],nums2[];\\n int[] nums1[];\\n boolean con = true;\\n \\n ArrayList < Integer > ar = new ArrayList < Integer >();\\n ArrayList < Integer > fi = new ArrayList < Integer >();\\n Map map = new HashMap();\\n public static void main (String[] args)\\n {\\n new CF111111 ();\\n }\\n \\n public int GCD(int a, int b) {\\n if (b==0) return a;\\n return GCD(b,a%b);\\n }\\n \\n public int LIS(int arr[])\\n {\\n int n = arr.length;\\n int sun[] = new int [n];\\n int cur = 0;\\n for(int x = 0;x= max)\\n {\\n max2 = max;\\n max = nums[x];\\n }\\n else if(nums[x] >= max2)\\n max2 = nums[x];\\n }\\n System.out.println(Math.min(max2, b-1)-1);\\n }\\n }\\n catch(IOException e)\\n {\\n\\n }\\n }\\n \\n \\n \\n \\n \\n \\n \\n String next () throws IOException\\n {\\n while (as == null || !as.hasMoreTokens ())\\n {\\n as = new StringTokenizer (in.readLine ().trim ());\\n }\\n \\n \\n return as.nextToken ();\\n }\\n \\n \\n \\n long nextLong () throws IOException\\n {\\n return Long.parseLong (next ());\\n }\\n \\n \\n int... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class Solution{\\n\\n\\n void solve()throws Exception\\n {\\n\\n int n=nextInt();\\n\\n int[]a=new int[n];\\n for(int i=0;i 0 && a[i] != a[i-1]){\\n\\t\\t\\t\\tp++;\\n\\t\\t\\t}\\n\\t\\t\\tf[p]++;\\n\\t\\t}\\n\\t\\tf = Arrays.copyOf(f, p+1);\\n\\t\\tint mod = 1000000007;\\n\\t\\t\\n\\t\\tint[][] fif = enumFIF(1000, mod);\\n\\t\\tlong[] res = countSameNeighborsSequence(f, fif, mod);\\n\\t\\tlong ans = res[0];\\n\\t\\tfor(int v : f){\\n\\t\\t\\tans = ans * fif[0][v] % mod;\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.println(ans);\\n\\t}\\n\\t\\n\\tpublic static int[][] enumFIF(int n, int mod) {\\n\\t\\tint[] f = new int[n + 1];\\n\\t\\tint[] invf = new int[n + 1];\\n\\t\\tf[0] = 1;\\n\\t\\tfor (int i = 1; i <= n; i++) {\\n\\t\\t\\tf[i] = (int) ((long) f[i - 1] * i % mod);\\n\\t\\t}\\n\\t\\tlong a = f[n];\\n\\t\\tlong b = mod;\\n\\t\\tlong p = 1, q = 0;\\n\\t\\twhile (b > 0) {\\n\\t\\t\\tlong c = a \\/ b;\\n\\t\\t\\tlong d;\\n\\t\\t\\td = a;\\n\\t\\t\\ta = b;\\n\\t\\t\\tb = d % b;\\n\\t\\t\\td = p;\\n\\t\\t\\tp = q;\\n\\t\\t\\tq = d - c * q;\\n\\t\\t}\\n\\t\\tinvf[n] = (int) (p < 0 ? p + mod : p);\\n\\t\\tfor (int i = n - 1; i >= 0; i--) {\\n\\t\\t\\tinvf[i] = (int) ((long) invf[i + 1] * (i + 1) % mod);\\n\\t\\t}\\n\\t\\treturn new int[][] { f, invf };\\n\\t}\\n\\n\\t\\n\\tpublic static long[] countSameNeighborsSequence(int[] a, int[][] fif, int mod)\\n\\t{\\n\\t\\tint n = a.length;\\n\\t\\t\\n\\t\\tint bef = a[0];\\n\\t\\tint aft = a[0];\\n\\t\\tlong[] dp = new long[bef];\\n\\t\\tdp[bef-1] = 1;\\n\\t\\tfor(int u = 1;u < n;u++){\\n\\t\\t\\tint v = a[u];\\n\\t\\t\\taft += v;\\n\\t\\t\\tlong[][] ldp = new long[bef][aft];\\n\\t\\t\\tfor(int i = 0;i < dp.length;i++){\\n\\t\\t\\t\\tldp[i][0] = dp[i];\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tfor(int i = 0;i < v;i++){\\n\\t\\t\\t\\tlong[][] ndp = new long[bef][aft];\\n\\t\\t\\t\\tfor(int j = 0;j < bef;j++){\\n\\t\\t\\t\\t\\tfor(int k = 0;j+k < aft;k++){\\n\\t\\t\\t\\t\\t\\tif(ldp[j][k] == 0)continue;\\n\\t\\t\\t\\t\\t\\t\\/\\/ XX -> XCX\\n\\t\\t\\t\\t\\t\\tif(j > 0){\\n\\t\\t\\t\\t\\t\\t\\tndp[j-1][k] += ldp[j][k] *... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class origami {\\n\\tpublic static void main(String args[]){\\n\\t\\tScanner input = new Scanner(System.in);\\n\\t\\tdouble n = input.nextInt();\\n\\t\\tdouble k = input.nextInt();\\n\\t\\tdouble red = 0;\\n\\t\\tdouble green = 0;\\n\\t\\tdouble blue = 0;\\n\\t\\tdouble ans = 0;\\n\\t\\tred = (2 * n) \\/ k;\\n\\t\\tgreen = (5 * n) \\/ k;\\n\\t\\tblue = (8 * n) \\/ k;\\n\\n\\t\\tdouble red1 = Math.ceil(red) ;\\n\\t\\tdouble green1 = Math.ceil(green);\\n\\t\\tdouble blue1 = Math.ceil(blue);\\n\\n\\t\\tans+=red1;\\n\\t\\tans+=green1;\\n\\t\\tans+=blue1;\\n\\t\\tDouble answer = new Double(ans);\\n\\t\\tint finished = answer.intValue();\\n\\t\\tSystem.out.println(finished);\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.awt.Point;\\nimport java.io.File;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.PrintStream;\\nimport java.util.LinkedList;\\nimport java.util.Queue;\\nimport java.util.Scanner;\\nimport java.util.HashSet;\\n\\npublic class FireAgain {\\n\\n\\tPoint[] coordinate;\\n\\tQueue q = new LinkedList<>();\\n\\t\\/\\/ HashSet vis = new HashSet<>();\\n\\tboolean[][] vis;\\n\\tPrintStream out;\\n\\tint x, y;\\n\\n\\tboolean distance(Point word1, Point word2) {\\n\\n\\t\\tif (Math.abs(word1.x - word2.x) == 1 && Math.abs(word1.y - word2.y) == 1)\\n\\t\\t\\treturn false;\\n\\n\\t\\tif (Math.abs(word1.x - word2.x) == 1 && word1.y == word2.y)\\n\\t\\t\\treturn true;\\n\\n\\t\\tif (word1.x == word2.x && Math.abs(word1.y - word2.y) == 1)\\n\\t\\t\\treturn true;\\n\\n\\t\\treturn false;\\n\\t}\\n\\n\\tvoid bfs(Point s) {\\n\\n\\t\\twhile (!q.isEmpty()) {\\n\\t\\t\\ts = q.poll();\\n\\n\\t\\t\\tPoint p = new Point();\\n\\t\\t\\tp.x = s.x - 1;\\n\\t\\t\\tp.y = s.y;\\n\\n\\t\\t\\tif (p.x >= 1 && p.x <= x && p.y >= 1 && p.y <= y) {\\n\\t\\t\\t\\tif (!vis[p.x][p.y]) {\\n\\t\\t\\t\\t\\tvis[p.x][p.y] = true;\\n\\t\\t\\t\\t\\tq.add(p);\\n\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\tp = new Point();\\n\\t\\t\\tp.x = s.x + 1;\\n\\t\\t\\tp.y = s.y;\\n\\n\\t\\t\\tif (p.x >= 1 && p.x <= x && p.y >= 1 && p.y <= y) {\\n\\t\\t\\t\\tif (!vis[p.x][p.y]) {\\n\\t\\t\\t\\t\\tvis[p.x][p.y] = true;\\n\\t\\t\\t\\t\\tq.add(p);\\n\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\tp = new Point();\\n\\t\\t\\tp.x = s.x;\\n\\t\\t\\tp.y = s.y - 1;\\n\\n\\t\\t\\tif (p.x >= 1 && p.x <= x && p.y >= 1 && p.y <= y) {\\n\\t\\t\\t\\tif (!vis[p.x][p.y]) {\\n\\t\\t\\t\\t\\tvis[p.x][p.y] = true;\\n\\t\\t\\t\\t\\tq.add(p);\\n\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tp = new Point () ;\\n\\t\\t\\tp.x = s.x ;\\n\\t\\t\\tp.y = s.y + 1;\\n\\t\\t\\t\\n\\t\\t\\tif (p.x >= 1 && p.x <= x && p.y >= 1 && p.y <= y) {\\n\\t\\t\\t\\tif (!vis[p.x][p.y]) {\\n\\t\\t\\t\\t\\tvis[p.x][p.y] = true ;\\n\\t\\t\\t\\t\\tq.add(p);\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\tif (q.size() == 0)\\n\\t\\t\\t\\tout.print(s.x + \\\" \\\" + s.y);\\n\\t\\t}\\n\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws FileNotFoundException {\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n\\n\\t\\tFireAgain F = new FireAgain();\\n\\t\\t Scanner in = new Scanner (new FileReader(\\\"input.txt\\\"));\\n\\t\\t F.out = new PrintStream(new File(\\\"output.txt\\\"));\\n\\t\\n\\t\\tF.x = in.nextInt();\\n\\t\\tF.y = in.nextInt();\\n\\n\\t\\tint l = 0;\\n\\t\\tF.vis = new boolean[F.x + 1][F.y + 1];\\n\\n\\t\\tint k = in.nextInt();\\n\\n\\t\\tfor (int i = 0; i <... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import static java.lang.Integer.parseInt;\\nimport static java.lang.Long.parseLong;\\nimport static java.lang.Math.max;\\nimport static java.lang.Math.min;\\nimport static java.lang.System.exit;\\nimport static java.util.Arrays.fill;\\n\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class E {\\n\\n\\tstatic void solve() throws Exception {\\n\\t\\tint tests = scanInt();\\n\\/\\/\\t\\tint tests = 40;\\n\\t\\tfor (int test = 0; test < tests; test++) {\\n\\t\\t\\tint n = scanInt(), m = scanInt(), a[][] = new int[n][m];\\n\\/\\/\\t\\t\\tint n = 12, m = 2000, a[][] = new int[n][m];\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tfor (int j = 0; j < m; j++) {\\n\\t\\t\\t\\t\\ta[i][j] = scanInt();\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tint bestCols[] = new int[min(m, n)];\\n\\t\\t\\tfor (int i = 0; i < bestCols.length; i++) {\\n\\t\\t\\t\\tbestCols[i] = i;\\n\\t\\t\\t}\\n\\t\\t\\tif (m > n) {\\n\\t\\t\\t\\tint bestColMax[] = new int[n];\\n\\t\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\t\\tint cmax = 0;\\n\\t\\t\\t\\t\\tfor (int j = 0; j < n; j++) {\\n\\t\\t\\t\\t\\t\\tcmax = max(cmax, a[j][i]);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tbestColMax[i] = cmax;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tfor (int i = n; i < m; i++) {\\n\\t\\t\\t\\t\\tint cmax = 0;\\n\\t\\t\\t\\t\\tfor (int j = 0; j < n; j++) {\\n\\t\\t\\t\\t\\t\\tcmax = max(cmax, a[j][i]);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tint minBC = 0, minBCM = Integer.MAX_VALUE;\\n\\t\\t\\t\\t\\tfor (int j = 0; j < n; j++) {\\n\\t\\t\\t\\t\\t\\tif (bestColMax[j] < minBCM) {\\n\\t\\t\\t\\t\\t\\t\\tminBC = j;\\n\\t\\t\\t\\t\\t\\t\\tminBCM = bestColMax[j];\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tif (cmax > minBCM) {\\n\\t\\t\\t\\t\\t\\tbestCols[minBC] = i;\\n\\t\\t\\t\\t\\t\\tbestColMax[minBC] = cmax;\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tint dyn[] = new int[1 << n], dynNext[] = new int[1 << n], sums[] = new int[1 << n], csums[] = new int[1 << n];\\n\\t\\t\\tfor (int i: bestCols) {\\n\\t\\t\\t\\tfill(dynNext, 0);\\n\\t\\t\\t\\tfill(sums, 0);\\n\\t\\t\\t\\tfor (int j = 0; j < n; j++) {\\n\\t\\t\\t\\t\\tfor (int k = 1, bit = 0; k < 1 << n; k++) {\\n\\t\\t\\t\\t\\t\\tif (k == 1 << (bit + 1)) {\\n\\t\\t\\t\\t\\t\\t\\t++bit;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\tsums[k] = max(sums[k], csums[k] = csums[k ^ (1 << bit)] + a[(bit + j) % n][i]);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tfor (int mask1 = 0; mask1 < 1 << n; mask1++) {\\n\\t\\t\\t\\t\\tint cdyn = dynNext[mask1];\\n\\t\\t\\t\\t\\tfor (int mask2 = mask1;; mask2 = (mask2 - 1) & mask1)... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.Arrays;\\nimport java.util.Random;\\n\\npublic class ProblemC {\\n \\n public static void main(String[] args) throws IOException {\\n init();\\n new ProblemC().run();\\n out.flush();\\n out.close();\\n }\\n \\n static void init() throws IOException {\\n in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n out = new PrintWriter(new OutputStreamWriter(System.out));\\n in.ordinaryChars(0, 65535);\\n in.wordChars(0, 65535);\\n in.whitespaceChars(' ', ' ');\\n in.whitespaceChars('\\\\n', '\\\\n');\\n in.whitespaceChars('\\\\r', '\\\\r');\\n }\\n \\n \\/\\/ класс для пар\\n class Pair {\\n private final L X;\\n private final R Y;\\n \\n public Pair(L X, R Y) {\\n this.X = X;\\n this.Y = Y;\\n }\\n \\n public L getX() {\\n return X;\\n }\\n \\n public R getY() {\\n return Y;\\n }\\n \\n @Override\\n public int hashCode() {\\n return X.hashCode() ^ Y.hashCode();\\n }\\n \\n @Override\\n public boolean equals(Object o) {\\n if (!(o instanceof Pair)) return false;\\n Pair pairo = (Pair) o;\\n return X.equals(pairo.getX()) && Y.equals(pairo.getY());\\n }\\n }\\n \\n static final long INFL = 200000000000000000L;\\n static final int INF = 2000000000;\\n static final boolean DEBUG = true;\\n \\n static StreamTokenizer in;\\n static PrintWriter out;\\n \\n static void print(String s) {\\n print(s, 0);\\n }\\n \\n static void print(String s, int debug) {\\n if (debug == 0 || DEBUG) {\\n out.print(s);\\n }\\n }\\n \\n static void println(String s) {\\n println(s, 0);\\n }\\n \\n static void println(String s, int debug) {\\n if (debug == 0 || DEBUG) {\\n out.println(s);\\n }\\n }\\n \\n static void printArray(int[] arr) {\\n println(Arrays.toString(arr));\\n }\\n \\n static void printArray(char[] arr) {\\n println(Arrays.toString(arr));\\n }\\n \\n static void printArray(String[] arr) {\\n println(Arrays.toString(arr));\\n }\\n \\n static void sort(int[] a) {\\n Random rnd = new Random();\\n for (int i = a.length - 1; i > 0; i--) {\\n int index... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.HashMap;\\nimport java.util.StringTokenizer;\\n\\npublic class C {\\n\\n\\tstatic int K;\\n\\tstatic int sz[];\\n\\tstatic long vs[][];\\n\\tstatic long curSum[];\\n\\tstatic HashMap valToBucket;\\n\\tstatic long sum;\\n\\tstatic int maskIfPick[][];\\n\\tstatic int dp[];\\n\\t\\n\\tstatic int pickId[];\\n\\tstatic int newBox[];\\n\\tpublic static void main(String[] args) {\\n\\t\\tFS in = new FS();\\n\\t\\tK = in.nextInt();\\n\\t\\tsz = new int[K];\\n\\t\\tvalToBucket = new HashMap();\\n\\t\\tvs = new long[K][];\\n\\t\\tcurSum = new long[K];\\n\\t\\tsum = 0;\\n\\t\\tfor(int i = 0; i < K; i++) {\\n\\t\\t\\tsz[i] = in.nextInt();\\n\\t\\t\\tvs[i] = new long[sz[i]];\\n\\t\\t\\tfor(int j = 0; j < sz[i]; j++) {\\n\\t\\t\\t\\tlong v = in.nextLong();\\n\\t\\t\\t\\tsum += v;\\n\\t\\t\\t\\tcurSum[i] += v;\\n\\t\\t\\t\\tvs[i][j] = v;\\n\\t\\t\\t\\tvalToBucket.put(v, i);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tif(sum % K != 0) {\\n\\t\\t\\tSystem.out.println(\\\"No\\\");\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tsum \\/= K;\\n\\t\\tmaskIfPick = new int[K][];\\n\\t\\t\\/\\/go through if i pick each node\\n\\t\\tfor(int i = 0; i < K; i++) {\\n\\t\\t\\tmaskIfPick[i] = new int[sz[i]];\\n\\t\\t\\tfor(int j = 0; j < sz[i]; j++) {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tint mask = (1< 0) break;\\n\\t\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\t\\tmask |= (1< cc = new HashMap(72);\\n\\n void add(char c) {\\n cc.put(c, cc.getOrDefault(c, 0) + 1);\\n }\\n\\n void rem(char c) {\\n Integer cnt = cc.get(c) - 1;\\n if (cnt != 0) {\\n cc.put(c, cnt);\\n } else {\\n cc.remove(c);\\n }\\n }\\n\\n public void run() throws Exception {\\n int n = nextInt();\\n\\n char [] s = next().toCharArray();\\n BitSet bs = new BitSet();\\n for (char c : s) {\\n bs.set(c);\\n }\\n\\n int t = bs.cardinality();\\n \\n int m = Integer.MAX_VALUE;\\n for (int i = 0, j = 0; i < n; i++) {\\n while ((j < n) && (cc.size() < t)) {\\n add(s[j]);\\n j++;\\n }\\n \\n if (cc.size() == t) {\\n m = Math.min(m, j - i);\\n }\\n \\n rem(s[i]);\\n }\\n \\n println(m);\\n }\\n\\n public static void main(String... args) throws Exception {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n pw = new PrintWriter(new BufferedOutputStream(System.out));\\n new P701A().run();\\n br.close();\\n pw.close();\\n System.err.println(\\\"\\\\n[Time : \\\" + (System.currentTimeMillis() - startTime) + \\\" ms]\\\");\\n }\\n\\n static long startTime = System.currentTimeMillis();\\n static BufferedReader br;\\n static PrintWriter pw;\\n StringTokenizer stok;\\n\\n String nextToken() throws IOException {\\n while (stok == null || !stok.hasMoreTokens()) {\\n String s = br.readLine();\\n if (s == null) { return null; }\\n stok = new StringTokenizer(s);\\n }\\n return stok.nextToken();\\n }\\n\\n void print(byte b) { print(\\\"\\\" + b); }\\n void print(int i) { print(\\\"\\\" + i); }\\n void print(long l) { print(\\\"\\\" + l); }\\n void print(double d) { print(\\\"\\\" + d); }\\n void print(char c) { print(\\\"\\\" + c); }\\n void print(Object o) {\\n if (o instanceof int[]) { print(Arrays.toString((int [])o));\\n } else if (o instanceof long[]) { print(Arrays.toString((long [])o));\\n } else if (o instanceof char[]) { print(Arrays.toString((char... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.HashSet;\\nimport java.util.Set;\\n\\npublic class ProblemD {\\n\\t\\n\\n\\t\\n\\tstatic int N;\\n\\tstatic boolean[][] graph;\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader s = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\t\\tString[] data = s.readLine().split(\\\" \\\");\\n\\t\\tint n = Integer.valueOf(data[0]);\\n\\t\\tN = n;\\n\\t\\tint m = Integer.valueOf(data[1]);\\n\\t\\tgraph = new boolean[n][n];\\n\\t\\tfor (int i = 0 ; i < m ; i++) {\\n\\t\\t\\tString[] line = s.readLine().split(\\\" \\\");\\n\\t\\t\\tint a = Integer.valueOf(line[0])-1;\\n\\t\\t\\tint b = Integer.valueOf(line[1])-1;\\n\\t\\t\\tgraph[a][b] = true;\\n\\t\\t\\tgraph[b][a] = true;\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong ans = 0;\\n\\t\\tfor (int i = 0 ; i < n ; i++) {\\n\\t\\t\\tans += doit(i);\\n\\t\\t}\\n\\t\\tans \\/= 2;\\n\\t\\t\\n\\t\\tout.println(ans);\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tstatic long doit(int n) {\\n\\t\\tlong[][] dp = new long[1<= 1) {\\n\\t\\t\\t\\t\\tfor (int k = 0 ; k < n ; k++) {\\n\\t\\t\\t\\t\\t\\tif (graph[j][k] && (i & (1<= 2) {\\n\\t\\t\\t\\tfor (int j = 0 ; j < n ; j++) {\\n\\t\\t\\t\\t\\tif (graph[j][n]) {\\n\\t\\t\\t\\t\\t\\tret += dp[i][j];\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn ret;\\n\\t}\\n\\t\\n\\t\\n\\tstatic void generateLarge() {\\n\\t\\tSystem.out.println(\\\"19 171\\\");\\n\\t\\tfor (int i = 1 ; i <= 19 ; i++) {\\n\\t\\t\\tfor (int j = i+1 ; j <= 19 ; j++) {\\n\\t\\t\\t\\tSystem.out.println(i + \\\" \\\" + j);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\n\\tpublic static void debug(Object... os){\\n\\t\\tSystem.err.println(Arrays.deepToString(os));\\n\\t}\\n} Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\n\\/**\\n *\\n * @author Mostafa\\n *\\/\\npublic class Main {\\n public static void main(String[] args) throws IOException {\\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n int n = Integer.parseInt(in.readLine());\\n System.out.println((n\\/2) *3);\\n }\\n\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n Scanner cin = new Scanner(new BufferedInputStream(System.in));\\n long n;\\n long maxlcm;\\n \\n void run(){\\n \\tn = cin.nextInt();\\n \\tif(n == 1 || n ==2)\\n \\t\\tmaxlcm = n;\\n \\telse if(n >= 3){\\n \\tif(n % 2 != 0){\\n \\t \\tmaxlcm = n * (n-1) * (n - 2);\\n \\t }\\n \\telse if(n%3 != 0)\\n \\t\\tmaxlcm = n * (n - 1) * (n - 3);\\n \\telse maxlcm = (n - 1) * (n - 2) * (n - 3);\\n \\t} \\n \\tSystem.out.println(maxlcm);\\n }\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew Main().run();\\n\\n\\t}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.awt.Point;\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport static java.lang.Math.*;\\n \\npublic class Solution35C {\\n \\n final boolean ONLINE_JUDGE = System.getProperty(\\\"ONLINE_JUDGE\\\")!=null;\\n BufferedReader in;\\n PrintWriter out;\\n StringTokenizer tok = new StringTokenizer(\\\"\\\");\\n \\n void init() throws FileNotFoundException{\\n if (ONLINE_JUDGE){\\n \\t\\tin = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(\\\"output.txt\\\");\\n }else{\\n in = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n out = new PrintWriter(\\\"output.txt\\\");\\n }\\n }\\n \\n String readString() throws IOException{\\n while(!tok.hasMoreTokens()){\\n tok = new StringTokenizer(in.readLine());\\n }\\n return tok.nextToken();\\n }\\n \\n int readInt() throws IOException{\\n return Integer.parseInt(readString());\\n }\\n \\n long readLong() throws IOException{\\n return Long.parseLong(readString());\\n }\\n \\n double readDouble() throws IOException{\\n return Double.parseDouble(readString());\\n }\\n \\n public static void main(String[] args){\\n new Solution35C().run();\\n }\\n \\n public void run(){\\n try{\\n long t1 = System.currentTimeMillis();\\n init();\\n solve();\\n out.close();\\n long t2 = System.currentTimeMillis();\\n System.err.println(\\\"Time = \\\"+(t2-t1));\\n }catch (Exception e){\\n e.printStackTrace(System.err);\\n System.exit(-1);\\n }\\n }\\n \\n static class Utils {\\n \\n private Utils() {}\\n \\n ... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/**\\n * DA-IICT\\n * Author : Savaliya Sagar\\n *\\/\\nimport java.io.*;\\nimport java.math.*;\\nimport java.util.*;\\n\\npublic class C817 {\\n\\tInputStream is;\\n\\tPrintWriter out;\\n\\tString INPUT = \\\"\\\";\\n\\n\\tvoid solve() {\\n\\t\\tlong n = nl();\\n\\t\\tlong s = nl();\\n\\t\\tlong l = 1;\\n\\t\\tlong r = n;\\n\\t\\tlong ans = 0;\\n\\t\\twhile(l<=r){\\n\\t\\t\\tlong mid = (l+r)\\/2;\\n\\t\\t\\tlong sum = 0;\\n\\t\\t\\tlong temp = mid;\\n\\t\\t\\twhile(temp!=0){\\n\\t\\t\\t\\tsum += temp%10;\\n\\t\\t\\t\\ttemp\\/=10;\\n\\t\\t\\t}\\n\\t\\t\\tif(mid-sum= lenbuf) {\\n\\t\\t\\tptrbuf = 0;\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tlenbuf = is.read(inbuf);\\n\\t\\t\\t} catch (IOException e) {\\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t}\\n\\t\\t\\tif (lenbuf <= 0)\\n\\t\\t\\t\\treturn -1;\\n\\t\\t}\\n\\t\\treturn inbuf[ptrbuf++];\\n\\t}\\n\\n\\tprivate boolean isSpaceChar(int c) {\\n\\t\\treturn !(c >= 33 && c <= 126);\\n\\t}\\n\\n\\tprivate int skip() {\\n\\t\\tint b;\\n\\t\\twhile ((b = readByte()) != -1 && isSpaceChar(b))\\n\\t\\t\\t;\\n\\t\\treturn b;\\n\\t}\\n\\n\\tprivate double nd() {\\n\\t\\treturn Double.parseDouble(ns());\\n\\t}\\n\\n\\tprivate char nc() {\\n\\t\\treturn (char) skip();\\n\\t}\\n\\n\\tprivate String ns() {\\n\\t\\tint b = skip();\\n\\t\\tStringBuilder sb = new StringBuilder();\\n\\t\\twhile (!(isSpaceChar(b))) { \\/\\/ when nextLine, (isSpaceChar(b) && b !=\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\/\\/ ' ')\\n\\t\\t\\tsb.appendCodePoint(b);\\n\\t\\t\\tb = readByte();\\n\\t\\t}\\n\\t\\treturn sb.toString();\\n\\t}\\n\\n\\tprivate char[] ns(int n) {\\n\\t\\tchar[] buf = new char[n];\\n\\t\\tint b =... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\n\\npublic class A {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tBigInteger l = sc.nextBigInteger();\\n\\t\\tBigInteger r = sc.nextBigInteger();\\n\\t\\tBigInteger a = l.add(BigInteger.ZERO);\\n\\t\\twhile (a.compareTo(r) < 0) {\\n\\t\\t\\tBigInteger b = a.add(BigInteger.ONE);\\n\\t\\t\\twhile (b.compareTo(r) < 0) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\ta.modInverse(b);\\n\\t\\t\\t\\t} catch (ArithmeticException e) {\\n\\t\\t\\t\\t\\tb = b.add(BigInteger.ONE);\\n\\t\\t\\t\\t\\tcontinue;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tBigInteger c = b.add(BigInteger.ONE);\\n\\t\\t\\t\\twhile (c.compareTo(r) <= 0) {\\n\\t\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\t\\tb.modInverse(c);\\n\\t\\t\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\t\\t\\ta.modInverse(c);\\n\\t\\t\\t\\t\\t\\t} catch (ArithmeticException e) {\\n\\t\\t\\t\\t\\t\\t\\tSystem.out.printf(\\\"%s %s %s\\\\n\\\", a.toString(), b.toString(), c.toString());\\n\\t\\t\\t\\t\\t\\t\\treturn;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t} catch (ArithmeticException e) {\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\tc = c.add(BigInteger.ONE);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tb = b.add(BigInteger.ONE);\\n\\t\\t\\t}\\n\\t\\t\\ta = a.add(BigInteger.ONE);\\n\\t\\t}\\n\\t\\tSystem.out.println(\\\"-1\\\");\\n\\t}\\n}\\n\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\npublic class j\\n{\\npublic static void main(String a[])throws IOException\\n{\\nBufferedReader b=new BufferedReader(new InputStreamReader(System.in));\\nint n=0,i=0,k=2;\\nString s=\\\"\\\\0\\\",r=\\\"\\\\0\\\";\\ns=b.readLine();\\nn=s.length()-1;\\nwhile(k<=s.length())\\n{\\nfor(i=0;i=0;j--)\\n {\\n sum1+=a[j];\\n k++;\\n if(sum1*2>sum)\\n break;\\n }\\n pw.println(k);\\n pw.flush();\\n }\\n} Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.StreamTokenizer;\\nimport java.util.Arrays;\\n\\npublic class D11 {\\n\\n\\tstatic StreamTokenizer in;\\n\\tstatic PrintWriter out;\\n\\t\\n\\tstatic int nextInt() throws IOException {\\n\\t\\tin.nextToken();\\n\\t\\treturn (int)in.nval;\\n\\t}\\n\\t\\n\\tstatic String nextString() throws IOException {\\n\\t\\tin.nextToken();\\n\\t\\treturn in.sval;\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));\\n\\t\\tout = new PrintWriter(System.out);\\n\\n\\t\\tn = nextInt();\\n\\t\\tm = nextInt();\\n\\t\\t\\n\\t\\tg = new boolean[n][n];\\n\\t\\tfor (int i = 0; i < m; i++) {\\n\\t\\t\\tint a = nextInt()-1, b = nextInt()-1;\\n\\t\\t\\tg[a][b] = g[b][a] = true;\\n\\t\\t}\\n\\t\\t\\n\\t\\tlong ans = 0;\\n\\t\\tfor (int i = n; i > 0; i--) {\\n\\t\\t\\t\\/\\/long cur = solve(i);\\n\\t\\t\\tlong cur = calc(g, i-1);\\n\\t\\t\\tans += cur;\\n\\t\\t}\\n\\t\\t\\n\\t\\tout.println(ans\\/2);\\n\\t\\t\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tstatic int n, m, V;\\n\\tstatic boolean[][] g;\\n\\t\\n\\t\\/*static long solve(int V) {\\n\\t\\tint v = V-1;\\n\\t\\tlong[][] memo = new long[V][1 << V];\\n\\t\\t\\n\\t\\tmemo[v][1 << v] = 1;\\n\\t\\tfor (int mask = 1; mask < (1 << V); mask++)\\n\\t\\t\\tfor (int i = 0; i < V; i++) if ((mask&(1 << i)) != 0)\\n\\t\\t\\t\\tfor (int j = 0; j < V; j++) if (g[i][j] && (mask&(1 << j)) == 0)\\n\\t\\t\\t\\t\\tmemo[j][mask|(1 << j)] += memo[i][mask];\\n\\t\\t\\n\\t\\tlong res = 0;\\n\\t\\tfor (int mask = 1; mask < (1 << V); mask++)\\n\\t\\t\\tfor (int i = 0; i < V; i++)\\n\\t\\t\\t\\tif (Integer.bitCount(mask) > 2 && g[v][i]) res += memo[i][mask];\\n\\t\\treturn res\\/2;\\n\\t}*\\/\\n\\t\\n\\tstatic long calc(boolean[][] bs,int n){\\n long[][] dp=new long[1<>j)&1)==1)\\n for(int k=0;k>k)&1)==0 && bs[j][k]){\\/\\/add\\n dp[i|(1< 2 * r) return r;\\n double hisY = res[idxHim];\\n double lo = hisY, hi = hisY + 2 * r, best = hi;\\n for (int cnt = 0; cnt <= 50; cnt++) {\\n double myY = (lo) + ((hi - lo) \\/ 2);\\n if (notIntersect(xMe, myY, xHim, hisY)) {\\n best = Math.min(best, myY);\\n hi = Math.max(lo, myY);\\n } else\\n lo = Math.min(hi, myY);\\n }\\n return best;\\n }\\n static boolean notIntersect (double x1, double y1, double x2, double y2) {\\n return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) >= 2 * r * 2 * r;\\n }\\n public static void main(String[] args) throws Exception {\\n Scanner sc = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n int n = sc.nextInt();\\n res = new double[n];\\n r = sc.nextInt();\\n int[] x = new int[n];\\n for (int i = 0; i < n; i++)\\n x[i] = sc.nextInt();\\n\\n for (int i = 0; i < n; i++) {\\n double max = r;\\n for (int j = 0; j < i; j++) {\\n max = Math.max(max, solve(x[i], x[j], j));\\n }\\n if (i > 0) out.print(\\\" \\\");\\n res[i] = max;\\n out.printf(\\\"%.10f\\\", max);\\n }\\n out.println();\\n\\n out.flush();\\n out.close();\\n }\\n static class Scanner {\\n StringTokenizer st;\\n BufferedReader br;\\n\\n public Scanner(InputStream s){\\tbr = new BufferedReader(new InputStreamReader(s));}\\n\\n public Scanner(FileReader s) throws FileNotFoundException {\\tbr = new BufferedReader(s);}\\n\\n public String next() throws IOException\\n {\\n while (st == null || !st.hasMoreTokens())\\n st = new StringTokenizer(br.readLine());\\n return st.nextToken();\\n }\\n\\n public int nextInt()... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class LookingForOrder\\n{\\n\\tpublic Scanner in = new Scanner(System.in);\\n\\tpublic PrintStream out = System.out;\\n\\n\\tpublic int[] go;\\n\\tpublic int[][] cost;\\n\\t\\n\\tpublic int [] sol;\\n\\tpublic Pair[] how;\\n\\tpublic int n, lim;\\n\\t\\n\\tpublic Pair bag;\\n\\tpublic Pair[] obj;\\n\\t\\n\\tpublic void main()\\n\\t{\\t\\t\\n\\t\\tbag = new Pair(in.nextInt(), in.nextInt());\\n\\t\\t\\n\\t\\tn = in.nextInt();\\n\\t\\tobj = new Pair[n];\\n\\t\\tfor(int i=0;i 0)\\n\\t\\t{\\n\\t\\t\\tsolve(set);\\n\\t\\t\\tT = how[set];\\n\\t\\t\\tout.print(\\\" \\\"+(T.x+1));\\n\\t\\t\\tset = off(T.x, set);\\n\\t\\t\\tif(T.y >= 0) \\n\\t\\t\\t{\\n\\t\\t\\t\\tout.print(\\\" \\\" + (T.y+1));\\n\\t\\t\\t\\tset = off(T.y, set);\\n\\t\\t\\t}\\n\\t\\t\\tout.print(\\\" 0\\\");\\n\\t\\t}\\n\\t\\tout.println();\\n\\t}\\/\\/end public void main()\\n\\n\\tpublic int oo = 987654321;\\n\\t\\n\\tpublic boolean in(int x, int set) { return ((1<= 0) return sol[set];\\n\\t\\t\\n\\t\\tint ret;\\n\\t\\tif(set == 0) ret = 0;\\n\\t\\telse\\n\\t\\t{\\n\\t\\t\\tret = oo;\\n\\t\\t\\t\\n\\t\\t\\tint x, y, sub, c;\\n\\t\\t\\tfor(x=0;x 0) {\\n \\/\\/update the union of reachability\\n curMask &= graph[j + szRight] >> szRight;\\n \\/\\/can also attempt to pull from prev mask for max size\\n \\/\\/will not be optimal if end update happens, but otherwise is useful for dp\\n dp[mask] = Math.max(dp[mask], dp[mask ^ (1 << j)]);\\n }\\n }\\n \\/\\/if the union of connectedness is the starting mask then we have a clique\\n if (mask == curMask) {\\n dp[mask] = Math.max(dp[mask],Integer.bitCount(mask));\\n }\\n }\\n int ans = 0;\\n int rmaxMask = 1 << szRight;\\n for(int mask = 0; mask < rmaxMask; mask++) {\\n \\/\\/mask to track if the current creates its own clique\\n int curMask = mask;\\n \\/\\/mask to track the connection between the halves\\n int oMask = maxMask -1;\\n for(int j = 0; j < szRight; j++) {\\n if (((1 << j) & mask) > 0) {\\n \\/\\/need to mask... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/**\\n * BaZ :D\\n *\\/\\nimport java.util.*;\\nimport java.io.*;\\nimport static java.lang.Math.*;\\npublic class Main\\n{\\n static Reader scan;\\n static PrintWriter pw;\\n static int n,k,left[],right[],arr[];\\n static long MOD = 1000000007,count[],dp[];\\n public static void main(String[] args) {\\n new Thread(null,null,\\\"BaZ\\\",1<<25)\\n {\\n public void run()\\n {\\n try\\n {\\n solve();\\n }\\n catch(Exception e)\\n {\\n e.printStackTrace();\\n System.exit(1);\\n }\\n }\\n }.start();\\n }\\n static void solve() throws IOException\\n {\\n scan = new Reader();\\n pw = new PrintWriter(System.out,true);\\n StringBuilder sb = new StringBuilder();\\n n = ni();\\n k = ni();\\n int stack[] = new int[1000001];\\n int top = -1;\\n arr = new int[n];\\n left = new int[n];\\n right = new int[n];\\n for(int i=0;i=0 && arr[stack[top]]<=arr[i])\\n top--;\\n if(top==-1)\\n left[i] = 0;\\n else left[i] = stack[top]+1;\\n stack[++top] = i;\\n }\\n top = -1;\\n for(int i=n-1;i>=0;--i) {\\n while(top>=0 && arr[stack[top]]=MOD)\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport static java.lang.Math.*;\\nimport static java.util.Arrays.fill;\\nimport static java.util.Arrays.binarySearch;\\nimport static java.util.Arrays.sort;\\n\\npublic class Main {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\/\\/\\t\\ttry {\\n\\/\\/\\t\\t\\tif (new File(\\\"input.txt\\\").exists())\\n\\/\\/\\t\\t\\t\\tSystem.setIn(new FileInputStream(\\\"input.txt\\\"));\\n\\/\\/\\t\\t} catch (SecurityException e) {}\\n\\t\\t\\n\\/\\/\\t\\tlong time1 = System.currentTimeMillis();\\n\\t\\tnew Main().run();\\n\\/\\/\\t\\tcheckMemory();\\n\\/\\/\\t\\tlong time2 = System.currentTimeMillis();\\n\\/\\/\\t\\tSystem.err.println((time2 - time1) + \\\" ms\\\");\\n\\t}\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st = new StringTokenizer(\\\"\\\");\\n\\t\\n\\tint vNum;\\n\\tint eNum;\\n\\tboolean[][] g;\\n\\t\\n\\tvoid run() throws IOException {\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\n\\t\\tvNum = nextInt();\\n\\t\\teNum = nextInt();\\n\\t\\tg = new boolean [vNum][vNum];\\n\\t\\tfor (int e = 0; e < eNum; e++) {\\n\\t\\t\\tint u = nextInt() - 1;\\n\\t\\t\\tint v = nextInt() - 1;\\n\\t\\t\\tg[u][v] = g[v][u] = true;\\n\\t\\t}\\n\\t\\t\\n\\/\\/\\t\\tfor (int v = 7; v <= 11; v++) {\\n\\/\\/\\t\\t\\tgenFullGraph(v);\\n\\/\\/\\t\\t\\tif (naiveDP() != optimizedDP())\\n\\/\\/\\t\\t\\t\\tSystem.err.println(\\\"Error on \\\" + v);\\n\\/\\/\\t\\t}\\n\\t\\t\\n\\t\\tout.println(optimizedDP());\\n\\t\\t\\n\\t\\tout.close();\\n\\t}\\n\\t\\n\\t\\/*************************************************************** \\n\\t * Test\\n\\t **************************************************************\\/\\n\\tlong naiveDP() {\\n\\t\\tlong[] count = new long [vNum + 1];\\n\\t\\tint size = 1 << vNum;\\n\\t\\tlong[][] dp = new long [size][vNum];\\n\\t\\tfor (int begin = 0; begin < vNum; begin++) {\\n\\t\\t\\tfor (long[] row : dp) fill(row, 0L);\\n\\t\\t\\tdp[1 << begin][begin] = 1L;\\n\\t\\t\\tfor (int mask = 0; mask < size; mask++) {\\n\\t\\t\\t\\tint len = Integer.bitCount(mask);\\n\\t\\t\\t\\tfor (int v = 0; v < vNum; v++) {\\n\\t\\t\\t\\t\\tlong cval = dp[mask][v];\\n\\t\\t\\t\\t\\tif (cval == 0L) continue;\\n\\t\\t\\t\\t\\tif (g[v][begin]) count[len] += cval;\\n\\t\\t\\t\\t\\tfor (int nv = 0; nv < vNum; nv++) {\\n\\t\\t\\t\\t\\t\\tif (g[v][nv]) {\\n\\t\\t\\t\\t\\t\\t\\tint nmask = mask | (1 << nv);\\n\\t\\t\\t\\t\\t\\t\\tif (nmask != mask)\\n\\t\\t\\t\\t\\t\\t\\t\\tdp[nmask][nv] +=... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\n\\npublic class A_IQTest {\\n\\n static int n;\\n\\n public static void main(String[] args) {\\n Scanner s = new Scanner(System.in);\\n n = s.nextInt();\\n \\n int[] nums = new int[n];\\n \\n for (int i = 0; i < n; i++) {\\n nums[i] = s.nextInt();\\n }\\n \\n \\n int ei = -1;\\n int oi = -1;\\n int ecnt = 0;\\n int ocnt = 0;\\n for (int i = 0; i < n; i++) {\\n if(nums[i] % 2 == 0){\\n ei = i;\\n ecnt++;\\n }else{\\n oi = i;\\n ocnt++;\\n }\\n }\\n if(ecnt == 1){\\n System.out.println(ei+1);\\n }else{\\n System.out.println(oi+1);\\n }\\n }\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\n import java.math.BigInteger;\\n import java.util.*;\\n \\n public class Main {\\n \\n static final double eps = 1e-8;\\n \\n public static void main(String[] args) throws IOException {\\n try {\\n \\n int n = nextInt();\\n int k = nextInt();\\n int[] a = new int[n];\\n int[] d = new int[n];\\n int[] dr = new int[n];\\n boolean used[] = new boolean[100001];\\n a[0] = nextInt();\\n used[ a[0] ] = true;\\n d[0] = 1;\\n for(int i = 1; i < n; i++)\\n {\\n a[i] = nextInt();\\n if(!used[ a[i] ])\\n {\\n used[ a[i] ] = true;\\n d[i] = d[i - 1] + 1;\\n }\\n else\\n {\\n d[i] = d[i - 1];\\n }\\n }\\n Arrays.fill(used, false);\\n\\n \\n int r = Arrays.binarySearch(d, k);\\n \\n if(r < 0)\\n {\\n pw.println(\\\"-1 -1\\\");\\n return;\\n }\\n \\n while( r > 0 && d[r] == d[r - 1] )\\n r--;\\n \\n used[ a[r] ] = true;\\n dr[r] = 1;\\n for(int i = r - 1; i >= 0; i--)\\n {\\n if(!used[ a[i] ])\\n {\\n used[ a[i] ] = true;\\n dr[i] = dr[i + 1] + 1;\\n }\\n else\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/Author: Patel Rag\\n\\/\\/Java version \\\"1.8.0_211\\\"\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class Main\\n{\\n static class FastReader\\n {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastReader(){ br = new BufferedReader(new InputStreamReader(System.in)); }\\n\\n String next()\\n {\\n while (st == null || !st.hasMoreElements())\\n {\\n try\\n {\\n st = new StringTokenizer(br.readLine());\\n }\\n catch (IOException e)\\n {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() { return Integer.parseInt(next()); }\\n\\n long nextLong(){ return Long.parseLong(next()); }\\n\\n double nextDouble(){ return Double.parseDouble(next()); }\\n\\n float nextFloat() { return Float.parseFloat(next()); }\\n\\n boolean nextBoolean() { return Boolean.parseBoolean(next()); }\\n\\n String nextLine()\\n {\\n String str = \\\"\\\";\\n try\\n {\\n str = br.readLine();\\n }\\n catch (IOException e)\\n {\\n e.printStackTrace();\\n }\\n return str;\\n }\\n }\\n static long modExp(long x, long n, long mod) \\/\\/binary Modular exponentiation\\n {\\n long result = 1;\\n while(n > 0)\\n {\\n if(n % 2 == 1)\\n result = (result%mod * x%mod)%mod;\\n x = (x%mod * x%mod)%mod;\\n n=n\\/2;\\n }\\n return result;\\n }\\n static long gcd(long a, long b)\\n {\\n if(a==0) return b;\\n return gcd(b%a,a);\\n }\\n public static void main(String[] args)\\n throws IOException\\n {\\n FastReader fr = new FastReader();\\n long n = fr.nextLong();\\n long x = fr.nextLong();\\n long y = fr.nextLong();\\n long w = Long.min(x,y) - 1 + (x - Long.min(x,y)) + (y - Long.min(x,y));\\n long b = n - Long.max(x,y) + (Long.max(x,y) - x) + (Long.max(x,y) - y);\\n if(w <= b) System.out.println(\\\"White\\\");\\n else System.out.println(\\\"Black\\\");\\n\\n }\\n}\\nclass Pair \\/\\/ Pair class\\n{\\n public final U first; \\/\\/ first field of a Pair\\n public final V second; \\/\\/ second field of a Pair\\n\\n private Pair(U first, V... What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.util.stream.IntStream;\\nimport java.io.BufferedWriter;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.UncheckedIOException;\\nimport java.nio.charset.Charset;\\nimport java.util.StringTokenizer;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.io.BufferedReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author mikit\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n LightScanner in = new LightScanner(inputStream);\\n LightWriter out = new LightWriter(outputStream);\\n APaintTheNumbers solver = new APaintTheNumbers();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class APaintTheNumbers {\\n public void solve(int testNumber, LightScanner in, LightWriter out) {\\n \\/\\/ out.setBoolLabel(LightWriter.BoolLabel.YES_NO_FIRST_UP);\\n int n = in.ints();\\n int[] a = in.ints(n);\\n IntroSort.sort(a);\\n boolean[] done = new boolean[n];\\n int ans = 0;\\n for (int i = 0; i < n; i++) {\\n if (done[i]) continue;\\n int d = a[i];\\n ans++;\\n for (int j = 0; j < n; j++) {\\n if (a[j] % d == 0) {\\n done[j] = true;\\n }\\n }\\n }\\n out.ans(ans).ln();\\n }\\n\\n }\\n\\n static class IntroSort {\\n private static int INSERTIONSORT_THRESHOLD = 16;\\n\\n private IntroSort() {\\n }\\n\\n static void sort(int[] a, int low, int high, int maxDepth) {\\n while (high - low > INSERTIONSORT_THRESHOLD) {\\n if (maxDepth-- == 0) {\\n HeapSort.sort(a, low, high);\\n return;\\n ... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class A implements Runnable {\\n private void solve() throws IOException {\\n String str = nextToken();\\n for (int i=str.length()-1; i>=0; --i)\\n for (int j=0; j+i<=str.length(); ++j)\\n if (str.substring(j+1).contains(str.substring(j, j+i))) {\\n writer.println(i);\\n return;\\n }\\n writer.println(0);\\n }\\n\\n public static void main(String[] args) {\\n new Thread(new A()).start();\\n }\\n\\n BufferedReader reader;\\n StringTokenizer tokenizer;\\n PrintWriter writer;\\n\\n public void run() {\\n try {\\n reader = new BufferedReader(new InputStreamReader(System.in));\\n tokenizer = null;\\n writer = new PrintWriter(System.out);\\n solve();\\n reader.close();\\n writer.close();\\n } catch (Exception e) {\\n e.printStackTrace();\\n System.exit(1);\\n }\\n }\\n\\n int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() throws IOException {\\n return Double.parseDouble(nextToken());\\n }\\n\\n String nextToken() throws IOException {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n tokenizer = new StringTokenizer(reader.readLine());\\n }\\n return tokenizer.nextToken();\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\nimport java.util.ArrayList;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tFastScanner in = new FastScanner(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tTaskD solver = new TaskD();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskD {\\n ArrayList[] g;\\n int n, m;\\n boolean[][] have;\\n int[] x;\\n int[] y;\\n boolean[] used;\\n int stop;\\n \\n\\n public void solve(int testNumber, FastScanner in, PrintWriter out) {\\n n = in.nextInt();\\n g = new ArrayList[n];\\n for (int i = 0; i < n; i++)\\n g[i] = new ArrayList<>();\\n have = new boolean[n][n];\\n m = in.nextInt();\\n for (int i = 0; i < m; i++) {\\n int a = in.nextInt();\\n int b = in.nextInt();\\n --a;\\n --b;\\n g[a].add(b);\\n have[a][b] = true;\\n }\\n int res = Integer.MAX_VALUE;\\n for (int center = 0; center < n; center++)\\n res = Math.min(res, solve(center));\\n out.print(res);\\n }\\n\\n int solve(int v) {\\n stop = v;\\n int withV = 0;\\n int add = 0;\\n for (int i = 0; i < n; i++)\\n if (i != v)\\n if (have[v][i])\\n withV++;\\n else\\n add++;\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport static java.lang.Math.*;\\nimport static java.util.Arrays.*;\\n\\npublic class A {\\n\\n int INF = 1 << 28;\\n\\n void run() {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n int a = sc.nextInt();\\n int b = sc.nextInt();\\n long[] chores = new long[n];\\n for(int i=0;i 1 && (mask & (1 << i)) != 0\\n\\t\\t\\t\\t\\t\\t&& first(mask, n) != i) {\\n\\t\\t\\t\\t\\tfor (int j = 0; j < n; j++) {\\n\\t\\t\\t\\t\\t\\tif (edges[i][j] == 1) {\\n\\t\\t\\t\\t\\t\\t\\tdp[mask][i] += dp[mask ^ (1 << i)][j];\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tlong count = 0;\\n\\t\\tfor (int mask = 1; mask < (1 << n); mask++) {\\n\\t\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\t\\tif (Integer.bitCount(mask) >= 3\\n\\t\\t\\t\\t\\t\\t&& edges[i][first(mask, n)] != 0)\\n\\t\\t\\t\\t\\tcount += dp[mask][i];\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tSystem.out.println(count \\/ 2);\\n\\n\\t}\\n\\n\\tstatic int first(int mask, int n) {\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tif ((mask & (1 << i)) != 0)\\n\\t\\t\\t\\treturn i;\\n\\t\\t}\\n\\t\\treturn -1;\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\npublic class E16 {\\n\\tstatic double[][] grid;\\n\\tpublic static void main(String[] args) throws IOException\\t{\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint n = Integer.parseInt(br.readLine());\\n\\t\\tgrid = new double[n][n];\\n\\t\\tfor(int i = 0; i < n; i++)\\t{\\n\\t\\t\\tStringTokenizer st = new StringTokenizer(br.readLine());\\n\\t\\t\\tfor(int j = 0; j < n; j++)\\t{\\n\\t\\t\\t\\tgrid[i][j] = Double.parseDouble(st.nextToken());\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tboolean[] seen = new boolean[1< q = new LinkedList();\\n\\t\\tq.add((1< statements;\\n\\tstatic final int MOD = (int) 1e9 + 7;\\n\\n\\tstatic int[][] memo;\\n\\n\\tstatic int solve(int i, int c) {\\n\\t\\tif(i == statements.size())\\n\\t\\t\\treturn 1;\\n\\t\\tif(memo[i][c] != -1)\\n\\t\\t\\treturn memo[i][c];\\n\\n\\t\\tlong ans = solve(i + 1, c + statements.get(i));\\n\\t\\tif(c > 0)\\n\\t\\t\\tans += solve(i, c - 1);\\n\\t\\treturn memo[i][c] = (int) (ans % MOD);\\n\\n\\t}\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\n\\t\\tint n = sc.nextInt();\\n\\t\\tstatements = new ArrayList<>();\\n\\n\\t\\tchar[] c = new char[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tc[i] = sc.next().charAt(0);\\n\\t\\t}\\n\\n\\t\\tif(c[0] == 's')\\n\\t\\t\\tstatements.add(0);\\n\\t\\telse\\n\\t\\t\\tstatements.add(1);\\n\\n\\t\\tfor (int i = 1; i < n; i++) {\\n\\t\\t\\tif(c[i - 1] == 'f') {\\n\\t\\t\\t\\tif(c[i] == 'f')\\n\\t\\t\\t\\t\\tstatements.set(statements.size() - 1, statements.get(statements.size() - 1) + 1);\\n\\t\\t\\t}else {\\n\\n\\t\\t\\t\\tif(c[i] == 's')\\n\\t\\t\\t\\t\\tstatements.add(0);\\n\\t\\t\\t\\telse\\n\\t\\t\\t\\t\\tstatements.add(1);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\n\\t\\tmemo = new int[statements.size()][n + 1];\\n\\n\\t\\tfor(int[] a : memo)\\n\\t\\t\\tArrays.fill(a, -1);\\n\\t\\tout.println(solve(0, 0));\\n\\t\\tout.flush();\\n\\t\\tout.close();\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\t\\tStringTokenizer st;\\n\\t\\tBufferedReader br;\\n\\n\\t\\tpublic Scanner(InputStream s) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(s));\\n\\t\\t}\\n\\n\\t\\tpublic Scanner(String file) throws FileNotFoundException {\\n\\t\\t\\tbr = new BufferedReader(new FileReader(file));\\n\\t\\t}\\n\\n\\t\\tpublic String next() throws IOException {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tpublic int nextInt() throws IOException {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tpublic long nextLong() throws IOException... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/\\/package round136;\\nimport java.io.ByteArrayInputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\n\\npublic class A2 {\\n\\tInputStream is;\\n\\tPrintWriter out;\\n\\tString INPUT = \\\"\\\";\\n\\t\\n\\tvoid solve()\\n\\t{\\n\\t\\tint n = ni();\\n\\t\\tint[] a = new int[n];\\n\\t\\tint[] b = new int[n];\\n\\t\\tfor(int i = 0;i < n;i++)b[i] = a[i] = ni();\\n\\t\\t\\n\\t\\tb = radixSort(b);\\n\\t\\tint ct = 0;\\n\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\tif(a[i] != b[i])ct++;\\n\\t\\t}\\n\\t\\tif(ct <= 2){\\n\\t\\t\\tout.println(\\\"YES\\\");\\n\\t\\t}else{\\n\\t\\t\\tout.println(\\\"NO\\\");\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic static int[] radixSort(int[] f)\\n\\t{\\n\\t\\tint[] to = new int[f.length];\\n\\t\\t{\\n\\t\\t\\tint[] b = new int[65537];\\n\\t\\t\\tfor(int i = 0;i < f.length;i++)b[1+(f[i]&0xffff)]++;\\n\\t\\t\\tfor(int i = 1;i <= 65536;i++)b[i]+=b[i-1];\\n\\t\\t\\tfor(int i = 0;i < f.length;i++)to[b[f[i]&0xffff]++] = f[i];\\n\\t\\t\\tint[] d = f; f = to;to = d;\\n\\t\\t}\\n\\t\\t{\\n\\t\\t\\tint[] b = new int[65537];\\n\\t\\t\\tfor(int i = 0;i < f.length;i++)b[1+(f[i]>>>16)]++;\\n\\t\\t\\tfor(int i = 1;i <= 65536;i++)b[i]+=b[i-1];\\n\\t\\t\\tfor(int i = 0;i < f.length;i++)to[b[f[i]>>>16]++] = f[i];\\n\\t\\t\\tint[] d = f; f = to;to = d;\\n\\t\\t}\\n\\t\\treturn f;\\n\\t}\\n\\t\\n\\tvoid run() throws Exception\\n\\t{\\n\\t\\tis = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());\\n\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tlong s = System.currentTimeMillis();\\n\\t\\tsolve();\\n\\t\\tout.flush();\\n\\t\\ttr(System.currentTimeMillis()-s+\\\"ms\\\");\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) throws Exception\\n\\t{\\n\\t\\tnew A2().run();\\n\\t}\\n\\t\\n\\tpublic int ni()\\n\\t{\\n\\t\\ttry {\\n\\t\\t\\tint num = 0;\\n\\t\\t\\tboolean minus = false;\\n\\t\\t\\twhile((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));\\n\\t\\t\\tif(num == '-'){\\n\\t\\t\\t\\tnum = 0;\\n\\t\\t\\t\\tminus = true;\\n\\t\\t\\t}else{\\n\\t\\t\\t\\tnum -= '0';\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\twhile(true){\\n\\t\\t\\t\\tint b = is.read();\\n\\t\\t\\t\\tif(b >= '0' && b <= '9'){\\n\\t\\t\\t\\t\\tnum = num * 10 + (b - '0');\\n\\t\\t\\t\\t}else{\\n\\t\\t\\t\\t\\treturn minus ? -num : num;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t} catch (IOException e) {\\n\\t\\t}\\n\\t\\treturn -1;\\n\\t}\\n\\t\\n\\tpublic long nl()\\n\\t{\\n\\t\\ttry {\\n\\t\\t\\tlong num = 0;\\n\\t\\t\\tboolean minus = false;\\n\\t\\t\\twhile((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));\\n\\t\\t\\tif(num ==... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.Scanner;\\n\\n\\npublic class CodeForces {\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n\\tint n = sc.nextInt();\\n\\tint k = sc.nextInt();\\n int ans = 0;\\n long x = n;\\n x = x*(x+1)\\/2;\\n while (x!=k) {\\n x-=n;\\n n--;\\n ans++;\\n k++;\\n }\\n System.out.println(ans);\\n }\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class a{\\n static BufferedReader br;\\n static PrintWriter pw;\\n static int N, M, K;\\n static ArrayList graph[][];\\n public static void main(String args[]) throws IOException{\\n br = new BufferedReader(new InputStreamReader(System.in));\\n pw = new PrintWriter(System.out);\\n StringTokenizer st = new StringTokenizer(br.readLine());\\n N = Integer.parseInt(st.nextToken());\\n M = Integer.parseInt(st.nextToken());\\n K = Integer.parseInt(st.nextToken());\\n if(K % 2 == 1){\\n for(int i = 0; i < N; i++){\\n for(int j = 0; j < M; j++){\\n pw.print(\\\"-1 \\\");\\n }\\n pw.println();\\n }\\n br.close(); pw.close();\\n return;\\n }\\n graph = new ArrayList[N][M];\\n for(int i = 0; i < N; i++){\\n for(int j = 0; j < M; j++){\\n graph[i][j] = new ArrayList();\\n }\\n }\\n for(int i = 0; i < N; i++){\\n st = new StringTokenizer(br.readLine());\\n for(int j = 0; j < M-1; j++){\\n int w = Integer.parseInt(st.nextToken());\\n graph[i][j].add(w);\\n }\\n }\\n for(int i = 0; i < N; i++){\\n graph[i][M-1].add(0);\\n }\\n for(int i = 0; i < N-1; i++){\\n st = new StringTokenizer(br.readLine());\\n for(int j = 0; j < M; j++){\\n int w = Integer.parseInt(st.nextToken());\\n graph[i][j].add(w);\\n }\\n }\\n K \\/= 2;\\n for(int i = 0; i < M; i++) graph[N-1][i].add(0);\\n long ans[][][] = new long[K+1][N][M];\\n for(int i = 0; i < N; i++){\\n Arrays.fill(ans[0][i], 0);\\n }\\n for(int i = 1; i <= K; i++){\\n for(int x = 0; x < N; x++){\\n for(int y = 0; y < M; y++){\\n long cur = (long)1e17;\\n if(x < N-1){\\n cur =... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Scanner;\\n\\npublic class Solution {\\n\\n private static int[] a;\\n\\n public static void main(String[] args) {\\n Scanner sc = new Scanner(System.in);\\n\\n int n = sc.nextInt(), m = sc.nextInt();\\n\\n a = new int[101];\\n for (int i = 0; i < m; i++) {\\n int type = sc.nextInt();\\n a[type] = a[type] + 1;\\n }\\n\\n int lo=1, hi=100, max=0;\\n\\n while (lo <= hi) {\\n int mid = lo + (hi - lo)\\/2;\\n if (check(n, mid)) {\\n max = mid;\\n lo = mid+1;\\n } else {\\n hi = mid -1;\\n }\\n }\\n System.out.println(max);\\n }\\n\\n public static boolean check(int n, int target) {\\n int result = 0;\\n for (int i=0; i = n) {return true;}\\n return false;\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.io.BufferedReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n BPhoenixAndPuzzle solver = new BPhoenixAndPuzzle();\\n int testCount = Integer.parseInt(in.next());\\n for (int i = 1; i <= testCount; i++)\\n solver.solve(i, in, out);\\n out.close();\\n }\\n\\n static class BPhoenixAndPuzzle {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n if (n % 2 == 1) {\\n out.println(\\\"NO\\\");\\n return;\\n }\\n n \\/= 2;\\n if (n == 1 || (int) Math.sqrt(n) * (int) (Math.sqrt(n)) == n) {\\n out.println(\\\"YES\\\");\\n } else {\\n if (n % 2 == 0) {\\n n \\/= 2;\\n if ((int) Math.sqrt(n) * (int) (Math.sqrt(n)) == n) {\\n out.println(\\\"YES\\\");\\n return;\\n }\\n }\\n out.println(\\\"NO\\\");\\n }\\n }\\n\\n }\\n\\n static class InputReader {\\n BufferedReader reader;\\n StringTokenizer tokenizer;\\n\\n public InputReader(InputStream stream) {\\n reader = new BufferedReader(new InputStreamReader(stream), 32768);\\n tokenizer = null;\\n }\\n\\n public String next() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens())... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class SportMafia {\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\t\\n\\t\\tint n = sc.nextInt();\\n\\t\\tint k = sc.nextInt();\\n\\t\\t\\n\\t\\tint next = 1;\\n\\t\\tint current = 0;\\n\\t\\tint result = 0;\\n\\t\\t\\n\\t\\tfor(int i = 0; i < n; i++) {\\n\\t\\t\\tif(current < k) {\\n\\t\\t\\t\\tcurrent += next++;\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tcurrent--;\\n\\t\\t\\t\\tresult++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(result);\\n\\t\\t\\n\\t\\tsc.close();\\n\\t}\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Scanner;\\n\\npublic class ChainReaction {\\n\\t\\n\\tpublic static void main(String [] args) {\\n\\t\\tScanner kb = new Scanner(System.in);\\n\\t\\tint num = kb.nextInt();\\n\\t\\t\\n\\t\\tint[] beacons = new int[1000002];\\n\\t\\tfor (int i=0; i= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n if (numChars <= 0) {\\n return -1;\\n }\\n }\\n return buf[curChar++];\\n }\\n \\n public boolean isSpaceChar(int c) {\\n if (filter != null) {\\n return filter.isSpaceChar(c);\\n }\\n return isWhitespace(c);\\n }\\n \\n public interface SpaceCharFilter {\\n \\n public boolean isSpaceChar(int ch);\\n }\\n \\n public String next() {\\n return nextString();\\n }\\n \\n public char nextChar(){\\n \\tint c=read();\\n \\twhile (isSpaceChar(c)) {\\n c = read();\\n }\\n \\treturn (char)c;\\n }\\n \\n public String nextString() {\\n int c = read();\\n while (isSpaceChar(c)) {\\n c = read();\\n }\\n StringBuilder res = new StringBuilder();\\n do {\\n res.appendCodePoint(c);\\n c = read();\\n } while (!isSpaceChar(c));\\n return res.toString();\\n }\\n \\n public int... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n \\npublic class digits {\\n public static void main(String[] args) throws IOException {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n long k = Long.parseLong(br.readLine());\\n long temp = 9 * (int)Math.pow(10,0);\\n int count = 0;\\n long initial = 0;\\n while(k > temp) {\\n count++;\\n initial = temp;\\n temp += 9 * (long)Math.pow(10,count)*(count+1);\\n }\\n long index = (k-initial-1)%(count+1);\\n long num = (long)Math.pow(10,count) + (k-initial-1)\\/(count+1);\\n System.out.println((num+\\\"\\\").charAt((int)index));\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\npublic class A {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tString s = new String(in.readLine());\\n\\t\\tint len=s.length();\\n\\t\\tint ans=0;\\n\\t\\tfor (int i=0;ians) {\\n\\t\\t\\t\\t\\tans=score;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(ans);\\n\\t}\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/package round718;\\n\\nimport java.io.*;\\nimport java.util.ArrayDeque;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.util.Queue;\\n\\npublic class D2 {\\n\\tInputStream is;\\n\\tFastWriter out;\\n\\tString INPUT = \\\"\\\";\\/\\/2 5 9 9 9 9 9 8 8 8 8 5 6 7 8 9\\\";\\n\\n\\tvoid solve()\\n\\t{\\n\\t\\tint n = ni(), m = ni(), K = ni();\\n\\t\\tint[][] a = new int[2*n+1][2*m+1];\\n\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\tint[] u = na(m-1);\\n\\t\\t\\tfor(int j = 0;j < m-1;j++){\\n\\t\\t\\t\\ta[2*i][2*j+1] = u[j];\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tfor(int i = 0;i < n-1;i++){\\n\\t\\t\\tint[] u = na(m);\\n\\t\\t\\tfor(int j = 0;j < m;j++){\\n\\t\\t\\t\\ta[2*i+1][2*j] = u[j];\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif(K % 2 == 1){\\n\\t\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\t\\tfor(int j = 0;j < m;j++){\\n\\t\\t\\t\\t\\tout.print(-1 + \\\" \\\");\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tout.println();\\n\\t\\t\\t}\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tint[][][] dp = new int[K\\/2+1][n][m];\\n\\t\\tint[] dr = {1, 0, -1, 0};\\n\\t\\tint[] dc = {0, 1, 0, -1};\\n\\t\\tfor(int i = 1;i <= K\\/2;i++){\\n\\t\\t\\tfor(int j = 0;j < n;j++){\\n\\t\\t\\t\\tfor(int k = 0;k < m;k++){\\n\\t\\t\\t\\t\\tdp[i][j][k] = Integer.MAX_VALUE;\\n\\t\\t\\t\\t\\tfor(int l = 0;l < 4;l++){\\n\\t\\t\\t\\t\\t\\tint jj = j + dr[l], kk = k + dc[l];\\n\\t\\t\\t\\t\\t\\tif(jj >= 0 && jj < n && kk >= 0 && kk < m){\\n\\t\\t\\t\\t\\t\\t\\tdp[i][j][k] = Math.min(dp[i][j][k], dp[i-1][jj][kk] + a[j+jj][k+kk]);\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tfor(int i = 0;i < n;i++){\\n\\t\\t\\tfor(int j = 0;j < m;j++){\\n\\t\\t\\t\\tout.print(dp[K\\/2][i][j] * 2 + \\\" \\\");\\n\\t\\t\\t}\\n\\t\\t\\tout.println();\\n\\t\\t}\\n\\t}\\n\\t\\n\\tvoid run() throws Exception\\n\\t{\\n\\/\\/\\t\\tint n = 500, m = 500;\\n\\/\\/\\t\\tRandom gen = new Random();\\n\\/\\/\\t\\tStringBuilder sb = new StringBuilder();\\n\\/\\/\\t\\tsb.append(n + \\\" \\\");\\n\\/\\/\\t\\tsb.append(n + \\\" \\\");\\n\\/\\/\\t\\tsb.append(20 + \\\" \\\");\\n\\/\\/\\t\\tfor (int i = 0; i < n; i++) {\\n\\/\\/\\t\\t\\tfor(int j = 0;j < m-1;j++) {\\n\\/\\/\\t\\t\\t\\tsb.append(gen.nextInt(200000) + \\\" \\\");\\n\\/\\/\\t\\t\\t}\\n\\/\\/\\t\\t}\\n\\/\\/\\t\\tfor (int i = 0; i < n-1; i++) {\\n\\/\\/\\t\\t\\tfor(int j = 0;j < m;j++) {\\n\\/\\/\\t\\t\\t\\tsb.append(gen.nextInt(200000) + \\\" \\\");\\n\\/\\/\\t\\t\\t}\\n\\/\\/\\t\\t}\\n\\/\\/\\t\\tINPUT = sb.toString();\\n\\n\\n\\t\\tis = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());\\n\\t\\tout = new FastWriter(System.out);\\n\\t\\t\\n\\t\\tlong s = System.currentTimeMillis();\\n\\t\\tsolve();\\n\\t\\tout.flush();\\n\\t\\ttr(System.currentTimeMillis()-s+\\\"ms\\\");\\n\\t}\\n\\t\\n\\tpublic static void... Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport static java.lang.Math.*;\\nimport java.util.*;\\nimport java.util.function.*;\\nimport java.lang.*;\\n\\npublic class Main {\\n final static boolean debug = false;\\n final static String fileName = \\\"\\\";\\n final static boolean useFiles = false;\\n\\n public static void main(String[] args) throws FileNotFoundException {\\n long start;\\n if (debug)\\n start = System.nanoTime();\\n InputStream inputStream;\\n OutputStream outputStream;\\n if (useFiles) {\\n inputStream = new FileInputStream(fileName + \\\".in\\\");\\n outputStream = new FileOutputStream(fileName + \\\".out\\\");\\n } else {\\n inputStream = System.in;\\n outputStream = System.out;\\n }\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n Task solver = new Task(in, out);\\n solver.solve();\\n if(debug)\\n out.println((System.nanoTime() - start) \\/ 1e+9);\\n out.close();\\n }\\n}\\nclass Task {\\n int[][] dist, pre;\\n int[] x, y, d, prev;\\n String[] leafDescription;\\n String[] linerDescription;\\n String[][] allDescriptions;\\n int xs, ys, n;\\n\\n int dist(int i, int j) {\\n return (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]);\\n }\\n\\n void go(int[] prev, String[] leafDescription, int[] d, int len, int add, String description){\\n for (int mask = 0; mask < d.length; mask++) {\\n if ((mask & add) != add)\\n continue;\\n int newValue = d[mask & (~add)] + len;\\n if (d[mask] > newValue){\\n d[mask] = newValue;\\n leafDescription[mask] = description;\\n prev[mask] = mask & (~add);\\n }\\n }\\n }\\n\\n int rec(int mask) {\\n if (d[mask] != -1)\\n return d[mask];\\n int lowest = 0;\\n for (; ((1 << lowest) & mask) == 0; lowest++) ;\\n\\n int newMask = mask & (~(1 << lowest));\\n d[mask] = rec(newMask) + dist[lowest][n];\\n ... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.StringTokenizer;\\n\\npublic class B {\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tFastScanner fs=new FastScanner();\\n\\t\\tint T=fs.nextInt();\\n\\t\\tfor (int tt=0; tt l=new ArrayList<>();\\n\\t\\tfor (int i:a) l.add(i);\\n\\t\\tCollections.sort(l);\\n\\t\\tfor (int i=0; i0) {\\n int N = sc.nextInt();\\n int K = sc.nextInt();\\n int[] a = new int[N + 1];\\n for (int i = 1; i <= N; i++) {\\n a[i] = sc.nextInt();\\n int canonical = 1;\\n while (a[i] > 1) {\\n int factor = spf[a[i]];\\n int parity = 0;\\n while (a[i] % factor == 0) {\\n a[i] \\/= factor;\\n parity ^= 1;\\n }\\n if (parity == 1) {\\n canonical *= factor;\\n }\\n }\\n a[i] = canonical;\\n }\\n int[][] transition = new int[K + 1][N + 1];\\n\\/\\/ HashMap freq = new HashMap<>();\\n for (int k = 0; k <= K; k++) {\\n int l = N + 1;\\n int duplicates = 0;\\n for (int r = N; r >= 1; r--) {\\n while (l - 1 >= 1) {\\n int nextDuplicates = duplicates;\\n if (freq[a[l - 1]] >= 1) {\\n nextDuplicates++;\\n }\\n if (nextDuplicates <= k) {\\n duplicates =... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tPrintWriter out = new PrintWriter(outputStream);\\n\\t\\tA solver = new A();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass A {\\n\\tpublic void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.readInt();\\n int a = in.readInt();\\n int b = in.readInt();\\n int[] hs = new int[n];\\n for (int i=0;i 32) {\\n break;\\n }\\n }\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n return c;\\n }\\n\\n public int readInt() {\\n int res = 0;\\n boolean sign = false;\\n int c = skipSpace();\\n try {\\n if (c == '-') {\\n sign = true;\\n c = in.read();\\n }\\n while (true) {\\n if (c >= '0' && c <= '9') {\\n res = res * 10 + c - '0';\\n } else {\\n throw new InputMismatchException();\\n }\\n c =... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.io.BufferedWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.util.ArrayList;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.Collections;\\nimport java.io.InputStream;\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n int INF = 1000 * 1000 * 1000;\\n\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int x0 = in.readInt();\\n int y0 = in.readInt();\\n int n = in.readInt();\\n int[] xs = new int[n + 1], ys = new int[n + 1];\\n xs[0] = x0;\\n ys[0] = y0;\\n for (int i = 1; i <= n; i++) {\\n xs[i] = in.readInt();\\n ys[i] = in.readInt();\\n }\\n int[] one = new int[n];\\n for (int i = 0; i < n; i++) one[i] = dist(0, i + 1, xs, ys) * 2;\\n int[][] two = new int[n][n];\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) {\\n two[i][j] = dist(0, i + 1, xs, ys) + dist(0, j + 1, xs, ys) + dist(i + 1, j + 1, xs, ys);\\n }\\n }\\n int[] dp = new int[(1 << n)];\\n Arrays.fill(dp, INF);\\n dp[0] = 0;\\n int[] prev = new int[(1 << n)];\\n for (int mask = 0; mask < (1 << n); mask++) {\\n for (int i = 0; i < n; i++) {\\n if (((mask >> i) & 1) != 0) continue;\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\n\\npublic class Main\\n{\\n\\tPrintWriter out = new PrintWriter(System.out);\\n\\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer tok = new StringTokenizer(\\\"\\\");\\n String next() throws IOException {\\n if (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); }\\n return tok.nextToken();\\n }\\n int ni() throws IOException { return Integer.parseInt(next()); }\\n long nl() throws IOException { return Long.parseLong(next()); }\\n \\n void solve() throws IOException {\\n int n=ni(),k=ni();\\n int puts=(int)Math.sqrt(2*k);\\n int t=(puts*(puts+1))\\/2;\\n puts++;\\n while (t= 0)\\n {\\n System.out.println(n - k.longValue() + 1);\\n }\\n else\\n {\\n System.out.println(\\\"0\\\");\\n }\\n }\\n \\n public static BigInteger findFirst(BigInteger s) \\/\\/ first number where sum of digs >= s\\n {\\n BigInteger b = BigInteger.ZERO;\\n while (cd(b).compareTo(b.subtract(s)) > 0)\\n {\\n BigInteger c = BigInteger.ONE;\\n while (cd(b.add(c)).compareTo(b.add(c).subtract(s)) > 0) {\\n c = c.multiply(BigInteger.TEN);\\n }\\n \\/\\/ possibly overshot\\n c = c.divide(BigInteger.TEN);\\n if (c.compareTo(BigInteger.TEN) < 0) c = BigInteger.TEN; \\/\\/ always add at least 10\\n b = b.add(c);\\n }\\n return b;\\n }\\n \\n public static BigInteger cd(BigInteger n)\\n {\\n BigInteger t = BigInteger.ZERO;\\n while (n.compareTo(BigInteger.ZERO) > 0)\\n {\\n t = t.add(n.mod(BigInteger.TEN));\\n n = n.divide(BigInteger.TEN);\\n }\\n return t;\\n }\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\npublic class EdA {\\n\\tstatic long[] mods = {1000000007, 998244353, 1000000009};\\n\\tstatic long mod = mods[0];\\n\\tpublic static MyScanner sc;\\n public static PrintWriter out;\\n\\n\\tpublic static void main(String[] omkar) throws Exception{\\n\\t\\t\\/\\/ TODO Auto-generated method stub\\n \\t\\tsc = new MyScanner();\\n \\t\\tout = new PrintWriter(System.out);\\n \\t\\t\\n\\t \\tint n = sc.nextInt();\\n\\t \\tint m = sc.nextInt();\\n\\t \\tint[][]cnt = new int[m][m];\\n\\t \\tString s = sc.next();\\n\\t \\tfor(int j =0;j copy = new ArrayList();\\n\\t\\tfor (int i : array)\\n\\t\\t\\tcopy.add(i);\\n\\t\\tCollections.sort(copy);\\n\\t\\tfor(int i = 0;i= lenbuf){\\n\\t\\t\\tptrbuf = 0;\\n\\t\\t\\ttry { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }\\n\\t\\t\\tif(lenbuf <= 0)return -1;\\n\\t\\t}\\n\\t\\treturn inbuf[ptrbuf++];\\n\\t}\\n\\t\\n\\tprivate boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }\\n\\tprivate int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }\\n\\t\\n\\tprivate double nd() { return Double.parseDouble(ns()); }\\n\\tprivate char nc() { return (char)skip(); }\\n\\t\\n\\tprivate String ns()\\n\\t{\\n\\t\\tint b = skip();\\n\\t\\tStringBuilder sb = new StringBuilder();\\n\\t\\twhile(!(isSpaceChar(b))){ \\/\\/ when nextLine, (isSpaceChar(b) && b != ' ')\\n\\t\\t\\tsb.appendCodePoint(b);\\n\\t\\t\\tb = readByte();\\n\\t\\t}\\n\\t\\treturn sb.toString();\\n\\t}\\n\\t\\n\\tprivate char[] ns(int n)\\n\\t{\\n\\t\\tchar[] buf = new char[n];\\n\\t\\tint b = skip(), p = 0;\\n\\t\\twhile(p < n && !(isSpaceChar(b))){\\n\\t\\t\\tbuf[p++] = (char)b;\\n\\t\\t\\tb = readByte();\\n\\t\\t}\\n\\t\\treturn n... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.List;\\nimport java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.util.ArrayList;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.Writer;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author RiaD\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tReader in = new Reader(inputStream);\\n\\t\\tOutputWriter out = new OutputWriter(outputStream);\\n\\t\\tTaskA solver = new TaskA();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskA {\\n private static final long MOD = 1000000009;\\n\\n public void solve(int testNumber, Reader in, OutputWriter out) {\\n long answer = 0;\\n int n = in.nextInt();\\n int m = in.nextInt();\\n int k = in.nextInt();\\n\\n long l = -1;\\n long r = n + 1;\\n\\n while (l + 1 < r) {\\n long c = (l + r) \\/ 2;\\n if(n < c * k || canAchieve(n - c * k, k) >= m - c * k) {\\n r = c;\\n }\\n else\\n l = c;\\n }\\n\\n \\/\\/out.println(r);\\n\\n long c = r;\\n\\n answer = ((IntegerUtils.power(2, c + 1, MOD) - 2 + MOD) % MOD) * k % MOD;\\n\\n n -= k * c;\\n m -= k * c;\\n answer += m;\\n answer %= MOD;\\n\\n out.println(answer);\\n }\\n\\n private long canAchieve(long n, long k) {\\n return n - n \\/ k;\\n }\\n}\\n\\nclass Reader {\\n private BufferedReader reader;\\n private StringTokenizer tokenizer;\\n\\n public Reader(BufferedReader reader) {\\n this.reader = reader;\\n }\\n\\n public Reader(InputStream stream) {\\n this(new BufferedReader(new InputStreamReader(stream)));\\n }\\n\\n public String nextString() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n tokenizer = new StringTokenizer(readLine());\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class A {\\n public static void main(String args[]) {\\n FastScanner scn = new FastScanner();\\n int n = scn.nextInt();\\n int s = scn.nextInt();\\n if (s <= n) {\\n System.out.println(1);\\n } else if (s > n) {\\n if(s%n == 0){\\n System.out.println(s\\/n);\\n } else {\\n System.out.println(s\\/n + 1);\\n }\\n }\\n\\n }\\n\\n public static class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner(String s) {\\n try {\\n br = new BufferedReader(new FileReader(s));\\n } catch (FileNotFoundException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n }\\n\\n public FastScanner() {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n }\\n\\n String nextToken() {\\n while (st == null || !st.hasMoreElements()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n \\/\\/ TODO Auto-generated catch block\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n int nextInt() {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() {\\n return Double.parseDouble(nextToken());\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Arrays;\\nimport java.util.Comparator;\\nimport java.util.Scanner;\\n\\npublic class A\\n{\\n public A()\\n {\\n Scanner sc = new Scanner(System.in);\\n int n = sc.nextInt();\\n Integer mas[] = new Integer[n];\\n int b = 0;\\n for (int i = 0 ; i < n ; i ++)\\n {\\n mas[i] = sc.nextInt();\\n b+=mas[i];\\n }\\n Arrays.sort(mas, new Comparator()\\n {\\n\\n @Override\\n public int compare(Integer o1, Integer o2)\\n {\\n if(o1>o2)\\n return -1;\\n else if(o1==o2)\\n return 0;\\n else \\n return 1;\\n } \\n });\\n int N = 0; int g = 0;\\n for (int i = 0 ; i < n ; i ++)\\n {\\n g+=mas[i];\\n if(g>(int)(b\\/2))\\n {\\n System.out.println(i+1);\\n return;\\n }\\n }\\n System.out.println(n);\\n }\\n public static void main(String[] args)\\n {\\n new A(); \\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.*;\\n\\npublic class ProblemB3 {\\n Map> dest;\\n\\n private ProblemB3() throws IOException {\\n BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));\\n String h = rd.readLine();\\n String[] q = h.split(\\\"\\\\\\\\s+\\\");\\n int a = Integer.parseInt(q[1]);\\n int b = Integer.parseInt(q[2]);\\n h = rd.readLine();\\n q = h.split(\\\" \\\");\\n int n = q.length;\\n int[] p = new int[n];\\n for(int i=0;i pset = new HashSet<>();\\n for(int x: p) {\\n pset.add(x);\\n }\\n dest = new HashMap<>();\\n boolean res = true;\\n for(int x: p) {\\n boolean aOk = pset.contains(a-x);\\n boolean bOk = pset.contains(b-x);\\n if(!aOk && !bOk) {\\n res = false;\\n break;\\n } else {\\n if(aOk) {\\n addEdgeAndBack(x,a-x,0);\\n }\\n if(bOk) {\\n addEdgeAndBack(x,b-x,1);\\n }\\n }\\n }\\n Set aSet = new HashSet<>();\\n\\n if(res && a != b) {\\n for(int x: p) {\\n List e = getEdges(x);\\n if(e.size() == 1) {\\n int[] edge = e.get(0);\\n boolean odd = true;\\n int curA = edge[1];\\n int prev = x;\\n while(true) {\\n int cur = edge[0];\\n if(curA == 0 && odd) {\\n aSet.add(prev);\\n aSet.add(cur);\\n }\\n e = getEdges(cur);\\n if(e.size() == 1) {\\n if(!odd && e.get(0)[0] != cur) {\\n res = false;\\n }\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.lang.*;\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.*;\\nimport java.math.*;\\npublic class Main {\\n public void dfs(ArrayList[] graph,int[] visited,int source) {\\n \\n }\\n public static void main(String[] args) throws Exception{\\n Reader.init(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n Main mm =new Main();\\n int n=Reader.nextInt();\\n int m=Reader.nextInt();\\n String s=Reader.next();\\n int[][] count=new int[m][m];\\n for(int i=1;i0) {\\n for(int k=0;k=0;j--)\\n {\\n sum1+=a[j];\\n k++;\\n if(sum1*2>sum)\\n break;\\n }\\n pw.println(k);\\n pw.flush();\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\n\\npublic class CodeForces1177B {\\n\\t\\n\\tpublic static char custBinSearch(long lower, long upper, long lowIndex, int ten, long position) {\\n\\t\\tlong half = Math.round((lower + upper) \\/ 2.0);\\n\\t\\t\\n\\t\\tlong lowBound = lowIndex + (half - lower)*(ten + 1);\\n\\t\\tlong upBound = lowBound + ten;\\n\\t\\t\\n\\t\\tif(position < lowBound) { \\/\\/Less than the lowest index of half\\n\\t\\t\\treturn custBinSearch(lower, half - 1, lowIndex, ten, position);\\n\\t\\t\\t\\n\\t\\t} else if (position > upBound) { \\/\\/Remember to update lowIndex here.\\n\\t\\t\\tlowIndex += (half + 1 - lower)*(ten + 1);\\n\\t\\t\\treturn custBinSearch(half + 1, upper, lowIndex, ten, position);\\n\\t\\t\\t\\n\\t\\t} else {\\n\\t\\t\\treturn Long.toString(half).charAt((int) (position - lowBound)); \\/\\/The final number will at max be 11 characters long, thus it is safe to convert and cast.\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t}\\n\\t\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader inputs = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\n\\t\\tlong indexPosition = Long.parseLong(inputs.readLine());\\n\\t\\t\\n\\t\\tinputs.close();\\n\\t\\t\\n\\t\\t\\/\\/Isolate possible combinations so that all further numbers will have the same length.\\n\\t\\tint tenFactor = 0;\\n\\t\\tlong lowerBound = 1;\\n\\t\\tlong upperBound = (long) (Math.pow(10, 12));\\n\\t\\tlong lowerIndexBound = 1;\\n\\t\\tlong redIndex = 0;\\n\\t\\tredIndex += indexPosition;\\n\\t\\t\\n\\t\\twhile(redIndex > 0) {\\n\\t\\t\\tredIndex -= (long) (9*Math.pow(10, tenFactor)*(tenFactor + 1));\\n\\t\\t\\tif(redIndex <= 0) { \\/\\/Stage 1: Completed Successfully.\\n\\t\\t\\t\\tlowerBound = (long) (Math.pow(10, tenFactor));\\n\\t\\t\\t\\tupperBound = (long) (Math.pow(10, tenFactor + 1) - 1);\\n\\t\\t\\t\\tbreak;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tlowerIndexBound += (long) (9*Math.pow(10, tenFactor)*(tenFactor + 1));\\n\\t\\t\\ttenFactor++;\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(custBinSearch(lowerBound, upperBound, lowerIndexBound, tenFactor, indexPosition));\\n\\t\\t\\n\\t}\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport static java.lang.Math.*;\\nimport java.io.*;\\n\\npublic class SolutionB {\\n public static void main(String args[])throws IOException{\\n Scanner sc = new Scanner(System.in);\\n int a[] = new int[1501];\\n for(int i = 0; i < 3; i++){\\n a[sc.nextInt()]++;\\n }\\n if(a[1] > 0 || a[2] > 1 || a[3] > 2 || (a[4] == 2 && a[2] == 1)){\\n System.out.println(\\\"YES\\\");\\n }else{\\n System.out.println(\\\"NO\\\");\\n }\\n }\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.awt.image.BandedSampleModel;\\nimport java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.lang.reflect.Array;\\nimport java.util.Scanner;\\npublic class D{\\n\\n static void sort(int[] A){\\n\\n int n = A.length;\\n Random rnd = new Random();\\n for(int i=0; i0)\\n {\\n long f=arr[j][k][3]+ans[j][k-1];\\n min=Math.min(min,f);\\n }\\n\\n if(k {\\n @Override\\n public int compareTo(Home arg0) {\\n return st - arg0.st;\\n }\\n\\n int st, end;\\n \\n }\\n \\n public void solve() throws IOException {\\n int n = nextInt(), t = nextInt() * 2;\\n Home[] h = new Home[n];\\n for(int i = 0; i < n; ++i) {\\n int x = nextInt() * 2, a = nextInt() * 2;\\n h[i] = new Home();\\n h[i].st = x - a \\/ 2;\\n h[i].end = x + a \\/ 2; \\n } \\n Arrays.sort(h);\\n int ans = 2;\\n for(int i = 0; i + 1 < n; ++i) {\\n int delta = h[i + 1].st - h[i].end;\\n if (delta == t)\\n ans++;\\n if (delta > t)\\n ans += 2;\\n }\\n pw.println(ans);\\n }\\n \\n static final String filename = \\\"A\\\";\\n static final boolean fromConsole = true;\\n\\n public void run() {\\n try {\\n if (!fromConsole) {\\n in = new BufferedReader(new FileReader(filename + \\\".in\\\"));\\n pw = new PrintWriter(filename + \\\".out\\\");\\n } else {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n pw = new PrintWriter(System.out);\\n }\\n st = new StringTokenizer(\\\"\\\");\\n long st = System.currentTimeMillis();\\n solve(); \\n \\/\\/pw.printf(\\\"\\\\nWorking time: %d ms\\\\n\\\", System.currentTimeMillis() - st); \\n pw.close();\\n } catch (Exception e) {\\n e.printStackTrace();\\n System.exit(-1);\\n } \\n }\\n \\n private StringTokenizer st;\\n private BufferedReader in;\\n private PrintWriter pw; \\n \\n boolean hasNext() throws IOException {\\n while (!st.hasMoreTokens()) {\\n String line = in.readLine();\\n if (line == null) {\\n return false;\\n ... Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.StringTokenizer;\\n\\npublic class MicroWorld {\\n\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\t\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tStringTokenizer st = new StringTokenizer(br.readLine());\\n\\t\\t\\n\\t\\tint n = Integer.parseInt(st.nextToken());\\n\\t\\tint k = Integer.parseInt(st.nextToken());\\n\\t\\t\\n\\t\\tint[] temp = new int[1000001];\\n\\t\\t\\n\\t\\tStringTokenizer st1 = new StringTokenizer(br.readLine());\\n\\t\\t\\n\\t\\tfor (int i = 0; i < n; i++){\\n\\t\\t\\t\\n\\t\\t\\ttemp[Integer.parseInt(st1.nextToken())]++;\\n\\t\\t}\\n\\t\\t\\n\\t\\tint b = k + 1;\\n\\t\\t\\n\\t\\tfor (int i = 1000000; i > 0; i--){\\n\\t\\t\\t\\n\\t\\t\\tif (temp[i] > 0){\\n\\t\\t\\t\\tif (b <= k){\\n\\t\\t\\t\\t\\tn -= temp[i];\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tb = 1;\\n\\t\\t\\t}else{\\n\\t\\t\\t\\tb++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\t\\n\\t\\tSystem.out.println(n);\\n\\t\\t\\n\\t}\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.lang.reflect.Array;\\nimport java.math.BigInteger;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\n\\npublic class A\\n{\\n\\tpublic static void main(String [] args) throws IOException\\n\\t{\\n\\t\\tScanner in = new Scanner(System.in);\\n\\n\\t\\tSystem.out.println(rec(in.nextLong(), in.nextLong()));\\n\\n\\t}\\n\\n\\tprivate static long rec(long a, long b)\\n\\t{\\n\\t\\treturn b == 0 ? 0 : a\\/b + rec(b, a%b);\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.IOException;\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Liavontsi Brechka\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n DEhabIEsheOdnaOcherednayaZadachaNaXor solver = new DEhabIEsheOdnaOcherednayaZadachaNaXor();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class DEhabIEsheOdnaOcherednayaZadachaNaXor {\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int c = 0;\\n int d = 0;\\n\\n int prevSign = 0;\\n int nextSign;\\n boolean zeroOut = true;\\n for (int i = 29; i >= 0; i--) {\\n if (zeroOut) {\\n print(c, d, out);\\n prevSign = read(in);\\n }\\n\\n print((1 << i) | c, (1 << i) | d, out);\\n nextSign = read(in);\\n\\n if (prevSign == nextSign) {\\n zeroOut = false;\\n\\n print((1 << i) | c, d, out);\\n nextSign = read(in);\\n\\n if (nextSign < 0) {\\n c = (1 << i) | c;\\n d = (1 << i) | d;\\n }\\n } else {\\n zeroOut = true;\\n\\n if (nextSign < 0) c = (1 << i) | c;\\n else d = (1 << i) | d;\\n }\\n }\\n\\n out.printf(\\\"! %d %d\\\", c, d);\\n out.flush();\\n }\\n\\n private void print(int c, int d, PrintWriter out) {\\n out.printf(\\\"? %d %d\\\\n\\\", c, d);\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n private static void solve(InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n\\n if (n < 6) {\\n out.println(-1);\\n } else {\\n int m = (n - 2);\\n for (int i = 2; i <= m; i++) {\\n out.println(\\\"1 \\\" + i);\\n }\\n out.println(m + \\\" \\\" + (m + 1));\\n out.println(m + \\\" \\\" + (m + 2));\\n }\\n\\n for (int i = 2; i <= n; i++) {\\n out.println(\\\"1 \\\" + i);\\n }\\n }\\n\\n private static void shuffleArray(int[] array) {\\n int index;\\n Random random = new Random();\\n for (int i = array.length - 1; i > 0; i--) {\\n index = random.nextInt(i + 1);\\n if (index != i) {\\n array[index] ^= array[i];\\n array[i] ^= array[index];\\n array[index] ^= array[i];\\n }\\n }\\n }\\n\\n public static void main(String[] args) {\\n InputReader in = new InputReader(System.in);\\n OutputWriter out = new OutputWriter(System.out);\\n solve(in, out);\\n in.close();\\n out.close();\\n }\\n\\n private static class InputReader {\\n private BufferedReader br;\\n private StringTokenizer st;\\n\\n InputReader(InputStream is) {\\n br = new BufferedReader(new InputStreamReader(is));\\n st = null;\\n }\\n\\n String nextLine() {\\n String line = null;\\n try {\\n line = br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return line;\\n }\\n\\n String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n String line = nextLine();\\n if (line == null) return null;\\n st = new StringTokenizer(line);\\n }\\n return st.nextToken();\\n }\\n\\n byte nextByte() {\\n return Byte.parseByte(next());\\n }\\n\\n short nextShort() {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.PrintWriter;\\nimport java.util.*;\\n\\n\\/**\\n * Created by trung.pham on 28\\/12\\/17.\\n *\\/\\npublic class C_Round_455_Div2 {\\n static long[][]dp;\\n\\n static long MOD =(long) 1e9 + 7;\\n public static void main(String[] args) {\\n Scanner in = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n int n = in.nextInt();\\n char[]data = new char[n];\\n dp = new long[n][n];\\n for(long []a : dp){\\n Arrays.fill(a,-1);\\n }\\n for(int i = 0; i < n; i++){\\n data[i] = in.next().charAt(0);\\n }\\n out.println(cal(0, 0, data));\\n\\n out.close();\\n }\\n\\n static long cal(int index, int nested, char[]data ){\\n \\/\\/System.out.println(index + \\\" \\\" + nested);\\n if(index + 1 == data.length){\\n return 1;\\n }\\n if(dp[index][nested] != -1){\\n return dp[index][nested];\\n }\\n long result = 0;\\n boolean isLoop = data[index] == 'f';\\n if(isLoop){\\n result = cal(index + 1, nested + 1, data);\\n }else{\\n result = cal(index + 1, nested, data);\\n if(nested > 0){\\n result += cal(index, nested - 1, data);\\n result %= MOD;\\n }\\n }\\n \\/\\/ System.out.println(result + \\\" \\\" + index + \\\" \\\" + nested);\\n return dp[index][nested]= result;\\n\\n }\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\npublic class a {\\npublic static void main(String[] args) throws IOException\\n{\\n input.init(System.in);\\n int n = input.nextInt(), k = input.nextInt();\\n TreeSet ts = new TreeSet();\\n int[] data = new int[n];\\n for(int i = 0; i1 && k==1.*data[n-1]\\/data[0])\\n System.out.println(n-1);\\n else\\n {\\n for(int i = 0; i= '0' && c <= '9');\\n\\n if (neg)\\n return -ret;\\n return ret;\\n }\\n\\n public long nextLong() throws IOException\\n {\\n long ret = 0;\\n byte c = read();\\n while (c <= ' ')\\n c = read();\\n boolean neg = (c == '-');\\n if (neg)\\n c = read();\\n do {\\n ret = ret * 10 + c - '0';\\n }\\n while ((c = read()) >= '0' && c <= '9');\\n if (neg)\\n return -ret;\\n return ret;\\n }\\n\\n public double nextDouble() throws IOException\\n {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Scanner;\\n\\npublic class dwl {\\n\\n\\tpublic static void main(String[] args) {\\n\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tString[] lr = sc.nextLine().split(\\\" \\\");\\n\\t\\tlong l = Long.valueOf(lr[0]);\\n\\t\\tlong r = Long.valueOf(lr[1]);\\n\\n\\t\\tif (r - l <= 1 || (l == 1 && (r - l) == 2)\\n\\t\\t\\t\\t|| (l % 2 != 0 && (r - l) < 3))\\n\\t\\t\\tSystem.out.println(-1);\\n\\t\\telse {\\n\\t\\t\\tif (l == 1)\\n\\t\\t\\t\\tSystem.out.println(2 + \\\" \\\" + 3 + \\\" \\\" + 4);\\n\\t\\t\\telse {\\n\\t\\t\\t\\tif (l % 2 == 0) {\\n\\t\\t\\t\\t\\tString res = \\\"\\\";\\n\\t\\t\\t\\t\\tres += l + \\\" \\\";\\n\\t\\t\\t\\t\\tres += (l + 1) + \\\" \\\";\\n\\t\\t\\t\\t\\tres += (l + 2) + \\\" \\\";\\n\\t\\t\\t\\t\\tres = res.trim();\\n\\t\\t\\t\\t\\tSystem.out.println(res);\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tString res = \\\"\\\";\\n\\t\\t\\t\\t\\tres += (l + 1) + \\\" \\\";\\n\\t\\t\\t\\t\\tres += (l + 2) + \\\" \\\";\\n\\t\\t\\t\\t\\tres += (l + 3) + \\\" \\\";\\n\\t\\t\\t\\t\\tres = res.trim();\\n\\t\\t\\t\\t\\tSystem.out.println(res);\\n\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t}\\n\\n\\t}\\n\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class Solution{\\n \\n static class Node implements Comparable{\\n int sum;\\n int l;\\n int r;\\n Node next;\\n int nb;\\n Node ini;\\n boolean not;\\n public Node(int sum,int l,int r){\\n this.sum = sum;\\n this.l = l;\\n this.r = r;\\n nb = 0;\\n not = false;\\n ini = null;\\n }\\n \\n @Override\\n public int compareTo(Node node){\\n if(sum-node.sum!=0) return sum-node.sum;\\n else if(l-node.l!=0) return l-node.l;\\n else return r - node.r;\\n }\\n }\\n \\n public static void main(String[] args)throws IOException{\\n \\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer st = new StringTokenizer(br.readLine());\\n \\n PrintWriter out = new PrintWriter(System.out);\\n \\n int n = Integer.parseInt(st.nextToken());\\n \\n TreeSet ts = new TreeSet();\\n \\n st = new StringTokenizer(br.readLine());\\n int[] a = new int[n+1];\\n for(int i=1;i<=n;i++) a[i] = Integer.parseInt(st.nextToken());\\n \\n int[] s = new int[n+1];\\n for(int i=1;i<=n;i++) s[i] = s[i-1] + a[i];\\n \\n for(int i=1;i<=n;i++){\\n for(int j=i;j<=n;j++){\\n ts.add(new Node(s[j]-s[i-1],i,j));\\n }\\n }\\n int minvalue = -2000*(int)Math.pow(10,5);\\n int maxvalue = 2000*(int)Math.pow(10,5);\\n ts.add(new Node(minvalue,0,0));\\n ts.add(new Node(maxvalue,0,0));\\n \\/\\/System.out.println(minvalue);\\n Node node = ts.higher(ts.first());\\n \\n int sum = 0;\\n \\n \\n \\n int max = 0;\\n Node m = null;\\n \\n while(node.sum!=maxvalue){\\n \\n sum = node.sum;\\n while(node.sum==sum){\\n node = ts.higher(node);\\n }\\n \\n ... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\npublic class mainA {\\n public static PrintWriter out = new PrintWriter(System.out);\\n public static FastScanner enter = new FastScanner(System.in);\\n public static void main(String[] args) throws IOException {\\n solve();\\n out.close();\\n }\\n public static boolean[] was;\\n private static void solve() throws IOException{\\n int n=enter.nextInt();\\n int[] arr=new int[n];\\n was=new boolean[n];\\n for (int i = 0; i = l) {\\n\\t\\t\\t\\tk = 0;\\n\\t\\t\\t\\ttry { l = in.read(bb); } catch (IOException e) { l = 0; }\\n\\t\\t\\t\\tif (l <= 0) return -1;\\n\\t\\t\\t}\\n\\t\\t\\treturn bb[k++];\\n\\t\\t}\\n\\t\\tint nextInt() {\\n\\t\\t\\tbyte c = 0; while (c <= 32) c = getc();\\n\\t\\t\\tint a = 0;\\n\\t\\t\\twhile (c > 32) { a = a * 10 + c - '0'; c = getc(); }\\n\\t\\t\\treturn a;\\n\\t\\t}\\n\\t}\\n\\tScanner sc = new Scanner(System.in);\\n\\tpublic static void main(String[] $) {\\n\\t\\tCF1187G o = new CF1187G(); o.main(); o.flush();\\n\\t}\\n\\n\\tstatic final int INF = 0x3f3f3f3f;\\n\\tArrayList[] aa_;\\n\\tint n_, m_;\\n\\tint[] pi, dd, bb;\\n\\tint[] uu, vv, uv, cost;\\n\\tboolean[] iq;\\n\\tint[] cc;\\n\\tvoid init() {\\n\\t\\taa_ = new ArrayList[n_];\\n\\t\\tfor (int u = 0; u < n_; u++)\\n\\t\\t\\taa_[u] = new ArrayList();\\n\\t\\tpi = new int[n_];\\n\\t\\tdd = new int[n_];\\n\\t\\tbb = new int[n_];\\n\\t\\tiq = new boolean[n_];\\n\\t\\tuu = new int[m_];\\n\\t\\tvv = new int[m_];\\n\\t\\tuv = new int[m_];\\n\\t\\tcost = new int[m_];\\n\\t\\tcc = new int[m_ * 2];\\n\\t\\tm_ = 0;\\n\\t}\\n\\tvoid link(int u, int v, int cap, int cos) {\\n\\t\\tint h = m_++;\\n\\t\\tuu[h] = u;\\n\\t\\tvv[h] = v;\\n\\t\\tuv[h] = u ^ v;\\n\\t\\tcost[h] = cos;\\n\\t\\tcc[h << 1 ^ 0] = cap;\\n\\t\\taa_[u].add(h << 1 ^ 0);\\n\\t\\taa_[v].add(h << 1 ^ 1);\\n\\t}\\n\\tboolean dijkstra(int s, int t) {\\n\\t\\tArrays.fill(pi, INF);\\n\\t\\tpi[s] = 0;\\n\\t\\tTreeSet pq = new TreeSet<>((u, v) -> pi[u] != pi[v] ? pi[u] - pi[v] : dd[u] != dd[v] ? dd[u] - dd[v] : u - v);\\n\\t\\tpq.add(s); iq[s] = true;\\n\\t\\tInteger first;\\n\\t\\twhile ((first = pq.pollFirst()) != null) {\\n\\t\\t\\tint u = first;\\n\\t\\t\\tiq[u] = false;\\n\\t\\t\\tint d = dd[u] + 1;\\n\\t\\t\\tArrayList adj = aa_[u];\\n\\t\\t\\tfor (int h_ : adj)\\n\\t\\t\\t\\tif (cc[h_] > 0) {\\n\\t\\t\\t\\t\\tint h = h_ >> 1;\\n\\t\\t\\t\\t\\tint p = pi[u] + ((h_ & 1) == 0 ? cost[h] : -cost[h]);\\n\\t\\t\\t\\t\\tint v = u ^ uv[h];\\n\\t\\t\\t\\t\\tif (pi[v] > p || pi[v] == p && dd[v] > d) {\\n\\t\\t\\t\\t\\t\\tif (iq[v]) {\\n\\t\\t\\t\\t\\t\\t\\tpq.remove(v); iq[v] = false;\\n\\t\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\t\\tpi[v] = p;\\n\\t\\t\\t\\t\\t\\tdd[v] = d;\\n\\t\\t\\t\\t\\t\\tbb[v]... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.lang.*;\\nimport java.math.*;\\nimport java.io.*;\\n\\n\\/* spar5h *\\/\\n\\npublic class cf1 implements Runnable{ \\n\\t\\n\\tpublic void run() {\\n\\n\\t\\tInputReader s = new InputReader(System.in);\\n\\t\\tPrintWriter w = new PrintWriter(System.out);\\n\\t\\t\\n\\t\\tint t = 1;\\n\\t\\t\\n\\t\\twhile(t-- > 0) {\\n\\t\\t\\t\\n\\t\\t\\tint n = s.nextInt(), m = s.nextInt();\\n\\t\\t\\t\\n\\t\\t\\tint[] a = new int[n + 1];\\n\\t\\t\\t\\n\\t\\t\\tfor(int i = 1; i <= n; i++)\\n\\t\\t\\t\\ta[i] = s.nextInt();\\n\\t\\t\\t\\n\\t\\t\\tint[] b = new int[n + 1];\\n\\t\\t\\t\\n\\t\\t\\tfor(int i = 1; i <= n; i++)\\n\\t\\t\\t\\tb[i] = s.nextInt();\\n\\t\\t\\t\\n\\t\\t\\tArrayList list = new ArrayList();\\n\\t\\t\\t\\n\\t\\t\\tlist.add(a[1]);\\n\\t\\t\\t\\n\\t\\t\\tfor(int i = 2; i <= n; i++) {\\n\\t\\t\\t\\tlist.add(b[i]); list.add(a[i]);\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tlist.add(b[1]);\\n\\t\\t\\t\\n\\t\\t\\tdouble wt = m;\\n\\t\\t\\tboolean check = true;\\n\\t\\t\\t\\n\\t\\t\\tfor(int i = list.size() - 1; i >= 0; i--) {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif(list.get(i) <= 1) {\\n\\t\\t\\t\\t\\tcheck = false; break;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tdouble x = wt \\/ (list.get(i) - 1);\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\twt += x;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tif(check)\\n\\t\\t\\t\\tw.println(wt - m);\\n\\t\\t\\telse\\n\\t\\t\\t\\tw.println(-1);\\n\\t\\t}\\n\\t\\t\\n\\t\\tw.close();\\n\\t}\\n\\t\\n\\tstatic class InputReader {\\n\\t\\t\\n\\t\\tprivate InputStream stream;\\n\\t\\tprivate byte[] buf = new byte[1024];\\n\\t\\tprivate int curChar;\\n\\t\\tprivate int numChars;\\n\\t\\tprivate SpaceCharFilter filter;\\n\\t\\t\\n\\t\\tpublic InputReader(InputStream stream)\\n\\t\\t{\\n\\t\\t\\tthis.stream = stream;\\n\\t\\t}\\n\\t\\t\\n\\t\\tpublic int read()\\n\\t\\t{\\n\\t\\t\\tif (numChars==-1) \\n\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\n\\t\\t\\tif (curChar >= numChars)\\n\\t\\t\\t{\\n\\t\\t\\t\\tcurChar = 0;\\n\\t\\t\\t\\ttry \\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tnumChars = stream.read(buf);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tcatch (IOException e)\\n\\t\\t\\t\\t{\\n\\t\\t\\t\\t\\tthrow new InputMismatchException();\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\tif(numChars <= 0)\\t\\t\\t\\t\\n\\t\\t\\t\\t\\treturn -1;\\n\\t\\t\\t}\\n\\t\\t\\treturn buf[curChar++];\\n\\t\\t}\\n\\t \\n\\t\\tpublic String nextLine()\\n\\t\\t{\\n\\t\\t\\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tString str = \\\"\\\";\\n try\\n {\\n str = br.readLine();\\n }\\n catch (IOException e)\\n {\\n e.printStackTrace();\\n }\\n return str;\\n\\t\\t}\\n\\t\\tpublic int nextInt()\\n\\t\\t{\\n\\t\\t\\tint c =... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class _1523_C {\\n public static void main(String[] args) throws IOException {\\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(System.out);\\n int t = Integer.parseInt(in.readLine());\\n while(t-- > 0) {\\n int n = Integer.parseInt(in.readLine());\\n int[] a = new int[n];\\n for(int i = 0; i < n; i++) {\\n a[i] = Integer.parseInt(in.readLine());\\n }\\n boolean[][] used = new boolean[n][n + 1];\\n boolean[] used2 = new boolean[n];\\n String[][] res = new String[n][2];\\n res[0][0] = \\\"1\\\";\\n res[0][1] = \\\"\\\";\\n for(int i = 1; i < n; i++) {\\n if(a[i] == 1) {\\n for(int j = i - 1; j >= 0; j--) {\\n if(!used[j][a[i]] && !used2[j]) {\\n res[i][0] = res[j][0] + \\\".1\\\";\\n res[i][1] = res[j][0];\\n used[j][a[i]] = true;\\n break;\\n }\\n }\\n }else {\\n for(int j = i - 1; j >= 0; j--) {\\n if(!used[j][a[i]] && !used2[j] && a[j] == a[i] - 1) {\\n if(res[j][1].equals(\\\"\\\")) {\\n res[i][0] = \\\"\\\" + a[i];\\n }else {\\n res[i][0] = res[j][1] + \\\".\\\" + a[i];\\n }\\n res[i][1] = res[j][1];\\n used[j][a[i]] = true;\\n break;\\n }\\n used2[j] = true;\\n }\\n }\\n }\\n for(int i = 0; i < n; i++) {\\n out.println(res[i][0]);\\n }\\n }\\n in.close();\\n out.close();\\n }\\n}\\n Complexity:\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\n\\nimport java.io.*;\\nimport java.util.*;\\nimport java.text.*;\\nimport java.math.*;\\nimport java.util.regex.*;\\nimport java.lang.*;\\n\\n\\npublic class P11D{\\n\\tstatic long mod=1000000007;\\n\\t\\n public static void main(String[] args) throws Exception{ \\t\\n \\tInputReader in = new InputReader(System.in); \\n \\tPrintWriter pw=new PrintWriter(System.out); \\n \\t\\n \\t\\n \\t\\/\\/int t=in.readInt();\\n \\/\\/while(t-->0)\\n \\/\\/{\\n \\t\\n int n=in.readInt();\\n int m=in.readInt();\\n boolean v[][]=new boolean[n][n];\\n for(int i=0;i=3&&v[i][s])\\n \\t\\t\\t\\t{\\n \\t\\t\\t\\t\\tans+=dp[mask][i];\\n \\t\\t\\t\\t}\\n \\t\\t\\t}\\n \\t\\t}\\n \\t}\\n \\tans\\/=2;\\n\\t\\tpw.println(ans);\\t \\t\\n \\t\\n \\t\\/\\/}\\n \\t\\n \\tpw.close();\\n }\\n \\n\\n\\t\\npublic static long gcd(long x,long y)\\n{\\n\\tif(x%y==0)\\n\\t\\treturn y;\\n\\telse\\n\\t\\treturn gcd(y,x%y);\\n}\\npublic static int gcd(int x,int y)\\n{\\n\\tif(x%y==0)\\n\\t\\treturn y;\\n\\telse \\n\\t\\treturn gcd(y,x%y);\\n}\\npublic static int abs(int a,int b)\\n{\\n\\treturn (int)Math.abs(a-b);\\n}\\npublic static long abs(long a,long b)\\n{\\n\\treturn (long)Math.abs(a-b);\\n}\\npublic static int max(int a,int b)\\n{\\n\\tif(a>b)\\n\\t\\treturn a;\\n\\telse\\n\\t\\treturn b;\\n}\\npublic static int min(int a,int b)\\n{\\n\\tif(a>b)\\n\\t\\treturn b;\\n\\telse \\n\\t\\treturn a;\\n}\\npublic static long max(long a,long b)\\n{\\n\\tif(a>b)\\n\\t\\treturn... Complexity:\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n\\tpublic static void main(String[] args) throws IOException{\\n\\t\\tScanner cin = new Scanner(System.in);\\n\\t\\t\\n\\t\\tint t, n, m;\\n\\t\\t\\n\\t\\tt = cin.nextInt();\\n\\t\\t\\n\\t\\twhile(t > 0) {\\n\\t\\t\\tt--;\\n\\t\\t\\tint sum = 0;\\n\\t\\t\\tn = cin.nextInt();\\n\\t\\t\\tm = cin.nextInt();\\n\\t\\t\\twhile(n > 0 && m > 0) {\\n\\t\\t\\t\\tif(n < m) {\\n\\t\\t\\t\\t\\tint k = n;\\n\\t\\t\\t\\t\\tn = m;\\n\\t\\t\\t\\t\\tm = k;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tsum += n \\/ m; n %= m;\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tSystem.out.println(sum);\\n\\t\\t}\\n\\t}\\n\\n}\\n\\n \\t \\t\\t\\t \\t\\t \\t \\t\\t\\t \\t\\t\\t\\t Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/* package whatever; \\/\\/ don't place package name! *\\/\\n\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\nimport java.util.Collections;\\nimport java.util.HashSet;\\n\\n\\/* Name of the class has to be \\\"Main\\\" only if the class is public. *\\/\\npublic class Ideone\\n{\\n\\tpublic static void main (String[] args) throws java.lang.Exception\\n\\t{\\n\\t\\tScanner sc=new Scanner(System.in);\\n\\t\\tint n=sc.nextInt();\\n\\t\\tArrayList s1=new ArrayList ();\\n\\t\\tArrayList s2=new ArrayList ();\\n\\t\\t\\tArrayList s3=new ArrayList ();\\n\\t\\t\\tint i;\\n\\t\\tfor(i=0;i 0; i--){\\n ArrayList list = new... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\nimport java.math.*;\\n\\npublic class bhaa {\\n\\n InputStream is;\\n PrintWriter o;\\n \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/ CODED++ BY++ ++ ++ ++ BHAVYA++ ARORA++ ++ ++ ++ FROM++ JAYPEE++ INSTITUTE++ OF++ INFORMATION++ TECHNOLOGY++ \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\n\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/ Make it work, make it right, make it fast. Make it work, make it right, make it fast. Make it work, make it right, make it fast. Make it work, make it right, make it fast. \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\n\\n boolean chpr(int n)\\n {\\n \\tif(n==1)\\n \\t{\\n \\t\\treturn true;\\n \\t}if(n==2)\\n \\t{\\n \\t\\treturn true;\\n \\t}\\n \\tif(n==3)\\n \\t{\\n \\t\\treturn true;\\n \\t}\\n \\tif(n%2==0)\\n \\t{\\n \\t\\treturn false;\\n\\n \\t}\\n \\tif(n%3==0)\\n \\t{\\n \\t\\treturn false;\\n \\t}\\n \\t\\n \\tint w=2;\\n \\t\\tint i=5;\\n \\twhile(i*i<=n)\\n \\t{\\n \\t\\tif(n%i==0)\\n \\t\\t{\\n \\t\\t\\treturn false;\\n \\t\\t}\\n \\t\\ti+=w;\\n \\t\\tw=6-w;\\n \\t}\\n \\treturn true;\\n\\n }\\n \\n void solve() {\\n\\n\\n int n=ni();\\n int k=ni();\\n int rr=2*n;\\n int gr=5*n;\\n int br=8*n;\\n o.println((long)(Math.ceil(rr*1.0\\/k)+Math.ceil(gr*1.0\\/k)+Math.ceil(br*1.0\\/k)));\\n\\n\\n\\n \\t\\n\\n }\\n\\n\\n\\n\\n\\n \\n\\n\\n \\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n \\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n \\/\\/---------- I\\/O Template ----------\\n \\n public static void main(String[] args) { new bhaa().run(); }\\n void run() { \\n is = System.in; \\n o = new PrintWriter(System.out);\\n solve();\\n o.flush();\\n }\\n \\n byte input[] = new byte[1024];\\n int len = 0, ptr = 0;\\n \\n int readByte() { \\n if(ptr >= len) { ptr = 0; \\n try { len = is.read(input); } \\n catch(IOException e) { throw new InputMismatchException(); } \\n if(len <= 0) { return -1; } \\n } return input[ptr++];\\n }\\n boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }\\n int skip() { \\n int b = readByte(); \\n while(b != -1 && isSpaceChar(b)) { b = readByte(); } \\n return b;\\n }\\n \\n char nc() { return (char)skip(); }\\n String ns()... Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class D implements Runnable {\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew D().run();\\n\\t}\\n\\n\\tclass FastScanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\t\\tboolean eof;\\n\\t\\tString buf;\\n\\n\\t\\tpublic FastScanner(String fileName) throws FileNotFoundException {\\n\\t\\t\\tbr = new BufferedReader(new FileReader(fileName));\\n\\t\\t\\tnextToken();\\n\\t\\t}\\n\\n\\t\\tpublic FastScanner(InputStream stream) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(stream));\\n\\t\\t\\tnextToken();\\n\\t\\t}\\n\\n\\t\\tString nextToken() {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\t\\ttry {\\n\\t\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\t\\t\\t\\t} catch (Exception e) {\\n\\t\\t\\t\\t\\teof = true;\\n\\t\\t\\t\\t\\tbreak;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\tString ret = buf;\\n\\t\\t\\tbuf = eof ? \\\"-1\\\" : st.nextToken();\\n\\t\\t\\treturn ret;\\n\\t\\t}\\n\\n\\t\\tint nextInt() {\\n\\t\\t\\treturn Integer.parseInt(nextToken());\\n\\t\\t}\\n\\n\\t\\tlong nextLong() {\\n\\t\\t\\treturn Long.parseLong(nextToken());\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble() {\\n\\t\\t\\treturn Double.parseDouble(nextToken());\\n\\t\\t}\\n\\n\\t\\tvoid close() {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tbr.close();\\n\\t\\t\\t} catch (Exception e) {\\n\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tboolean isEOF() {\\n\\t\\t\\treturn eof;\\n\\t\\t}\\n\\t}\\n\\n\\tFastScanner sc;\\n\\tPrintWriter out;\\n\\n\\tpublic void run() {\\n\\t\\tLocale.setDefault(Locale.US);\\n\\t\\ttry {\\n\\t\\t\\tsc = new FastScanner(System.in);\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\tsolve();\\n\\t\\t\\tsc.close();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Throwable e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(1);\\n\\t\\t}\\n\\t}\\n\\n\\tint nextInt() {\\n\\t\\treturn sc.nextInt();\\n\\t}\\n\\n\\tString nextToken() {\\n\\t\\treturn sc.nextToken();\\n\\t}\\n\\n\\tlong nextLong() {\\n\\t\\treturn sc.nextLong();\\n\\t}\\n\\n\\tdouble nextDouble() {\\n\\t\\treturn sc.nextDouble();\\n\\t}\\n\\n\\tvoid solve() {\\n\\t\\t\\/\\/ long time = System.currentTimeMillis();\\n\\t\\tint n = nextInt();\\n\\t\\tint m = nextInt();\\n\\t\\tboolean[][] edges = new boolean[n][n];\\n\\t\\tboolean[] edge = new boolean[(n << 5) | n];\\n\\t\\tfor (int i = 0; i < m; i++) {\\n\\t\\t\\tint x = nextInt() - 1;\\n\\t\\t\\tint y = nextInt() - 1;\\n\\t\\t\\tedges[x][y] = edges[y][x] = true;\\n\\t\\t\\tedge[(x << 5) | y] = edge[(y << 5) | x] = true;\\n\\t\\t}\\n\\t\\tlong[][] dp = new long[n][1 << n];\\n\\t\\tlong ans = 0;\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tfor (int... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\n\\/**\\n * Problem solution template.\\n * @author Andrew Porokhin, andrew.porokhin@gmail.com\\n *\\/\\npublic class Problem17A implements Runnable {\\n void solve() throws NumberFormatException, IOException {\\n \\n \\n \\n int n = nextInt();\\n int k = nextInt();\\n\\n ArrayList primes = new ArrayList(n + 1); \\n boolean[] simplePrime = new boolean[n + 1];\\n Arrays.fill(simplePrime, 0, simplePrime.length, true);\\n simplePrime[0] = simplePrime[1] = false;\\n \\n for (int i = 2; i <= n; i++) {\\n if (simplePrime[i]) {\\n for (int j = i + i; j <= n; j += i) {\\n simplePrime[j] = false;\\n }\\n \\n primes.add(i);\\n }\\n }\\n \\n \\n int actualK = 0;\\n for (int i = 1; i < primes.size(); i++) {\\n int val = primes.get(i - 1) + primes.get(i) + 1;\\n if (val <= n) {\\n if (simplePrime[val]) {\\n \\/\\/ System.out.printf(\\\"%d + %d + 1 = %d%n\\\", primes.get(i - 1), primes.get(i), val);\\n actualK++;\\n }\\n } else {\\n break;\\n }\\n }\\n \\/\\/ System.out.printf(\\\"req: %d actual: %d%n\\\", k, actualK);\\n System.out.println((k <= actualK ? \\\"YES\\\" : \\\"NO\\\"));\\n }\\n\\n \\n StringTokenizer st;\\n BufferedReader in;\\n PrintWriter out;\\n \\n public static void main(String[] args) {\\n new Problem17A().run();\\n }\\n\\n public void run() {\\n try {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n solve();\\n } catch (Exception e) {\\n e.printStackTrace();\\n } finally {\\n out.flush();\\n out.close();\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.InputStreamReader;\\nimport java.util.Scanner;\\nimport java.io.IOException;\\n\\npublic class kresz {\\n\\tpublic static double a;\\n\\tpublic static double v;\\n\\tpublic static double l;\\n\\tpublic static double d;\\n\\tpublic static double w;\\n\\t\\t\\n\\tpublic static double gyorsulut (double v1, double v2) { \\/\\/v1 -> v2 mennyi utat tesz meg\\n\\t\\treturn Math.abs((v2*v2-v1*v1)\\/(2*a));\\n\\t}\\n\\tpublic static double gyorsulido (double v1, double v2) { \\/\\/v1 -> v2 mennyi idő\\n\\t\\treturn Math.abs((v2-v1)\\/a);\\n\\t}\\n\\t\\n\\t\\n\\tpublic static void beolvas () throws IOException {\\n\\t\\tScanner be = new Scanner (new InputStreamReader (System.in));\\n\\t\\t\\ta = be.nextDouble();\\n\\t\\t\\tv = be.nextDouble();\\n\\t\\t\\tl = be.nextDouble();\\n\\t\\t\\td = be.nextDouble();\\n\\t\\t\\tw = be.nextDouble();\\n\\t\\tbe.close();\\n\\t}\\n\\t\\n\\t\\n\\tpublic static void main (String args[]) throws IOException {\\n\\t\\t\\tbeolvas();\\n\\t\\t\\tdouble s = l; \\/\\/hátralévő út\\n\\t\\t\\tdouble t = 0; \\/\\/eltelt idő\\n\\t\\t\\t\\n\\t\\t\\tif (v <= w || Math.sqrt(2*a*d) <= w) { \\/\\/nincs korlátozás\\n\\t\\t\\t\\tif (gyorsulut(0,v) > l) {\\n\\t\\t\\t\\t\\tt+=gyorsulido(0, Math.sqrt(2*a*l));\\n\\t\\t\\t\\t\\ts = 0;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\ts-=gyorsulut(0,v);\\n\\t\\t\\t\\t\\tt+=gyorsulido(0,v);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse {\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\/\\/gyorsuló szakaszok a korlátozásig\\n\\t\\t\\t\\tif (d < gyorsulut(0,v)+gyorsulut(v,w)) {\\n\\t\\t\\t\\t\\tdouble x = Math.sqrt(a*(d-w*w\\/(2*a))+w*w);\\n\\t\\t\\t\\t\\ts-=gyorsulut(0,w)+2*gyorsulut(w,x);\\n\\t\\t\\t\\t\\tt+=gyorsulido(0,w)+2*gyorsulido(w,x);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\ts-=gyorsulut(0,v)+gyorsulut(w,v);\\n\\t\\t\\t\\t\\tt+=gyorsulido(0,v)+gyorsulido(w,v);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\/\\/gyorsuló szakaszok a korlátozástól\\n\\t\\t\\t\\tif (gyorsulut(v,w) > l-d) {\\n\\t\\t\\t\\t\\tdouble y = Math.sqrt(2*a*(l-d)+w*w);\\n\\t\\t\\t\\t\\ts-= gyorsulut(w,y);\\n\\t\\t\\t\\t\\tt+=gyorsulido(w,y);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\ts-=gyorsulut(w,v);\\n\\t\\t\\t\\t\\tt+=gyorsulido(w,v);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t\\tt+=s\\/v; \\/\\/nem gyorsuló szakaszok ideje\\n\\t\\t\\t\\n\\t\\t\\tSystem.out.println(t);\\n\\t\\t\\t\\n\\t}\\n\\t\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/ Don't place your source in a package\\nimport javax.swing.*;\\nimport java.lang.reflect.Array;\\nimport java.text.DecimalFormat;\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.io.*;\\nimport java.math.*;\\nimport java.util.stream.Stream;\\n\\n\\n\\/\\/ Please name your class Main\\npublic class Main {\\n static FastScanner fs=new FastScanner();\\n static class FastScanner {\\n BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n StringTokenizer st=new StringTokenizer(\\\"\\\");\\n public String next() {\\n while (!st.hasMoreElements())\\n try {\\n st=new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n return st.nextToken();\\n }\\n int Int() {\\n return Integer.parseInt(next());\\n }\\n\\n long Long() {\\n return Long.parseLong(next());\\n }\\n\\n String Str(){\\n return next();\\n }\\n }\\n\\n\\n public static void main (String[] args) throws java.lang.Exception {\\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\\n\\n int T=1;\\n for(int t=0;t 0)\\n {\\n if (n % n1 == 0)\\n {\\n if (check(n1))\\n {\\n System.out.print(\\\"YES\\\");\\n q = false;\\n break;\\n } \\n }\\n n1--;\\n }\\n if (q) System.out.print(\\\"NO\\\");\\n \\n }\\n public static boolean check (int n)\\n {\\n int n1 = n;\\n while (n1 != 0)\\n {\\n if (n1 % 10 != 4 && n1 % 10 != 7) return false;\\n n1 \\/= 10;\\n }\\n return true;\\n }\\n\\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\/\\/~ 22:04:48\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class Main{\\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));\\n\\t\\tString out = \\\"\\\";\\n\\t\\tString[] p = br.readLine().split(\\\"[ ]\\\");\\n\\t\\tint n = Integer.valueOf(p[0]);\\n\\t\\tdouble t = Double.valueOf(p[1]);\\n\\t\\t\\n\\t\\tint offset = 5000;\\n\\t\\tboolean[] flags = new boolean[offset+5000];\\n\\t\\tfor(int i=0;i2*t+1) buf+=2;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tlast = index;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tbuf ++;\\n\\t\\tout = \\\"\\\"+buf+\\\"\\\\r\\\\n\\\";\\n\\t\\tbw.write(out,0,out.length());\\n\\t\\tbr.close();\\n\\t\\tbw.close();\\n\\t}\\n\\tstatic int[] toIntArray(String line){\\n\\t\\tString[] p = line.trim().split(\\\"\\\\\\\\s+\\\");\\n\\t\\tint[] out = new int[p.length];\\n\\t\\tfor(int i=0;i map = new HashMap();\\n long[] ar = new long[numCnt];\\n for (int i = 0; i < numCnt; i++) {\\n ar[i] = nextLong();\\n map.put(ar[i] * 10007 + ar[i] \\/ 13, i);\\n }\\n for (int i = 0; i < ar.length; i++) {\\n long req = ar[i] * k;\\n Integer idx=map.get(req * 10007 + req \\/ 13);\\n if (idx!=null) {\\n union(i, idx);\\n }\\n }\\n int[] count = new int[numCnt];\\n for (int i = 0; i < parent.length; i++) {\\n count[find(i)]++;\\n }\\n int res = 0;\\n for (int i = 0; i < numCnt; i++) {\\n res += (int) ((count[i] + 1) \\/ 2.0);\\n }\\n System.out.println(res);\\n }\\n\\n static BufferedReader br = new BufferedReader(new InputStreamReader(\\n System.in));\\n static StringTokenizer tokenizer = new StringTokenizer(\\\"\\\");\\n\\n static long nextLong() throws Exception {\\n return Long.parseLong(next());\\n }\\n\\n static double nextDouble() throws Exception {\\n return Double.parseDouble(next());\\n }\\n\\n static String next() throws Exception {\\n while (true) {\\n if (tokenizer.hasMoreTokens()) {\\n return tokenizer.nextToken();\\n }\\n String s = br.readLine();\\n... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class Solution{\\n public static void main(String[] args)throws IOException{\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n int n = Integer.parseInt(br.readLine());\\n StringTokenizer st = new StringTokenizer(br.readLine());\\n int[] a = new int[n];\\n for(int i=0;ia[i-1]) ok = false;\\n for(int i=ind-1;i>=0;i--) if(a[i]>a[i+1]) ok = false;\\n if(ok) System.out.println(\\\"YES\\\");\\n else System.out.println(\\\"NO\\\");\\n \\n }\\n}\\n\\n What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\n\\/**\\n * @author Don Li\\n *\\/\\npublic class LogicalExpression {\\n \\n int N = 256;\\n \\n void solve() {\\n Expression[] E = new Expression[N];\\n for (int i = 0; i < N; i++) E[i] = new Expression();\\n \\n E[Integer.parseInt(\\\"00001111\\\", 2)].update_f(\\\"x\\\");\\n E[Integer.parseInt(\\\"00110011\\\", 2)].update_f(\\\"y\\\");\\n E[Integer.parseInt(\\\"01010101\\\", 2)].update_f(\\\"z\\\");\\n \\n for (int l = 2; l < 40; l++) {\\n for (int i = 0; i < N; i++) {\\n for (int j = 0; j < N; j++) {\\n if (E[i].e != null && E[j].t != null && E[i].e.length() + E[j].t.length() + 1 == l) {\\n E[i | j].update_e(E[i].e + '|' + E[j].t);\\n }\\n if (E[i].t != null && E[j].f != null && E[i].t.length() + E[j].f.length() + 1 == l) {\\n E[i & j].update_t(E[i].t + '&' + E[j].f);\\n }\\n }\\n if (E[i].f != null) E[i ^ (N - 1)].update_f('!' + E[i].f);\\n }\\n }\\n \\n String[] res = new String[N];\\n for (int i = 0; i < N; i++) res[i] = E[i].calc_best();\\n \\n int n = in.nextInt();\\n for (int i = 0; i < n; i++) {\\n int x = Integer.parseInt(in.nextToken(), 2);\\n out.println(res[x]);\\n }\\n }\\n \\n static class Expression {\\n String e, t, f;\\n \\n Expression() {\\n }\\n \\n public Expression(String e, String t, String f) {\\n this.e = e;\\n this.t = t;\\n this.f = f;\\n }\\n \\n String calc_best() {\\n String best = e;\\n if (compare(best, t) > 0) best = t;\\n if (compare(best, f) > 0) best = f;\\n return best;\\n }\\n \\n void update_e(String ne) {\\n if (e == null || compare(e, ne) > 0) {\\n e... What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.util.Scanner;\\n\\npublic class Main {\\n\\t\\n\\tpublic static void main(String[] args)\\n\\t{\\n\\t\\tScanner s=new Scanner(System.in);\\n\\t\\t\\n\\t\\tint n=s.nextInt();\\n\\t\\t\\n\\t\\tint[] arr=new int[n];\\n\\t\\t\\n\\t\\tfor(int i=0;i= 0; j--) {\\n if (a[i - 1] == 's') {\\n dp[1][j][0] = dp[1][j][1] = dp[0][j][1];\\n } else {\\n if (j > 0)\\n dp[1][j][0] = dp[1][j][1] = dp[0][j - 1][0];\\n }\\n }\\n\\n for (int j = 0; j <= n; j++) {\\n dp[0][j][0] = dp[1][j][0];\\n dp[0][j][1] = dp[1][j][1];\\n dp[1][j][0] = 0;\\n dp[1][j][1] = 0;\\n }\\n for (int j = n - 1; j >= 0; j--) {\\n dp[0][j][1] += dp[0][j + 1][1];\\n dp[0][j][1] %= mod;\\n }\\n }\\n\\n System.out.println(dp[0][0][1]);\\n \\/\\/ end here\\n }\\n\\n public static void main(String[] args) throws FileNotFoundException {\\n (new _909C()).solve();\\n }\\n\\n class InputHelper {\\n StringTokenizer tokenizer = null;\\n private BufferedReader bufferedReader;\\n\\n public InputHelper(InputStream inputStream) {\\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\\n bufferedReader = new BufferedReader(inputStreamReader, 16384);\\n }\\n\\n public String read() {\\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\\n try {\\n String line = bufferedReader.readLine();\\n if (line == null) {\\n return null;\\n }\\n tokenizer = new StringTokenizer(line);\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\npublic class B {\\n public static PrintStream out = System.out;\\n public static InputReader in = new InputReader(System.in);\\n static class Node implements Comparable {\\n int res;\\n Node(int pp) {\\n p = pp;\\n }\\n int p;\\n @Override\\n public int compareTo(Node n) {\\n return Integer.compare(p, n.p);\\n }\\n @Override\\n public boolean equals(Object o) {\\n return p == ((Node) o).p;\\n }\\n }\\n public static void main(String args[]) {\\n int N, a, b;\\n N = in.nextInt();\\n int[] label;\\n a = in.nextInt();\\n b = in.nextInt();\\n if (a < b) {\\n label = new int[] {0, 1};\\n } else {\\n int tmp = a;\\n a = b;\\n b = tmp;\\n label = new int[] {1, 0};\\n }\\n Node[] nodes = new Node[N];\\n for (int i = 0; i < N; i++) {\\n nodes[i] = new Node(in.nextInt());\\n }\\n TreeSet ts = new TreeSet<>();\\n for (int i = 0; i < N; i++) {\\n ts.add(nodes[i]);\\n }\\n while (!ts.isEmpty()) {\\n Node n = ts.first();\\n Node an = new Node(a - n.p);\\n Node bn = new Node(b - n.p);\\n SortedSet ats = ts.tailSet(an);\\n SortedSet bts = ts.tailSet(bn);\\n Node an2 = ats.isEmpty() ? null : ats.first();\\n Node bn2 = bts.isEmpty() ? null : bts.first();\\n Node n2 = null;\\n int l = 0;\\n if (bn2 != null && bn2.equals(bn)) {\\n n2 = bn2;\\n l = label[1];\\n } else if (an2 != null && an2.equals(an)) {\\n n2 = an2;\\n l = label[0];\\n } else {\\n NO();\\n }\\n if (!n.equals(n2)) {\\n ts.remove(n);\\n n.res = l;\\n }\\n ts.remove(n2);\\n n2.res = l;\\n }\\n out.println(\\\"YES\\\");\\n for (int i = 0; i... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\n\\n\\npublic class Main {\\n\\n public static void main(String[] args) {\\n\\n Scanner in = new Scanner(System.in);\\n PrintWriter out = new PrintWriter(System.out);\\n \\n int n = in.nextInt();\\n \\n out.println(n+\\\" 0 0\\\");\\n \\n in.close();\\n out.close();\\n \\n }\\n\\n}\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\n\\n\\npublic class Main {\\n public static void main(String[] args) throws IOException {\\n BufferedReader r = new BufferedReader(new InputStreamReader(System.in));\\n \\n int n = Integer.parseInt(r.readLine());\\n \\n String[] line = r.readLine().split(\\\"[ ]+\\\");\\n \\n int[] a = new int[n];\\n for(int i = 0; i < n; i++)\\n a[i] = Integer.parseInt(line[i]);\\n \\n \\n Arrays.sort(a);\\n \\n boolean found = false;\\n for(int i = 0; i < n && !found; i++)\\n if(a[i] != 1)found = true;\\n \\n \\n if(found){\\n System.out.println(1);\\n for(int i = 1; i < n; i++)\\n System.out.println(a[i-1]);\\n }else{\\n for(int i = 0; i < n-1; i++)\\n System.out.println(1);\\n System.out.println(2);\\n }\\n }\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\nimport java.util.Map.Entry;\\n\\npublic class E {\\n\\tFastScanner in;\\n\\tPrintWriter out;\\n\\tboolean systemIO = true;\\n\\n\\tpublic class DSU {\\n\\t\\tint[] sz;\\n\\t\\tint[] p;\\n\\n\\t\\tpublic DSU(int n) {\\n\\t\\t\\tsz = new int[n];\\n\\t\\t\\tp = new int[n];\\n\\t\\t\\tfor (int i = 0; i < p.length; i++) {\\n\\t\\t\\t\\tp[i] = i;\\n\\t\\t\\t\\tsz[i] = 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tpublic int get(int x) {\\n\\t\\t\\tif (x == p[x]) {\\n\\t\\t\\t\\treturn x;\\n\\t\\t\\t}\\n\\t\\t\\tint par = get(p[x]);\\n\\t\\t\\tp[x] = par;\\n\\t\\t\\treturn par;\\n\\t\\t}\\n\\n\\t\\tpublic boolean unite(int a, int b) {\\n\\t\\t\\tint pa = get(a);\\n\\t\\t\\tint pb = get(b);\\n\\t\\t\\tif (pa == pb) {\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t\\tif (sz[pa] < sz[pb]) {\\n\\t\\t\\t\\tp[pa] = pb;\\n\\t\\t\\t\\tsz[pb] += sz[pa];\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tp[pb] = pa;\\n\\t\\t\\t\\tsz[pa] += sz[pb];\\n\\t\\t\\t}\\n\\t\\t\\treturn true;\\n\\t\\t}\\n\\t}\\n\\n\\tpublic class SegmentTreeAdd {\\n\\t\\tint pow;\\n\\t\\tlong[] min;\\n\\t\\tlong[] delta;\\n\\t\\tboolean[] flag;\\n\\n\\t\\tpublic SegmentTreeAdd(long[] a) {\\n\\t\\t\\tpow = 1;\\n\\t\\t\\twhile (pow < a.length) {\\n\\t\\t\\t\\tpow *= 2;\\n\\t\\t\\t}\\n\\t\\t\\tflag = new boolean[2 * pow];\\n\\t\\t\\tmin = new long[2 * pow];\\n\\t\\t\\tdelta = new long[2 * pow];\\n\\t\\t\\tfor (int i = 0; i < min.length; i++) {\\n\\t\\t\\t\\tmin[i] = Long.MAX_VALUE \\/ 2;\\n\\t\\t\\t}\\n\\t\\t\\tfor (int i = 0; i < a.length; i++) {\\n\\t\\t\\t\\tmin[pow + i] = a[i];\\n\\t\\t\\t}\\n\\t\\t\\tfor (int i = pow - 1; i > 0; i--) {\\n\\t\\t\\t\\tmin[i] = f(min[2 * i], min[2 * i + 1]);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tpublic long get(int l, int r) {\\n\\t\\t\\treturn get(1, 0, pow, l, r);\\n\\t\\t}\\n\\n\\t\\tprivate long get(int v, int tl, int tr, int l, int r) {\\n\\t\\t\\tpush(v, tl, tr);\\n\\t\\t\\tif (l >= tr || r <= tl) {\\n\\t\\t\\t\\treturn Long.MAX_VALUE \\/ 2;\\n\\t\\t\\t}\\n\\t\\t\\tif (l <= tl && r >= tr) {\\n\\t\\t\\t\\treturn min[v];\\n\\t\\t\\t}\\n\\t\\t\\tint tm = (tl + tr) \\/ 2;\\n\\t\\t\\treturn f(get(2 * v, tl, tm, l, r), get(2 * v + 1, tm, tr, l, r));\\n\\t\\t}\\n\\n\\t\\tpublic void set(int l, int r, long x) {\\n\\t\\t\\tset(1, 0, pow, l, r, x);\\n\\t\\t}\\n\\n\\t\\tprivate void set(int v, int tl, int tr, int l, int r, long x) {\\n\\t\\t\\tpush(v, tl, tr);\\n\\t\\t\\tif (l >= tr || r <= tl) {\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tif (l <= tl && r >= tr) {\\n\\t\\t\\t\\tdelta[v] += x;\\n\\t\\t\\t\\tflag[v] = true;\\n\\t\\t\\t\\tpush(v, tl, tr);\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tint tm = (tl + tr) \\/ 2;\\n\\t\\t\\tset(2 * v, tl, tm, l, r, x);\\n\\t\\t\\tset(2 * v + 1, tm, tr, l, r, x);\\n\\t\\t\\tmin[v] = f(min[2 * v], min[2... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\npublic class Main\\n{\\n\\tpublic static void main(String[] args) throws Exception\\n\\t{\\n\\t BufferedReader br=new BufferedReader(new InputStreamReader(System.in));\\n\\t int n=Integer.parseInt(br.readLine());\\n\\t String s=br.readLine();\\n\\t String ss[]=s.split(\\\" \\\");\\n\\t int arr[]=new int[n];\\n\\t for(int i=0;i list = new ArrayList<>();\\n if (months >= 2) {\\n a = 2;\\n long c = months;\\n\\n while (c > 1) {\\n if (c % 2 == 1) {\\n count++;\\n list.add(a);\\n }\\n c = c \\/ 2;\\n\\n a = (a * a) % modulo;\\n }\\n while (count > 0) {\\n long b = list.get(0);\\n list.remove(0);\\n a = (a * b) % modulo;\\n count--;\\n }\\n\\n } else {\\n a = (long) Math.pow(2, months);\\n }\\n\\n\\n long b = clothes;\\n\\n \\/\\/System.out.println(b);\\n b = (2 * b - 1) % modulo;\\n ans = (a * b) % modulo;\\n ans = (ans + 1) % modulo;\\n }else{\\n ans = 0;\\n }\\n\\n }\\n}\\n Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in Actual solution is at the top\\n *\\n * @author MaxHeap\\n *\\/\\npublic class Main {\\n\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n CBanhMi solver = new CBanhMi();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class CBanhMi {\\n\\n long mod = (long) (1e9 + 7);\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int q = in.nextInt();\\n long[] two = new long[n + 1];\\n two[0] = 1;\\n for (int i = 1; i <= n; ++i) {\\n two[i] = (two[i - 1] * 2L);\\n two[i] %= mod;\\n }\\n\\n char[] s = in.nextCharArray();\\n int[] acc = new int[n + 1];\\n for (int i = 1; i <= n; ++i) {\\n acc[i] = s[i - 1] == '0' ? 0 : 1;\\n acc[i] += acc[i - 1];\\n }\\n \\/\\/ 0 0 1 1 | 1: 1 1 2| 2: 2 3| 4: 5| 9\\n \\/\\/ 0 1 1 1| 1: 1 2 2| 2: 3 3| 5: 6| 11\\n \\/\\/ 0 1 1 wwqwq| 1: 1 2 2| 3: 5 3| 8: 8| 16\\n \\/\\/ 0 0 1 1| 1: 1 1 2| 3: 3 3| 6: 6| 12\\n \\/\\/ 0 0 0 1| 1: 1 1 1| 2: 2 2| 4: 4| 8\\n while (q-- > 0) {\\n int f = in.nextInt();\\n int t = in.nextInt();\\n int ones = acc[t] - acc[f - 1];\\n int zeros = (t - f + 1) - ones;\\n if (ones == 0) {\\n out.println(0);\\n } else {\\n long ans = two[t - f + 1] - (zeros > 0 ? two[zeros] : 0);\\n if (zeros == 0) {\\n --ans;\\n }\\n ans = (ans + mod) % mod;\\n out.println(ans);\\n }\\n }\\n }\\n\\n }\\n\\n static class InputReader implements FastIO {\\n\\n private InputStream stream;\\n private static final int DEFAULT_BUFFER_SIZE = 1 << 16;\\n private static final int EOF = -1;\\n ... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStreamWriter;\\nimport java.io.BufferedWriter;\\nimport java.util.Comparator;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.Writer;\\nimport java.io.IOException;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.math.BigInteger;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Egor Kulikov (egor@egork.net)\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskA solver = new TaskA();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n}\\n\\nclass TaskA {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int count = in.readInt();\\n int[] array = IOUtils.readIntArray(in, count);\\n int[] sorted = array.clone();\\n ArrayUtils.sort(sorted, IntComparator.DEFAULT);\\n int differs = 0;\\n for (int i = 0; i < count; i++) {\\n if (array[i] != sorted[i])\\n differs++;\\n }\\n if (differs <= 2)\\n out.printLine(\\\"YES\\\");\\n else\\n out.printLine(\\\"NO\\\");\\n }\\n}\\n\\nclass InputReader {\\n\\n private InputStream stream;\\n private byte[] buf = new byte[1024];\\n private int curChar;\\n private int numChars;\\n private SpaceCharFilter filter;\\n\\n public InputReader(InputStream stream) {\\n this.stream = stream;\\n }\\n\\n public int read() {\\n if (numChars == -1)\\n throw new InputMismatchException();\\n if (curChar >= numChars) {\\n curChar = 0;\\n try {\\n numChars = stream.read(buf);\\n } catch (IOException e) {\\n throw new InputMismatchException();\\n }\\n if (numChars <= 0)\\n return -1;\\n }\\n return buf[curChar++];\\n }\\n\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.awt.Point;\\nimport java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class C {\\n\\n\\tstatic StringBuilder st = new StringBuilder();\\n\\n\\t\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tScanner sc = new Scanner(System.in);\\n\\t\\tPrintWriter out = new PrintWriter(System.out);\\n\\n\\t\\tPoint [] square = new Point [4] ; \\n\\t\\tPoint [] rotSquare = new Point[4] ; \\n\\t\\t\\n\\t\\tfor(int i = 0 ; i < 4 ;i++)\\n\\t\\t\\tsquare[i] = new Point(sc.nextInt() , sc.nextInt());\\n\\t\\t\\n\\t\\tfor(int i = 0 ; i < 4 ;i++)\\n\\t\\t\\trotSquare[i] = new Point(sc.nextInt() , sc.nextInt());\\n\\t\\t\\n\\t\\tboolean can = false ; \\n\\t\\t\\n\\t\\tfor(int x = -100 ; x <= 100 ; x++)\\n\\t\\t\\tfor(int y = -100 ; y <= 100 ; y++)\\n\\t\\t\\t\\tcan |= inside(new Point(x , y), square) & inside(new Point (x , y), rotSquare);\\n\\t\\t\\t\\t\\n\\t\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\tout.println(can ? \\\"YES\\\" : \\\"NO\\\");\\n\\t\\t\\n\\t\\tout.flush();\\n\\t\\tout.close();\\n\\n\\t}\\n\\tstatic int crossProduct(Point a , Point b)\\n\\t{\\n\\t\\tint ans = a.x * b.y - a.y * b.x ; \\n\\t\\t\\n\\t\\tif(ans < 0)return -1 ;\\n\\t\\tif(ans == 0) return 0 ;\\n\\t\\treturn 1 ; \\n\\t}\\n\\t\\n\\tstatic boolean inside(Point a , Point [] points)\\n\\t{\\n\\t\\tboolean allPos = true ; \\n\\t\\tboolean allNeg = true ; \\n\\t\\t\\n\\t\\tfor(int i = 0 ; i < 4 ; i++)\\n\\t\\t{\\n\\t\\t\\tPoint v1 = new Point (points[i].x - a.x , points[i].y - a.y) ; \\n\\t\\t\\tPoint v2 = new Point (points[(i + 1) % 4].x - a.x , points[(i + 1) % 4].y - a.y) ; \\n\\t\\t\\t\\n\\t\\t\\tallPos &= crossProduct(v1, v2) >= 0;\\n\\t\\t\\tallNeg &= crossProduct(v1, v2) <= 0;\\n\\t\\t}\\n\\t\\treturn allPos | allNeg ; \\n\\t\\t\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\t\\tBufferedReader br;\\n\\t\\tStringTokenizer st;\\n\\n\\t\\tScanner(InputStream in) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\n\\t\\tString next() throws Exception {\\n\\t\\t\\twhile (st == null || !st.hasMoreTokens())\\n\\t\\t\\t\\tst = new StringTokenizer(br.readLine());\\n\\n\\t\\t\\treturn st.nextToken();\\n\\t\\t}\\n\\n\\t\\tint nextInt() throws Exception {\\n\\t\\t\\treturn Integer.parseInt(next());\\n\\t\\t}\\n\\n\\t\\tlong nextLong() throws Exception {\\n\\t\\t\\treturn Long.parseLong(next());\\n\\t\\t}\\n\\n\\t\\tdouble nextDouble() throws Exception {\\n\\t\\t\\treturn Double.parseDouble(next());\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic void shuffle(int[] a) {\\n\\t\\tint n = a.length;\\n\\t\\tfor (int i =... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main {\\n\\n\\tstatic class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner() {\\n try {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n st = new StringTokenizer(br.readLine());\\n } catch (Exception e){e.printStackTrace();}\\n }\\n\\n public String next() {\\n if (st.hasMoreTokens()) return st.nextToken();\\n try {st = new StringTokenizer(br.readLine());}\\n catch (Exception e) {e.printStackTrace();}\\n return st.nextToken();\\n }\\n\\n public int nextInt() {return Integer.parseInt(next());}\\n\\n public long nextLong() {return Long.parseLong(next());}\\n\\n public double nextDouble() {return Double.parseDouble(next());}\\n\\n public String nextLine() {\\n String line = \\\"\\\";\\n if(st.hasMoreTokens()) line = st.nextToken();\\n else try {return br.readLine();}catch(IOException e){e.printStackTrace();}\\n while(st.hasMoreTokens()) line += \\\" \\\"+st.nextToken();\\n return line;\\n }\\n }\\n public static void main(String[] args) {\\n FastScanner sc = new FastScanner();\\n PrintWriter pw = new PrintWriter(System.out);\\n\\n int n = sc.nextInt();\\n int best = 1;\\n int bestTime = Integer.MAX_VALUE;\\n for(int i=0;i 2;\\n\\n out.println(!fail ? \\\"YES\\\" : \\\"NO\\\");\\n }\\n\\n public static void main(String[] args) {\\n new A().run();\\n }\\n\\n public void run() {\\n try {\\n in = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(System.out);\\n\\n rnd = new Random();\\n\\n solve();\\n\\n out.close();\\n } catch (IOException e) {\\n e.printStackTrace();\\n System.exit(42);\\n }\\n }\\n\\n String nextToken() throws IOException {\\n while (st == null || !st.hasMoreTokens()) {\\n String line = in.readLine();\\n\\n if (line == null)\\n return null;\\n\\n st = new StringTokenizer(line);\\n }\\n\\n return st.nextToken();\\n }\\n\\n int nextInt() throws IOException {\\n return Integer.parseInt(nextToken());\\n }\\n\\n long nextLong() throws IOException {\\n return Long.parseLong(nextToken());\\n }\\n\\n double nextDouble() throws IOException {\\n return Double.parseDouble(nextToken());\\n }\\n} What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\npublic class C {\\n\\t\\n\\tpublic static void main(String[] args) {\\n\\t\\tScanner qwe = new Scanner(System.in);\\n\\t\\tint n = qwe.nextInt();\\n\\t\\tdouble r = qwe.nextDouble();\\n\\t\\t\\n\\t\\tdouble[] fy = new double[n];\\n\\t\\tArrays.fill(fy, r);\\n\\t\\t\\n\\t\\tdouble[] xs = new double[n];\\n\\t\\tfor (int i = 0; i < xs.length; i++) {\\n\\t\\t\\txs[i] = qwe.nextDouble();\\n\\t\\t}\\n\\t\\t\\n\\t\\tfor(int i =0; i < n; i++){\\n\\t\\t\\t\\n\\t\\t\\tfor(int j = i+1; j < n; j++){\\n\\t\\t\\t\\tdouble dx = xs[j]-xs[i];\\n\\t\\t\\t\\tif(Math.abs(dx) > 2*r) continue;\\n\\t\\t\\t\\tfy[j] = Math.max(fy[j], Math.sqrt(4*r*r-dx*dx)+fy[i]);\\n\\t\\t\\t}\\n\\t\\t\\t\\n\\t\\t}\\n\\t\\t\\n\\t\\tStringBuilder stb = new StringBuilder();\\n\\t\\tfor (int i = 0; i < xs.length; i++) {\\n\\t\\t\\tstb.append(fy[i]+\\\" \\\");\\n\\t\\t}\\n\\t\\tSystem.out.println(stb);\\n\\t}\\n\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.util.Scanner;\\n\\n\\npublic class A {\\n public static void main(String[] args) {\\n \\n Scanner in = new Scanner(System.in);\\n \\n long l = in.nextLong();\\n long r = in.nextLong();\\n \\n if(r-l < 2 ){\\n System.out.println(\\\"-1\\\");\\n }\\n \\n else if(r-l == 2 && l %2 ==1){\\n System.out.println(\\\"-1\\\");\\n }\\n else{\\n \\n \\n if(l%2 == 0){\\n System.out.println(l+ \\\" \\\"+(l+1)+\\\" \\\"+(l+2));\\n \\n }\\n else{\\n System.out.println((l+1)+ \\\" \\\"+(l+2)+\\\" \\\"+(l+3));\\n }\\n }\\n \\n }\\n }\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\n\\npublic class p3sol{\\n\\n\\tstatic char[] c;\\n\\tstatic int[][] dp;\\n\\tstatic int mod = (int)1e9 + 7;\\n\\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\n\\t\\tint n = Integer.parseInt(br.readLine());\\n\\t\\tc = new char[n];\\n\\n\\t\\tfor(int i = 0; i < n; i++)\\n\\t\\t\\tc[i] = br.readLine().charAt(0);\\n\\n\\t\\tdp = new int[n + 1][n + 1];\\n\\n\\t\\tdp[0][0] = 1;\\n\\n\\t\\tfor(int i = 0; i < n - 1; i++){\\n\\t\\t\\tif(c[i] == 's'){\\n\\t\\t\\t\\tint prev = 0;\\n\\t\\t\\t\\tfor(int j = i; j >= 0; j--){\\n\\t\\t\\t\\t\\tprev += dp[i][j];\\n\\t\\t\\t\\t\\tprev %= mod;\\n\\t\\t\\t\\t\\tdp[i + 1][j] += prev;\\n\\t\\t\\t\\t\\tdp[i + 1][j] %= mod;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t\\telse{\\n\\t\\t\\t\\tfor(int j = 1; j <= n; j++){\\n\\t\\t\\t\\t\\tdp[i + 1][j] += dp[i][j - 1];\\n\\t\\t\\t\\t\\tdp[i + 1][j] %= mod;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\tint ans = 0;\\n\\t\\tfor(int i = 0; i < n; i++){\\n\\t\\t\\tans += dp[n - 1][i];\\n\\t\\t\\tans %= mod;\\n\\t\\t}\\n\\n\\t\\t\\/\\/ print(dp);\\n\\n\\t\\tSystem.out.println(ans);\\n\\t\\t\\n\\t\\tbr.close();\\n\\t}\\n\\n\\tpublic static void print(int[][] a){\\n\\t\\tfor(int i = 0; i < a.length; i++){\\n\\t\\t\\tfor(int j = 0; j < a[0].length; j++)\\n\\t\\t\\t\\tSystem.out.print(a[i][j] + \\\" \\\");\\n\\t\\t\\tSystem.out.println(\\\"\\\");\\n\\t\\t}\\n\\t}\\n\\n} Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\nimport static java.lang.Math.*;\\n\\n\\npublic class Main {\\n FastScanner in;\\n PrintWriter out;\\n\\n static final String FILE = \\\"\\\";\\n\\n public void solve() {\\n out.print(25);\\n }\\n\\n public void run() {\\n if (FILE.equals(\\\"\\\")) {\\n in = new FastScanner(System.in);\\n out = new PrintWriter(System.out);\\n } else {\\n try {\\n in = new FastScanner(new FileInputStream(FILE +\\n \\\".in\\\"));\\n out = new PrintWriter(new FileOutputStream(FILE +\\n \\\".out\\\"));\\n } catch (FileNotFoundException e) {\\n e.printStackTrace();\\n }\\n }\\n solve();\\n out.close();\\n }\\n\\n public static void main(String[] args) {\\n (new Main()).run();\\n }\\n\\n class FastScanner {\\n BufferedReader br;\\n StringTokenizer st;\\n\\n public FastScanner(InputStream is) {\\n br = new BufferedReader(new InputStreamReader(is));\\n }\\n\\n public String next() {\\n while (st == null || !st.hasMoreTokens()) {\\n try {\\n st = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return st.nextToken();\\n }\\n\\n public String nextLine() {\\n st = null;\\n try {\\n return br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n return \\\"\\\";\\n }\\n }\\n\\n public int nextInt() {\\n return Integer.parseInt(next());\\n }\\n\\n public long nextLong() {\\n return Long.parseLong(next());\\n }\\n\\n public double nextDouble() {\\n return Double.parseDouble(next());\\n }\\n\\n public float nextFloat() {\\n return Float.parseFloat(next());\\n }\\n }\\n\\n class Pair, B extends Comparable>\\n ... Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. \\nimport java.io.*;\\nimport java.util.*;\\nimport java.lang.*;\\nimport java.math.*;\\n\\nimport static java.lang.Math.*;\\n\\npublic class Solution implements Runnable {\\n\\n\\tpublic long gcd(long a, long b) {\\n\\t\\tlong tmp;\\n\\t\\twhile (b > 0) {\\n\\t\\t\\ta %= b;\\n\\t\\t\\ttmp = a;\\n\\t\\t\\ta = b;\\n\\t\\t\\tb = tmp;\\n\\t\\t}\\n\\t\\treturn a;\\n\\t}\\n\\t\\n\\tpublic void solve() throws Exception {\\n\\t\\tlong a = sc.nextLong();\\n\\t\\tlong b = sc.nextLong();\\n\\t\\tlong ans = 0;\\n\\t\\tlong k = 0;\\n\\t\\tif (a == 1 || b == 1) {\\n\\t\\t\\tout.println(max(a, b));\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\twhile (a > 1 && b > 1) {\\n\\t\\t\\tif (a > b) {\\n\\t\\t\\t\\tk = a \\/ b;\\n\\t\\t\\t\\tans += k;\\n\\t\\t\\t\\ta -= (k * b);\\t\\t\\t\\t\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tk = b \\/ a;\\n\\t\\t\\t\\tans += k;\\n\\t\\t\\t\\tb -= (k * a);\\n\\t\\t\\t}\\n\\t\\t\\tk = gcd(a, b);\\n\\t\\t\\ta \\/= k;\\n\\t\\t\\tb \\/= k;\\n\\t\\t}\\n\\t\\tif (a == 1)\\n\\t\\t\\tans += b;\\n\\t\\telse\\n\\t\\t\\tans += a;\\n\\t\\tout.println(ans);\\n\\t}\\n\\t\\n\\tstatic Throwable throwable;\\n\\t\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tFastScanner sc;\\n\\t\\n\\tpublic static void main(String[] args) throws Throwable {\\n\\t\\tThread thread = new Thread(null, new Solution(), \\\"\\\", (1 << 26));\\n\\t\\tthread.start();\\n\\t\\tthread.join();\\n\\t\\tif (throwable != null) {\\n\\t\\t\\tthrow throwable;\\n\\t\\t}\\n\\t}\\n\\t\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\tsc = new FastScanner(in);\\n\\t\\t\\tsolve();\\n\\t\\t} catch (Throwable throwable) {\\n\\t\\t\\tthis.throwable = throwable;\\t\\t\\t\\n\\t\\t} finally {\\n\\t\\t\\tout.close();\\n\\t\\t}\\t\\t\\n\\t}\\n\\n}\\n\\nclass FastScanner {\\n\\tBufferedReader reader;\\n\\tStringTokenizer strTok;\\n\\t\\n\\tpublic FastScanner(BufferedReader reader) {\\n\\t\\tthis.reader = reader;\\n\\t}\\n\\t\\n\\tpublic String nextToken() throws Exception {\\n\\t\\twhile (strTok == null || !strTok.hasMoreTokens()) {\\n\\t\\t\\tstrTok = new StringTokenizer(reader.readLine());\\n\\t\\t}\\n\\t\\treturn strTok.nextToken();\\n\\t}\\n\\t\\n\\tpublic int nextInt() throws Exception {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\t\\n\\tpublic long nextLong() throws Exception {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\t\\n\\tpublic double nextDouble() throws Exception {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n}\\n Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\n\\npublic class p343a\\n{\\n public static void main(String args[])\\n {\\n Scanner sc = new Scanner(System.in);\\n System.out.println();\\n long a = sc.nextLong();\\n long b = sc.nextLong();\\n if(a==b) System.out.println(\\\"1\\\");\\n else if(b==1) System.out.println(a);\\n else if(a==1) System.out.println(b);\\n else if(a>b) System.out.println(count(a,b));\\n else System.out.println(count(b,a));\\n }\\n\\n public static long count(long a,long b)\\n {\\n long count = 0;\\n while(b!=1)\\n {\\n long c = a\\/b;\\n count += c;\\n long d = a-(c*b);\\n a = b;\\n b = d;\\n if(b==1)\\n {\\n count += a;\\n break;\\n }\\n }\\n return count;\\n }\\n} Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\n\\npublic class Watermelon {\\n static int[][] ans;static int n,m;static boolean[][] vis;\\n public static void main(String[] args) throws IOException {\\n Scanner sc=new Scanner(new File(\\\"input.txt\\\"));\\n\\/\\/ Scanner sc=new Scanner(System.in);\\n PrintWriter pw=new PrintWriter(\\\"output.txt\\\");\\n int n=sc.nextInt(),m=sc.nextInt(),k=sc.nextInt();\\n Queue pq=new ArrayDeque<>();\\n boolean[] vis=new boolean[n*m];\\n for(int i=0;i=0&&!vis[x-m]){\\n pq.add(x-m);\\n vis[x-m]=true;\\n }\\n if(x+1=0&&!vis[x-m]){\\n pq.add(x-m);\\n vis[x-m]=true;\\n }\\n if(x-1>=0&&!vis[x-1]){\\n pq.add(x-1);\\n vis[x-1]=true;\\n }\\n }\\n else{\\n if(x+m=0&&!vis[x-m]){\\n pq.add(x-m);\\n vis[x-m]=true;\\n }\\n if(x-1>=0&&!vis[x-1]){\\n pq.add(x-1);\\n vis[x-1]=true;\\n }\\n ... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\npublic class G {\\n static int n,t;\\n static int[]a;\\n static int[]g;\\n static long[][][]dp;\\n static final long MOD=1000000007;\\n public static void main(String[]args){\\n Scanner sc=new Scanner(System.in);\\n n=sc.nextInt();\\n t=sc.nextInt();\\n a=new int[n];\\n g=new int[n];\\n for(int i=0;i= MOD ? a - MOD : a;\\n }\\n\\n @SuppressWarnings(\\\"unchecked\\\")\\n void solve() throws IOException {\\n final int n = nextInt();\\n int m = nextInt();\\n int[] from = new int[m];\\n int[] to = new int[m];\\n for(int i = 0; i < m; i++) {\\n from[i] = nextInt();\\n to[i] = nextInt();\\n }\\n int ans = solve(n, m, from, to);\\n writer.println(ans);\\n writer.close();\\n }\\n\\n private int solve(final int n, int m, int[] from, int[] to) {\\n final List> g = new ArrayList<>();\\n final List> rg = new ArrayList<>();\\n for(int i = 0; i <= n; i++) {\\n g.add(new ArrayList());\\n rg.add(new ArrayList());\\n }\\n int[] c = new int[n + 1];\\n int[] loop = new int[n + 1];\\n for(int i = 0; i < m; i++) {\\n int u = from[i];\\n int v = to[i];\\n g.get(u).add(v);\\n rg.get(v).add(u);\\n c[u]++;\\n c[v]++;\\n if(u == v) {\\n loop[u]++;\\n }\\n }\\n class Utils {\\n int[] prev = new int[n + 1];\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.lang.*;\\nimport java.math.BigInteger;\\nimport java.io.*;\\nimport java.util.*;\\n\\npublic class Solution implements Runnable{\\n public static BufferedReader br;\\n public static PrintWriter out;\\n public static StringTokenizer stk;\\n public static boolean isStream = true;\\n\\n public static void main(String[] args) throws IOException {\\n \\tif (isStream) {\\n br = new BufferedReader(new InputStreamReader(System.in));\\n } else {\\n br = new BufferedReader(new FileReader(\\\"in.txt\\\"));\\n }\\n out = new PrintWriter(System.out);\\n new Thread(new Solution()).start();\\n }\\n\\n public void loadLine() {\\n try {\\n stk = new StringTokenizer(br.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n\\n public String nextLine() {\\n try {\\n return br.readLine();\\n } catch (IOException e) {\\n e.printStackTrace();\\n return \\\"\\\";\\n }\\n }\\n\\n public String nextWord() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return stk.nextToken();\\n }\\n\\n public Integer nextInt() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return Integer.valueOf(stk.nextToken());\\n }\\n\\n public Long nextLong() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return Long.valueOf(stk.nextToken());\\n }\\n\\n public Double nextDouble() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return Double.valueOf(stk.nextToken());\\n }\\n \\n public Float nextFloat() {\\n while (stk==null||!stk.hasMoreTokens()) loadLine();\\n return Float.valueOf(stk.nextToken());\\n }\\n \\n public void run() {\\n \\tint n = nextInt();\\n \\tint[] arr = new int[n];\\n \\tfor (int i = 0; i < n;i++) {\\n \\t\\tarr[i] = nextInt();\\n \\t}\\n \\tArrays.sort(arr);\\n \\tif (arr[n-1] != 1) arr[n-1] = 1;\\n \\telse arr[n-1] = 2;\\n \\tArrays.sort(arr);\\n \\tfor (int i = 0; i < n; i++) {\\n \\t\\tout.print(arr[i]+\\\" \\\");\\n \\t}\\n ... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStreamWriter;\\nimport java.io.BufferedWriter;\\nimport java.util.Locale;\\nimport java.io.OutputStream;\\nimport java.util.RandomAccess;\\nimport java.io.PrintWriter;\\nimport java.util.AbstractList;\\nimport java.io.Writer;\\nimport java.util.List;\\nimport java.util.Map;\\nimport java.io.IOException;\\nimport java.math.BigDecimal;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.util.TreeMap;\\nimport java.math.BigInteger;\\nimport java.util.Collections;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Jacob Jiang\\n *\\/\\npublic class Main {\\n\\tpublic static void main(String[] args) {\\n\\t\\tInputStream inputStream = System.in;\\n\\t\\tOutputStream outputStream = System.out;\\n\\t\\tInputReader in = new InputReader(inputStream);\\n\\t\\tOutputWriter out = new OutputWriter(outputStream);\\n\\t\\tTaskA solver = new TaskA();\\n\\t\\tsolver.solve(1, in, out);\\n\\t\\tout.close();\\n\\t}\\n}\\n\\nclass TaskA {\\n public void solve(int testNumber, InputReader in, OutputWriter out) {\\n int n = in.nextInt();\\n long k = in.nextInt();\\n if (k == 1) {\\n out.println(n);\\n return;\\n }\\n long[] a = in.nextLongArray(n);\\n ArrayUtils.safeSort(a);\\n Map map = new TreeMap();\\n for (int i = 0; i < n; i++) {\\n map.put(a[i], i);\\n }\\n int answer = 0;\\n boolean[] visited = new boolean[n];\\n for (int i = 0; i < n; i++) {\\n if (!visited[i]) {\\n visited[i] = true;\\n int count = 1;\\n long cur = a[i];\\n while (true) {\\n cur *= k;\\n Integer index = map.get(cur);\\n if (index == null)\\n break;\\n visited[index] = true;\\n count++;\\n }\\n answer += NumberUtils.upDiv(count, 2);\\n }\\n }\\n out.println(answer);\\n }\\n}\\n\\nclass InputReader {\\n\\n private InputStream... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.InputStreamReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\n\\npublic class Task343A {\\n\\n\\tpublic static void main(String... args) throws NumberFormatException,\\n\\t\\t\\tIOException {\\n\\t\\tSolution.main(System.in, System.out);\\n\\t}\\n\\n\\tstatic class Scanner {\\n\\n\\t\\tprivate final BufferedReader br;\\n\\t\\tprivate String[] cache;\\n\\t\\tprivate int cacheIndex;\\n\\n\\t\\tScanner(InputStream is) {\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(is));\\n\\t\\t\\tcache = new String[0];\\n\\t\\t\\tcacheIndex = 0;\\n\\t\\t}\\n\\n\\t\\tint nextInt() throws IOException {\\n\\t\\t\\tif (cacheIndex >= cache.length) {\\n\\t\\t\\t\\tcache = br.readLine().split(\\\" \\\");\\n\\t\\t\\t\\tcacheIndex = 0;\\n\\t\\t\\t}\\n\\t\\t\\treturn Integer.parseInt(cache[cacheIndex++]);\\n\\t\\t}\\n\\n\\t\\tlong nextLong() throws IOException {\\n\\t\\t\\tif (cacheIndex >= cache.length) {\\n\\t\\t\\t\\tcache = br.readLine().split(\\\" \\\");\\n\\t\\t\\t\\tcacheIndex = 0;\\n\\t\\t\\t}\\n\\t\\t\\treturn Long.parseLong(cache[cacheIndex++]);\\n\\t\\t}\\n\\n\\t\\tString next() throws IOException {\\n\\t\\t\\tif (cacheIndex >= cache.length) {\\n\\t\\t\\t\\tcache = br.readLine().split(\\\" \\\");\\n\\t\\t\\t\\tcacheIndex = 0;\\n\\t\\t\\t}\\n\\t\\t\\treturn cache[cacheIndex++];\\n\\t\\t}\\n\\n\\t\\tvoid close() throws IOException {\\n\\t\\t\\tbr.close();\\n\\t\\t}\\n\\n\\t}\\n\\n\\tstatic class Solution {\\n\\n\\t\\tprivate static long r(long a, long b) {\\n\\t\\t\\tif (a == 0 || b == 0) {\\n\\t\\t\\t\\treturn 0;\\n\\t\\t\\t}\\n\\t\\t\\tif (a > b) {\\n\\t\\t\\t\\treturn a \\/ b + r(b, a % b);\\n\\t\\t\\t}\\n\\t\\t\\treturn b \\/ a + r(a, b % a);\\n\\t\\t}\\n\\n\\t\\tpublic static void main(InputStream is, OutputStream os)\\n\\t\\t\\t\\tthrows NumberFormatException, IOException {\\n\\t\\t\\tPrintWriter pw = new PrintWriter(os);\\n\\t\\t\\tScanner sc = new Scanner(is);\\n\\n\\t\\t\\tlong a = sc.nextLong();\\n\\t\\t\\tlong b = sc.nextLong();\\n\\n\\t\\t\\tpw.println(r(a, b));\\n\\n\\t\\t\\tpw.flush();\\n\\t\\t\\tsc.close();\\n\\t\\t}\\n\\t}\\n\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n\\n\\tBufferedReader in;\\n\\tStringTokenizer str = null;\\n\\t\\n\\tprivate String next() throws Exception{\\n\\t\\tif (str == null || !str.hasMoreElements())\\n\\t\\t\\tstr = new StringTokenizer(in.readLine());\\n\\t\\treturn str.nextToken();\\n\\t}\\n\\t\\n\\tprivate int nextInt() throws Exception{\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\t\\n\\tprivate long nextLong() throws Exception{\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\t\\n\\tprivate double nextDouble() throws Exception{\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\t\\n\\tpublic void run() throws Exception{\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tlong l = nextLong();\\n\\t\\tlong r = nextLong();\\n\\n\\t\\tint bit = 63;\\n\\t\\twhile(bit >= 0 && (hasBit(l, bit) == hasBit(r, bit))) {\\n\\t\\t\\tbit--;\\n\\t\\t}\\n\\t\\tSystem.out.println((1L< 0;\\n\\t}\\n\\t\\t\\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tnew Main().run();\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.Scanner;\\nimport java.util.HashMap;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Rene\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n Scanner in = new Scanner(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskC solver = new TaskC();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskC {\\n public void solve(int testNumber, Scanner in, PrintWriter out) {\\n int n = in.nextInt();\\n String s = in.next();\\n HashMap indexMap = new HashMap<>();\\n for (int i = 0; i < n; i++) {\\n char c = s.charAt(i);\\n if (!indexMap.containsKey(c)) {\\n indexMap.put(c, indexMap.size());\\n }\\n }\\n int[] last = new int[indexMap.size()];\\n Arrays.fill(last, -1_000_000);\\n int answer = n;\\n for (int i = 0; i < n; i++) {\\n int index = indexMap.get(s.charAt(i));\\n last[index] = i;\\n int first = i;\\n for (int a : last) first = Math.min(first, a);\\n int visits = i - first + 1;\\n answer = Math.min(answer, visits);\\n }\\n out.println(answer);\\n }\\n\\n }\\n}\\n\\n Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.InputStreamReader;\\nimport java.util.ArrayList;\\nimport java.util.Arrays;\\nimport java.util.Collections;\\n\\npublic class CF1141F {\\n\\tpublic static void main(String[] args) throws Exception {\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tint n = Integer.parseInt(br.readLine());\\n\\t\\tString[] split = br.readLine().split(\\\" \\\");\\n\\t\\tint[] terms = new int[n];\\n\\t\\tint[] sums = new int[n+1];\\n\\t\\tfor(int i=0; i blocks = new ArrayList<>();\\n\\t\\tfor(int i=0; i best = new ArrayList<>();\\n\\t\\tint i = 0;\\n\\t\\twhile(i curBlocks = new ArrayList<>();\\n\\t\\t\\twhile(i=0; j--){\\n\\t\\t\\t\\tint idx = Collections.binarySearch(curBlocks, new Block(curBlocks.get(j).r+1, curBlocks.get(j).r+1, curBlocks.get(j).sum));\\n\\t\\t\\t\\tif(idx<0) idx = -(idx+1);\\n\\t\\t\\t\\tmemo[j] = Math.max(memo[j+1], 1+memo[idx]);\\n\\t\\t\\t}\\n\\t\\t\\tif(memo[0]>best.size()){\\n\\t\\t\\t\\tbest = new ArrayList<>();\\n\\t\\t\\t\\tint idx = 0;\\n\\t\\t\\t\\twhile(memo[idx]>=1){\\n\\t\\t\\t\\t\\tif(memo[idx]>memo[idx+1]) best.add(curBlocks.get(idx));\\n\\t\\t\\t\\t\\tidx++;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tStringBuilder sb = new StringBuilder();\\n\\t\\tsb.append(best.size()).append(\\\"\\\\n\\\");\\n\\t\\tfor(Block b : best){\\n\\t\\t\\tsb.append(b.l+1).append(\\\" \\\").append(b.r+1).append(\\\"\\\\n\\\");\\n\\t\\t}\\n\\t\\tSystem.out.print(sb);\\n\\t}\\n\\t\\n\\tstatic class Block implements Comparable{\\n\\t\\tint l, r, sum;\\n\\t\\t\\n\\t\\tBlock(int a, int b, int c){\\n\\t\\t\\tl = a;\\n\\t\\t\\tr = b;\\n\\t\\t\\tsum = c;\\n\\t\\t}\\n\\n\\t\\t@Override\\n\\t\\tpublic int compareTo(Block o) {\\n\\t\\t\\tif(sum==o.sum){\\n\\t\\t\\t\\tif(l==o.l) return r-o.r;\\n\\t\\t\\t\\treturn l-o.l;\\n\\t\\t\\t}\\n\\t\\t\\treturn sum-o.sum;\\n\\t\\t}\\n\\t}\\n}\\n Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.*;\\nimport java.lang.*;\\nimport static java.lang.Math.*;\\n\\npublic class Main implements Runnable {\\n public static void main(String[] args) {\\n new Thread(null, new Main(), \\\"Check2\\\", 1 << 28).start();\\/\\/ to increse stack size in java\\n }\\n static long mod = (long) (1e9 + 7);\\n public void run() {\\n InputReader in = new InputReader(System.in);\\n PrintWriter w = new PrintWriter(System.out);\\n\\n\\n long n = in.nextLong();\\n long k = in.nextLong();\\n long ans= 0;\\n for (long i=1;i<=Math.min(100000,n);i++){\\n long left = i;\\n long right = n-i;\\n long sum = left * (left + 1);\\n sum \\/= 2;\\n if (sum - right ==k){\\n ans = right;\\n }\\n }\\n w.println(ans);\\n\\n w.close();\\n }\\n void debug(Object...args) {\\n System.out.println(Arrays.deepToString(args));\\n }\\n static class pair implements Comparable{\\n\\n int a;\\n int b;\\n\\n pair(int a,int b){\\n this.a = a;\\n this.b = b;\\n }\\n public int compareTo(pair o){\\n if(this.b != o.b)return this.b - o.b;\\n return this.a - o.a;\\n }\\n\\n }\\n long modinv(long a,long b) {\\n long p=power(b,mod-2,mod);\\n\\n p=a%mod*p%mod;\\n p%=mod;\\n\\n return p;\\n\\n }\\n long power(long x,long y,long mod){\\n if(y==0)return 1%mod;\\n if(y==1)return x%mod;\\n long res=1;\\n x=x%mod;\\n while(y>0)\\n {\\n if((y%2)!=0){\\n res=(res*x)%mod;\\n }\\n y=y\\/2;\\n x=(x*x)%mod;\\n }\\n return res;\\n }\\n long gcd(long a,long b){\\n\\n if(b==0)return a;\\n return gcd(b,a%b);\\n }\\n void sev(int a[],int n){\\n\\n for(int i=2;i<=n;i++)a[i]=i;\\n for(int i=2;i<=n;i++){\\n\\n if(a[i]!=0){\\n for(int j=2*i;j<=n;){\\n\\n a[j]=0;\\n j=j+i;\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.io.Reader;\\nimport java.io.IOException;\\nimport java.util.StringTokenizer;\\n\\/*\\n * @author Tnascimento \\n *\\/\\n\\npublic class MaeDosDragoes {\\n\\tpublic static PrintWriter saida = new PrintWriter(System.out, false);\\n\\tpublic static class Escanear {\\n BufferedReader reader;\\n StringTokenizer tokenizer;\\n\\t\\tpublic Escanear() {\\n this(new InputStreamReader(System.in));\\n }\\n\\t\\tpublic Escanear(Reader in) {\\n reader = new BufferedReader(in);\\n }\\n String proximo() {\\n if (tokenizer == null || !tokenizer.hasMoreElements()) {\\n try {\\n tokenizer = new StringTokenizer(reader.readLine());\\n } catch (IOException e) {\\n e.printStackTrace();\\n }\\n }\\n return tokenizer.nextToken();\\n }\\n \\n int nextInt() {\\n return Integer.parseInt(proximo());\\n }\\n }\\n\\n\\n\\n public static void main(String[] args) {\\n\\t\\tEscanear fastScanner = new Escanear();\\n int proximoInt = fastScanner.nextInt();\\n double proximoDouble = fastScanner.nextInt();\\n long[] graph = new long[proximoInt];\\n for(Integer i = 0; i < proximoInt; i++) {\\n for(Integer j =0; j < proximoInt; j++) {\\n Integer val = fastScanner.nextInt();\\n if (val.equals(1) || i.equals(j)) {\\n\\t\\t\\t\\t graph[i] |= 1L << j;\\n\\t\\t\\t\\t}\\n }\\n }\\n\\n int szLeft = proximoInt\\/2;\\n int szRight = proximoInt - szLeft;\\n\\n int[] dp = new int[1 << szLeft];\\n int maxMask = 1 << szLeft;\\n\\n for(int mask = 1; mask 0) {\\n curMask &= graph[j + szRight] >> szRight;\\n dp[mask] = Math.max(dp[mask], dp[mask ^ (1 << j)]);\\n }\\n }\\n if... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\nimport java.util.stream.*;\\n\\npublic class ProblemF {\\n private static boolean debug = false;\\n\\n private static int N;\\n private static int[] A;\\n\\n private static void solveProblem(InputStream instr) throws Exception {\\n InputReader sc = new InputReader(instr);\\n int testCount = 1;\\n if (debug) {\\n testCount = sc.nextInt();\\n }\\n\\n for (int t = 1; t <= testCount; t++) {\\n printDebug(\\\"------ \\\" + t + \\\" ------\\\");\\n N = sc.nextInt();\\n A = readInts(sc, N);\\n Object result = solveTestCase();\\n System.out.println(result);\\n }\\n }\\n\\n private static Object solveTestCase() {\\n int sum[] = new int[N];\\n sum[0] = A[0];\\n for (int i = 1; i < N; i++) {\\n sum[i] = sum[i - 1] + A[i];\\n }\\n TreeMap> map = new TreeMap<>();\\n for (int i = 0; i < N; i++) {\\n for (int j = i; j < N; j++) {\\n int groupSum = sum[j] - (i == 0 ? 0 : sum[i - 1]);\\n map.putIfAbsent(groupSum, new ArrayList<>());\\n map.get(groupSum).add(new int[]{i, j});\\n }\\n }\\n int max = -1;\\n List maxAnswer = null;\\n for (Map.Entry> entry : map.entrySet()) {\\n List values = entry.getValue();\\n if (values.size() <= max) {\\n continue;\\n }\\n List curr = findMax(values);\\n if (curr.size() > max) {\\n max = curr.size();\\n maxAnswer = curr;\\n\\n }\\n }\\n List answer = new ArrayList<>();\\n for (int[] value : maxAnswer) {\\n answer.add((value[0] + 1) + \\\" \\\" + (value[1] + 1));\\n }\\n return max + \\\"\\\\n\\\" + joinValues(answer, \\\"\\\\n\\\");\\n }\\n\\n private static List findMax(List values) {\\n values.sort(new Comparator() {\\n @Override\\n public int compare(int[] o1,... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.io.BufferedWriter;\\nimport java.io.Writer;\\nimport java.io.OutputStreamWriter;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author Alex\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n OutputWriter out = new OutputWriter(outputStream);\\n TaskB solver = new TaskB();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskB {\\n int n;\\n int startrow;\\n int startcol;\\n long want;\\n\\n boolean check(long time) {\\n long max = (long) 2 * time * (time + 1) + 1;\\n long highest = startrow - time;\\n if(highest < 0) {\\n max -= Math.abs(highest) * Math.abs(highest);\\n }\\n long lowest = startrow + time;\\n if(lowest >= n) {\\n max -= Math.abs(lowest - n + 1) * Math.abs(lowest - n + 1);\\n }\\n long leftmost = startcol - time;\\n if(leftmost < 0) {\\n max -= Math.abs(leftmost) * Math.abs(leftmost);\\n }\\n long rightmost = startcol + time;\\n if(rightmost >= n) {\\n max -= Math.abs(rightmost - n + 1) * Math.abs(rightmost - n + 1);\\n }\\n long upperright = time - (startrow + 1) - (n - startcol);\\n if(upperright >= 0) {\\n max += (upperright + 1) * (upperright + 2) \\/ 2;\\n }\\n long lowerright = time - (n - startrow) - (n - startcol);\\n if(lowerright >= 0) {\\n max += (lowerright + 1) * (lowerright + 2) \\/ 2;\\n }\\n long upperleft = time - (startrow + 1) -... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.FileNotFoundException;\\nimport java.io.FileReader;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.math.BigInteger;\\nimport java.util.Arrays;\\nimport java.util.Comparator;\\nimport java.util.HashMap;\\nimport java.util.LinkedList;\\nimport java.util.Locale;\\nimport java.util.Queue;\\nimport java.util.StringTokenizer;\\nimport java.util.TreeMap;\\nimport java.util.TreeSet;\\n\\npublic class Solution implements Runnable {\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\n\\tString nextToken() throws Exception {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tst = new StringTokenizer(in.readLine());\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws Exception {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tlong nextLong() throws Exception {\\n\\t\\treturn Long.parseLong(nextToken());\\n\\t}\\n\\n\\tdouble nextDouble() throws Exception {\\n\\t\\treturn Double.parseDouble(nextToken());\\n\\t}\\n\\t\\n\\tint fu(int[] a, int l) {\\n\\t\\tfor (int i = l; i < a.length - 1; i++) {\\n\\t\\t\\tif (a[i] > a[i + 1]) return i;\\n\\t\\t}\\n\\t\\treturn a.length;\\n\\t}\\n\\t\\n\\tvoid swap(int[] a, int q, int w) {\\n\\t\\tint t = a[q]; a[q] = a[w]; a[w] = t;\\n\\t}\\n\\t\\n\\tvoid solve() throws Exception {\\n\\t\\tint n = nextInt();\\n\\t\\tint[] a = new int[n];\\n\\t\\tfor (int i = 0; i < n; i++) a[i] = nextInt();\\n\\t\\tint q = fu(a, 0);\\n\\t\\tif (q == n) out.println(\\\"YES\\\"); else {\\n\\t\\t\\tint w = fu(a, q + 1);\\n\\t\\t\\tif (w < n) {\\n\\t\\t\\t\\tboolean ans = false;\\n\\t\\t\\t\\tswap(a, q, w);\\n\\t\\t\\t\\tans |= fu(a, 0) == n;\\n\\t\\t\\t\\tswap(a, q, w);\\n\\t\\t\\t\\tif (q < n - 1) {\\n\\t\\t\\t\\t\\tswap(a, q + 1, w);\\n\\t\\t\\t\\t\\tans |= fu(a, 0) == n;\\n\\t\\t\\t\\t\\tswap(a, q + 1, w);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (w < n - 1) {\\n\\t\\t\\t\\t\\tswap(a, q, w + 1);\\n\\t\\t\\t\\t\\tans |= fu(a, 0) == n;\\n\\t\\t\\t\\t\\tswap(a, q, w + 1);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (q < n - 1 && w < n - 1) {\\n\\t\\t\\t\\t\\tswap(a, q + 1, w + 1);\\n\\t\\t\\t\\t\\tans |= fu(a, 0) == n;\\n\\t\\t\\t\\t\\tswap(a, q + 1, w + 1);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (ans) out.println(\\\"YES\\\"); else out.println(\\\"NO\\\");\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tint j = q + 1;\\n\\t\\t\\t\\twhile (j < n && a[j] == a[q + 1]) j++;\\n\\t\\t\\t\\tj--;\\n\\t\\t\\t\\tswap(a, q, j);\\n\\t\\t\\t\\tif (fu(a, 0) == n) out.println(\\\"YES\\\"); else {\\n\\t\\t\\t\\t\\tswap(a, q, j);\\n\\t\\t\\t\\t\\tq++;\\n\\t\\t\\t\\t\\tj =... What is the time complexity of the previous code?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.BufferedReader;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.Comparator;\\n\\npublic class ProblemA {\\n public static class Team {\\n int solved;\\n int penalty;\\n Team(int s, int p) {\\n solved = s;\\n penalty = p;\\n }\\n }\\n \\n public static void main(String[] args) throws IOException {\\n BufferedReader s = new BufferedReader(new InputStreamReader(System.in));\\n String[] data = s.readLine().split(\\\" \\\");\\n int n = Integer.valueOf(data[0]);\\n int k = Integer.valueOf(data[1]);\\n\\n \\n Team[] t = new Team[n];\\n for (int i = 0 ; i < n ; i++) {\\n String[] line = s.readLine().split(\\\" \\\");\\n t[i] = new Team(Integer.valueOf(line[0]), Integer.valueOf(line[1]));\\n }\\n Arrays.sort(t, new Comparator(){\\n public int compare(Team arg0, Team arg1) {\\n if (arg0.solved != arg1.solved) {\\n return arg1.solved - arg0.solved;\\n }\\n return arg0.penalty - arg1.penalty;\\n }\\n });\\n \\n \\n int idx = k - 1;\\n int ksol = t[idx].solved;\\n int kpen = t[idx].penalty;\\n int count = 0;\\n for (int i = 0 ; i < n ; i++) {\\n if (t[i].solved == ksol && t[i].penalty == kpen) {\\n count++;\\n }\\n }\\n System.out.println(count);\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.Map;\\nimport java.io.InputStreamReader;\\nimport java.io.IOException;\\nimport java.util.TreeMap;\\nimport java.io.BufferedReader;\\nimport java.io.OutputStream;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n * @author Hamed Valizadeh (havaliza@gmail.com)\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n FastInputReader in = new FastInputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskB solver = new TaskB();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n}\\n\\nclass TaskB {\\n int n, a, b;\\n Map position;\\n int[] p;\\n int[] group;\\n\\n public void solve(int testNumber, FastInputReader in, PrintWriter out) {\\n n = in.nextInt();\\n a = in.nextInt();\\n b = in.nextInt();\\n\\n position = new TreeMap();\\n p = new int[n];\\n group = new int[n];\\n\\n for (int i = 0; i < n; i++) {\\n p[i] = in.nextInt();\\n group[i] = -1;\\n position.put(p[i], i);\\n }\\n\\n for (int i = 0; i < n; i++) {\\n if (getMate(i) != -1)\\n continue;\\n out.println(\\\"NO\\\");\\n return;\\n }\\n\\n for (int i = 0; i < n; i++) {\\n boolean aMate = position.containsKey(a - p[i]);\\n boolean bMate = position.containsKey(b - p[i]);\\n if (aMate && bMate)\\n continue;\\n if (group[i] != -1)\\n continue;\\n if (!solve(i)) {\\n out.println(\\\"NO\\\");\\n return;\\n }\\n }\\n\\n for (int i = 0; i < n; i++) {\\n if (group[i] != -1)\\n continue;\\n if (!solve(i)) {\\n out.println(\\\"NO\\\");\\n return;\\n }\\n }\\n\\n ... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\nimport static java.util.Arrays.*;\\nimport static java.lang.Math.*;\\nimport java.math.*;\\n\\npublic class Main { \\n\\n void run() throws IOException {\\n int n = in.nextInt();\\n char[] c = in.next().toCharArray();\\n int[][] t = new int[n][n];\\n int[][] h = new int[n][n];\\n int allt = 0, allh = 0;\\n for (int i = 0; i < n; i++) {\\n if (c[i] == 'T') {\\n allt++;\\n } else {\\n allh++;\\n }\\n }\\n for (int i = 0; i < n; i++) {\\n if (c[i] == 'T') {\\n t[i][i] = 1;\\n h[i][i] = 0;\\n } else {\\n t[i][i] = 0;\\n h[i][i] = 1;\\n }\\n for (int j = i + 1; j < n; j++) {\\n if (c[j] == 'T') {\\n t[i][j] = t[i][j - 1] + 1;\\n h[i][j] = h[i][j - 1];\\n } else {\\n h[i][j] = h[i][j - 1] + 1;\\n t[i][j] = t[i][j - 1];\\n }\\n }\\n }\\n for (int i = 1; i < n; i++) {\\n t[i][i - 1] = allt;\\n h[i][i - 1] = allh;\\n for (int j = 0; j < i - 1; j++) {\\n t[i][j] = allt - t[j + 1][i - 1];\\n h[i][j] = allh - h[j + 1][i - 1];\\n }\\n }\\n int r = Integer.MAX_VALUE;\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) { \\n if (h[i][j] == t[(j + 1) % n][(i - 1 + n) % n]) {\\n r = min(r, h[i][j]);\\n }\\n if (t[i][j] == h[(j + 1) % n][(i - 1 + n) % n]) {\\n r = min(r, t[i][j]);\\n }\\n }\\n }\\n out.println(r);\\n \\/* for (int i = 0; i < n; i++) {\\n for (int j = 0; j < n; j++) {\\n out.print(t[i][j] + \\\" \\\");\\n }\\n out.println();\\n }\\n out.println();\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j <... Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import static java.util.Arrays.*;\\nimport static java.lang.Math.*;\\nimport static java.math.BigInteger.*;\\nimport java.util.*;\\nimport java.math.*;\\nimport java.io.*;\\n\\npublic class A implements Runnable\\n{\\n String file = \\\"input\\\";\\n \\n void init() throws IOException\\n {\\n \\/\\/input = new BufferedReader(new FileReader(file + \\\".in\\\"));\\n input = new BufferedReader(new InputStreamReader(System.in));\\n out = new PrintWriter(new BufferedOutputStream(System.out));\\n }\\n \\n void solve() throws IOException\\n {\\n String s = next();\\n int res = 0;\\n int L = s.length();\\n for(int i = 0; i < L; i++)\\n for(int j = i + 1; j <= L; j++)\\n {\\n String ss = s.substring(i, j);\\n int k = s.indexOf(ss);\\n \\/\\/print(ss, k);\\n if(k >= 0)\\n {\\n if(s.substring(k + 1).indexOf(ss) >= 0) res = max(res, j - i);\\n }\\n }\\n System.out.println(res);\\n }\\n \\n String next() throws IOException\\n {\\n if(st == null || !st.hasMoreTokens()) st = new StringTokenizer(input.readLine());\\n return st.nextToken();\\n }\\n \\n int nextInt() throws IOException\\n {\\n return Integer.parseInt(next());\\n }\\n \\n long nextLong() throws IOException\\n {\\n return Long.parseLong(next());\\n }\\n \\n double nextDouble() throws IOException\\n {\\n return Double.parseDouble(next());\\n }\\n \\n void print(Object... o)\\n {\\n System.out.println(deepToString(o));\\n }\\n \\n void gcj(Object o)\\n {\\n String s = String.valueOf(o);\\n out.println(\\\"Case #\\\" + test + \\\": \\\" + s);\\n System.out.println(\\\"Case #\\\" + test + \\\": \\\" + s);\\n }\\n \\n BufferedReader input;\\n PrintWriter out;\\n StringTokenizer st;\\n int test;\\n \\n public static void main(String[] args) throws IOException\\n {\\n new Thread(null, new A(), \\\"\\\", 1 << 20).start();\\n }\\n \\n public void run()\\n {\\n try\\n {\\n ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"\\/**\\n * @author Juan Sebastian Beltran Rojas\\n * @mail jsbeltran.valhalla@gmail.com\\n * @veredict\\n * @url https:\\/\\/codeforces.com\\/problemset\\/problem\\/1238\\/E\\n * @category dp\\n * @date 19\\/10\\/2019\\n **\\/\\n\\nimport java.io.BufferedReader;\\nimport java.io.InputStreamReader;\\nimport java.util.Arrays;\\nimport java.util.StringTokenizer;\\n\\nimport static java.lang.Integer.bitCount;\\nimport static java.lang.Integer.parseInt;\\n\\npublic class CF1238E {\\n static long[][] Q;\\n static int N;\\n static int M;\\n static long[] mem;\\n static long[] sums;\\n\\n public static void main(String args[]) throws Throwable {\\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\\n for (String ln; (ln = in.readLine()) != null; ) {\\n StringTokenizer st = new StringTokenizer(ln);\\n N = parseInt(st.nextToken());\\n M = parseInt(st.nextToken());\\n char[] S = in.readLine().toCharArray();\\n Q = new long[M][M];\\n mem = new long[1 << M];\\n Arrays.fill(mem, -1);\\n for (int i = 1; i < N; i++)\\n Q[S[i - 1] - 'a'][S[i] - 'a'] = Q[S[i] - 'a'][S[i - 1] - 'a'] = Q[S[i - 1] - 'a'][S[i] - 'a'] + 1;\\n calculateSums();\\n for (int i = (1 << M) - 1; i >= 0; i--)\\n f(i);\\n System.out.println(f(0));\\n }\\n }\\n\\n static void calculateSums() {\\n sums = new long[1 << M];\\n Arrays.fill(sums, -1);\\n for (int u = 0; u < (1 << M); u++) {\\n if (sums[u] == -1) {\\n sums[u] = 0;\\n for (int j = 0; j < M; j++)\\n for (int k = j + 1; k < M; k++)\\n if (((u & (1 << j)) == 0 && (u & (1 << k)) != 0) ||\\n ((u & (1 << j)) != 0 && (u & (1 << k)) == 0))\\n sums[u] += Q[j][k];\\n int neg = (~u) & ((1 << M) - 1);\\n sums[neg] = sums[u];\\n }\\n }\\n }\\n\\n static long f(int u) {\\n if (bitCount(u) == M) return 0;\\n if... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.math.BigInteger;\\nimport java.util.StringTokenizer;\\nimport java.util.function.Function;\\n\\npublic class D {\\n public static void main(String[] args) throws IOException {\\n try (Input input = new StandardInput(); PrintWriter writer = new PrintWriter(System.out)) {\\n long[] s = new long[40];\\n for (int i = 1; i < s.length; i++) {\\n s[i] = 1 + 4 * s[i - 1];\\n if (i >= 32) {\\n s[i] = Long.MAX_VALUE;\\n }\\n }\\n Function getS = (i) -> (i < s.length) ? s[i] : Long.MAX_VALUE;\\n int t = input.nextInt();\\n testCase:\\n for (int tt = 0; tt < t; tt++) {\\n int n = input.nextInt();\\n long k = input.nextLong();\\n long kk = 1;\\n BigInteger maxDivisions = BigInteger.ZERO;\\n for (int division = 1; division <= n; division++) {\\n long needToDivide = (1L << division) - 1;\\n if (needToDivide > k) {\\n writer.println(\\\"NO\\\");\\n continue testCase;\\n }\\n k -= needToDivide;\\n maxDivisions = maxDivisions.add(BigInteger.valueOf(kk).multiply(BigInteger.valueOf(getS.apply(n - division))));\\n if (maxDivisions.compareTo(BigInteger.valueOf(k)) >= 0) {\\n writer.println(\\\"YES \\\" + (n - division));\\n continue testCase;\\n }\\n kk += (1L << division + 1);\\n }\\n writer.println(\\\"NO\\\");\\n }\\n }\\n }\\n\\n interface Input extends Closeable {\\n String next() throws IOException;\\n\\n default int nextInt() throws IOException {\\n return Integer.parseInt(next());\\n }\\n\\n default long nextLong() throws IOException {\\n return Long.parseLong(next());\\n }\\n }\\n\\n private static class StandardInput... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n\\n\\tBufferedReader in;\\n\\tStringTokenizer str = null;\\n\\tPrintWriter out;\\n\\t\\n\\tprivate String next() throws Exception{\\n\\t\\tif (str == null || !str.hasMoreElements())\\n\\t\\t\\tstr = new StringTokenizer(in.readLine());\\n\\t\\treturn str.nextToken();\\n\\t}\\n\\t\\n\\tprivate int nextInt() throws Exception{\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\t\\n\\tprivate long nextLong() throws Exception{\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\t\\n\\tprivate double nextDouble() throws Exception{\\n\\t\\treturn Double.parseDouble(next());\\n\\t}\\n\\t\\n\\tpublic void run() throws Exception{\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out);\\n\\n\\t\\tlong n = nextLong();\\n\\t\\tif (n == 1) {\\n\\t\\t\\tSystem.out.println(0);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\tlong k = nextLong();\\n\\t\\tlong t = 1-(k-1) + k*(k+1)\\/2-1;\\n\\t\\tif (t < n){\\n\\t\\t\\tSystem.out.println(-1);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\n\\t\\tlong l = 0;\\n\\t\\tlong r = k;\\n\\n\\t\\twhile(r - l > 1) {\\n\\t\\t\\tlong m = (r + l)\\/2;\\n\\t\\t\\tlong s = 1 - m + k*(k+1)\\/2 - (k-m)*(k-m+1)\\/2;\\n\\t\\t\\t\\/\\/System.out.println(m + \\\" \\\" + s + \\\" \\\" + n);\\n\\t\\t\\tif (s >= n){\\n\\t\\t\\t\\tr = m;\\n\\t\\t\\t}else{\\n\\t\\t\\t\\tl = m;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(r);\\n\\t\\tout.close();\\n\\t}\\n\\t\\t\\n\\tpublic static void main(String[] args) throws Exception{\\n\\t\\tnew Main().run();\\n\\t}\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class p343a\\n{\\n public static void main(String args[])\\n {\\n Scanner sc = new Scanner(System.in);\\n System.out.println();\\n long a = sc.nextLong();\\n long b = sc.nextLong();\\n if(a==b) System.out.println(\\\"1\\\");\\n else if(b==1) System.out.println(a);\\n else if(a==1) System.out.println(b);\\n else if(a>b) System.out.println(count(a,b));\\n else System.out.println(count(b,a));\\n }\\n\\n public static long count(long a,long b)\\n {\\n long count = 0;\\n while(b!=1)\\n {\\n long c = a\\/b;\\n count += c;\\n long d = a-(c*b);\\n a = b;\\n b = d;\\n if(b==1)\\n {\\n count += a;\\n break;\\n }\\n }\\n return count;\\n }\\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\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.Locale;\\nimport java.util.Scanner;\\n\\npublic class PipelineSolver {\\n\\n private long n;\\n\\n private long k;\\n\\n public static void main(String[] args) {\\n PipelineSolver solver = new PipelineSolver();\\n\\n solver.readData();\\n int solution = solver.solve();\\n solver.print(solution);\\n }\\n\\n private int gcd(int a, int b) {\\n return b == 0 ? a : gcd(b, a % b);\\n }\\n\\n private int lcm(int a, int b) {\\n return a * b \\/ gcd(a, b);\\n }\\n\\n private void print(int[] values) {\\n StringBuilder builder = new StringBuilder();\\n\\n for (int value : values) {\\n builder.append(value);\\n builder.append(\\\" \\\");\\n }\\n\\n print(builder);\\n }\\n\\n private void print(Object value) {\\n System.out.println(value);\\n }\\n\\n private void print(boolean value) {\\n System.out.println(value ? \\\"YES\\\" : \\\"NO\\\");\\n }\\n\\n private void print(int value) {\\n System.out.println(value);\\n }\\n\\n private void print(long value) {\\n System.out.println(value);\\n }\\n\\n private void print(double value) {\\n System.out.printf(Locale.ENGLISH, \\\"%.10f\\\", value);\\n }\\n\\n private int[] getDigits(int number) {\\n int[] digits = new int[10];\\n int index = digits.length - 1;\\n int digitsCount = 0;\\n\\n while (number > 0) {\\n digits[index] = number % 10;\\n number \\/= 10;\\n index--;\\n digitsCount++;\\n }\\n\\n int[] result = new int[digitsCount];\\n\\n System.arraycopy(digits, digits.length - digitsCount, result, 0, digitsCount);\\n\\n return result;\\n }\\n\\n private int[] readArray(Scanner scanner, int size) {\\n int[] result = new int[size];\\n\\n for (int i = 0; i < size; i++) {\\n result[i] = scanner.nextInt();\\n }\\n\\n return result;\\n }\\n\\n private void readData() {\\n Scanner scanner = new Scanner(System.in);\\n\\n n = scanner.nextLong();\\n k = scanner.nextLong();\\n }\\n\\n private int solve() {\\n\\n ... What is the time complexity of the previous code?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.Scanner;\\n\\n\\/**\\n * @author pvasilyev\\n * @since 8\\/16\\/13\\n *\\/\\npublic class ProblemC {\\n\\n public static final String FILE_IN = \\\"std.in\\\";\\n public static final String FILE_OUT = \\\"std.out\\\";\\n private static boolean debugMode = true;\\n private static final long MOD = 1000 * 1000 * 1000 + 9;\\n\\n public static void main(String[] args) throws IOException {\\n\\n final Scanner reader = new Scanner(new InputStreamReader(debugMode ? System.in : new FileInputStream(FILE_IN)));\\n final PrintWriter writer = new PrintWriter(debugMode ? System.out : new FileOutputStream(FILE_OUT));\\n\\n\\/\\/ final long start = System.currentTimeMillis();\\n solveTheProblem(reader, writer);\\n\\/\\/ System.out.println(System.currentTimeMillis() - start);\\n\\n reader.close();\\n writer.close();\\n }\\n\\n private static void solveTheProblem(final Scanner reader, final PrintWriter writer) {\\n\\n final long n = reader.nextLong();\\n final long m = reader.nextLong();\\n final long k = reader.nextLong();\\n\\n if (n - n\\/k >= m) {\\n writer.println(m);\\n return;\\n } else {\\n long sum = 1;\\n long maxK = m - n + n\\/k;\\n sum = fastPow(2, maxK);\\n sum = 2 * (sum - 1);\\n sum = sum % MOD;\\n sum *= k;\\n sum += m - maxK * k;\\n writer.println(sum % MOD);\\n }\\n\\n }\\n\\n private static long fastPow(final int exp, final long deg) {\\n if (deg == 0) {\\n return 1;\\n } else if (deg == 1) {\\n return exp;\\n } else if (deg % 2 == 0) {\\n long temp = fastPow(exp, deg \\/ 2);\\n temp = (temp * temp) % MOD;\\n return temp;\\n } else {\\n long temp = fastPow(exp, deg \\/ 2);\\n temp = (temp * temp) % MOD;\\n return (temp * exp) % MOD;\\n }\\n }\\n\\n\\n}\\n Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\npublic class B{\\n\\tstatic int[][] hor;\\n\\tstatic int[][] ver;\\n\\tstatic int n;\\n\\tstatic int m;\\n\\tstatic int k;\\n\\tstatic long[][][] dp;\\n\\t\\n\\tstatic long dist(int row, int col)\\n\\t{\\n\\t\\tif(k%2==1)return Integer.MAX_VALUE;\\n\\t\\treturn 2*make(row,col,k\\/2);\\n\\t}\\n\\t\\n\\tstatic long make(int row, int col, int moves)\\n\\t{\\n\\t\\tif(moves == 0)\\n\\t\\t{\\n\\t\\t\\treturn 0;\\n\\t\\t}\\n\\t\\t\\n\\t\\tif(dp[row][col][moves]!=-1)return dp[row][col][moves];\\n\\t\\t\\n\\t\\tlong ans = Long.MAX_VALUE;\\n\\t\\t\\n\\t\\tif(col-1>=0)\\n\\t\\t{\\n\\t\\t\\tans = Math.min(ans, hor[row][col-1]+make(row,col-1,moves-1));\\n\\t\\t}\\n\\t\\tif(col+1=0)\\n\\t\\t{\\n\\t\\t\\tans = Math.min(ans, ver[row-1][col]+make(row-1,col,moves-1));\\n\\t\\t}\\n\\t\\tif(row+1 ts= new ArrayList();\\n for (int i = 0; i < N; i++) {\\n ts.add(nextInt());\\n }\\n int count=0,pos=0;\\n Collections.sort(ts);\\n int jj=ts.size()-1;\\n while(m>k){\\n \\n if((jj<0)||(k==0))\\n {pos=1;break;}\\n else{\\n \\/\\/ System.out.println(k);\\n k+=ts.get(jj) -1;\\n jj--;\\n count++;\\n }\\n \\n }\\n if(pos==0)\\n out.println(count);\\n else\\n out.println(\\\"-1\\\");\\n \\n }\\n} Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\nimport java.io.*;\\n\\npublic class Main {\\n public static void main(String[] args) throws IOException {\\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(new PrintStream(System.out));\\n StringTokenizer st = new StringTokenizer(f.readLine());\\n int n = Integer.parseInt(st.nextToken());\\n int m = Integer.parseInt(st.nextToken());\\n long[] arrB = new long[n];\\n long[] arrG = new long[m];\\n st=new StringTokenizer(f.readLine());\\n for(int i=0;iarrG[0]){\\n ans=-1;\\n }\\n System.out.println(ans);\\n f.close();\\n out.close();\\n }\\n} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;\\nimport java.util.*;\\nimport static java.lang.Math.*;\\n\\npublic class A {\\n public static void main(String[] args) {\\n Scanner input = new Scanner();\\n StringBuilder output = new StringBuilder();\\n\\n int n = input.nextInt();\\n int[] a = new int[n];\\n\\n for (int i = 0; i < n; i++) {\\n a[i] = input.nextInt();\\n }\\n\\n Arrays.sort(a);\\n boolean[] colored = new boolean[n];\\n int colors = 0;\\n for (int i = 0; i < n; i++) {\\n if (!colored[i]) {\\n colors ++;\\n colored[i] = true;\\n for (int j = i+1; j < n; j++) {\\n if (a[j] % a[i] == 0) {\\n colored[j] = true;\\n }\\n }\\n }\\n }\\n\\n System.out.println(colors);\\n }\\n\\n private static class Scanner {\\n BufferedReader br; StringTokenizer st;\\n public Scanner(Reader in) { br = new BufferedReader(in); }\\n public Scanner() { this(new InputStreamReader(System.in)); }\\n String next() {\\n while (st == null || !st.hasMoreElements()) {\\n try { st = new StringTokenizer(br.readLine());\\n } catch (IOException e) { e.printStackTrace(); } }\\n return st.nextToken(); }\\n int nextInt() { return Integer.parseInt(next()); }\\n long nextLong() { return Long.parseLong(next()); }\\n double nextDouble() { return Double.parseDouble(next()); }\\n String readNextLine() {\\n String str = \\\"\\\";\\n try { str = br.readLine();\\n } catch (IOException e) { e.printStackTrace(); }\\n return str; }\\n int[] readIntArray(int n) {\\n int[] a = new int[n];\\n for (int idx = 0; idx < n; idx++) { a[idx] = nextInt(); }\\n return a; }\\n long[] readLongArray(int n) {\\n long[] a = new long[n];\\n for (int idx = 0; idx < n; idx++) { a[idx] = nextLong(); }\\n return a; }\\n } \\/\\/ end Scanner\\n}\\n Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.util.*;\\n\\npublic class C{\\n\\tstatic String s;\\n\\tstatic long val[];\\n\\tstatic int N,size;\\n\\tstatic int index(char c){\\n\\t\\tif(c <= 'Z'){\\n\\t\\t\\treturn c - 'A';\\n\\t\\t}else{\\n\\t\\t\\treturn c - 'a' + ('Z' - 'A' + 1);\\n\\t\\t}\\n\\t}\\n\\n\\tstatic int l(int i){\\n\\t\\treturn (i<<1)+1;\\n\\t}\\n\\tstatic int r(int i){\\n\\t\\treturn (i<<1)+2;\\n\\t}\\n\\n\\tstatic void setup(int l, int r, int i){\\n\\t\\tif(l==r){\\n\\t\\t\\tval[i] = (1L< m) {\\n int tmp = n;\\n n = m;\\n m = tmp;\\n }\\n \\/\\/ n < m !!!!\\n \\/\\/ n rows m columns\\n\\n if (n == 1) {\\n out.print(m - (m + 2) \\/ 3);\\n return;\\n }\\n\\n int[][] dp = new int[n * m + 1][1 << (2 * n)];\\n for (int i = 0; i < dp.length; i++)\\n Arrays.fill(dp[i], INF);\\n\\n dp[0][0] = 0;\\n for (int i = 0; i < dp.length - 1; i++) {\\n int maxNewMask = (1 << Math.min(2 * n, n * m - i)) - 1;\\n for (int mask = 0; mask < dp[i].length; mask++)\\n if (dp[i][mask] != INF) {\\n \\/\\/System.err.println(i + \\\" \\\" + mask + \\\" \\\" + dp[i][mask]);\\n if ((mask & 1) == 1) \\/\\/ already covered, skip\\n dp[i + 1][mask >> 1] = Math.min(dp[i + 1][mask >> 1],\\n dp[i][mask]);\\n \\/\\/ place on this tile\\n int newMask = mask >> 1;\\n if (i % n != n - 1)\\n newMask |= 1;\\n newMask |= 1 << (n - 1);\\n newMask &= maxNewMask;\\n dp[i + 1][newMask] = Math.min(dp[i + 1][newMask],\\n dp[i][mask] + 1);\\n\\n if (i % n != n - 1) {\\/\\/ place on next tile\\n newMask = mask >> 1;\\n newMask |= 1;\\n if (i % n != n - 2)\\n newMask |= 2;\\n newMask |= (1 << n);\\n newMask &= maxNewMask;\\n dp[i + 1][newMask] = Math.min(dp[i + 1][newMask],\\n dp[i][mask] + 1);\\n }\\n\\n \\/\\/ place on... What is the time complexity of the previous code?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class CF1141F {\\n\\tstatic class V {\\n\\t\\tint l, r, a;\\n\\t\\tV(int l, int r, int a) {\\n\\t\\t\\tthis.l = l; this.r = r; this.a = a;\\n\\t\\t}\\n\\t}\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tPrintWriter pw = new PrintWriter(System.out);\\n\\t\\tint n = Integer.parseInt(br.readLine());\\n\\t\\tStringTokenizer st = new StringTokenizer(br.readLine());\\n\\t\\tint[] aa = new int[n + 1];\\n\\t\\tfor (int i = 1; i <= n; i++)\\n\\t\\t\\taa[i] = Integer.parseInt(st.nextToken());\\n\\t\\tfor (int i = 1; i <= n; i++)\\n\\t\\t\\taa[i] += aa[i - 1];\\n\\t\\tint m = n * (n + 1) \\/ 2;\\n\\t\\tV[] vv = new V[m];\\n\\t\\tm = 0;\\n\\t\\tfor (int i = 1; i <= n; i++)\\n\\t\\t\\tfor (int j = i; j <= n; j++)\\n\\t\\t\\t\\tvv[m++] = new V(i, j, aa[j] - aa[i - 1]);\\n\\t\\tArrays.sort(vv, (u, v) -> u.a != v.a ? u.a - v.a : u.r - v.r);\\n\\t\\tint[] ii_ = new int[m];\\n\\t\\tint[] ii = new int[m];\\n\\t\\tint k_ = 0;\\n\\t\\tfor (int i = 0, j; i < m; i = j) {\\n\\t\\t\\tj = i + 1;\\n\\t\\t\\twhile (j < m && vv[j].a == vv[i].a)\\n\\t\\t\\t\\tj++;\\n\\t\\t\\tint k = 0, r = 0;\\n\\t\\t\\tfor (int h = i; h < j; h++)\\n\\t\\t\\t\\tif (vv[h].l > r) {\\n\\t\\t\\t\\t\\tii[k++] = h;\\n\\t\\t\\t\\t\\tr = vv[h].r;\\n\\t\\t\\t\\t}\\n\\t\\t\\tif (k_ < k) {\\n\\t\\t\\t\\tk_ = k;\\n\\t\\t\\t\\tint[] tmp = ii_; ii_ = ii; ii = tmp;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tpw.println(k_);\\n\\t\\tfor (int h = 0; h < k_; h++) {\\n\\t\\t\\tint i = ii_[h];\\n\\t\\t\\tpw.println(vv[i].l + \\\" \\\" + vv[i].r);\\n\\t\\t}\\n\\t\\tpw.close();\\n\\t}\\n}\\n What is the time complexity of the previous code?\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\n\\n\\n\\n\\n\\n\\npublic class B2 {\\n\\tString s = null;\\n\\n\\tString[] ss = null;\\n\\tint[][] sn = null;\\n\\tint n = 0;\\n\\tdouble ans = 1;\\n\\tint A = 0;\\n\\tpublic void run() throws Exception{\\n\\n\\t\\tBufferedReader br = null;\\n\\t\\tFile file = new File(\\\"input.txt\\\");\\n\\t\\tif(file.exists()){\\n\\t\\t\\tbr = new BufferedReader(new FileReader(\\\"input.txt\\\"));\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tbr = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t}\\n\\t\\n\\t\\ts = br.readLine();\\n\\t\\tss = s.split(\\\" \\\");\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\tn = Integer.parseInt(ss[0]);\\n\\t\\tint k = Integer.parseInt(ss[1]);\\n\\t\\tA = Integer.parseInt(ss[2]);\\n\\t\\tsn = new int[n][2];\\n\\n\\t\\tfor(int i = 0; i < n; i++){\\n\\t\\t\\ts = br.readLine();\\n\\t\\t\\tss = s.split(\\\" \\\");\\n\\t\\t\\tsn[i][0] = Integer.parseInt(ss[0]);\\n\\t\\t\\tsn[i][1] = Integer.parseInt(ss[1]);\\n\\t\\t}\\n\\n\\t\\tint num = 0;\\n\\t\\tfor(int i = 0; i < n; i++){\\n\\t\\t\\tnum += (100 - sn[i][1]) \\/ 10;\\n\\t\\t}\\n\\t\\tif(k >= num){\\n\\t\\t\\tSystem.out.println(\\\"1.0\\\");\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\t\\n\\t\\tcheck(0, k, sn);\\n\\t\\t\\n\\t\\tans = 1 - ans;\\n\\t\\tSystem.out.println(ans);\\n\\t\\t\\n\\t}\\n\\t\\n\\tvoid check(int i, int k, int[][] sn){\\n\\t\\tif(i == n && k == 0){\\n\\t\\t\\tcheck2(sn);\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\telse if(i == n && k > 0){\\n\\t\\t\\treturn;\\n\\t\\t}\\n\\t\\telse if(k == 0){\\n\\t\\t\\tcheck(i+1, k, sn);\\n\\t\\t}\\n\\t\\telse{\\n\\t\\t\\tfor(int j = 0; j <= k; j++){\\n\\t\\t\\t\\tif(sn[i][1] + j * 10 <= 100){\\n\\t\\t\\t\\t\\tint[][] nsn = copy(sn);\\n\\t\\t\\t\\t\\tnsn[i][1] += j * 10;\\n\\t\\t\\t\\t\\tcheck(i+1, k - j, nsn);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\t\\n\\tvoid check2(int[][] sn){\\n\\t\\tList target = new ArrayList();\\n\\t\\tint h = 0;\\n\\t\\tfor(int i = 0; i < sn.length; i++){\\n\\t\\t\\tif(sn[i][1] != 100){\\n\\t\\t\\t\\ttarget.add(i);\\n\\t\\t\\t}\\n\\t\\t\\telse{\\n\\t\\t\\t\\th++;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tif(h > n \\/ 2){\\n\\t\\t\\tSystem.out.println(\\\"1.0\\\");\\n\\t\\t\\tSystem.exit(0);\\t\\n\\t\\t}\\n\\t\\tint makemax = n - h;\\n\\t\\tint makemin = (n+1)\\/2;\\n\\t\\tdouble ma = 0;\\n\\t\\tfor(int i = makemax; i >= makemin; i--){\\n\\t\\t\\tCombination c = new Combination(makemax, i);\\n\\t\\t\\tIterator ite = c.iterator();\\n\\t\\t\\t\\n\\t\\t\\twhile(ite.hasNext()){\\n\\t\\t\\t\\tint[] ret = ite.next();\\n\\t\\t\\t\\tSet make = new HashSet();\\n\\t\\t\\t\\tfor(int j = 0; j < ret.length; j++){\\n\\t\\t\\t\\t\\tif(ret[j] > 0){\\n\\t\\t\\t\\t\\t\\tmake.add(target.get(j));\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tdouble makeK = 1;\\n\\t\\t\\t\\tint B... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\nimport java.io.*;\\nimport java.math.*;\\npublic class A{\\n\\n void solve(){\\n int n=ni();\\n long r=ni();\\n int x[]=new int[n+1];\\n for(int i=1;i<=n;i++) x[i]=ni();\\n\\n double ans[]=new double[n+1];\\n ans[1]=r;\\n for(int i=2;i<=n;i++){\\n double mx=0;\\n for(int j=1;j 2*r) {\\n mx = Math.max(mx,r);\\n } else {\\n xx *= xx;\\n mx=Math.max(mx,ans[j] + Math.sqrt(4 * r * r - xx));\\n \\/\\/ if(i==5) pw.println(j);\\n }\\n \\/\\/if(i==4) pw.println(mx);\\n }\\n ans[i]=mx;\\n }\\n for(int i=1;i<=n;i++) pw.print(ans[i]+\\\" \\\");\\n }\\n\\n\\n long M=(long)1e9+7;\\n InputStream is;\\n PrintWriter pw;\\n String INPUT = \\\"\\\";\\n void run() throws Exception {\\n is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());\\n pw = new PrintWriter(System.out);\\n long s = System.currentTimeMillis();\\n solve();\\n pw.flush();\\n if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+\\\"ms\\\");\\n }\\n\\n public static void main(String[] args) throws Exception { new A().run(); }\\n\\n private byte[] inbuf = new byte[1024];\\n public int lenbuf = 0, ptrbuf = 0;\\n\\n private int readByte() {\\n if(lenbuf == -1)throw new InputMismatchException();\\n if(ptrbuf >= lenbuf){\\n ptrbuf = 0;\\n try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }\\n if(lenbuf <= 0)return -1;\\n }\\n return inbuf[ptrbuf++];\\n }\\n\\n private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }\\n private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }\\n\\n private double nd() { return Double.parseDouble(ns()); }\\n private char nc() { return (char)skip(); }\\n\\n private String ns() {\\n int b =... Complexity:\",\"targets\":\"quadratic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;\\npublic class Test { public static void main(String[] args)\\n{\\nScanner sc = new Scanner(System.in);\\nint n= sc.nextInt();\\nint x= (int)Math.sqrt(n) ;\\nint a[] = new int[n+5];\\nfor(int i=1,o=n,j;i<=n;i+=x)\\nfor(j=(int)Math.min(i+x-1,n);j>=i;a[j--]=o--);\\nfor(int i=1;i<=n;i++)System.out.print(a[i]+\\\" \\\");\\nSystem.out.println();\\n\\n\\n} \\n} Complexity:\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import static java.util.Arrays.*;\\nimport static java.lang.Math.*;\\nimport java.util.*;\\nimport java.io.*;\\n\\npublic class A implements Runnable\\n{\\n\\tpublic static void main(String [] args) throws IOException\\n\\t{\\n\\t\\tnew Thread(null, new A(), \\\"\\\", 1 << 20).start();\\n\\t}\\n\\t\\n\\tString file = \\\"input\\\";\\n\\tBufferedReader input;\\n\\tPrintWriter out;\\n\\t\\n\\tpublic void run() \\n\\t{\\n\\t\\ttry\\n\\t\\t{\\n\\t\\t\\t\\/\\/input = new BufferedReader(new FileReader(file + \\\".in\\\"));\\n\\t\\t\\tinput = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(new BufferedOutputStream(System.out));\\n\\t\\t\\tsolve();\\n\\t\\t\\tinput.close();\\n\\t\\t\\tout.close();\\n\\t\\t}\\n\\t\\tcatch(Exception e)\\n\\t\\t{\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(1);\\n\\t\\t}\\n\\t}\\n\\tint N, T;\\n\\tvoid solve() throws IOException\\n\\t{\\n\\t\\tStringTokenizer st = tokens();\\n\\t\\tN = nextInt(st); T = nextInt(st);\\n\\t\\tT *= 2;\\n\\t\\tArrayList list = new ArrayList();\\n\\t\\tfor(int i = 0; i < N; i++)\\n\\t\\t{\\n\\t\\t\\tst = tokens();\\n\\t\\t\\tint c = nextInt(st), L = nextInt(st);\\n\\t\\t\\tc *= 2; L *= 2;\\n\\t\\t\\tlist.add(new Pair(c - L \\/ 2, c + L \\/ 2));\\n\\t\\t}\\n\\t\\tCollections.sort(list);\\n\\t\\tHashSet set = new HashSet();\\n\\t\\tfor(int i = 0; i < list.size(); i++)\\n\\t\\t{\\n\\t\\t\\tif(i == 0 || list.get(i).x - list.get(i - 1).y >= T)\\n\\t\\t\\t{\\n\\t\\t\\t\\tset.add(list.get(i).x - T \\/ 2);\\n\\t\\t\\t}\\n\\t\\t\\tif(i == list.size() - 1 || list.get(i + 1).x - list.get(i).y >= T)\\n\\t\\t\\t{\\n\\t\\t\\t\\tset.add(list.get(i).y + T \\/ 2);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tSystem.out.println(set.size());\\n\\t}\\n\\tclass Pair implements Comparable\\n\\t{\\n\\t\\tint x, y;\\n\\t\\tpublic Pair(int x, int y)\\n\\t\\t{\\n\\t\\t\\tthis.x = x;\\n\\t\\t\\tthis.y = y;\\n\\t\\t}\\n\\t\\tpublic int compareTo(Pair p)\\n\\t\\t{\\n\\t\\t\\tif(x != p.x) return x - p.x;\\n\\t\\t\\treturn y - p.y;\\n\\t\\t}\\n\\t}\\n\\n\\tStringTokenizer tokens() throws IOException\\n\\t{\\n\\t\\treturn new StringTokenizer(input.readLine());\\n\\t}\\n\\t\\n\\tString next(StringTokenizer st)\\n\\t{\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\t\\n\\tint nextInt() throws IOException\\n\\t{\\n\\t\\treturn Integer.parseInt(input.readLine());\\n\\t}\\n\\t\\n\\tint nextInt(StringTokenizer st)\\n\\t{\\n\\t\\treturn Integer.parseInt(st.nextToken());\\n\\t}\\n\\t\\n\\tdouble nextDouble() throws IOException\\n\\t{\\n\\t\\treturn Double.parseDouble(input.readLine());\\n\\t}\\n\\t\\n\\tdouble... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.StringTokenizer;\\n\\npublic class D5 implements Runnable {\\n\\n\\tfinal double eps = 1e-9;\\n\\n\\tprivate void Solution() throws IOException {\\n\\t\\tdouble a = nextDouble(), v = nextDouble();\\n\\t\\tdouble l = nextDouble(), d = nextDouble(), w = nextDouble();\\n\\t\\tdouble t = 0;\\n\\t\\tif (w + eps > v) {\\n\\t\\t\\tdouble s = v * v \\/ (2 * a);\\n\\t\\t\\tif (s + eps > l)\\n\\t\\t\\t\\tt = Math.sqrt(2 * l \\/ a);\\n\\t\\t\\telse {\\n\\t\\t\\t\\tdouble ta = v \\/ a;\\n\\t\\t\\t\\tdouble sa = a * ta * ta \\/ 2;\\n\\t\\t\\t\\tt = ta + (l - sa) \\/ v;\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\tdouble sv = v * v \\/ (2 * a);\\n\\t\\t\\tdouble sw = w * w \\/ (2 * a);\\n\\t\\t\\tif (sw + eps > d) {\\n\\t\\t\\t\\tif (sv + eps > l)\\n\\t\\t\\t\\t\\tt = Math.sqrt(2 * l \\/ a);\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tdouble ta = v \\/ a;\\n\\t\\t\\t\\t\\tdouble sa = a * ta * ta \\/ 2;\\n\\t\\t\\t\\t\\tt = ta + (l - sa) \\/ v;\\n\\t\\t\\t\\t}\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tdouble sd = (w * w - v * v) \\/ (-2 * a);\\n\\t\\t\\t\\tif (sv + sd < eps + d)\\n\\t\\t\\t\\t\\tt = v \\/ a + (d - sv - sd) \\/ v + (v - w) \\/ a;\\n\\t\\t\\t\\telse {\\n\\t\\t\\t\\t\\tdouble f = Math.sqrt(d * a + w * w \\/ 2);\\n\\t\\t\\t\\t\\tt = f \\/ a + (f - w) \\/ a;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\\tif (sd + eps > l - d) {\\n\\t\\t\\t\\t\\tdouble lv = Math.sqrt((l - d) * 2 * a + w * w);\\n\\t\\t\\t\\t\\tt += (lv - w) \\/ a;\\n\\t\\t\\t\\t} else {\\n\\t\\t\\t\\t\\tt += (v - w) \\/ a + (l - d - sd) \\/ v;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tout.printf(\\\"%.12f\\\", t);\\n\\t}\\n\\n\\tpublic static void main(String[] args) {\\n\\t\\tnew D5().run();\\n\\t}\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer tokenizer;\\n\\n\\tpublic void run() {\\n\\t\\ttry {\\n\\t\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\t\\tout = new PrintWriter(System.out);\\n\\t\\t\\tSolution();\\n\\t\\t\\tout.close();\\n\\t\\t} catch (Exception e) {\\n\\t\\t\\te.printStackTrace();\\n\\t\\t\\tSystem.exit(0);\\n\\t\\t}\\n\\t}\\n\\n\\tvoid print(Object... obj) {\\n\\t\\tfor (int i = 0; i < obj.length; i++) {\\n\\t\\t\\tif (i != 0)\\n\\t\\t\\t\\tout.print(\\\" \\\");\\n\\t\\t\\tout.print(obj[i]);\\n\\t\\t}\\n\\t}\\n\\n\\tvoid println(Object... obj) {\\n\\t\\tprint(obj);\\n\\t\\tprint(\\\"\\\\n\\\");\\n\\t}\\n\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(next());\\n\\t}\\n\\n\\tlong nextLong() throws NumberFormatException, IOException {\\n\\t\\treturn Long.parseLong(next());\\n\\t}\\n\\n\\tdouble nextDouble() throws... Complexity:\",\"targets\":\"constant\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.IOException;\\nimport java.io.InputStreamReader;\\nimport java.io.PrintWriter;\\nimport java.util.ArrayList;\\nimport java.util.Collections;\\nimport java.util.Comparator;\\n\\n\\npublic class pr988B {\\n public static void main(String[] args) throws IOException {\\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\\n PrintWriter out = new PrintWriter(System.out);\\n\\n int n = Integer.parseInt(br.readLine());\\n\\n ArrayList a = new ArrayList<>();\\n\\n for (int i = 0; i < n; i++) {\\n a.add(br.readLine());\\n }\\n\\n if(solve(n, a)){\\n out.println(\\\"YES\\\");\\n for (String s : a) {\\n out.println(s);\\n }\\n }\\n else\\n out.println(\\\"NO\\\");\\n\\n out.flush();\\n out.close();\\n }\\n\\n private static boolean solve(int n, ArrayList a) {\\n a.sort(Comparator.comparingInt(String::length));\\n for (int i = 0; i < n - 1; i++) {\\n if(!a.get(i+1).contains(a.get(i))) return false;\\n }\\n return true;\\n }\\n}\\n Complexity:\",\"targets\":\"nlogn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Pr468B {\\n\\tpublic static void main(String[] args) throws IOException {\\n\\t\\tnew Pr468B().run();\\n\\t}\\n\\n\\tBufferedReader in;\\n\\tPrintWriter out;\\n\\tStringTokenizer st;\\n\\n\\tString nextToken() throws IOException {\\n\\t\\twhile (st == null || !st.hasMoreTokens()) {\\n\\t\\t\\tst = new StringTokenizer(in.readLine());\\n\\t\\t}\\n\\t\\treturn st.nextToken();\\n\\t}\\n\\n\\tint nextInt() throws IOException {\\n\\t\\treturn Integer.parseInt(nextToken());\\n\\t}\\n\\n\\tvoid run() throws IOException {\\n\\t\\tin = new BufferedReader(new InputStreamReader(System.in));\\n\\t\\tout = new PrintWriter(System.out, true);\\n\\t\\tsolve();\\n\\t\\tout.flush();\\n\\t}\\n\\n\\tint[] which;\\n\\tboolean[] was;\\n\\tint[] pa;\\n\\tint[] pb;\\n\\n\\tvoid dfs(int i, boolean fa) {\\n\\t\\twas[i] = true;\\n\\t\\tif (fa) {\\n\\t\\t\\tif (pa[i] == -1) {\\n\\t\\t\\t\\tout.println(\\\"NO\\\");\\n\\t\\t\\t\\tout.flush();\\n\\t\\t\\t\\tSystem.exit(0);\\n\\t\\t\\t}\\n\\t\\t\\twhich[i] = 0;\\n\\t\\t\\twhich[pa[i]] = 0;\\n\\t\\t\\tif (pb[pa[i]] != -1 && !was[pb[pa[i]]]) {\\n\\t\\t\\t\\tdfs(pb[pa[i]], fa);\\n\\t\\t\\t}\\n\\t\\t} else {\\n\\t\\t\\tif (pb[i] == -1) {\\n\\t\\t\\t\\tout.println(\\\"NO\\\");\\n\\t\\t\\t\\tout.flush();\\n\\t\\t\\t\\tSystem.exit(0);\\n\\t\\t\\t}\\n\\t\\t\\twhich[i] = 1;\\n\\t\\t\\twhich[pb[i]] = 1;\\n\\t\\t\\tif (pa[pb[i]] != -1 && !was[pa[pb[i]]]) {\\n\\t\\t\\t\\tdfs(pa[pb[i]], fa);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\tvoid solve() throws IOException {\\n\\t\\tint n = nextInt();\\n\\t\\tint a = nextInt();\\n\\t\\tint b = nextInt();\\n\\t\\tint[] p = new int[n];\\n\\t\\tHashMap allNums = new HashMap();\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tp[i] = nextInt();\\n\\t\\t\\tif (p[i] >= Math.max(a, b)) {\\n\\t\\t\\t\\tout.println(\\\"NO\\\");\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t\\tallNums.put(p[i], i);\\n\\t\\t}\\n\\t\\tpa = new int[n];\\n\\t\\tpb = new int[n];\\n\\t\\tArrays.fill(pa, -1);\\n\\t\\tArrays.fill(pb, -1);\\n\\t\\twhich = new int[n];\\n\\t\\tArrays.fill(which, -1);\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tif (pa[i] == -1 && allNums.containsKey(a - p[i])) {\\n\\t\\t\\t\\tpa[i] = allNums.get(a - p[i]);\\n\\t\\t\\t\\tpa[pa[i]] = i;\\n\\t\\t\\t}\\n\\t\\t\\tif (pb[i] == -1 && allNums.containsKey(b - p[i])) {\\n\\t\\t\\t\\tpb[i] = allNums.get(b - p[i]);\\n\\t\\t\\t\\tpb[pb[i]] = i;\\n\\t\\t\\t}\\n\\t\\t\\tif (pa[i] == -1 && pb[i] == -1) {\\n\\t\\t\\t\\tout.println(\\\"NO\\\");\\n\\t\\t\\t\\treturn;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\twas = new boolean[n];\\n\\t\\tfor (int i = 0; i < n; i++) {\\n\\t\\t\\tif (!was[i] &&... What is the time complexity of the previous code?\",\"targets\":\"linear\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.OutputStream;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\nimport java.io.PrintWriter;\\nimport java.util.Arrays;\\nimport java.util.InputMismatchException;\\nimport java.io.IOException;\\nimport java.io.InputStream;\\n\\n\\/**\\n * Built using CHelper plug-in\\n * Actual solution is at the top\\n *\\n * @author beginner1010\\n *\\/\\npublic class Main {\\n public static void main(String[] args) {\\n InputStream inputStream = System.in;\\n OutputStream outputStream = System.out;\\n InputReader in = new InputReader(inputStream);\\n PrintWriter out = new PrintWriter(outputStream);\\n TaskG1 solver = new TaskG1();\\n solver.solve(1, in, out);\\n out.close();\\n }\\n\\n static class TaskG1 {\\n final int mod = (int) 1e9 + 7;\\n int[][][] dp;\\n\\n int rec(int mask, int time, int T, int genre, int[] ts, int[] gs) {\\n if (time > T)\\n return 0;\\n if (time == T)\\n return 1;\\n if (mask == (1 << ts.length) - 1)\\n return 0;\\n int res = dp[genre][time][mask];\\n if (res != -1)\\n return res;\\n res = 0;\\n for (int i = 0; i < ts.length; i++) {\\n if ((mask & (1 << i)) == 0 && (mask == 0 || gs[i] != genre)) {\\n res += rec(mask | (1 << i), time + ts[i], T, gs[i], ts, gs);\\n if (res >= mod)\\n res -= mod;\\n }\\n }\\n return dp[genre][time][mask] = res;\\n }\\n\\n public void solve(int testNumber, InputReader in, PrintWriter out) {\\n int n = in.nextInt();\\n int[] ts = new int[n];\\n int[] gs = new int[n];\\n int T = in.nextInt();\\n for (int i = 0; i < n; i++) {\\n ts[i] = in.nextInt();\\n gs[i] = in.nextInt() - 1;\\n }\\n dp = new int[3][T][1 << n];\\n for (int[][] aux : dp) {\\n for (int[] aux2 : aux)\\n Arrays.fill(aux2,... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?\",\"targets\":\"np\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whichcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"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;\\nimport java.io.FileReader;\\nimport java.io.IOException;\\nimport java.io.PrintWriter;\\nimport java.util.*;\\n\\npublic class CodeForces {\\n class Pair {\\n K first;\\n V second;\\n public Pair(K k, V v) {\\n first = k;\\n second = v;\\n }\\n }\\n private boolean contain(int set, int i) {\\n return (set & (1< 0;\\n }\\n\\n private static int gcd(int a, int b) {\\n if (b == 0) return a;\\n return gcd(b, a%b);\\n }\\n \\n private long pow(long a, long p) {\\n if (p == 0) return 1;\\n long b = pow(a, p\\/2);\\n b = b * b;\\n if (p % 2 == 1) b *= a;\\n return b % mod;\\n }\\n \\n private static boolean isSame(double a, double b) {\\n return Math.abs(a - b) < 1e-10;\\n }\\n\\n private static void swapBoolean(boolean[] p, int i, int j) {\\n boolean tmp = p[i];\\n p[i] = p[j];\\n p[j] = tmp;\\n }\\n\\n private static void swap(int[] p, int i, int j) {\\n int tmp = p[i];\\n p[i] = p[j];\\n p[j] = tmp;\\n }\\n private static int countOne(int a) {\\n if (a == 0) return 0;\\n return countOne(a & (a-1)) + 1;\\n }\\n\\n private static int sdiv(int a, int b) {\\n return (a +b -1) \\/ b;\\n }\\n\\n private int[] retran(int index) {\\n int[] res = new int[2];\\n res[0] = index \\/ M;\\n res[1] = index % M;\\n return res;\\n }\\n\\n private int tran(int x, int y) {\\n return x * M + y;\\n }\\n\\n private boolean inTable(int x, int y) {\\n return x>=0 && x< N && y >= 0 && y < M;\\n }\\n\\n int N;\\n int R;\\n int[][] C = new int[10][10];\\n int M;\\n int mod = 1_000_000_007;\\n long IMPO;\\n int ans;\\n\\n int[] dx = new int[]{1,0, -1, 0};\\n int[] dy = new int[]{0, -1, 0, 1};\\n Map dp = new HashMap<>();\\n\\n class Edge {\\n int u;\\n int v;\\n int start;\\n int duration;\\n public Edge(int u, int v, int l, int d) {\\n this.u = u;\\n this.v = v;\\n ... Complexity:\",\"targets\":\"logn\",\"language\":\"java\",\"split\":\"train\",\"template\":\"identifycomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n" "{\"inputs\":\"import java.io.*;\\nimport java.util.*;\\n\\npublic class Main { \\n public static void main(String[] args) throws IOException { \\n \\/\\/InputStream input = System.in;\\n \\/\\/OutputStream output = System.out;\\n InputReader in = new InputReader(new FileReader(new File(\\\"input.txt\\\")));\\n PrintWriter out = new PrintWriter(new FileWriter(new File(\\\"output.txt\\\")));\\n \\/\\/InputReader in = new InputReader(input);\\n \\/\\/PrintWriter out = new PrintWriter(output);\\n Solution s = new Solution();\\n s.solve(1, in, out);\\n out.close();\\n }\\n\\n static class Solution { \\n \\n double EPS = 0.0000001;\\n public void solve(int cs, InputReader in, PrintWriter out) {\\n\\n int n = in.nextInt(), m = in.nextInt();\\n Graph g = new Graph(n, m);\\n int k = in.nextInt();\\n for (int[] v : g.vis)\\n Arrays.fill(v, -1);\\n while (k-- > 0) {\\n Pair start = new Pair(in.nextInt()-1, in.nextInt()-1);\\n g.bfs(start);\\n }\\n int idx1 = 0, idx2 = 0, max = 0;\\n for (int i = 0; i < n; i++) {\\n for (int j = 0; j < m; ++j) {\\n if (g.vis[i][j] > max) {\\n idx1 = i;\\n idx2 = j;\\n max = g.vis[i][j];\\n }\\n }\\n }\\n out.println((idx1+1) + \\\" \\\" + (idx2+1));\\n }\\n\\n static class Pair {\\n int x, y;\\n\\n public Pair(int x, int y) {\\n this.x = x ;\\n this.y = y;\\n }\\n }\\n\\n static class Graph {\\n LinkedList adj[];\\n int n, e;\\n int[][] vis;\\n\\n @SuppressWarnings(\\\"unchecked\\\")\\n public Graph(int n, int e) {\\n this.n = n;\\n this.e = e;\\n adj = new LinkedList[n];\\n for (int i = 0; i < n; ++i)\\n adj[i] = new LinkedList<>();\\n vis =... What is the time complexity of the previous code?\",\"targets\":\"cubic\",\"language\":\"java\",\"split\":\"train\",\"template\":\"whatcomplexity\",\"dataset\":\"codeparrot\\/codecomplex\",\"config\":\"codeparrot--codecomplex\"}\n"