filename_1 stringlengths 8 15 | filename_2 stringlengths 8 12 | code_1 stringlengths 591 24.4k | code_2 stringlengths 591 35.2k | labels int64 0 1 | notes stringclasses 2
values |
|---|---|---|---|---|---|
6f02c6d9 | ff34fab2 |
import java.io.*;
import java.util.*;
public class Main {
static long mod = 1000000007;
static long inv(long a, long b) {
return 1 < a ? b - inv(b % a, a) * b / a : 1;
}
static long mi(long a) {
return inv(a, mod);
}
static InputReader sc = new InputReader(System.in);
... | import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.io... | 1 | Plagiarised |
a5d5a95f | c4ca2ff3 | import java.util.*;
import java.io.*;
public class Main {
// For fast input output
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
{ try {br = new BufferedReader(
new FileReader("input.txt"));
PrintStream out = new PrintStream(new FileOutputStream("output.txt"));
System.setOut(out);... | /* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scan... | 0 | Non-plagiarised |
4e9c4bf9 | f9e08a46 | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class E1525D {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int[] arr = new int[n];
ArrayList<Integer> occupied = new ArrayList<>();
... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Armchair {
public static void main(String args[]){
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int arr[]=new int[n];
ArrayList<Integer> list1=new ArrayList<Integer>();
Ar... | 0 | Non-plagiarised |
31cdf5fe | 80cc284c | import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
while(t-- > 0)
{
int n = scanner.nextInt();
int[] time = new int[n];
int[] h = new int... | import java.util.*;
public class solution{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0){
int n = sc.nextInt();
long[] k = new long[n];
long[] h = new long[n];
for(int i = 0;i < n;i++){
k[i] = sc.nextLong();
}
for(int i... | 0 | Non-plagiarised |
4a1573d6 | db8d728d |
import java.util.*;
import java.math.*;
import java.io.*;
public class A{
static FastReader scan=new FastReader();
public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
static LinkedList<Integer>edges[];
static boolean stdin = true;
static String filein = "input";
sta... | import java.util.*;
import java.io.*;
import java.math.*;
import java.lang.*;
public class BinaryTable {
// static int mod = 998244353;
static int mod = 1000000007;
private static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br ... | 0 | Non-plagiarised |
35f0c004 | 8d6f1bf5 | import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[])
{
FastReader input=new FastReader();
PrintWriter out=new PrintWriter(System.out);
int T=input.nextInt();
while(T-->0)
{
int n=input.nextInt();
String a... | //package Div2.C;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Menorah {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.re... | 0 | Non-plagiarised |
4fd752f7 | c7239c97 | /*==========================================================================*/
/*
* AUTHOR: RonWonWon
* CREATED: 02.05.2021 20:16:37
* EMAIL: rachitpts.2454@gmail.com
*/
/*==========================================================================*/
import java.io.*;
imp... | /*==========================================================================*/
/*
* AUTHOR: RonWonWon
* CREATED: 02.05.2021 20:16:37
* EMAIL: rachitpts.2454@gmail.com
*/
/*==========================================================================*/
import java.io.*;
imp... | 1 | Plagiarised |
26e699de | 76ad805a | //package Task1;
import java.util.Scanner;
public class Menorah {
static int MOD9= 1000000000;
public static void main(String[] args){
Scanner sc= new Scanner(System.in);
int numberTest=sc.nextInt();
while(numberTest-->0){
int n=sc.nextInt();
char[] s=new char... | import java.util.Arrays;
import java.util.Scanner;
public class First {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
String a = sc.next();
String b = sc.next... | 0 | Non-plagiarised |
1984bef1 | 2063ba3e | import java.util.*;
import java.io.*;
public class stoneheaps {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
for(int i = 0; i < t; i ++) {
int n = Integer.parseInt(br.readLine());
... | import java.io.*;
import java.util.*;
public class c {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
int numCases = Integer.parseInt(in.readLine());
f... | 0 | Non-plagiarised |
1410e423 | da5cf40b | import java.io.*;
import java.util.*;
public class C {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
int t = Integer.parseInt(br.... | /***** ---> :) Vijender Srivastava (: <--- *****/
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
static FastReader sc =new FastReader();
static PrintWriter out=new PrintWriter(System.out);
static long mod=(long)1e9+7;
/* start */
... | 0 | Non-plagiarised |
3b498a39 | ae775964 | /*
* HI THERE! (:
*
* CREATED BY : NAITIK V
*
* JAI HIND
*
*/
import java.util.*;
import java.io.*;
import java.math.*;
public class Main
{
static FastReader sc=new FastReader();
static long dp[][];
static int mod=1000000007;
static int max;
public static void main(String[] args)
{
... |
import java.awt.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.ObjectInputStream.GetField;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.ut... | 0 | Non-plagiarised |
5288afb7 | df594a00 | import java.io.*;
import java.util.*;
public class Codeforces
{
public static void main(String args[])throws Exception
{
BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb=new StringBuilder();
int t=Integer.parseInt(bu.readLine());
while(t--... | import java.io.*;
import java.util.*;
public class Codeforces {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int cases = Integer.parseInt(br.readLine());
while(cases-- > 0) {
br.readLine();
String[] str = br.readLine... | 0 | Non-plagiarised |
ad2a1ae2 | bc46480a |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.StringTokenizer;
public class Solution {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = ... | import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;
/**
* Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools
*/
public class Main {
static InputReader sc=new InputReader(System.in);
publi... | 0 | Non-plagiarised |
3b5cec19 | 8f31b279 | import java.util.*;
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Test{
static class Pair implements Comparable<Pair>{
int wt;
int idx;
Pair(int x,int y){
... | import java.util.*;
import java.io.*;
public class JavaTract
{
static class Pair implements Comparable<Pair>{
int first;
int second;
Pair(int x,int y){
this.first=x;
this.second=y;
}
@Override
public int compareTo(Pair x){
return this.first-x.first;
}
}... | 1 | Plagiarised |
22b41936 | 9cea10af |
import java.io.*;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Collections;
import java.io.InputStreamReader;
import static java.lang.Math.*;
import static java.lang.System.*;
public class Main1 {
static ArrayList<Integer> list1 = new ArrayList<>() ;
sta... | //package currentContest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;
public class P4 {
static int dp[][]=new int[5000+1][5000+1];
public static void main(String[] args) {
//... | 1 | Plagiarised |
307ef2cb | 565f77b7 | import java.util.PriorityQueue;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.Random;
import java.io.FileWriter;
import java.io.PrintWriter;
/*
Solution Created: 18:1... | import java.util.*;
import java.io.*;
public class Solution {
static Scanner scn = new Scanner(System.in);
static PrintWriter out = new PrintWriter(System.out);
static StringBuilder sb = new StringBuilder();
public static void main(String[] HastaLaVistaLa) {
int t = scn.nextInt();
while(t-- > 0) solve();
o... | 0 | Non-plagiarised |
07a0e4dc | bac616ee | import java.io.*;
import java.util.*;
public class C_NotAssigning_1400 {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
int t = sc.nextInt();
while(t-->0) {
int n = sc.nextInt();
... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class NotAssigning {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
... | 0 | Non-plagiarised |
13860c31 | 870e16d9 | import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.InputMismatchException;
/**
* Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools
*/
public class Main {
static InputReader sc=n... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class CF1 {
public static void main(String[] args) {
FastScanner sc=new FastScanner();
int T=sc.nextInt();
// int T=1;
for (int tt=0; tt<T; tt++){
int n ... | 0 | Non-plagiarised |
213340b3 | 870e16d9 | import java.util.*;
import java.io.*;
public class Solution {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.h... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class CF1 {
public static void main(String[] args) {
FastScanner sc=new FastScanner();
int T=sc.nextInt();
// int T=1;
for (int tt=0; tt<T; tt++){
int n ... | 0 | Non-plagiarised |
0e68e463 | 29cf2e70 | import java.io.*;
import java.util.*;
import static java.lang.Math.*;
public class D {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
PrintWriter pw = new PrintWriter(System.out);
int t = in.nextInt();
for(int tt = 0; tt < t; tt++) {
int n... | import java.util.*;
import java.io.*;
public class D {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
while(T-- > 0) {
int n = in.nextInt();
int[] a = new int[n];
for(int j=0;j<n;j++) a[j] = i... | 0 | Non-plagiarised |
28c2d81a | 48c5f745 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class D {
public static void main(String[] args) {
FastScanner fs = new FastScanner();
int cases = fs.nextInt();
while(cases-->0){
int n = fs.nextInt(), k = f... |
import java.io.*;
import java.util.*;
public class E {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Reader sc=new Reader();
PrintWriter pw=new PrintWriter(System.out);
int t=sc.nextInt();
while(t-->0) {
int n=sc.nextInt();
int k=sc.nextInt();
int[] ... | 1 | Plagiarised |
558df7d4 | d8654140 | import java.io.*;
import java.util.*;
public class Pupsen {
public static void main(String[] args) throws Exception {
FastIO in = new FastIO();
int t = in.nextInt();
for (int tc=0; tc<t; tc++) {
int n = in.nextInt();
int[] a = new int[n];
for (int i=0; i<n; i++) {
a[i] = in.nextInt();
}
int[] ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.*;
public class Codeforces {
static int mod=1000000007 ;
static List<Integer>[] adj;
static boolean vst[];
static int dp[];
public static v... | 0 | Non-plagiarised |
3a12e509 | 47310b0e | import java.io.*;
import java.util.*;
public class Practice
{
// static final long mod=7420738134811L;
static int mod=1000000007;
static final int size=501;
static FastReader sc=new FastReader(System.in);
// static Reader sc=new Reader();
static PrintWriter out=new PrintWriter(System.out);
static long[] factori... | import java.io.*;
import java.util.*;
public class Codeforces {
public static void main(String[] args) throws IOException{
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
int t = Integer.parseInt(br.readLine());
while (t-- > 0) {
int ... | 0 | Non-plagiarised |
4241f473 | 77448a05 | import java.io.*;
import java.util.*;
public class C {
public static void main(String[] args)throws IOException {
FastScanner scan = new FastScanner();
BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
int t = scan.nextInt();
for(int tt = 0;tt<t;tt++) {
int n = scan.n... | //package currentContest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Random;
import java.util.StringTokenizer;
public class P4 {
static in... | 1 | Plagiarised |
46bde295 | 8a858867 |
import java.io.*;
import java.util.Arrays;
public class C {
static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
private static int nextInt() {
try {... | import java.io.*;
import java.util.*;
public class Mainnn{
// static final File ip = new File("input.txt");
// static final File op = new File("output.txt");
// static {
// try {
// System.setOut(new PrintStream(op));
// System.setIn(new FileInputStream(ip));
// }... | 1 | Plagiarised |
80881cae | 9555b9d1 | //package Codeforces;
import java.io.*;
import java.util.*;
public class CP
{
static Scanner sc=new Scanner(System.in);
public static void main(String[] args) throws IOException, CloneNotSupportedException
{
int t=sc.nextInt();
while(t-->0)
{
int n=sc.nextInt();
int k[]=new int[n];
int h[]=new int[n... | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] arg... | 0 | Non-plagiarised |
6f02c6d9 | 884f5678 |
import java.io.*;
import java.util.*;
public class Main {
static long mod = 1000000007;
static long inv(long a, long b) {
return 1 < a ? b - inv(b % a, a) * b / a : 1;
}
static long mi(long a) {
return inv(a, mod);
}
static InputReader sc = new InputReader(System.in);
... | import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class JaiShreeRam{
static Scanner in=new Scanner();
static long mod = 1000000007;
static ArrayList<ArrayList<Integer>> adj;
public static void main(String[] args) throws Exception{
class Element{
int... | 1 | Plagiarised |
1a31f5cb | dc575a6c | import java.util.*;
import java.io.*;
public class Solution
{
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader()
{
din = new DataInputS... | // "static void main" must be defined in a public class.
import java.util.*;
import java.io.*;
public class Main {
static long[][]dp;
static ArrayList<Integer>[]adj;
static int[][]arr;
static class FastScanner {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
StringTokenizer ... | 0 | Non-plagiarised |
ccc8ef27 | f7a0ea6d | import java.util.*;
public class Sol
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0)
{
int n = sc.nextInt();
int a[][]=new int[n][5];
int tot[]=new int[n];
for(int i=0;i<n;i++)
{
String x = sc.n... | import java.util.*;
public class Solution {
private static Scanner in = new Scanner(System.in);
public static void main(String args[]) {
int t = in.nextInt();
while(t-->0) {
solution();
}
}
private static void solution() {
int ans=0;
int n = in.nextInt();
String s[] = new String[n];
... | 0 | Non-plagiarised |
9ab3c0e1 | d5fa4746 | //package CF672;
/**
* @version 1.0
* @Package_Name: CF672
* @Author: Redorain
* @Date: 2020/9/25 8:47
*/
import java.util.*;
public class d {
public static Scanner sc = new Scanner(System.in);
public static final int MOD = 998244353;
int []f; int [] lf;
public static int mul(int a, int b) {
... | import java.lang.*;
import java.util.*;
import java.io.*;
public class Main {
static FastScanner in = new FastScanner();
static final int MOD = 998244353;
static int n, k;
static int[] fact, invFact;
static int mul(int a, int b) {
return (int)((long)a * (long)b % MOD);
}
static i... | 1 | Plagiarised |
47d54299 | 63bfa731 | // package com.company.Codechef;
// import com.sun.security.jgss.GSSUtil;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class a {
static int depth[];
static ArrayList<Integer> tree[];
static int diameter=0;
public static void ma... |
import java.util.*;
import java.io.*;
public class D {
static ArrayList<Integer> adj[] = new ArrayList[(int)1e5+7];
static int diameter = 0;
static int[] depth = new int[(int)1e5 + 7];
public static void main(String[] args) {
FastReader in = new FastReader();
int t = in.nextInt();
... | 1 | Plagiarised |
e185bce5 | f3d7ce08 |
import java.util.*;
import java.io.*;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
public class Main {
private static FS sc = new FS();
private static class FS {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(... | import javax.swing.plaf.IconUIResource;
import java.lang.reflect.Array;
import java.text.CollationElementIterator;
import java.util.*;
import java.io.*;
//Timus judge id- 323935JJ
public class Main {
//----------------------------------------------------------------------------------------------
p... | 0 | Non-plagiarised |
2a35cd81 | 464ad4dd | import java.util.*;
import java.io.*;
public class Transform_the_experssion {
static Scanner sc=new Scanner(System.in);
static PrintWriter pw=new PrintWriter(System.out);
static ArrayList<Integer> []arr;
public static void main(String[] args) throws IOException, InterruptedException {
int t=sc.nextInt();
... | import java.io.*;
import java.util.*;
public class Solution{
public static int in = 0, count=0;
static class comparator implements Comparator<int[]>{
public int compare(int[] arr1 ,int[] arr2){
int gain1 =0, gain2=0;
for(int i:arr1) gain1+=i;
for(int i:arr2) gain2+=i;... | 0 | Non-plagiarised |
fadc1365 | fdd85afb | import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class a{
public static void main(String args[]) throws java.lang.Exception{
FastScanner s=new FastScanner();
PrintWriter out=new PrintWriter(System.out);
int... | import java.util.*;
public class Solution{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
long max=(long)1e18;
StringBuilder sb=new StringBuilder();
while(t-->0){
int n=sc.nextInt();
int k=sc.nextInt();
... | 0 | Non-plagiarised |
1f6b81b1 | 51151974 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
public class InterestingStory {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStrea... | import java.io.*;
import java.util.*;
public class Solution{
public static void main (String[] args) throws java.lang.Exception {
FastReader sc = new FastReader();
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
int testCase = sc.nextInt();
while (testCa... | 0 | Non-plagiarised |
034030f3 | bf992c91 | import java.util.*;
import java.io.*;
public class D_1525 {
static int INF = (int)1e9;
static int n, m;
static int[] full, free;
static int[][] memo;
public static int dp(int i, int j) {
if(i == n)
return 0;
if(j == m)
return INF;
if(memo[i][j] != -1)
return memo[i][j];
return memo[i][j... | import java.util.Arrays;
import java.util.Scanner;
public class P1525D {
public static int[] ones, zeros;
public static int[][] memo;
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int[] arr = new int[n];
int oneCount = ... | 1 | Plagiarised |
5b9a0551 | db1ef8b3 | import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
public class Main {
public static void main(String[] args) {
FastScanner in=new FastScanner();
PrintWriter out=new PrintWriter(System.out);
int t=in.nextInt();
while(t-->0)
solve(in,out);
out.close... | import java.util.*;
import java.io.*;
import java.math.*;
/**
*
* @Har_Har_Mahadev
*/
public class C {
private static long INF = 2000000000000000000L, M = 1000000007, MM = 998244353;
private static int N = 0;
public static void process() throws IOException {
int n = sc.nextInt();
PriorityQueue<Integer> o... | 0 | Non-plagiarised |
3e28571b | 77b5c134 | import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import static java.lang.Math.*;
public class Ans implements Runnable {
public static void main(String args[]) {
Ans s = new Ans();
s.run();
}
static void debug(Object... o) {
System.out.println(Arrays.deepToString(o));
}
InputReader sc = ... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
// https://codeforces.com/contest/1407/problem/D
public class Discrete_Centrifugal_Jumps {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
... | 0 | Non-plagiarised |
63a24497 | 6e5ab1d2 | import java.util.*;
import java.lang.*;
import java.io.*;
public class Main {
void solve() {
int n = in.nextInt();
char[] a = in.nextLine().toCharArray();
char[] b = in.nextLine().toCharArray();
int ans = MAX;
ans = Math.min(ans, operations(a, b));
ans = Math.min(a... | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;... | 1 | Plagiarised |
b2001d68 | ba468e1f |
/*
بسم الله الرحمن الرحيم
/$$$$$ /$$$$$$ /$$ /$$ /$$$$$$
|__ $$ /$$__ $$ |$$ |$$ /$$__ $$
| $$| $$ \ $$| $$|$$| $$ ... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Codeforces {
public static void main(String[] args) {
FastReader fastReader = new FastReader();
int t = fastReader.nextInt();
while (t-- > 0) {
int n = f... | 0 | Non-plagiarised |
ac180326 | b1e9f1f6 | //This code is written by प्रविण शंखपाळ
//package wizard;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.Collections;
import jav... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class test {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReade... | 0 | Non-plagiarised |
3f939694 | 54488276 | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;
import java.io.*;
public class Main {
public static void main(String args[])throws Exception{
Input sc=new Input();
StringBuilder sb=new StringBuilder();
int t=sc.readInt();... | import java.io.*;
import java.util.*;
public class C {
static int n;
public static void main (String[] args) throws IOException {
Kattio io = new Kattio();
int t = io.nextInt();
for (int ii=0; ii<t; ii++) {
n = io.nextInt();
String[] arr = new String[n];
for (int i=0; i<n; i++) {
String str = io... | 0 | Non-plagiarised |
9310ad0c | f36138e7 | import java.io.*;
import java.util.*;
public class Main{
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(
new InputStreamReader(System.in));
}
String next()
{
... | import java.io.*;
import java.util.*;
public class a {
public static void main(String[] args){
FastScanner sc = new FastScanner();
int t = sc.nextInt();
while(t-- > 0){
int n = sc.nextInt();
long time[] = new long[n];
long health[] = new long[n];
... | 0 | Non-plagiarised |
30e0cc81 | b55888de | import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.lang.*;
public class Main {
static class sortLong implements Comparator<long[]>{
public int compare(long[] a,long[] b){
if(a[0] > b[0]) return 1;return -1;
}
}
static class sortInt implements C... | import java.lang.reflect.Array;
import java.util.*;
public class Rough {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-->0) {
int n = sc.nextInt();
sc.nextLine();
String s[] = new String[n];... | 0 | Non-plagiarised |
3c667d4f | be3b1289 | import java.util.*;
public class j
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int n=in.nextInt();
while(n-->0)
{
int len=in.nextInt();
int t=in.nextInt();
int pos[]=new int[t];
int temp[]=new int[t];
for(int i=0;i<t;i++)
pos[i]=i... | import java.util.*;
import java.lang.*;
import java.io.*;
public class cf {
static PrintWriter out;
static int MOD = 1000000007;
static FastReader scan;
/*-------- I/O using short named function ---------*/
public static String ns() {
return scan.next();
}
public static int ni() ... | 1 | Plagiarised |
2bbf754b | 3a12e509 | import java.util.*;
/**
__ __
( _) ( _)
/ / \\ / /\_\_
/ / \\ / / | \ \
/ / \\ / / |\ \ \
/ / , \ , / / /| \ \
/ / |\_ /| / / / \ \_\
/ / |\/ _ '_| \ / / / \ \\
| / |/ 0 \0\ / | | \ \\
| |\|... | import java.io.*;
import java.util.*;
public class Practice
{
// static final long mod=7420738134811L;
static int mod=1000000007;
static final int size=501;
static FastReader sc=new FastReader(System.in);
// static Reader sc=new Reader();
static PrintWriter out=new PrintWriter(System.out);
static long[] factori... | 0 | Non-plagiarised |
1ea771ea | 2f8c3bf3 |
import java.io.*;
import java.util.*;
public class CODECHEF {
static class FastReader {
byte[] buf = new byte[2048];
int index, total;
InputStream in;
FastReader(InputStream is) {
in = is;
}
int scan() throws IOException {
if (index >= tot... | import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
int k=sc.nextInt();
int idx[]=new int[k];
for(int i=0;i<k;i++){
idx[i]=sc.nextInt();
}
... | 0 | Non-plagiarised |
9291ca83 | d61f51c5 | import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
public class Practice {
static HashMap<String, Integer> map = new HashMap<>();
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-->0) {
in... |
/*
/$$$$$ /$$$$$$ /$$ /$$ /$$$$$$
|__ $$ /$$__ $$ |$$ |$$ /$$__ $$
| $$| $$ \ $$| $$|$$| $$ \ $$ ... | 0 | Non-plagiarised |
9fd33d5a | c220c822 | import java.util.*;
import java.io.*;
public class Solution {
private static ArrayList<Integer> prime = new ArrayList<>();
public static void main(String[] args) throws IOException {
Scanner in=new Scanner(System.in);
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
... | // package com.company;
import java.util.*;
import java.io.*;
import java.lang.*;
public class Main{
public static void main(String args[]){
InputReader in=new InputReader(System.in);
TASK solver = new TASK();
int t=1;
t = in.nextInt();
for(int i=1;i<=t;i++)
{
... | 0 | Non-plagiarised |
3c74c140 | 732c98a0 |
//package com.company;
import java.math.*;
import java.util.*;
import java.lang.*;
import java.io.*;
public final class Main {
FastReader s;
public static void main (String[] args) throws java.lang.Exception
{
new Main().run();
}
void run()
{
s = new FastReader();
... | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
import static java.lang.Math.*;
import static java.lang.System.out;
import static java.lang.Long.MAX_VALUE;
public final class Main {
FastReader in;
StringBuffer sb;
public static void main(String[] args) {
new M... | 1 | Plagiarised |
2915ac5b | 9b8c6bd7 | import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
// static Scanner sc=new Scanner(System.in);
// static ArrayList<Integer> al;
static long min;
// static long[] dp;
static FastReader sc=new FastReader();
public static void main (String[] args) throws java.lang.Exception
{
... | import java.util.*;
import java.io.*;
import java.math.*;
public final class Main{
public static void main(String[] args) throws IOException{
// Scanner sc=new Scanner(System.in);
FastReader sc=new FastReader();
PrintWriter writer=new PrintWriter(System.out);
int tc=sc.nextInt();
while(tc-->0) {
in... | 1 | Plagiarised |
8f31b279 | a3e272af | import java.util.*;
import java.io.*;
public class JavaTract
{
static class Pair implements Comparable<Pair>{
int first;
int second;
Pair(int x,int y){
this.first=x;
this.second=y;
}
@Override
public int compareTo(Pair x){
return this.first-x.first;
}
}... |
import java.io.*;
import java.util.*;
public class Asd {
static PrintWriter w = new PrintWriter(System.out);
static FastScanner s = new FastScanner();
static boolean sd = false;
public static void main(String[] args) {
int t = s.nextInt();
//int t=1;
while (t-- > 0) {
... | 0 | Non-plagiarised |
5af25bd7 | fa1bf524 | import java.io.*;
import java.util.*;
public class MySolution {
public static void main(String[] args) throws Exception {
BufferedReader bu = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
int numOfTestCases = Integer.parseInt(bu.readLine());... | import java.util.*;
import java.io.*;
public class Solution {
static LinkedList<Integer> graph[];
static long key[][];
static long value[][];
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
StringBuffer out=new StringBuffer();
... | 0 | Non-plagiarised |
489930000000 | 96cd6ee9 | import java.io.*;
import java.util.*;
public class Codeforce {
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader() {
din = new DataInputStream(S... | import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class C{
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(... | 1 | Plagiarised |
0b5cff5a | 4fb09c5f | import java.io.*;
import java.text.DecimalFormat;
import java.util.*;
public class E {
static long mod=(long)1e9+7;
static long mod1=998244353;
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new... | import java.io.*;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.logging.Logger;
import java.util.stream.Collectors;
public class Trial {
public static void main(String[] args) throws IOException {
Scanner sc = new Scan... | 0 | Non-plagiarised |
3cbcb1cc | 6045e5d1 |
import java.util.*;
import java.lang.*;
import java.io.*;
public class E {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
br.readLine();
StringBuilder sb = new StringBuilder();
whi... |
import java.util.*;
import java.lang.*;
import java.io.*;
public class E {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
br.readLine();
StringBuilder sb = new StringBuilder();
whi... | 1 | Plagiarised |
8c591975 | b6724dd9 | import java.io.DataInputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
public class Main {
private static void run() throws IOException {
int n, k;
n = in.nextInt();
k = in.nextInt();
int[] a = new int[n];
long[] t = new l... |
import java.io.*;
import java.util.*;
public class AirConditioners {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
// System.in and System.out are input and output streams, respectively.
InputStream inputStream = System.in;
InputReader in = new InputReader(i... | 0 | Non-plagiarised |
74f4382e | bd584714 |
import java.io.*;
import java.util.*;
public class Solution {
static long modInverse(long a, long m) {
long m0 = m;
long y = 0, x = 1;
if (m == 1)
return 0;
while (a > 1) {
long q = a / m;
long t = m;
m = a % m;
a = t;
t = y;
y = x - q * y;
x = t;
}
if (x < 0)
x += m0;
... | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.FileReader;
... | 0 | Non-plagiarised |
2b9dfed3 | 351c9206 | import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import java.util.*;
import java.io.*;
import java.math.*;
/**
*
* @Har_Har_Mahadev
*/
/**
* Main , Solution , Remove Public
*/
public class E {
public static void process() throws IOException {
int n = sc.n... | import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import java.util.*;
import java.io.*;
import java.math.*;
/**
*
* @Har_Har_Mahadev
*/
/**
* Main , Solution , Remove Public
*/
public class E {
public static void process() throws IOException {
int n = sc.n... | 1 | Plagiarised |
49b94994 | f0d91796 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Main1582D {
public static void main(String[] args) {
final FastScanner in = new FastScanner(System.in);
... | import java.io.*;
import java.util.*;
public class cf {
public static void main(String[] args){
FastScanner sc = new FastScanner();
int t = sc.nextInt();
while(t-- > 0){
int n=sc.nextInt();
int arr[]=new int[n];
for(int i=0;i<n;i++){
arr... | 0 | Non-plagiarised |
6b83b22e | c59194c7 | import java.util.Scanner;
public class Subsequence {
private static Scanner sc = new Scanner(System.in);
public static void main(String args[]) {
int t = sc.nextInt();
while(t-->0) {
int n = sc.nextInt();
int a[] = new int[n];
int b[] = new int[n];
for(int i=0;i<n;i++) {
a[i]= sc.ne... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.*;
public class codeforcesB{
public static class FastReader
{
BufferedReader br;
StringTokenizer st;
public Fas... | 0 | Non-plagiarised |
00af3420 | d92c5342 | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
PrintWriter pw = new PrintWriter(System.out);
int t = sc.nextInt();
while(t-- > 0){
int n = sc.nextInt();
... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.*;
public class Main{
static class FastScanner {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));... | 0 | Non-plagiarised |
11373c16 | 69b2fd22 | /* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastRea... | import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[])
{
FastReader input=new FastReader();
PrintWriter out=new PrintWriter(System.out);
int T=1;
while(T-->0)
{
int n=input.nextInt();
int a[]=new int[n];
... | 0 | Non-plagiarised |
7686c854 | 8a729537 | import java.util.*;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.IntToLongFunction;
import java.lang.*;
import java.io.*;
import java.math.*;
public final class CF
{
public static void main(String[]args)throws IOException
{
FastReader ob=new FastRe... |
import java.io.*;
import java.util.*;
public class test3 {
public static void main(String[] args) throws IOException {
FastReader f = new FastReader();
int t = f.nextInt();
while(t-->0) {
int n = f.nextInt();
int C[] = new int[n];
long ans=Long.MAX_VALUE,pre = 0;
PriorityQueue<Integer> epq = ... | 1 | Plagiarised |
1c8bb204 | 7ed5a88d | import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class BST {
static class pair implements Comparable{
int high;
int idx;
pair(int x , int y){
high = x;
idx = y;
... | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.io.PrintStream;
//import java.util.*;
public class Solution {
public static final boolean L... | 0 | Non-plagiarised |
35eb27da | 8559d49e | /* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
i... | import java.io.*;
import java.util.*;
public class Ishu
{
static Scanner scan = new Scanner(System.in);
static BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
static void tc() throws Exception
{
int n = scan.nextInt();
String[] str = new String[n];
int i, j;
... | 0 | Non-plagiarised |
0df4050e | 6f02c6d9 | import java.io.*;
import java.util.*;
public class MainClass {
public static void main(String[] args) {
Reader in = new Reader(System.in);
int t = in.nextInt();
StringBuilder stringBuilder = new StringBuilder();
while (t-- > 0) {
ArrayList<Integer> reds = new ArrayList<>... |
import java.io.*;
import java.util.*;
public class Main {
static long mod = 1000000007;
static long inv(long a, long b) {
return 1 < a ? b - inv(b % a, a) * b / a : 1;
}
static long mi(long a) {
return inv(a, mod);
}
static InputReader sc = new InputReader(System.in);
... | 1 | Plagiarised |
8532d5ed | b9595381 | import java.util.*;
import java.io.*;
public class C_Interesting_Story{
public static void main(String[] args) {
FastScanner s= new FastScanner();
StringBuilder res = new StringBuilder();
int t=s.nextInt();
int p=0;
while(p<t){
int n=s.nextInt();
ArrayList<St... | import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main{
static int dest1;
static int dest2;
public static void main(String args[]){
FastScanner in = new FastScanner();
int test=in.nextInt();
while(test-->0){
int n=in.nextInt... | 0 | Non-plagiarised |
8a729537 | e270e909 |
import java.io.*;
import java.util.*;
public class test3 {
public static void main(String[] args) throws IOException {
FastReader f = new FastReader();
int t = f.nextInt();
while(t-->0) {
int n = f.nextInt();
int C[] = new int[n];
long ans=Long.MAX_VALUE,pre = 0;
PriorityQueue<Integer> epq = ... | import java.io.*;
import java.util.*;
public class GFG {
public static class Pair{
long first;
long second;
Pair(long first,long second){
this.first = first;
this.second = second;
}
}
public static int gcd(int a, int b)
{
// if b=0, a... | 1 | Plagiarised |
93ee4612 | da5cf40b | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual soluti... | /***** ---> :) Vijender Srivastava (: <--- *****/
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
static FastReader sc =new FastReader();
static PrintWriter out=new PrintWriter(System.out);
static long mod=(long)1e9+7;
/* start */
... | 0 | Non-plagiarised |
1eda0725 | d2901569 | import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[])
{
FastReader input=new FastReader();
PrintWriter out=new PrintWriter(System.out);
int T=input.nextInt();
while(T-->0)
{
int n=input.nextInt();
int k[]=... | import java.util.*;
import java.util.Scanner;
public class Solution {
static int mod=1000000007;;
//
public static void main(String[] args) {
// TODO Auto-generated method stub
// System.out.println();
Scanner sc=new Scanner(System.in);
int tt=sc.nextInt();
//
//
while(tt-->0){
int n=sc.nextIn... | 0 | Non-plagiarised |
927384f2 | d4779c71 | import java.util.*;
import java.io.*;
public class Main{
static class Point{
int x,y,z;
Point(int nx, int ny){
x = nx; y = ny;
}
@Override
public boolean equals(Object o) {
Point p = (Point)o;
return p.x == x && p.y == y;
}
}
public static void main(String[] args) throws IOException{
... | import java.util.ArrayList;
import java.util.Scanner;
import java.util.Stack;
public class D {
static Scanner sc = new Scanner(System.in);
static int[] height;
static int[] dp;
public static void main(String[] args) {
int n = sc.nextInt();
height = new int[n];
dp = new int[n];
... | 0 | Non-plagiarised |
69b2fd22 | 7bc92b7f | import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[])
{
FastReader input=new FastReader();
PrintWriter out=new PrintWriter(System.out);
int T=1;
while(T-->0)
{
int n=input.nextInt();
int a[]=new int[n];
... | import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args) throws java.io.IOException {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int[] arr=new int[n];
int[][] dp=new int[n][n];
int[][] min=new int[n][n];
ArrayLis... | 0 | Non-plagiarised |
3380fa52 | e1a5831a | import java.util.*;
import java.io.*;
import java.math.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Coder {
static int n, k;
static long a[];
static int pos[];
static int temp[];
static StringBuilder str = new StringBuilder("");
static int cnt[][] = new int[(int)1e5... | /* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
BufferedReader ... | 0 | Non-plagiarised |
0e87b87f | 6369a7a2 | import java.io.*;
import java.util.*;
public class table {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new
InputStreamReader(System.in));
}
public FastReader(File file) throws... | import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
public class C2 {
static ArrayList<Integer[]> list;
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader... | 0 | Non-plagiarised |
585af783 | f7a0ea6d | import java.util.*;
import java.io.*;
public class codeforces {
public static void main(String []args){
FastScanner sc = new FastScanner();
int t = sc.nextInt();
while(t-->0) {
int n = sc.nextInt();
String s[] = new String[n];
for(int i=0;i<n;i++)
... | import java.util.*;
public class Solution {
private static Scanner in = new Scanner(System.in);
public static void main(String args[]) {
int t = in.nextInt();
while(t-->0) {
solution();
}
}
private static void solution() {
int ans=0;
int n = in.nextInt();
String s[] = new String[n];
... | 0 | Non-plagiarised |
35bb6075 | ed728769 | /*
COLLECTIONS FRAMEWORK TUTORIAL
* HashMap
.add(key, value)
.get(key)
.containsKey(key) : true/false
.size()
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
static final long M = 1000000007;
... | import java.util.*;
import java.io.*;
public class Solution
{
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader()
{
din = new DataInputS... | 0 | Non-plagiarised |
cc669e02 | d88fa51c |
import java.util.*;
public class Codeforces {
// CHECK CONSTRAINTS ALWAYS EDGE CASE MISSED
static int mod = 1000000007;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
int t = sc.nextInt();
while(t-->0) {
int n = sc.nextInt(... | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class code{
public static int GCD(int a, int b)
{
if (b == 0)
return a;
return GCD(b, a % b);
}
//@SuppressWarnings("unchecked")
public static void main(String[] arg) throws IOException{
... | 0 | Non-plagiarised |
51d88c51 | c2b7b017 |
import java.awt.Container;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.Bi... | // Working program with FastReader
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
//
public class Example {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new Buffere... | 1 | Plagiarised |
624b8db5 | e9986d44 | //created by Whiplash99
import java.io.*;
import java.util.*;
public class C
{
private static ArrayDeque<Integer>[] edge;
private static HashMap<String,Integer> map;
private static String getHash(int u, int v)
{
if(u>v)
{
int tmp=u;
u=v;
v=tmp;
... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class cp23 {
static BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
static int mod = 1000000007;
static String toReturn = "";
static int steps = Integer.MAX_VALUE... | 0 | Non-plagiarised |
c1fef98f | f870e76b | import java.util.*;
import java.io.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Test{
static FastReader scan;
static void solve(){
scan.nextLine();
int n... |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Stack;
import j... | 0 | Non-plagiarised |
169e34bf | fae0662f | import java.util.*;
public class D{
static Scanner sc;
public static void solve(){
int n=sc.nextInt();
Integer a[]=new Integer[n];
int flag;
for(int i=0;i<n;i++) a[i]=sc.nextInt();
String s=sc.next();
ArrayList<Integer> x=new ArrayList<>();
ArrayList<Integer> y=new ArrayList<>();
for... | 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.StringTokenizer;
public class D {
public static void main(String[] args) throws IOException {
FastScanner fs = new Fas... | 1 | Plagiarised |
5af25bd7 | 77ec956f | import java.io.*;
import java.util.*;
public class MySolution {
public static void main(String[] args) throws Exception {
BufferedReader bu = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
int numOfTestCases = Integer.parseInt(bu.readLine());... | import java.io.*;
import java.util.*;
public class Codeforces
{
public static void main(String args[])throws Exception
{
BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb=new StringBuilder();
int t=Integer.parseInt(bu.readLine());
while(t--... | 1 | Plagiarised |
8ad1ad84 | f652c678 | import java.io.*;
import java.util.*;
import java.math.*;
import java.math.BigInteger;
//import javafx.util.*;
public final class B
{
static PrintWriter out = new PrintWriter(System.out);
static StringBuilder ans=new StringBuilder();
static FastReader in=new FastReader();
static ArrayList<Integer> g[];
sta... | import java.io.*;
import java.text.DecimalFormat;
import java.util.*;
public class C {
static long mod = (long) 1e9 + 7;
static long mod1 = 998244353;
static ArrayList<Integer>[] adj;
static HashMap<String,Long> hmap;
public static void main(String[] args) {
InputStream inputStream = System... | 0 | Non-plagiarised |
3a12e509 | fae0662f | import java.io.*;
import java.util.*;
public class Practice
{
// static final long mod=7420738134811L;
static int mod=1000000007;
static final int size=501;
static FastReader sc=new FastReader(System.in);
// static Reader sc=new Reader();
static PrintWriter out=new PrintWriter(System.out);
static long[] factori... | 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.StringTokenizer;
public class D {
public static void main(String[] args) throws IOException {
FastScanner fs = new Fas... | 0 | Non-plagiarised |
29cf2e70 | b2001d68 | import java.util.*;
import java.io.*;
public class D {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int T = in.nextInt();
while(T-- > 0) {
int n = in.nextInt();
int[] a = new int[n];
for(int j=0;j<n;j++) a[j] = i... |
/*
بسم الله الرحمن الرحيم
/$$$$$ /$$$$$$ /$$ /$$ /$$$$$$
|__ $$ /$$__ $$ |$$ |$$ /$$__ $$
| $$| $$ \ $$| $$|$$| $$ ... | 1 | Plagiarised |
1adac634 | ee0bc145 | import java.io.*;
import java.util.*;
public class Main {
static int i, j, k, n, m, t, y, x, sum = 0;
static long mod = 998244353;
static FastScanner fs = new FastScanner();
static PrintWriter out = new PrintWriter(System.out);
static String str;
static long ans;
public static void main(S... | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner();
PrintWriter out = new PrintWriter(System.out);
int t = sc.nextInt();
while(t-- > 0) {
int n = sc.nextInt();
int[] k = new int[n];
... | 0 | Non-plagiarised |
05ca89ed | 163d0dde |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.*;
public class er106c
{
//By shwetank_verma
public static void main(String[] args)
{
FastReader sc=new FastReader();
... | // Working program with FastReader
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class aa
{
static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastReader()
{
... | 1 | Plagiarised |
4552d8a0 | ec4c7e8e | import java.util.*;
import java.io.*;
////***************************************************************************
/* public class E_Gardener_and_Tree implements Runnable{
public static void main(String[] args) throws Exception {
new Thread(null, new E_Gardener_and_Tree(), "E_Gardener_and_Tree", 1<... | import java.util.*;
public class the_child_and_set
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int t=in.nextInt();
in.nextLine();
while(t--!=0)
{
int n=in.nextInt();
int arr[]=new int[n];
for(int i=0;i<n;i++)
{
arr[i]=in.nextInt();
}
in.nextLine();
... | 0 | Non-plagiarised |
0c0af0ff | d6a8d884 | import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
PrintWriter out = new PrintWriter(System.out);
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer tok = new StringTokenizer("");
String next() throws IOException {
if (!tok.hasMoreToke... | //Praise our lord and saviour qlf9
//DecimalFormat f = new DecimalFormat("##.00");
import java.util.*;
import java.io.*;
import java.math.*;
import java.text.*;
public class C{
public static void main(String[] omkar) throws Exception
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
Str... | 0 | Non-plagiarised |
25597bcb | 86232d21 | 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;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.... | import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
public class... | 0 | Non-plagiarised |
81a9086f | baebdc56 |
import java.io.*;
import java.util.*;
public class D
{
static long mod=998244353;
static long[] facts, factInvs;
public static void main(String[] args)throws IOException
{
FastReader f=new FastReader();
StringBuffer sb = new StringBuffer();
int n=f.nextInt();
int k=f.nextInt();
Time time[]=... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;
public class D {
static final int mod=998244353;
static long[] facts, factInvs;
public static void main(String[] args) {
precomp();
... | 0 | Non-plagiarised |
14b0fb8e | 6490bbe8 | import java.io.*;
import java.util.*;
public class Solution {
static long res;
public static void main(String[] args) throws Exception
{
FastReader fr=new FastReader();
int n=fr.nextInt();
ArrayList<Integer> oc=new ArrayList<>();
ArrayList<Integer> em=new ArrayList<>();
res=... | import java.util.*;
// import java.lang.*;
import java.io.*;
// THIS TEMPLATE MADE BY AKSH BANSAL.
public class Solution {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in))... | 0 | Non-plagiarised |
701c3f35 | d56bcb0c | import java.util.*;
import java.io.*;
public class Menorah {
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(f.readLine());
while(t-->0) {
int n=Integer.parseInt(f.readLine());
String s=f.readLine(... | import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
static int func(char a[],char b[]){
int n=a.length;
int a1=0,b1=0;
for(int i=0;i<n;i++){
if(a[i]=='1')a1++;
if(b[i]=='1')b1++;
}
if(a1!=b1)return 100000000;
int cnt=0... | 0 | Non-plagiarised |
04df7bb8 | 85125ecb | import java.math.BigInteger;
import java.sql.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import jav... | import java.io.*;
import java.util.Arrays;
import java.util.Hashtable;
public class AirConditionersUpsolve{
static class InputReader {
private static final int DEFAULT_BUFFER_SIZE = 1 << 16; // Change this to increase your input size //
private static final InputStream DEFAULT_STREAM = System.in;pr... | 1 | Plagiarised |
0d11fb94 | 8c79c384 | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class Main {
static int i, j, k, n, m, t, y, x, sum = 0;
static long mod = 1000000007;
static FastScanner fs = new FastScanner();
static PrintWriter out =... | /*
JAI MATA DI
*/
import java.util.*;
import javax.print.attribute.HashAttributeSet;
import java.io.*;
import java.math.BigInteger;
import java.sql.Array;
public class CP {
static class FR{
BufferedReader br;
StringTokenizer st;
public FR() {
br = new BufferedReader(new InputStreamReader(System... | 0 | Non-plagiarised |
680ba922 | ee4b9467 | import java.util.*;
import java.io.*;
public class Solution
{
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader()
{
din = new DataInputS... | import java.io.*;
import java.util.*;
public class _1615c {
FastScanner scn;
PrintWriter w;
PrintStream fs;
long MOD = 1000000007;
int MAX = 200005;
long mul(long x, long y) {long res = x * y; return (res >= MOD ? res % MOD : res);}
long power(long x, long y) {if (y < 0) return 1; long re... | 0 | Non-plagiarised |
132281000000000 | f415c0bf |
import java.io.*;
import java.math.*;
import java.util.*;
public class test {
static class Pair{
long x;
long y;
Pair(long x,long y){
this.x = x;
this.y = y;
}
}
static class Duo{
int x;
String s;
Duo(int x,String s){
this.x = ... |
import java.util.Scanner;
public class BalancedStoneHeaps {
static boolean check(long[] a, long k) {
int n = a.length;
long[] temp = new long[n];
for (int i = 0; i < n; i++) {
temp[i] = a[i];
}
for (int i = n - 1; i >= 2; i--) {
if (temp[i] < k) {
... | 1 | Plagiarised |
9028caf7 | e6b7a899 | import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[])
{
FastReader input=new FastReader();
PrintWriter out=new PrintWriter(System.out);
int T=1;
while(T-->0)
{
int n=input.nextInt();
int a[]=new int[n];
... | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
public class Main {
static final long MOD=1000000007;
static final long MOD1=998244353;
static long ans=0;
//static ArrayList<Integer> ans=new ArrayLis... | 0 | Non-plagiarised |
45b19e51 | f9adc043 | import java.util.*;
import java.io.*;
public class Main {
static FastScanner sc = new FastScanner(System.in);
static PrintWriter pw = new PrintWriter(System.out);
static StringBuilder sb = new StringBuilder();
static long mod = (long) 1e9 + 7;
public static void main(String[] args) throws Exceptio... | import java.util.*;
import java.io.*;
public class C {
public static void main(String[] args) throws IOException {
FastScanner in = new FastScanner(System.in);
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
int bruh = in.nextInt();
for (int cases = 0; cases < bruh;... | 0 | Non-plagiarised |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.