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
1ea3f71117d723aaf4c54e2bd31c5cf7
train_002.jsonl
1599575700
Alexandra has an even-length array $$$a$$$, consisting of $$$0$$$s and $$$1$$$s. The elements of the array are enumerated from $$$1$$$ to $$$n$$$. She wants to remove at most $$$\frac{n}{2}$$$ elements (where $$$n$$$ — length of array) in the way that alternating sum of the array will be equal $$$0$$$ (i.e. $$$a_1 - a_...
256 megabytes
import java.util.*; import java.io.*; public class Prb37 { static FastReader sc = new FastReader(); // #JusticeForSSR public static void main(String[] args) { int t = sc.nextInt(); while(t-- != 0){ int n = sc.nextInt(); int z = 0; int o = 0; ...
Java
["4\n2\n1 0\n2\n0 0\n4\n0 1 1 1\n4\n1 1 0 0"]
1 second
["1\n0\n1\n0\n2\n1 1\n4\n1 1 0 0"]
NoteIn the first and second cases, alternating sum of the array, obviously, equals $$$0$$$.In the third case, alternating sum of the array equals $$$1 - 1 = 0$$$.In the fourth case, alternating sum already equals $$$1 - 1 + 0 - 0 = 0$$$, so we don't have to remove anything.
Java 8
standard input
[ "constructive algorithms", "math" ]
eca92beb189c4788e8c4744af1428bc7
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^3$$$). Description of the test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 10^3$$$, $$$n$$$ is even)  — length of the array. The second line contains ...
1,100
For each test case, firstly, print $$$k$$$ ($$$\frac{n}{2} \leq k \leq n$$$) — number of elements that will remain after removing in the order they appear in $$$a$$$. Then, print this $$$k$$$ numbers. Note that you should print the numbers themselves, not their indices. We can show that an answer always exists. If ther...
standard output
PASSED
25cff5e439a9458cbfb3e797a4b16fbb
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.util.Scanner; public class Prob2 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int m = scanner.nextInt(); String[][] arr = new String[n][m]; String[] input = new String[n]; scanner.nextLine...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
58cec351b24aaad63e61de826a0475a4
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; import java.io.IOException; import java.io.InputStream; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collector; import java.util.stream.Collectors; import java.util.stream.IntStream; public class Main { pu...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
e9a6b57f9cef302641f29bcb9e3fefef
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.util.*; import java.math.*; public class Main { public static void main( String[] args ) { Scanner is = new Scanner( System.in ); int n = is.nextInt(), m = is.nextInt(); List<String> grid = new ArrayList<>(); for( int i = 0; i < n; i++ ) grid.add( is.next() ); int quanX = 0; for( int i = 0...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
de62e2decd8439b8828d17428388bfce
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.util.*; public class Main { public void solve() throws IOException { int n = nextInt(), m = nextInt(); int x1 = 0, y = 0, x2 = 0, k = 0; boolean t = false; char s[][] = new char[n][]; for (int i = 0; i < n; i++)...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
2e0e81f28110d05214a8726ea8f1cad8
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.math.BigInteger; import java.util.*; public class random_num { public static long x,y,d; public static int mod= (int) (Math....
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
713553ac123c38782dc5a6771781b91e
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import com.sun.org.apache.xpath.internal.operations.Bool; import java.io.*; import java.util.*; import java.lang.*; public final class Main { private boolean isPrime(int n){ if(n == 1) return false; for (int i = 2; i <= Math.sqrt(n); i++) if(n % i == 0) return false; return ...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
ebbad926028aff00605acd49ab6898d3
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.io.*; import java.util.*; public class B745 { public static void main(String[] args) throws Exception{ BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(f.readLine()); int n = Integer.parseInt(st.nextToken()); int k = Integer.p...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
3214a1da8955e23c679f19b7f23be6bb
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.io.*; import java.math.*; import java.lang.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); PrintWriter out = new ...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
92cb53bd01d569ba169e066b162d83a9
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.io.*; import java.util.*; public class B { static BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws IOException { ...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
a6d9fc9c4ce6f5a1c8cb989624dee534
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class R385Div2B { public static void main(String[] args) { FastScanner in=new FastScanner(); int n=in.nextInt(); int m=in.nextInt(); char[][] a=new char[n][m]; for(int i=0;i<n;i++) a[i]=in.nextToken(...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
c14e5e58111211fdbf56ab07a1b11b0f
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import java.io.*; import java.util.*; /** * * @author Sourav Kumar Paul (spaul100) * NIT Silchar */ public class SolveB { public static Reader in; public static PrintWriter out; public static long mod = 1000000007; public static long inf = 100000000000000000l; public static long fac[],inv...
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
ca86e7e6989ffab85f3238391cd24988
train_002.jsonl
1481992500
Hongcow likes solving puzzles.One day, Hongcow finds two identical puzzle pieces, with the instructions "make a rectangle" next to them. The pieces can be described by an n by m grid of characters, where the character 'X' denotes a part of the puzzle and '.' denotes an empty part of the grid. It is guaranteed that the ...
256 megabytes
import static java.lang.System.exit; import java.io.*; import java.util.StringTokenizer; public class B { static void solve() throws Exception { int n = nextInt(); int m = nextInt(); char[][] pazzle = new char[n][m]; for (int i = 0; i < n; i++) { pazzle[i] = next()....
Java
["2 3\nXXX\nXXX", "2 2\n.X\nXX", "5 5\n.....\n..X..\n.....\n.....\n....."]
2 seconds
["YES", "NO", "YES"]
NoteFor the first sample, one example of a rectangle we can form is as follows 111222111222For the second sample, it is impossible to put two of those pieces without rotating or flipping to form a rectangle.In the third sample, we can shift the first tile by one to the right, and then compose the following rectangle: ....
Java 8
standard input
[ "implementation" ]
b395be2597f4cc0478bc45f774fa1c01
The first line of input will contain two integers n and m (1 ≤ n, m ≤ 500), the dimensions of the puzzle piece. The next n lines will describe the jigsaw piece. Each line will have length m and will consist of characters '.' and 'X' only. 'X' corresponds to a part of the puzzle piece, '.' is an empty space. It is guara...
1,400
Output "YES" if it is possible for Hongcow to make a rectangle. Output "NO" otherwise.
standard output
PASSED
c520a857595986f2f195fda97fdd911d
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.OutputStream; import java.io.BufferedWriter; import java.io.Writer; import java.util.Scanner; import java.io.OutputStreamWriter; import java.io.InputStream; /** * Built using CHelper plug-in...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
b205da0da8a7ba568db650bf7a6838d7
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class OrGame { public static void main(String asd[])throws Exception{ Scanner in=new Scanner(System.in); int n=in.nextInt(); int k=in.nextInt(); int x=in.nextInt(); long a[]=new long[n+1]; long pefix[]=new lo...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
3bc5f971e479fff663e3eb689f36ecb7
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; import java.util.*; public class D { public static void main(String[] args) { MyScanner sc = new MyScanner(); int n = sc.nextInt(); int k = sc.nextInt(); int x = sc.nextInt(); long coef = x; for (int i = 1; i < k; i++) { coef *= x; } long[] unique = new long[n]; List<Integer> l ...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
f0de80d2e9b3908f6a81db612d54c921
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class ORgame { static long []arr; static int x; static int n; static int k; static long[][] memo; static long pre[]; static long post[]; public static void main(String[] args) { Scanner sc=new Scanner(System.in); n=sc.nextInt(); k=sc.nextInt(); ...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
2e6746c463babce3239b88ee4ec2ae43
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; import java.util.*; public class B578 { public static void main(String[] args) throws IOException { input.init(System.in); PrintWriter out = new PrintWriter(System.out); int n = input.nextInt(), k = input.nextInt(), x = input.nextInt(); long[] a = new long[n]; for(int i = 0; i<n; i...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
e6a33fe5c23ce83db58256a8a57d922e
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static ...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
21563308f41a08a66410516be85d4dad
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; import java.util.*; public class Template implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); void init() throws FileNotFoundException { try { in = new BufferedReader(new FileReader("input.txt")); o...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
5f2810d44c672c03a59bc9761fc5504c
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.util.*; import org.omg.CORBA.INTERNAL; import java.awt.List; import java.io.*; import java.lang.*; import java.lang.reflect.Array; public class code1 { public static int mx = 1228228; public static long[][] dp = new long[mx][21]; public static long[] a = new long[mx]; public static long[] b =...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
90696fa31d51829cb078acdb2e10495c
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; //PrintWriter import java.math.*; //BigInteger, BigDecimal import java.util.*; //StringTokenizer, ArrayList public class R320_Div2_D { FastReader in; PrintWriter out; public static void main(String[] args) { new R320_Div2_D().run(); } void run() { in = new FastReader(System.in...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
76d88a89ab69f8408d3127c9204fc136
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; //PrintWriter import java.math.*; //BigInteger, BigDecimal import java.util.*; //StringTokenizer, ArrayList public class R320_Div2_D { FastReader in; PrintWriter out; public static void main(String[] args) { new R320_Div2_D().run(); } void run() { in = new FastReader(System.in...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
76267ee59443571ea688cca43ccf257c
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; //PrintWriter import java.math.*; //BigInteger, BigDecimal import java.util.*; //StringTokenizer, ArrayList public class R320_Div2_D { FastReader in; PrintWriter out; public static void main(String[] args) { new R320_Div2_D().run(); } void run() { in = new FastReader(System.in...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
be9b3a96580d4c1962fcc91151e0f63e
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
0fe8fc6d551e7271987d082ff3852197
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
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.StringTokenizer; public class D { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter ...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
80fc5a37ad3a2ac1a6e9c22edce4a20a
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
//package busywithsolving; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class OrGame { static BufferedReader br = new BufferedReader( new InputStreamReader(System.in) ); static int n,k,x; public static void main( String[] args ) throws IOException ...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
bf5f541e64a250113bd58e019b2ad683
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
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.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.Input...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
5417b93bdb0583f5fda8223c9cc6082c
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
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.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.Input...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
f68db8481281e0d51a80ed2805f71dac
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
//package javaapplication1; import java.math.BigInteger; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n, k; long x; n...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
3facb9452c9508349fc6e6be9fef286c
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; import java.util.*; public class B { InputStream is; int __t__ = 1; int __f__ = 0; int __FILE_DEBUG_FLAG__ = __f__; String __DEBUG_FILE_NAME__ = "src/T"; FastScanner in; PrintWriter out; public void solve() { int n = in.nextInt(), k = in.nextInt(), x = in.nextInt(); long[] a = in.next...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
6a3b942df51f5f311462244884315b3e
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.util.*; import java.io.*; public class CF578B_DP{ public static int n, k; public static long a[], x, dp[][], mul[]; public static void main(String[] args)throws Exception { InputReader in = new InputReader(System.in); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); ...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
cce1c4099da5cd86ba561167c69c728e
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.util.*; import java.io.*; public class CF578B{ public static int n, k; public static long max, a[], x, suffix[], prefix[]; public static void main(String[] args)throws Exception { InputReader in = new InputReader(System.in); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
45811edaccbef6dfb78b49ce1dfe4f86
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; p...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
fcf450b46f4fece9a3db05b38f1b74db
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Exception { InputStream inpu...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
411e7fe7eb573b498dde51ba9fc82200
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.PriorityQueue; import java.util.Queue; import java.util.Scanner; import java.util.Stack; import java.util.StringTokenizer...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
76fd27f511c9294dd28bca02e4623b65
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; import java.util.*; import javax.swing.plaf.synth.SynthSpinnerUI; public class tr1 { static PrintWriter out; static StringBuilder sb; static int inf = (int) 1e9; static long mod = (long) 1e9 + 7; static int[] si; static ArrayList<Integer> primes; static HashSet<Integer> pr; static int n, k, ...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
3ff0db645785d2c22749e9f2371ced3b
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; public class OrGame { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), k = sc.nextInt()...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
b2188c384ae2a3866556af05e0c42c30
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.BitS...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
5a34bec44e79af2789a7d3a0b003bf2d
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class OrGame implements Closeable { private InputReader in = new InputReader(System.in); priva...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
bcd242c7b4c444d99f11ee759be91d3f
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.awt.*; import java.io.*; import java.util.*; public class Abc { public static void main(String[] args) throws Exception { FastReader sc = new FastReader(); int n=sc.nextInt();long k=sc.nextInt(),x=sc.nextInt(); long a[]=new long[n]; for (int i=0;i<n;i++)a[i]=sc.nextInt()...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
7543b429bd2f0339808774b9e9c4b6fe
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.awt.Point; import java.io.*; import java.lang.Integer; import java.lang.reflect.Array; import java.math.BigInteger; import java.util.*; import java.util.ArrayDeque; import static java.lang.Math.*; public class Main { final boolean ONLINE_JUDGE = !new File("input.txt").exists(); BufferedReader in;...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
c43a53729261e38ab84466340129b003
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.util.Random; import java.util.Scanner; public class Application { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(), k = scanner.nextInt(), x = scanner.nextInt(); long[] a = new long[n]; for (int i = 0; i < n; i...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
bc74592e4ad98afe1d299ebdc378d790
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
//package codeforces; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.Closeable; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; i...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
b1e15b4ce67c3bd3728855cd6843c4d0
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.*; import java.util.*; public class Main { static int [][]arr; static String ReadLn (int maxLg) // utility function to read from stdin { byte lin[] = new byte [maxLg]; int lg = 0, car = -1; String line = ""; try { while (lg < maxLg) ...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
bca1293a8b418e24556fb322238916d1
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; /** * Created by hama_du on 15/10/03. */ public class B { public static void main(String[] args) { InputReader in = new InputReader(System.in); Pri...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
cbf1afaa50f10c8c3b246f953876aadf
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
ddc2465cefa4b102b1eb6c130ebdff9e
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.ObjectInputStream.GetField; import java.io.PrintWriter; import java.math.BigInteger; i...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
8f474b5c408179419e8d676672859726
train_002.jsonl
1442416500
You are given n numbers a1, a2, ..., an. You can perform at most k operations. For each operation you can multiply one of the numbers by x. We want to make as large as possible, where denotes the bitwise OR. Find the maximum possible value of after performing at most k operations optimally.
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.io.InputStream; /** * Built using CHel...
Java
["3 1 2\n1 1 1", "4 2 3\n1 2 4 8"]
2 seconds
["3", "79"]
NoteFor the first sample, any possible choice of doing one operation will result the same three numbers 1, 1, 2 so the result is . For the second sample if we multiply 8 by 3 two times we'll get 72. In this case the numbers will become 1, 2, 4, 72 so the OR value will be 79 and is the largest possible result.
Java 8
standard input
[ "greedy", "brute force" ]
b544f02d12846026f6c76876bc6bd079
The first line contains three integers n, k and x (1 ≤ n ≤ 200 000, 1 ≤ k ≤ 10, 2 ≤ x ≤ 8). The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
1,700
Output the maximum value of a bitwise OR of sequence elements after performing operations.
standard output
PASSED
eddca90e295da4d0de3cdd6c1d20924a
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; public final class Main { //2^1 2^2 2^3 2^4 2^5 2^6 3^1 3^2 3^3 3^4 5^1 5^2 7^1 7^2 private void solve() { int[] pirmes = {2, 3, 5, 7, 11,13,17,19,23,29,31,37,41,43,47}; int cnt = 0; for (int i = 0; i < pirmes.length; i++) { ...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
778f6376796f7b34bbb0871a45085ab4
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.Scanner; public class C { public static void main(String[] args) { int[] prime = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,53 }; boolean flag = true; Scanner sc = new Scanner(System.in); int count=0; for (int i = 0; i < prime.length; i++) { System.out.println(prime[i]); ...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
88ef4c8f1dbff8df95ef641fc98d9c72
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.StreamTokenizer; import java.util.Arrays; public class C { static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
8ddaa8168f900a10365b5433cf09516f
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Scanner; import java.util.StringTokenizer; public class C { public static void main(String[] args) t...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
58e3396cb31b59c9abd43fbec2548d2f
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; public class A { static boolean isPrime(int n) { for(int i=2;i<n;i++) if(n%i==0) return false; ...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
468decd111d765636cc53b4bca2584d8
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.Arrays; import java.util.Collections; import java.util.StringTokenizer; import java.io.*; public class JavaApplication25 { public static void main(Strin...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
cfa3205c99530c08c34f9a14b3f771c0
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.StringTokenizer; public class A { public static void main(String[] args) throws IOException { Reader.init(System.in); ...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
989820e3a132c3cc78df1d3dc8af279b
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.StreamTokenizer; import java.util.Arrays; import java.util.Scanner; public class P680_C { private static StreamTokenizer inputReader = new StreamTokenizer( new BufferedReader(new InputStreamReader(System.in))); privat...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
3e5924d0ec196e73fddb8389cbcaf0ef
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; public class BearPrime { static StringTokenizer st; static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in),...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
f1ba80b5280494b6476d80a0bd73ff84
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.*; import java.awt.geom.*; import java.io.*; import java.math.*; public class Main { public static void main(String[] args) throws Exception { long startTime = System.nanoTime(); boolean [] primes=primeSieve(110); ArrayList<Integer> div=new ArrayList<Integer>(); int j=0; for(i...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
00e28563aa6fcfd36f0e469806955913
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.*; import java.awt.geom.*; import java.io.*; import java.math.*; public class Main { public static void main(String[] args) throws Exception { long startTime = System.nanoTime(); boolean [] primes=primeSieve(110); ArrayList<Integer> div=new ArrayList<Integer>(); for(int i=2;i<=50;...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
bef7a134f24e3d22d0b74ecfdd6c44a0
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.*; import java.awt.geom.*; import java.io.*; import java.math.*; public class Main { public static void main(String[] args) throws Exception { long startTime = System.nanoTime(); boolean [] primes=primeSieve(110); ArrayList<Integer> div=new ArrayList<Integer>(); for(int i=2;i<=50;...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
d40b515c49093b2b26e6d3305f8eccc5
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Random; import java.util.StringTokenizer; public class Main { static long sum = 0; static int n; public static void main...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
5b9962ada42b1072afda5a16271f65c1
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.*; import java.io.*; public class Test { public static void main(String at[]){ InputReader in=new InputReader(System.in); PrintWriter out=new PrintWriter(System.out); int t=1; while(t-->0){ int cnt=0; int prime[]={2,4,3,9,5,25,7,49,11, 13, 17, 19, 23, 29, 31, 37, 41,...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
80352d6cd951af7788f238f8ba8a85cf
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintStream; import java.io.PrintWriter; import java.math.BigInteger; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; impo...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
42ff2b0ee5cc362ccc01503ccaf7c19b
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.*; import java.io.*; public class cfp{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); boolean prime=true; int[] ar={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47}; int i=0; ...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
d4b9b4c090f2783cf532ffe5ef581142
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.*; import java.io.*; public class cdprac{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int[] prime={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47}; int j=0; int i=2; int c=1; ...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
627b287401d90714f46f3c93c1e3b1c4
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.util.*; public class Main { static final int MAXN = 100005; static final int INF = Integer.MAX_VALUE; static class Solver { int prime[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 4, 9, 25, 49}; public void ...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
a7cb53905cee635c19a0ef855dd28a42
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.Scanner; /** * Created by user on 01.06.2016. */ public class C { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[] pr = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47}; int col = 0; int del = 0; for (int ...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
6931c37e246df417be4f028fcdbbfdc3
train_002.jsonl
1465403700
This is an interactive problem. In the output section below you will see the information about flushing the output.Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your task is to say if the hidden number is prime or composite.Integer x &gt; 1 is called prime if it has exactly two distinct d...
256 megabytes
import java.util.Scanner; public class main { public static void main(String args[]){ Scanner sc=new Scanner(System.in); int arr[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97}; int count=0; for(int i=0;i<16;i++){ System.out.println(arr[i]); String str=sc.nextLine(); if(str...
Java
["yes\nno\nyes", "no\nyes\nno\nno\nno"]
1 second
["2\n80\n5\ncomposite", "58\n59\n78\n78\n2\nprime"]
NoteThe hidden number in the first query is 30. In a table below you can see a better form of the provided example of the communication process.The hidden number is divisible by both 2 and 5. Thus, it must be composite. Note that it isn't necessary to know the exact value of the hidden number. In this test, the hidden ...
Java 8
standard input
[ "math", "constructive algorithms", "number theory", "interactive" ]
8cf479fd47050ba96d21f3d8eb43c8f0
After each query you should read one string from the input. It will be "yes" if the printed integer is a divisor of the hidden number, and "no" otherwise.
1,400
Up to 20 times you can ask a query — print an integer from interval [2, 100] in one line. You have to both print the end-of-line character and flush the output. After flushing you should read a response from the input. In any moment you can print the answer "prime" or "composite" (without the quotes). After that, flush...
standard output
PASSED
9371704580d0f198a4df291a284d0237
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.InputStreamReader; public class D1176 { private static int N = 3000000; private static int[] div = getLowestDivisors(N); private static int[] getLowestDivisors(int n) { int[] ret = new int[n+1]; ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
db5ee6af40e0de41c42ae0f9c7f4f007
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.Arrays; import java.util.StringTokenizer; public class D { static final int LIMIT = 2750140; public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); boolean[] pr...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
0602f05a880b8e001fd8e9ccab52300d
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.*; public class TaskD { public void solve() { FastReader in = new FastReader(System.in); // FastReader in2 = new FastReader(new FileInputStream("input.txt")); PrintWriter out = new PrintWriter(System.out); // PrintWriter out2 = new P...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
ecc8b599062c8a863695d5aba492ed31
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.BufferedWriter; import java.util.HashMap; import java.util.InputMismatchException; import java.io.IOException; import java.util.ArrayList;...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
4f2236d9f313bae4022706c62c99963c
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.Scanner; import java.util.Vector; import java.util.Arrays; import java.util.Comparator; public class D{ static int[] simples = new int[2750132]; static int max = 2750131; static int[] coun = new int[max+1]; public static void erat(){ int num = -1; int sqrt = (int)Math.sqrt(max)+1; for(int i...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
1407e49c4bbd743abc8d3e7a2f29811d
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; import java.io.*; public class A { public static void main(String ar[]) throws Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(br.readLine()); String s1[]=br.readLine().split(" "); ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
6b4a8cd07e3d3361e6cb6aa478a77b28
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.*; public class D1176_RecoverIt { static int LIM = 2750131; public static void main(String[] args) { InputReader in = new InputReader(); int n = in.nextInt(); ArrayList<Integer> list = new ArrayList<>(); for (int i=0; i<2*n; i++) list.add(in.nextInt()); Collectio...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
b08e9b8a18d4da91b1f619da8ae3dcc0
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; public class codeforces { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder()); for (int i = 0; i < 2 * n; i++) { pq.add(sca...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
1b8ef0f0004d61daac9a673aed775e09
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; import java.lang.*; import java.lang.reflect.Array; import java.io.*; import java.math.*; import java.text.DecimalFormat; public class Temp{ static class InputReader { private final InputStream stream; private final byte[] buf = new byte[8192]; private int curChar, snumChars; ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
e2106c7fd79e8c22201de7fbaedc22ee
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; import java.io.*; public class RecoverIt { static boolean[] prime; public static void main(String[] args) { FastScanner scanner = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int N = scanner.nextInt(); TreeMap<Integer, Integer> mapping = ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
b0a38a330978b395a1cf125549a3bc5f
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; import java.util.InputMismatchException; public class D565B { static int[] great; static boolean[] comp; static int[] primes; public static void main(String[] args) { FastScanner in = new FastScann...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
c0e7493995d4163401894f899365f6fd
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; import java.io.*; public class codeforces{ static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader() { reader = new BufferedReader(new InputStreamReader(System.in)); tokenizer = null; } ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
a0678129c05cd283b3c4d057c67b4632
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; import java.io.*; public class Main { private static int[] composite; public static void main(String[] args) { Scanner in = new Scanner(System.in); Map<Integer, Integer> map = init(); int n = in.nextInt() * 2; Integer[] arr = new Integer[n]; HashMa...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
406f7af3bc1240704052819f257166b6
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; import java.util.HashMap; public class Main { public static void main(String[] args) { FastReader fr =new FastReader(); PrintWriter op =new PrintWriter(System.o...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
a4e1fad9addfeb22e484a105cc6be38a
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; public class D { public static void main(String[] args) { int maxn=3000_000; boolean[] isPrime=new boolean[maxn]; Arrays.fill(isPrime, true); for (int i=2; i<maxn; i++) for (int j=i+i; j<maxn; j+=i) isPrime[j]=false; isPrime[0]=isPrime[1]=...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
fd2d912d631b46f620fa00a9cd20382d
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer; import org.omg.CORBA.INTERNAL; import org.omg.CORBA.MARSHAL; import javax.swing.plaf.basic.BasicTreeUI; import java.io.*; import java.lang.reflect.Array; import java.math.BigInteger; import java.util.*; public class Main { private static Scanner...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
c66c1a455871081d8c398d2fb40d9281
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util. * ; public class recover_prime { static boolean[] used = new boolean[3000000] ; static int[] biggest_d = new int[3000000] ; static HashMap<Integer, Integer> p_order = new HashMap<Integer, Integer>() ; static void sieve() { Arrays.fill(used, true); for(int i=2;i<3000000;i++){ if(used[...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
0b705971677f445f9f317e50b0283db8
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; public class RecoverIt { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int a[] = new int[2*n]; for (int i=0; i<2*n; i++) { a[i] = scanner.nextInt(); } boolean[] isPrime = ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
a22d54d69326b49e5475c7379711aa7f
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.*; import java.util.function.Function; public class MainD { static int N; static int[] B; public static void main(String[] args) { FastScanner sc = new FastScanner(System.in); N = sc.nextInt(); B = sc.nextIntArray(N*2); List<Integer> ans...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
adcc96fed2e3517c4297d33d709d4981
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; /* abhi2601 */ public class Q1 implements Runnable{ //final static long mod = (long)1e9 + 7; class Pair implements Comparable<Pair>{ int a,b; Pair(int a, int b){ this.a=a; this.b=b; }...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
0594355a1a5ae384e2631f3c48509f96
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.StringTokenizer; public class A { public static void main(String[] args) throws Throwable { Scanner sc = new Scanner(); PrintWriter pw = new PrintWriter(System.out); int n = s...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
30b1cb34f3be4f139dd9e1486624dc54
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.Stack; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.uti...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
9b8997b305bc7bfc3db96016a7b01dc8
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.IOException; import java.io.InputStreamReader; import java.util.TreeSet; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import ja...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
232051c28e083a19e1d4cefcabc7649e
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; import java.io.*; public class Codechef{ static boolean[]primes; static int[]index; static int[]fac; static void sieve() { int n=2750131; primes[1]=false; for(int i=2;i*i<=n;i++) { if(primes[i]==false) continue; ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
6cf4d8b27edcd24176ba643ff139e532
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.lang.reflect.Array; public class D { static final int MOD = 1000000007; // 1e9 + 7 static final boolean AUTO_FLUSH = false; // slow if true // int = num(); // long = ll(); // string = next(); // a string line = line(); // -------...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
0b75d74fc107f84976498a858a36fe3d
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.ByteArrayInputStream; import java.io.PrintWriter; import java.util.ArrayList; // import java.util.Collections; // import java.util.Comparator; import java.util.List; import java.util.Scanner; public class D { static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null; public static void mai...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
62a2e94843329425a9d695e2850f3ed7
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.InputMismatchException; import java.util.List; public class Recover { InputStream is; PrintWriter out; String INPUT = ""; ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
ca34334ef49a97d695187e4575500e81
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; import java.math.*; public class Main extends Thread { boolean[] prime; FastScanner sc; PrintWriter pw; MathF mf; final class FastScanner { BufferedReader br; StringTokenizer st; public FastScanner() { tr...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
a9302dd528f83c9e30c3cbf8e53e8136
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; public class Solution{ static InputReader sc; static PrintWriter wc; public static void main(String[] args) { sc = new InputReader(System.in); wc = new PrintWriter(System.out); ...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
4ef01fc76979bc7c9d382800f0c6aae1
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class TryB { static class InputReader { private final InputStream stream; private final byte[] buf = new byte[8192]; private int curChar, snumChars; public InputReader(InputStream st...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
416cf74d9c6f9316a6084c0cf945497d
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.*; public class Main{ public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); // Start writing your solution here. ------------------------------------- int n=sc.next...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output