content stringlengths 219 31.2k | complexity stringclasses 5
values | file_name stringlengths 6 9 | complexity_ranked float64 0.1 0.9 |
|---|---|---|---|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.PriorityQueue;
public class LessorEqual_CodeForces {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamRea... | nlogn | 884.java | 0.7 |
import java.util.Scanner;
public class JavaApplication7 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n= sc.nextInt();
int m=sc.nextInt();
long sum=0;
long []d=new long[n];
long[]ds=new long[n];
for(int i =0;i<n;i++){
... | nlogn | 888.java | 0.7 |
import java.io.*;
import java.util.*;
import static java.lang.System.out;
public class Main {
private FastScanner scanner = new FastScanner();
public static void main(String[] args) {
new Main().solve();
}
private List<Integer>[] gr = new ArrayList[1000_000+5];
private int dp[][] = new ... | nlogn | 895.java | 0.7 |
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Comp c1 = getComp(scanner);
Comp c2 = getComp(scanner);
c1.sortByPrice();
c2.sortByPrice();
int i = 0;
int j = 0;
while(i < c1.num || j < c2.num) {
Elem xi = (i < c1.num) ... | nlogn | 897.java | 0.7 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] wide = new int[n], sta = new int[n];
HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();
for (int i = 0; i < n; i++)... | nlogn | 901.java | 0.7 |
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
public final class Codeforces
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
ArrayList<Integer> list=new ArrayList... | nlogn | 904.java | 0.7 |
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] p = new int[n / 2];
for (int i = 0; i < p.length; i++) {
p[i] = sc.nextInt();
}
System.out... | nlogn | 907.java | 0.7 |
import java.util.*;
import java.io.*;
public class Sol {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
int n = sc.nextInt();
int k = sc.nextInt();
int l = sc.nextInt();
Integer[] a = new Integer[n*k];
for(int i = 0; ... | nlogn | 909.java | 0.7 |
import java.io.*;
import java.util.StringTokenizer;
public class Main {
static int[] a;
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = sc.nextInt();
a = sc.nextIntArray(n);... | nlogn | 912.java | 0.7 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public class pr988B {
public static void main(String[] args) throws IOException {
BufferedReader b... | nlogn | 914.java | 0.7 |
import java.util.*;
import java.io.*;
public class D {
static final boolean stdin = true;
static final String filename = "";
static FastScanner br;
static PrintWriter pw;
public static void main(String[] args) throws IOException {
if (stdin) {
br = new FastScanner();
pw = new PrintWriter(new OutputStre... | nlogn | 915.java | 0.7 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class MicroWorld {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.i... | nlogn | 919.java | 0.7 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class MicroWorld {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = ne... | nlogn | 920.java | 0.7 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class gr1 {
static class InputReader {
public BufferedReader br;
public StringTokenizer token;
public InputReader(I... | nlogn | 924.java | 0.7 |
// Java implementation of counting the
// inversion using merge sort
class
Test {
/* This method sorts the input array and returns the
number of inversions in the array */
static
int
mergeSort(
int
arr[],
int
array_size)
{
int
temp[] =
new
int
[array_size];
return
_mergeSort(arr, temp,
0
, array_size... | nlogn | 93.java | 0.7 |
import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import java.util.Map.*;
public class codeforces {
static int count =0;
static boolean f=false;
static int [] arr;
static PrintWriter pw=new PrintWriter(System.out);
static void solve(int index , int mask) {
if(index==arr.l... | nlogn | 930.java | 0.7 |
import java.util.*;
import java.util.Map.Entry;
import java.io.*;
import java.lang.reflect.Array;
import java.math.*;
import java.security.SecureRandom;
public class WCS {
public static class Vector implements Comparable <Vector> {
long x, y;
int position;
Vector first, second;
boolean toReverse;
publ... | nlogn | 934.java | 0.7 |
import org.omg.PortableServer.AdapterActivator;
import java.io.*;
import java.lang.reflect.Array;
import java.net.CookieHandler;
import java.util.*;
import java.math.*;
import java.lang.*;
import java.util.concurrent.LinkedBlockingDeque;
import static java.lang.Math.*;
public class TaskA implements Runnable {
lo... | nlogn | 936.java | 0.7 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
public class CoveredPointsCount {
//UPSOLVE
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStre... | nlogn | 945.java | 0.7 |
import
java.util.*;
import
java.lang.*;
class
Main
{
static
void
minAbsSumPair(
int
arr[],
int
n)
{
// Variables to keep track of current sum and minimum sum
int
sum, min_sum =
999999
;
// left and right index variables
int
l =
0
, r = n-
1
;
// variable to keep track of the left and right pair f... | nlogn | 95.java | 0.7 |
import sun.reflect.generics.tree.Tree;
import java.io.*;
import java.math.BigInteger;
import java.net.Inet4Address;
import java.util.*;
public class l {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////... | nlogn | 953.java | 0.7 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | nlogn | 955.java | 0.7 |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.TreeMap;
import java.util.Map;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at t... | nlogn | 956.java | 0.7 |
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
public class Main {
static void insert(TreeMa... | nlogn | 957.java | 0.7 |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.OutputStreamWriter;
import java.util.NoSuchElementException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import ja... | nlogn | 958.java | 0.7 |
import java.util.*;
import java.io.*;
import static java.lang.System.in;
public class Main {
public static void main(String[] args)throws IOException{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][] point = new int[n][];
for(int i=0;i<n;i++) point[i] = new int[]{s... | nlogn | 960.java | 0.7 |
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class... | nlogn | 961.java | 0.7 |
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
InputReader.OutputWriter out = new InputR... | nlogn | 964.java | 0.7 |
import java.io.*;
import java.util.*;
public class Main {
static class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
try {
br = new BufferedReader(new InputStreamReader(System.in));
st = new StringTokenizer(br.readL... | nlogn | 966.java | 0.7 |
import java.util.*;
import java.io.*;
import java.math.*;
public class loser
{
static class InputReader {
public BufferedReader br;
public StringTokenizer token;
public InputReader(InputStream stream)
{
br=new BufferedReader(new InputStreamReader(stream),32768);
... | nlogn | 967.java | 0.7 |
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.StringTokenizer;
public class ChainReaction im... | nlogn | 975.java | 0.7 |
import javafx.util.Pair;
import java.io.*;
import java.util.*;
public class Beacon8 {
public static void main(String[] args) throws IOException {
// int[] arr = {1, 3, 7, 18};
// int bIndex = Arrays.binarySearch(arr, 4);
// System.out.println(bIndex);
Scanner scan = new Scanner(Syst... | nlogn | 980.java | 0.7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.