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
288468fdb343224efa361e617b6a923f
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.*; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { InputStream inputStream = System.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 8
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
edc46df08af978a4b3323aede4460122
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.*; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { InputStream inputStream = System.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 8
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
ca2872f4717305b528a17f94db2ef578
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.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.math.BigInteger; import java.util.*; import java.util.concurrent.ThreadLocalRandom; //import javax.print.att...
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 8
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
e2e76a352c00610a3afe8cee87d89d11
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.BufferedWriter; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.PriorityQueue; import java.util.Sca...
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 8
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
36783fe8e185c99a628b534247c9b615
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.*; public class InfiniteSet { static MScanner scanner = new MScanner(); static long mod = (int) (1e9 + 7); public static void main(String[] args) { int n = scanner.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 8
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
176613c9e9158f1e827a48b415802b21
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 { //--------------------------INPUT READER---------------------------------// static class fs { public BufferedReader br; StringTokenizer st = new StringTokenizer(""); public fs() { this(System.in); } public fs(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 8
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
2ee041f990c718f0c884aa648dcb2406
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.Arrays; import java.util.HashSet; import java.util.StringTokenizer; public class Main { static AReader scan = new AReader(); static int MOD = (int)1e9+7; static void slove() { int n = scan....
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 8
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
29246726b1a4f832d7a02e08a287f8f2
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 AACFCC { public static long mod = (long) Math.pow(10, 9) + 7; public static long mod2 = 998244353; public static int oo = 0; public static ArrayList<Integer> pri...
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 8
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
5229eeea14ae20da3c8b7e4db7e40f42
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 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StreamTokenizer st = new StreamTokenizer(br); static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); public static void mai...
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 8
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
8c884cfc15b5a523725548a90549ae5c
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.math.BigInteger; import java.util.*; import java.io.*; public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StreamTokenizer st = new StreamTokenizer(br); static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); 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 8
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
1864af9fb7420ced23bd5b4f29eacb94
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.*; import java.math.*; /** * @author Naitik * */ public class Main { static FastReader sc=new FastReader(); static long dp[]; // static boolean v[][][]; // static int mod=998244353;; static int mod=1000000007; static int max; static int bit[]; ...
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 8
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
5e91e5fe5bef87eebfa0a0c5eab683d4
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
/* Setting up my ambitions Check 'em one at a time, yeah, I made it Now it's time for ignition I'm the start, heat it up They follow, burning up a chain reaction, oh-oh-oh Go fire it up, oh, oh, no Assemble the crowd now, now Line 'em up on the ground No leaving anyone behind */ import static java.lang.Math...
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 8
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
9d21cf1397a5a2e86216dd0bf98dbe52
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
// OM NAMAH SHIVAY // 2 days remaining(2609) import java.math.BigInteger; import java.util.*; import java.io.*; public class Vaibhav { static boolean prime[]; static class Pair implements Comparable<Pair> { int a; int b; Pair(int a, int b) { this.a ...
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 8
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
90c38f9373ae5222586e11f6de6e8fd1
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.HashMap; import java.util.HashSet; import java.util.Objects; import java.util.Random; import java.util.Stack; import j...
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 8
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
277bcb585a64292f843ce34fe65d78db
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 InfiniteSet { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.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 8
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
457f6d1e5e3fe1df90a9c0829728898a
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.*; // import java.lang.*; // import java.math.*; public class Main { 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 int 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 8
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
d6e573c543962d7ef7364731b6fceb52
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 FastReader sc=null; static long mod=(long)1e9+7; public static void main(String[] args) { sc=new FastReader(); int n=sc.nextInt(),p=sc.nextInt(); int a[]=sc.readArray(n); long dp[]=new long[p+1],pre[]=new long[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 8
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
65a29ddab988d9e0dd0bf835b760fa5c
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 { // For fast input output static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try { br = new BufferedReader( new FileReader("input...
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 8
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
2f07d2b9f9bfb105021766dc882ef6dd
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.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long mod=1000000007; int n=sc.nextInt(),p=sc.nextInt(); long[] a=new long[n]; for(int 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 8
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
c4da9bcd9146cb3461199dc4951493ca
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.*; //import java.math.BigInteger; public class code{ public static class Pair{ int a; int b; Pair(int i,int j){ a=i; b=j; } } public static int GCD(int a, int b) { if (b == 0) return a; return GCD(b, a % b); }...
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 8
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
2d2f86c7ddd4c2706330dfd0ec2aecf7
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 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 StringTokenizer(bq.rea...
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 8
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
8462191999d4be5dceb928990b69e02c
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 { public static void main(String[] args) throws Exception { long[]pre=new long[200009]; pre[0]=1; pre[1]=1; for(int i=2;i<200009;i++){ pre[i]+=pre[i-1]; pre[i]+=pre[i-2]; ...
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 8
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
f881efcc2c0fda05d230eb7cfaa344f8
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.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
["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 8
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
ab0f0050f1be651471eb3bb53a902737
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 javax.swing.*; import java.lang.reflect.Array; import java.text.DecimalFormat; import java.util.*; import java.lang.*; import java.io.*; import java.math.*; import java.util.stream.Stream; // Please name your class Main public class Main { static FastScanner fs=new FastScanner(); ...
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 8
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
204bef51f8f5f1821c02b7b0b9eeefa4
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
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class Solution { static StringBuffe...
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 8
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
8f240e7ed3aa4b8f03fab958bab07e5f
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 javax.management.openmbean.KeyAlreadyExistsException; // import java.lang.invoke.ConstantBootstraps; // import java.math.BigInteger; // import java.beans.IndexedPropertyChangeEvent; import java.io.*; @SuppressWarnings("unchecked") public class Main implements Runnable { stat...
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 8
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
24ccc2cd7c87a64e7172f8303f220a7d
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 { private static final int MOD = 1_000_000_007; private static final int MANUAL_P_MAX = 30; public static void solve(FastIO io) { final int N = io.nextInt(); final int P = io.nextInt(); final int[] A = io.nextIntArray(N); HashSet<Intege...
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 8
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
23529b9a8ab0126cd04fb5c4911a4e31
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.IOException; import java.io.InputStream; import java.util.*; public class Main { static InputReader sc = new InputReader(System.in); public static void main(String[] args) { solve(); } private static void solve() { int n=sc.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 8
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
fd19d4329d2ceeb926cb9c972e793b47
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 final class Main { //int 2e9 - long 9e18 static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(0, 1), new Pair(1, 0), new Pair(0, -1)}; static...
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 8
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
db6811e2fab2580a9c23d6fdac54dbd9
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 D_Infinite_Set{ public static void solve(){ } public static void main(String args[])throws IOException{ Reader sc=new Reader(); int n=sc.nextInt(); int p=sc.nextInt(); int a[]=new int[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 8
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
f674d18494d434e5e4adcd6adce7146f
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 Solution { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuffer out = new StringBuffer(); int T = ...
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 8
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
48ff4c46b6e1640b65daf89f89ebfd80
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 Hiking { static Scanner sc; static PrintWriter pw; static int mod=(int)1e9+7; public static void sort(int[]in) { shuffle(in); Arrays.sort(in); } public static void shuffle(int[]in) { for(int i=0;i<in.length;i++) { int idx=(int)(Math....
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 8
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
02ef3d14616dc39b75ffba39c9d837d9
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 cravuri on 2/21/22 */ import java.util.Arrays; import java.util.Scanner; public class D { static final long MOD = (long) 1e9 + 7; static int numDigits(int a) { int count = 0; while (a != 0) { a = a >> 1; count++; } re...
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 8
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
e266ebc475e9c8633c6bb0fa5760cf79
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 Hiking { static Scanner sc; static PrintWriter pw; static int mod=(int)1e9+7; public static void sort(int[]in) { shuffle(in); Arrays.sort(in); } public static void shuffle(int[]in) { for(int i=0;i<in.length;i++) { int idx=(int)(Math.r...
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 8
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
3f0c9305e4508b74ccf31acdedb1ebcf
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.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int n = cin.nextInt(); int p = cin.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = cin.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 8
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
4289a54da1957f8db0336d8a088f9afb
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.lang.*; import java.io.*; public class Codechef { static long fans[] = new long[200001]; static long inv[] = new long[200001]; static long mod = 1000000007; static void init() { fans[0] = 1; inv[0] = 1; fans[1] = 1; inv[1] = 1; for (int i = 2; i < 200001; 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 8
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
354519bfb3e0c3dad3f5d983d60a4a16
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.*; import javafx.util.*; public class Solution { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reade...
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 8
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
2ecbd790bd8b0dd107ef042dce11fd69
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 final class D { public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int n = fs.nextInt(); int p = fs.nextInt(); int[] a = fs.readArray(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 8
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
46d0951259f695d5d686f4a4c39ab260
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.*; // BEFORE 31ST MARCH 2022 !! //MAX RATING EVER ACHIEVED-1622(LETS SEE WHEN WILL I GET TO CHANGE THIS) ////*************************************************************************** /* public class E_Gardener_and_Tree implements Runnable{ public static void ma...
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 8
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
4450046378dea9b83323731980357314
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 D1635 { static int mod = (int) 1e9 + 7; public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); long[] fib = new long[(int) 1e6]; ...
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 8
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
ff38f55a47170be1554e587cdfbcca3d
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 D { // @formatter:off static long mod=(int)(1e9)+7; static FastScanner in; static class FastScanner{ private InputStream stream; private byte[] buf = new byte[1 << 16]; private int curChar; private int numChars; // standard input public FastScanner() {...
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
158aab31cee643d3adf8900644416b99
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 codeforces_772_D { private static long mod = 1_000_000_007; private static long[] fib = getFib(200_001); private static long[] sumFib = getSumFib(200_001); private static long[] getSumFib(int sz) { var ans = new long[sz]; ans...
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
fb4e9dff39313e97db9bede14bd28080
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.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class TaskD { private static long MOD = 1_000_000_007L; public static void main(String[] arg) { final FastScanner in = new Fa...
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
f8a3e33a79c0fe2af44b71b20caf20a1
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.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class TaskD { private static long MOD = 1_000_000_007L; public static void main(String[] arg) { final FastScanner in = new Fa...
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
41938f52e0b208b4af8cf2596d147186
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 _1635_D { static long MOD = 1000000007; public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); StringT...
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
c65acb319db1a059bb9c30e44895ab8c
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 DD { { MULTI_TEST = false; FILE_NAME = ""; NEED_FILE_IO = false; INF = Long.MAX_VALUE; } //// fields int log(int x) { int log = 0; while(x > 0) { x /= 2; log++; ...
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
6472410a27ddb21bb45fba276f82bf3b
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.Arrays; import java.util.HashSet; import java.util.InputMismatchException; import java.util.StringTokenizer; public class DD { { MULTI_TEST = false; FILE_NAME = ""; NEED_FILE_IO = false; INF = Long.MAX_VALUE; } //// fields 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
8b9de0e36b38085d192cc6f6bceaa298
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 com.sun.source.tree.Tree; import java.io.*; import java.util.*; public class DD { { MULTI_TEST = false; FILE_NAME = ""; NEED_FILE_IO = false; INF = Long.MAX_VALUE; } //// fields int log(int x) { int log = 0; while(x > 0) { ...
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
b0c19f10316b148c088a70c4d8713e97
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 final int MOD = (int) (1e9 + 7); static FastReader sc; static void solve() { int n = sc.nextInt(); int p = sc.nextInt(); Integer[] a = new Integer[n]; Set<Integer> set = new TreeSet<>(); for (int 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
cef11a149106601a755389c2d3915eb2
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 final int MOD = (int) (1e9 + 7); static FastReader sc; static void solve() { int n = sc.nextInt(); int p = sc.nextInt(); Integer[] a = new Integer[n]; Set<Integer> set = new TreeSet<>(); for (int 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
c7621d0e860870f42d1bf85d7a504b0f
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 final int MOD = (int) (1e9 + 7); static FastReader sc; static void solve() { int n = sc.nextInt(); int p = sc.nextInt(); Integer[] a = new Integer[n]; Set<Integer> set = new TreeSet<>(); for (int 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
e7ef9aa0aa850c4af5acfb375dc26ddf
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 final int MOD = (int) (1e9 + 7); static FastReader sc; static void solve() { int n = sc.nextInt(); int p = sc.nextInt(); Integer[] a = new Integer[n]; Set<Integer> set = new TreeSet<>(); for (int 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
bbd75eb0d785d38397575856d49c1cda
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 final int MOD = (int) (1e9 + 7); static FastReader sc; static void solve() { int n = sc.nextInt(); int p = sc.nextInt(); Integer[] a = new Integer[n]; Set<Integer> set = new TreeSet<>(); for (int 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
043378526f0ee047f0320b0b866e3c30
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 final int MOD = (int) (1e9 + 7); static FastReader sc; static void solve() { int n = sc.nextInt(); int p = sc.nextInt(); Integer[] a = new Integer[n]; Set<Integer> set = new HashSet<>(); for (int 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
343070406cf631c80c6430f4b9daf009
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.*; public class Main { static final int MOD = (int) (1e9 + 7); static Scanner sc = new Scanner(System.in); static void solve() { int n = sc.nextInt(); int p = sc.nextInt(); Integer[] a = new Integer[n]; Set<Integer> set = new HashSet<>(); for (int 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
e286a118b62a9c9908070afe7fc62c7f
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 on: 10:40:04 PM | 20-Feb-2022 import java.util.*; import java.io.*; import java.math.*; import java.lang.*; public class Solution { static InputStream is; static PrintWriter out; static String INPUT = ""; static void solve() { int caseNo = 1; solveIt(caseNo); } // Solution st...
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
22bbeac54ae217594af4b28da284c171
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 on: 10:40:04 PM | 20-Feb-2022 import java.util.*; import java.io.*; import java.math.*; import java.lang.*; public class Solution { static InputStream is; static PrintWriter out; static String INPUT = ""; static void solve() { int caseNo = 1; solveIt(caseNo); } // Solution st...
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
e9e939c37bb6fbbfbf1dc98bba309027
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.Arrays; import java.util.HashSet; import java.util.InputMismatchException; public class E1635D { static int MOD = (int) 1e9 + 7; public static void main(String[] args) { FastIO io = new FastIO(); int n = io.nextInt(); int p = io.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
6e7d75ebf82579263fda8d5ab05f51ab
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 = 1000000007; public static void main (String[] args) throws IOException { Kattio io = new Kattio(); int n = io.nextInt(); int p = io.nextInt(); TreeSet<Long> set = new TreeSet<Long>(); for (int i=0; i<n; i++) { long x = io.nextLo...
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
d907eb83a3416dee62c04717132151ff
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 Code { //<--------------------------------FAST------------------------------------------------>// static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter out = new PrintWriter(System.out); static Strin...
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
b040a88b2815babb714b30061df1138c
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 Code { //<--------------------------------FAST------------------------------------------------>// static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter out = new PrintWriter(System.out); static Strin...
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
280e4f60d7469304b5df4fcad3e0be01
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 Code { //<--------------------------------FAST------------------------------------------------>// static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter out = new PrintWriter(System.out); static Strin...
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
61dc7f0b98857b4b9fe7057f9ef2f006
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.lang.reflect.Array; import java.lang.reflect.GenericArrayType; import java.util.*; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int p = sc.nextInt(); int[] arr = new int[n]; HashSet...
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
5f28f498a3f62660f9a2d5eea3ce4a7b
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.io.PrintStream; import java.util.Arrays; import java.util.Random; import java.util.HashSet; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * * ...
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
4b5f27390be64e6195527e98f2d25346
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 { public static void main(String[] args) { solve(); out.close(); } public static void solve() { int M = sc.nextInt(); int p = sc.nextInt(); int[] a = sc.readArray(M); long res = 0; Ha...
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
19fff2a1d9d95b0bba21b03154c127b8
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 javax.print.DocFlavor.INPUT_STREAM; import java.io.*; import java.math.*; import java.sql.Array; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLIntegrityConstraintViolationException; public class Main { private static class MyScanner { ...
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
38e4bf1e2e049b98331e38e81df0ede9
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
//Utilities import java.io.*; import java.util.*; public class a { static int t; static int n, p; static int[] a; static long[] dp; static long res; static final int MOD = (int)1e9+7; public static void main(String[] args) throws IOException { t = 1; while (t-- > 0) { n = in.iscan(); 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
cbc2de81422591ceff5f48680b5a56e3
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.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.security.cert.X509CRL; import java.util.*; import java.lang.*; import java.util.stream.Collector; import java.util.stream.Co...
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
f6101b9290f46c9d12e21209338b22af
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 D { public void prayGod() throws IOException { int n = nextInt(), p = nextInt(); int[] a = nextIntArray(n); sort(a); HashSet<Integer> seen = new HashSet<>(); int[] count = new int[30]; for (int 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
b886809c655c647779982a48594e258d
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 D { public void prayGod() throws IOException { int n = nextInt(), p = nextInt(); int[] a = nextIntArray(n); sort(a); HashSet<Integer> seen = new HashSet<>(); int[][] count = new int[30][2]; for (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
b77b0354868c7a8861cf86300b7ae806
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 D { class TrieNode { TrieNode[] children; boolean endValue; TrieNode() { children = new TrieNode[2]; Arrays.fill(children, null); endValue = false; } } public void prayG...
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
89106db06fb48ce196a15e906d0d85fe
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 javax.sound.midi.Soundbank; import java.awt.*; import java.io.*; import java.util.*; public class Main { static int N = 100001; // Array to store inverse of 1 to N static long[] factorialNumInverse = new long[N + 1]; // Array to precompute inverse of 1! to N! static long[...
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
d5e8ce45a1aa8d8cde0928dfd876e022
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 class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st...
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
22f937617ed64526f8d65276feddab22
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 class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st...
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
f03be037caa0b977d4680f0bc1d0be5a
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 InfiniteSet { //io static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter out = new PrintWriter(System.out); static boolean debug = false; //param static TreeSet<Integer> useful = new TreeSet<>(); ...
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
7a3e1e53e3d6b18c49c2c00ce4ba3879
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.Arrays; import java.util.HashSet; import java.util.StringTokenizer; public class D { static int mod= (int) (1e9+7); public static void main(String[] args) { ...
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
40884e8f47432ee8a3e894bb58763299
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.Arrays; import java.util.HashSet; import java.util.StringTokenizer; public class D { static int mod= (int) (1e9+7); public static void main(String[] args) { ...
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
72df30dbae663aba746de2d23a723584
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.Arrays; import java.util.HashSet; import java.util.StringTokenizer; public class D { static int mod= (int) (1e9+7); public static void main(String[] args) { ...
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
640a45b2f6aef89b569b93c9ec2d23be
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 CodeForces { /*-------------------------------------------EDITING CODE STARTS HERE-------------------------------------------*/ public static void solve(int tCase) throws IOException { int n = sc.nextInt(); int p = sc.nextInt(); int[] arr...
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
44664466f61b2cb0f558177cc1468ccb
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 CodeForces { /*-------------------------------------------EDITING CODE STARTS HERE-------------------------------------------*/ public static void solve(int tCase) throws IOException { int n = sc.nextInt(); int p = sc.nextInt(); int[] arr...
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
1198acd4e142434723d086484c2b8cff
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 { static int M = 1_000_000_007; static Random rng = new Random(); private static int testCase(int n, int p, int[] a) { Set<Integer> base = new HashSet<>(); int[] memo = new int[Math.max(34, p + 3)]; int ans = 0, ...
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
90e1541ad581f2fba12c996b2248f3e5
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 static java.lang.Integer.parseInt; import static java.lang.Long.parseLong; import static java.lang.Double.parseDouble; public class Main { public static void main(String[] args) throws IOException { in = new BufferedReader(new InputStreamReader(System.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
0edd4b37532551a896091d3caa22ca55
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 q4 { public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static long mod = 1000000007; public static long[] dp; public static void fill(){ dp = new long[200001]; dp[0] = 1; ...
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
2fdde40a7a8f515a75a97174a863d8a7
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 q4 { public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static long mod = 1000000007; public static long[] twoPower,normal; public static void fill(){ twoPower = new long[200001]; 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
42795cc68d902fdd2c0010895eec74c0
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 D1 { static IOHandler sc = new IOHandler(); public static void main(String[] args) { // TODO Auto-generated method stub solve(0); } private static void solve(int t) { int n = sc.nextInt(); int p = sc.nextInt(); int [] arr = sc.rea...
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
13faca4b65158acb96a22fd5dd371955
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.*; public class contestE { static final int mod = 1000000007; public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = 1;//scanner.nextInt(); while (t-->0){ int n = scanner.nextInt(); int p = scanner.nex...
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
d1e4e182e97a99828876ae8315ab3b8f
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.util.Scanner; import java.util.Set; public class TaskD { public static void main(String[] args) { Scanner in = new Scanner(System.in); new TaskD().solve(in); } private void solve(Scanner in) { int n = in.nextInt(); 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
efdfebf2edbbce79fa787de64c4cee89
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 { Solution() { super(System.out); } Scanner sc = new Scanner(System.in); public static void main(String[] $) { Solution o = new Solution(); o.main(); o.flush(); } static final int MD = 1000000007; void main() { int 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
5a64b148d9830d0198489e41cad01830
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 codeforces { static class in { static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer tokenizer = new StringTokenizer(""); static String next() throws IOException { while (!t...
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
4e95f0b0a26e1370ffcdd752263e7edc
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.lang.*; import java.math.BigInteger; import java.io.*; public class Main implements Runnable { public static void main(String[] args) { new Thread(null, new Main(), "whatever", 1 << 26).start(); } private FastScanner sc; private PrintWriter pw; ...
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
e38bcb8a318ff1a27d926fe64b6534d4
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.util.function.Function; import java.util.stream.IntStream; /* polyakoff */ public class Main { static FastReader in; static PrintWriter out; static Random rand = new Random(); static final int oo = (int) 2e9 + 10; static final long ...
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
dd6eea80d4e8380065043ee9bcdcea39
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.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.util.TreeSet; import java.util.StringTokenizer; import java.io.Writer; im...
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
1f18569c38c4cf50ad1041b68dbc115d
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 static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import java.io.*; import java.util.*; public class Solution { static int mod=(int)1e9+7; static HashMap<Integer,Boolean> mp=new HashMap<>(),present=new HashMap<>(); public static void main(String[...
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
dc4552f0827ab61f5a7c6e74e0a476f6
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.lang.*; import java.io.*; public class Main { void solve() { int n = in.nextInt(); int p = in.nextInt(); int[] a = array(n, 1); Arrays.sort(a); HashSet<Integer> set = new HashSet<>(); long[] dp = new long[p]; for ...
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
ee01e5db1991efb214d7fc5f22fd10e7
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 com.company; import java.io.*; import java.util.*; public class Main{ static boolean[] primecheck = new boolean[1000002]; static ArrayList<Integer>[] adj; static int[] vis; static int mod = (int)1e9 + 7; public static void main(String[] args) { OutputStream outputS...
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
023a41c53a40f0be092216781e18d011
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.util.HashSet; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.util.Set; import java.io.OutputStreamWriter; import java.util.InputMismatchException; ...
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
b90d8fca31e707a6d90e292a8047a5a1
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
/* "Everything in the universe is balanced. Every disappointment you face in life will be balanced by something good for you! Keep going, never give up." Just have Patience + 1... */ import java.util.*; import java.lang.*; impor...
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
2af4336905a735934483b19d67e582f8
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.Set; import java.lang.Math; import java.util.Queue; import java.util.Arrays; import java.util.Scanner; import java.util.HashMap; import java.util.HashSet; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.PriorityQueue; public final cla...
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
460a06f49e80dcdbaaacb601053068b8
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
// JAI SHREE RAM, HAR HAR MAHADEV, HARE KRISHNA import java.util.*; import java.util.Map.Entry; import java.util.stream.*; import java.lang.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.io.*; public class Eshan { static BufferedReader br = new BufferedReader(new InputStrea...
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
d9dbdb8bfa43be8013b3aa03ceaa88a0
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
// JAI SHREE RAM, HAR HAR MAHADEV, HARE KRISHNA import java.util.*; import java.util.Map.Entry; import java.util.stream.*; import java.lang.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.io.*; public class Eshan { static BufferedReader br = new BufferedReader(new InputStrea...
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