exec_outcome
stringclasses
1 value
code_uid
stringlengths
32
32
file_name
stringclasses
111 values
prob_desc_created_at
stringlengths
10
10
prob_desc_description
stringlengths
63
3.8k
prob_desc_memory_limit
stringclasses
18 values
source_code
stringlengths
117
65.5k
lang_cluster
stringclasses
1 value
prob_desc_sample_inputs
stringlengths
2
802
prob_desc_time_limit
stringclasses
27 values
prob_desc_sample_outputs
stringlengths
2
796
prob_desc_notes
stringlengths
4
3k
lang
stringclasses
5 values
prob_desc_input_from
stringclasses
3 values
tags
listlengths
0
11
src_uid
stringlengths
32
32
prob_desc_input_spec
stringlengths
28
2.37k
difficulty
int64
-1
3.5k
prob_desc_output_spec
stringlengths
17
1.47k
prob_desc_output_to
stringclasses
3 values
hidden_unit_tests
stringclasses
1 value
PASSED
8b5b6e48ee82e3b224a9c657374baf69
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.util.Arrays; import java.util.HashSet; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.util.Random; import java.io.FileWriter; import java.io.PrintWriter; /* Solution Created:...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
5f6b36ae137aee7253615104add3f39a
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.*; import java.util.*; public class new1{ static long mod = 1000000007; static long count = 0; public static long gcd(long a, long b) { if (a == 0) return b; return gcd(b%a, a); } public static void main(String[] args) throws IOException{ Buffe...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
038345bb7c2918c51033818b302ac337
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
/** * Created by Himanshu **/ import java.util.*; import java.io.*; import java.math.*; public class D1635 { public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(System.out); Reader s = new Reader(); int n = s.i(), p = s.i(); ...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
88fb738c2612ef937fa5a95b6d09bff2
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
//some updates in import stuff 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.*; //key points learned //max space ever that could be alloted in a program to pass in cf //int[][] prefixSum = new int[...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
c60593e1b370538f81ce2fc4654b4dc8
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.*; import java.util.*; public class Solution extends PrintWriter { long MOD = 1_000_000_007L; void solve() { int n = sc.nextInt(); int p = sc.nextInt(); Integer[] a = new Integer[n]; for(int i = 0; i < n; i++) a[i] = sc.nextInt(); Ar...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
2f4275435c246297e10bbca653976daf
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; /** TODO: unsolved D. Infinite Set https://codeforces.com/contest/1635/problem/D My idea: 1. How to use 2^p ? 2. 4y > 2y + 1 3. SOLUTION: 1. 2k + 1 must be odd, 4k must ...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
b778c547384bc8a3b12cf5b941a9363f
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; import static java.lang.Math.*; import static java.lang.Math.ceil; import static java.util.Arrays.sort; public class Round11 { static long dp[]; static Has...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
904d05dae287b7ed3035b38f92bd1410
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.util.HashSet; import java.util.Scanner; public class MainClass { private static final int mod = 1000000007; private static final int N = 200010; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int p =...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
d0da428a7183137324c3daa5b30a1c60
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
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 List<List<Integer>> adj; static int seive[]=new int[1000001]; static long C[][]; public static void m...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
34db5f73ed517b8be87a322cb2a6d445
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner scn = new Scanner(System.in); OutputWriter out = new OutputWriter(System.out); // Always print a trailing "\n" and close the OutputWriter as shown at th...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
7ebbc9bc82f2e95698132f3efde730f3
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.awt.MultipleGradientPaint.ColorSpaceType; import java.io.*; import java.sql.PreparedStatement; import java.util.*; public class cp { static int mod=(int)1e9+7; // static Reader sc=new Reader(); static FastReader sc=new FastReader(System.in); static int[] sp; static int size=(int...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
b6e047c4c84d0d6388735ceb407a9ec9
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
/* 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; pub...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
6ba18db50f42027aff2ed3815885ba8d
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; import java.util.TreeSet; public class TaskD { final long mod = 1_000_000_007; public static void main...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
64f5cd9f2f5ac27af15b0cd2362e2720
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
//package infiniteset; import java.util.*; import java.io.*; public class infiniteset { public static void main(String[] args) throws IOException { BufferedReader fin = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(fin.readLine()); int n = Integer.parse...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
b2d08d6ce9b78bcc06ae0c273cc1dc5f
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
// package c1635; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.u...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
0fe87a9a5bac8a079e1c3ac985c2be37
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; public class D_Inf { public static void main(String[] args) throws IOException { BufferedScanner input = new BufferedScanne...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
3a23b98c45a1e653333f95b3d05b7bfd
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class D { public static FastScanner s = new FastScanner(); public static PrintWriter out = new PrintWriter(System.out); public static void main(Stri...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
32d506109a074d9d65461fad1425027c
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
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...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
c2aa6a94af7d75cb75ec8cf6f6c17dac
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.*; import java.util.*; public class Main { static class Scanner { Scanner(InputStream in) { this.in = in; } InputStream in; byte[] bb = new byte[1 << 15]; int i, n; byte getc() { if (i == n) { i = n = 0; try { n = in.read(bb); } catch (IOException e) {} } return i < n...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
df10a8e4adaf7bb9e88447e80d3014e4
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.*; import java.util.*; public class D { static long MOD = (long) (1e9+7); static HashSet<Integer> bt = new HashSet<Integer>(); public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new ...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
fc2ff0d5fa0daab6f9453ca7922c801c
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.*; import java.util.*; public class CF1635D extends PrintWriter { CF1635D() { super(System.out); } Scanner sc = new Scanner(System.in); public static void main(String[] $) { CF1635D o = new CF1635D(); o.main(); o.flush(); } static final int MD = 1000000007; void main() { int n = sc.nextInt();...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
d36878f660c2983ad865910e784a5335
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { static int MOD = 1000000007; // After writing solution, quick scan for: // array out of bounds // special cases e.g. n=1? // npe, particularly in maps // // Big numbers arithmetic bugs: // in...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
d146a8a2f3d6c033ab1d70b2793d250f
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.HashSet; import java.util.Set; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in *...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 11
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
3d38130533414d6dffd394a0f6fd3aad
train_108.jsonl
1645367700
You are given an array $$$a$$$ consisting of $$$n$$$ distinct positive integers.Let's consider an infinite integer set $$$S$$$ which contains all integers $$$x$$$ that satisfy at least one of the following conditions: $$$x = a_i$$$ for some $$$1 \leq i \leq n$$$. $$$x = 2y + 1$$$ and $$$y$$$ is in $$$S$$$. $$$x = 4y$$$...
256 megabytes
import java.util.*; import java.io.*; public class C { static long mod = (long) 1e9 + 7; static boolean dfs(long n, HashSet<Long> set){ if(n == 1) return false; if(n%2 == 1){ if(set.contains(n/2)) return true; return dfs...
Java
["2 4\n6 1", "4 7\n20 39 5 200", "2 200000\n48763 1000000000"]
2 seconds
["9", "14", "448201910"]
NoteIn the first example, the elements smaller than $$$2^4$$$ are $$$\{1, 3, 4, 6, 7, 9, 12, 13, 15\}$$$.In the second example, the elements smaller than $$$2^7$$$ are $$$\{5,11,20,23,39,41,44,47,79,80,83,89,92,95\}$$$.
Java 17
standard input
[ "bitmasks", "dp", "math", "matrices", "number theory", "strings" ]
fbb6d21b757d8d56396af1253ec9e719
The first line contains two integers $$$n$$$ and $$$p$$$ $$$(1 \leq n, p \leq 2 \cdot 10^5)$$$. The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ $$$(1 \leq a_i \leq 10^9)$$$. It is guaranteed that all the numbers in $$$a$$$ are distinct.
1,800
Print a single integer, the number of elements in $$$S$$$ that are strictly smaller than $$$2^p$$$. Remember to print it modulo $$$10^9 + 7$$$.
standard output
PASSED
d55da6cc918d75668f6996877fec257c
train_108.jsonl
1645367700
There are $$$n$$$ weighted points on the $$$OX$$$-axis. The coordinate and the weight of the $$$i$$$-th point is $$$x_i$$$ and $$$w_i$$$, respectively. All points have distinct coordinates and positive weights. Also, $$$x_i &lt; x_{i + 1}$$$ holds for any $$$1 \leq i &lt; n$$$. The weighted distance between $$$i$$$-th ...
256 megabytes
import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import...
Java
["5 5\n-2 2\n0 10\n1 1\n9 2\n12 7\n1 3\n2 3\n1 5\n3 5\n2 4"]
3 seconds
["9\n11\n9\n24\n11"]
NoteFor the first query, the minimum weighted distance is between points $$$1$$$ and $$$3$$$, which is equal to $$$|x_1 - x_3| \cdot (w_1 + w_3) = |-2 - 1| \cdot (2 + 1) = 9$$$.For the second query, the minimum weighted distance is between points $$$2$$$ and $$$3$$$, which is equal to $$$|x_2 - x_3| \cdot (w_2 + w_3) =...
Java 8
standard input
[ "data structures", "greedy" ]
046d0c0c73aad1a5dc295af1a43e0fc6
The first line contains 2 integers $$$n$$$ and $$$q$$$ $$$(2 \leq n \leq 3 \cdot 10^5; 1 \leq q \leq 3 \cdot 10^5)$$$ — the number of points and the number of queries. Then, $$$n$$$ lines follows, the $$$i$$$-th of them contains two integers $$$x_i$$$ and $$$w_i$$$ $$$(-10^9 \leq x_i \leq 10^9; 1 \leq w_i \leq 10^9)$$$...
2,800
For each query output one integer, the minimum weighted distance among all pair of distinct points in the given subarray.
standard output
PASSED
aa183aa7e73d73295f80a8efb8b35716
train_108.jsonl
1645367700
There are $$$n$$$ weighted points on the $$$OX$$$-axis. The coordinate and the weight of the $$$i$$$-th point is $$$x_i$$$ and $$$w_i$$$, respectively. All points have distinct coordinates and positive weights. Also, $$$x_i &lt; x_{i + 1}$$$ holds for any $$$1 \leq i &lt; n$$$. The weighted distance between $$$i$$$-th ...
256 megabytes
// package c1635; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.StringTokenizer; import ja...
Java
["5 5\n-2 2\n0 10\n1 1\n9 2\n12 7\n1 3\n2 3\n1 5\n3 5\n2 4"]
3 seconds
["9\n11\n9\n24\n11"]
NoteFor the first query, the minimum weighted distance is between points $$$1$$$ and $$$3$$$, which is equal to $$$|x_1 - x_3| \cdot (w_1 + w_3) = |-2 - 1| \cdot (2 + 1) = 9$$$.For the second query, the minimum weighted distance is between points $$$2$$$ and $$$3$$$, which is equal to $$$|x_2 - x_3| \cdot (w_2 + w_3) =...
Java 11
standard input
[ "data structures", "greedy" ]
046d0c0c73aad1a5dc295af1a43e0fc6
The first line contains 2 integers $$$n$$$ and $$$q$$$ $$$(2 \leq n \leq 3 \cdot 10^5; 1 \leq q \leq 3 \cdot 10^5)$$$ — the number of points and the number of queries. Then, $$$n$$$ lines follows, the $$$i$$$-th of them contains two integers $$$x_i$$$ and $$$w_i$$$ $$$(-10^9 \leq x_i \leq 10^9; 1 \leq w_i \leq 10^9)$$$...
2,800
For each query output one integer, the minimum weighted distance among all pair of distinct points in the given subarray.
standard output
PASSED
33ba097980cbd8ad310289e7853132e1
train_108.jsonl
1645367700
There are $$$n$$$ weighted points on the $$$OX$$$-axis. The coordinate and the weight of the $$$i$$$-th point is $$$x_i$$$ and $$$w_i$$$, respectively. All points have distinct coordinates and positive weights. Also, $$$x_i &lt; x_{i + 1}$$$ holds for any $$$1 \leq i &lt; n$$$. The weighted distance between $$$i$$$-th ...
256 megabytes
// package c1635; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.StringTokenizer; import ja...
Java
["5 5\n-2 2\n0 10\n1 1\n9 2\n12 7\n1 3\n2 3\n1 5\n3 5\n2 4"]
3 seconds
["9\n11\n9\n24\n11"]
NoteFor the first query, the minimum weighted distance is between points $$$1$$$ and $$$3$$$, which is equal to $$$|x_1 - x_3| \cdot (w_1 + w_3) = |-2 - 1| \cdot (2 + 1) = 9$$$.For the second query, the minimum weighted distance is between points $$$2$$$ and $$$3$$$, which is equal to $$$|x_2 - x_3| \cdot (w_2 + w_3) =...
Java 11
standard input
[ "data structures", "greedy" ]
046d0c0c73aad1a5dc295af1a43e0fc6
The first line contains 2 integers $$$n$$$ and $$$q$$$ $$$(2 \leq n \leq 3 \cdot 10^5; 1 \leq q \leq 3 \cdot 10^5)$$$ — the number of points and the number of queries. Then, $$$n$$$ lines follows, the $$$i$$$-th of them contains two integers $$$x_i$$$ and $$$w_i$$$ $$$(-10^9 \leq x_i \leq 10^9; 1 \leq w_i \leq 10^9)$$$...
2,800
For each query output one integer, the minimum weighted distance among all pair of distinct points in the given subarray.
standard output
PASSED
90046677827cfb27823b30416dc749c8
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { //br = new BufferedReader(new FileReader("input.txt")); //out = new PrintWriter("output.txt"); int t = 1; t = nextInt(); while (t-- != 0) { ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
141170eea1076ffbdd54283ee425e4d5
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { //br = new BufferedReader(new FileReader("input.txt")); //out = new PrintWriter("output.txt"); int t = 1; t = nextInt(); while (t-- != 0) { ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
a68d6d68248d6b661387768ff82b226c
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
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(); long k=sc.nextLong(); long a[]=new long[n]; fo...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
13478e1f5fc4b1fdbb4d4911e4d03b47
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; //import static com.sun.tools.javac.jvm.ByteCodes.swap; public class fastTemp { static FastScanner fs = null; public static void main(String[] args) { fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
16ad153e7acc760e4fc9939d4490f259
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while (n-- > 0) { long ans = 0; int m = sc.nextInt(); int k = sc.nextInt(); int a...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
05df9c4c633c13ee7f33287ff1736a3b
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
//package CodeforcesContests; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class C { public static void main (String[] Z) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(Sy...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
2ff72360b2fd30dbc42d82990e506666
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; import static java.lang.Math.*; public class Practice { static StringBuilder sb = new StringBuilder(); static Scanner scn = new Scanner(System.in); public static void main(String[] HastaLaVistaLa) { int t = scn.nextInt(); // int t = 1; for(int tests = 0; t...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
cc80b9b0c3a1cbbe8935e5807f47cd14
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; /** * @author Naitik * */ public class Main { static FastReader sc=new FastReader(); static int dp[][][]; //static int v[][]; static int mod=998244353;; // static int mod=1000000007; static long max; static long bit[]; ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
cc2e7d7eecf94984530386b062cb7f63
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class c { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
4f49e99087c551bfe7442525ad0f5bc2
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Templ { static StreamTokenizer in; static int nextInt() throws IOException { in.nextToken(); return (int) in.nval; } public static void ma...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
c5088fa056743010d39343ef6a90b5af
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Templ { static StreamTokenizer in; static int nextInt() throws IOException { in.nextToken(); return (int) in.nval; ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
e3914366dc08310fe85dbed2fcfb84fb
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class solution { public static void main(String[] args) { FScanner sc = new FScanner(); //Arrays.fill(prime, true); //sieve(); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); long k=sc.nextInt(); k++; long arr[]=new long[n]; for(int i=0;i<...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
cd85d4c3454b1f349e7c0cfe35c90ff4
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class solution { public static void main(String[] args) { FScanner sc = new FScanner(); //Arrays.fill(prime, true); //sieve(); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); long k=sc.nextInt(); k++; long arr[]=new long[n]; for(int i=0;i<...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
43a94683b6e6dd267e1e5a0204025a89
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.awt.Container; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; public class Main { public ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
679efdbb9a374a00daaed7cd1374e236
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
//package com.company; import java.util.*; import java.io.*; public class Banknotes { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int testcases = Integer.parseInt(br.readLine()); for(int tests = 0; tes...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
5a6ca97946e93ad4c04a32247e864a37
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Task { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
bb5e09dd20f25903485ce62c85b8cbf6
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
//package Div2.C; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Banknotes { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.re...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
e6e51a38597037616a20aa319e9a5135
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
//package Div2.C; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Banknotes { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.re...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
eddd5ac8d56cbbd83a5bb1fe83aa8a8b
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
//package Div2.C; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Banknotes { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.re...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
e5b85e7d0efff4ba2043d4d8770b9657
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
// Problem: C. Banknotes // Contest: Codeforces - Educational Codeforces Round 116 (Rated for Div. 2) // URL: https://codeforces.com/contest/1606/problem/C // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) // Problem: D. Frog Traveler // Contest: Codeforces - Codeforces ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
16bd97687d44e28cc8ca9a86f099ad23
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; public class banknotes { public static void main(String[] args) { // Scanner sc = new Scanner(System.in); FastReader sc = new FastReader(); int t = sc.nextIn...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
99e2a81946c9f038ff5c28d0863cdd51
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; public class C1606{ static FastScanner fs = null; public static void main(String[] args) { fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int t = fs.nextInt(); while(t-->0){ int n = fs.nextInt(); long k = fs.nextLong(); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
dfe312d20b9bb0b86e781811ec4a8e05
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
/* || श्री राम समर्थ || || जय जय रघुवीर समर्थ || */ import java.io.*; import java.math.BigInteger; import java.util.*; import static java.util.Arrays.sort; public class CodeforcesTemp { static Reader scan = new Reader...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
bf1256634fa0b03bc4b2cb7b5d0b960c
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
/* || श्री राम समर्थ || || जय जय रघुवीर समर्थ || */ import java.io.*; import java.math.BigInteger; import java.util.*; import static java.util.Arrays.sort; public class CodeforcesTemp { static Reader scan = new Reader...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
649d5c1d76a1d7461a10b6e95f64357d
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.Scanner; public class C1606 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for (int t = 0; t < T; t++) { int N = in.nextInt(); int K = in.nextInt() + 1; int[] A = new int[N...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
5ae4e4d7bcb6a3469092f54c5aae5b18
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class Sum { static BufferedReader bf; static PrintWriter out; static Scanner sc; static StringTokenizer st; public static void main (String[] args)throws IOException { bf = new BufferedReader(new InputStreamReader(System.in)); out = new PrintW...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
917f683e8b1c626342846014e4acb411
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; public class SolnC { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i=0;i<t;i++) { int n=sc.nextInt(); int k=sc.nextInt(); k++; int[] a = new int[n]; for(int j=0;j<n;j++) { a[j]=sc.nextInt(); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
bf7eb3c4cba7fb738d3022c3e7698492
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) throws Exception { int tc = io.nextInt(); for (int i = 0; i < tc; i++) { solve(); } io.close(); } static long pow(long a, long b) { if (b ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
11183acce0710a6b232aecf864e24b07
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class C { 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 = in.nextInt(); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
55e1f9184c0ee99a9dbbbaf2fc64689e
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class Banknotes { public static void main(String[] args) throws IOException { FastReader fr = new FastReader(); PrintWriter pr = new PrintWriter(new OutputStreamWriter(System.out)); int t = fr.nextInt(); while (t-- > 0) { ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
5bff36811c7cc8a1cd42ef004e38bc1d
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; // import java.lang.*; // import java.math.*; public class Codeforces { static FastReader sc=new FastReader(); static PrintWriter out=new PrintWriter(System.out); static long mod=1000000007; // static long mod=998244353; static int MAX=Integer.MAX_VALUE; static...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
75591d3fed803470024d2a9f7efcbc69
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
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 Scanner(System.in); int t = sc.nextInt(); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
69c3020ead74fd9aa09d9a157c2f72a6
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.Scanner; public class Banknotes { public static void solve(int n,int k,int[] arr) { long ans=0; // if(k<1000000000) k=k+1; for (int i = 1; i < n; i++) { int x=(int) (Math.pow(10, arr[i])/Math.pow(10,arr[i-1])-1); // System.out.println("hi "+x); if(k-x>=0) { ans+=x*Math.p...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
727aa03513a323d7cf6211f4bcababd9
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.awt.Container; import java.awt.Point; import java.io.*; import java.util.*; //import javax.naming.directory.NoSuchAttributeException; public class Main { static FastScanner scr=new FastScanner(); // static Scanner scr=new Scanner(System.in); static PrintStream out=new PrintStream(System.o...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
313944409ecbf3ef1096c86a4be1ae26
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; import java.io.*; import java.util.*; import java.math.*; import static java.lang.Math.sqrt; import static java.lang.Math.floor; import java.io.*; import java.util.*; import java.io.*; import java.util.*; import java.util.*; public class topcoder { pu...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
d936366cf52b6eb20172237e56961c89
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class P3B { public static void main(String[] args) { FastIO io = new FastIO(); int t = io.nextInt(); while (t --> 0) { int n = io.nextInt(); int k = io.nextInt(); long[] array = new long[n]; for (int i=0; i...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
b99f320c5f24c57a4eaaacec8bac93c3
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Coder { static StringBuffer str=new StringBuffer(); static int n; static long k; static long a[]; /* Idea i got: Maximize the smaller number of bank notes so that we can minimize s and also at the same time, we can...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
44c55ff5c26c5548e9bb340b476e79a4
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; import static java.lang.Math.PI; import static java.lang.System.in; import static java.lang.System.out; import static java.lang.System.err; public class A { public static void main(String[] args) throws Exception { Foster...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
55921e39842342973e378814257ef263
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; import java.math.BigDecimal; import java.math.*; public class Main{ public static void main(String[] args) { TaskA solver = new TaskA(); // boolean[]prime=seive(3*100001); int t = in.nextInt(); for (int i = 1; i <= t ; i++...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
20d519d138f944deeb4a5f146a3db874
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; public class code{ static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { din = new ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
468d0e0fc42bfdcaca2107a3008ec709
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class C_Banknotes { static int M = 1_000_000_007; static final PrintWriter out =new PrintWriter(System.out); static final FastReader fs = new FastReader(); static boolean prime[]; public static void main (String[] a...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
e4fd17b81414f4c7b04a3ed1fc3ca961
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Practice { public static long mod = (long) Math.pow(10, 9) + 7; public static long mod2 = 998244353; public static int tt = 0; public static ArrayList<...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
2d9b2fbe3c156fb3a23b59fb1c4d0a0e
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class Main { public int isNegativeWeightCycle(int n, int[][] edges) { //code here int dis[]=new int[n]; Arrays.fill(dis,Integer.MAX_VALUE); for (int i=1;i<n;i++){ for (int j=0;j<edges.length;j++){ ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
336281c3820c45b8e5fec8b57d9fea3e
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*;import java.util.*;import java.math.*;import static java.lang.Math.*;import static java. util.Map.*;import static java.util.Arrays.*;import static java.util.Collections.*; import static java.lang.System.*; public class Main { public void tq()throws Exception { st=new Stri...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
24dedabd8f73b086b019de1aa43477f7
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
/** * check out my youtube channel sh0rkyboy * https://tinyurl.com/zdxe2y4z * I do screencasts, solutions, and other fun stuff in the future */ import java.util.*; import java.io.*; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.Math.max; public class EdA { ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
38582bd1746818889beba906b812b499
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
/* Author:-crazy_coder- */ import java.io.*; import java.util.*; public class cp{ static long mod=1000000007; static int ans=0; static int[] par=new int[100005]; static int[] rank=new int[100005]; static BufferedReader br=new BufferedRead...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
e10322ac35fef1073b023b7be92311bd
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; public class class1 { public static void main(String[] args) { Scanner input=new Scanner(System.in); int t=input.nextInt(); while(t-->0) { int n=input.nextInt(); long a[]=new long[n]; long k=input.nextLong()+1; long ans=0,temp1=0,temp2=0,temp3=...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
16befc5e09d2411ebb2a205c8d7bded3
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; public class class462 { public static void main(String arg[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); long k=sc.nextLong(); long a[]=new long[n]; int i; k+=1; for(i=0;i<n;i++) a[i]=sc.n...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
9f641d8279370e01a2762a3c9dc1b7c0
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
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 t = sc.nextInt(); for (int tc = 0; tc < t; ++tc) { int n = sc.nextInt(); int k = sc.nextInt(); int[] a = new int...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
bac0523d1ecd9a6090905257e03b6384
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class Main { static int i, j, k, n, m, t, y, x, sum = 0; static long mod = 100000000000L; static FastScanner fs = new FastScanner(); static PrintWriter out = new PrintWriter(System.out); static String str; static long ans; public st...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
328b66a8daaa011a2b4e8c16497f932e
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; //import javafx.util.*; public class Main { static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static int INF = Integer.MAX_VALUE; static int NINF = Integer.MIN_VALUE; public static StringBuilder str = new Stri...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
f65867ad3359c87d7a3e98c9995c30a7
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import static java.lang.Math.*; import java.io.*; import java.math.*; import java.util.*; public class cf2 { static FastReader x = new FastReader(); static OutputStream outputStream = System.out; static PrintWriter out = new PrintWriter(outputStream); /*---------------------------------------CODE STARTS...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
b1993afb8aa02e8fa804fc289885bd36
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Bit...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
c3581f173131b1954afcdb55867ab495
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class _1606c { FastScanner scn; PrintWriter w; PrintStream fs; int 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 ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
8e64bde73cdfd6a9e73ba332cbe5ca2d
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java....
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
60ac3fd2752680a09344f2c9de3c63d6
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; public class C { public static void main(String[] args) { FastReader in = new FastReader(); PrintWriter out = new PrintWriter(System.out); int T = in.nextInt(); for(int ttt = 1; ttt <= T; ttt++) { int n = in.nextInt(); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
7574a9fe0cff6c4edac6d540eb4e6377
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; public class CodeForces { class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try { br = new BufferedReader( new FileReader("input.txt")); Print...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
27a41a04c75a3e357b09eafb34235f13
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; public class MyCpClass{ public static void main(String []args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int T = Integer.parseInt(br.readLine()....
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
c55f8045f796962cd3087c49575cafda
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.util.*; import java.lang.*; public class Solution{ static class Graph{ public static class Vertex{ HashMap<Integer,Integer> nb= new HashMap<>(); // for neighbours of each vertex } public static HashM...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
6032722ecc9fab5a47ab570ae4062987
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; // cd C:\Users\Lenovo\Desktop\New //ArrayList<Integer> a=new ArrayList<>(); //List<Integer> lis=new ArrayList<>(); //StringBuilder ans = new StringBuilder(); //HashMap<Integer,Integer> map=new HashMap<>(); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
d79376c35c5064e81717cc971ed1be6a
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
/** * * YUVRAJ PARASHAR * * */ 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.*; public class Main{ // constants__________________________________________________________________...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
2cf393a910c4885fc996d520941842ae
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.PrintStream; import java.util.Scanner; public class C { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintStream out = System.out; int t = sc.nextInt(); for (int i = 0; i < t; i++) { int n = sc.nextInt(); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
17af7bd3321a2d46edc116bbe1f82aa6
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.util.stream.Collectors; import java.io.*; import java.math.*; public class ER116_C { public static FastScanner sc; public static int MOD= 1000000007; public static class FastScanner { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTok...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
123068dcb51d839caf111aa289130019
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.Scanner; public class CF_1606 { 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 = sc.nextInt(); Integer[] d= new Integer[n]; ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
1e7a610e18f4db4bf43ba949f55f1ffd
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
/* package codechef; // don't place package name! */ import java.io.*; public final class PROBOBAL { public static void main(String[] args)throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.readLine()),b=0,n=0,j=0,c...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
f72290e8de1bb728f8fe0e0fd6d0da4d
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; import java.io.*; public class Omar { static PrintWriter pw = new PrintWriter(System.out); static Scanner sc=new Scanner(System.in); public static void main(String[] args) throws IOException { int t=sc.nextInt(); while(t-->0) { long n=sc.nextLong(),k=sc.nextLong(); ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
730655eddcdc2d6410dd90d25de7f0ae
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt() ; while (N -- != 0){ int n = sc.nextInt() ; int k = sc.nextInt() ; k++ ; long[] ans = new long[n ...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
85f7cee9cce5bd7302687c0624daddb8
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Banknotes { private static final Scanner scanner = new Scanner(System.in); private static void solve(int t) { int n = scanner.nextInt(); int k = scanner.nextInt() + 1; List<Integer> ar...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
ce68fb455733a9ccda57c7fc05e65d76
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
//---#ON_MY_WAY--- import static java.lang.Math.*; import java.io.*; import java.math.*; import java.util.*; public class apples { static class pair { int x, y; public pair(int a, int b) { x = a; y = b; } } static FastReader x = new FastReader(); static OutputStream outputStream = Sy...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
a5846a7530536c8c5ae3dbf24374bb4f
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
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(); in...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
3cc3daac5e0e936fdd44abb136bcee26
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.text.DecimalFormat; import java.util.*; import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.st...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
520b08c79d04710ed70e4f5c5143d0e7
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.util.*; public class Contest_yandexA{ public static void main(String[] args) { Scanner input = new Scanner(System.in); int t = input.nextInt(); for(int tt = 0;tt<t;tt++){ int n = input.nextInt(); int k = input.nextInt()+1; int[] a = new int[n]; for(int i = 0;i<n;i++){ a[i]...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output
PASSED
b2b97869881df6d168577b014bd69edb
train_108.jsonl
1635518100
In Berland, $$$n$$$ different types of banknotes are used. Banknotes of the $$$i$$$-th type have denomination $$$10^{a_i}$$$ burles (burles are the currency used in Berland); the denomination of banknotes of the first type is exactly $$$1$$$.Let's denote $$$f(s)$$$ as the minimum number of banknotes required to represe...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; public class Main{ public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); static long MOD = (long) (1e9 + 7); // static long MOD = 998244353; static long MOD2 = MOD * MOD; static FastReader sc = new FastRea...
Java
["4\n3 13\n0 1 2\n2 777\n0 4\n3 255\n0 1 3\n10 1000000000\n0 1 2 3 4 5 6 7 8 9"]
2 seconds
["59\n778\n148999\n999999920999999999"]
null
Java 8
standard input
[ "greedy", "number theory" ]
e25e44b8f300d6be856df50bff8ff244
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — number of test cases. The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 10; 1 \le k \le 10^9$$$). The next line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$0 = a_1 &lt; a_2 &lt; \dots &lt; a...
1,400
For each test case, print one integer — the minimum positive number of burles $$$s$$$ that cannot be represented with $$$k$$$ or fewer banknotes.
standard output