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
7555f421bc72b542896fcddd12ec5587
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class A { static class Pair { int f;int s; // Pair(){} Pair(int f,int s){ this.f=f;this.s=s;} } static class Fast { BufferedReader br; StringTokenizer st; public Fast() { br = new Bu...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b < r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
41d16717602975e2b69368e105afff67
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { PrintWriter pw = new PrintWriter(System.out); int n = nextInt(); for (int j = 0; j < n; j++) { int abc = nextInt(); int a = nextInt(); int...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
e97bfc41be1ff4c6f779f656d2dd3c41
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; //import java.math.BigInteger; public class code{ public static class Pair{ int a; int b; Pair(int i,int j){ a=i; b=j; } } public static int GCD(int a, int b) { if (b == 0) return a; return GCD(b, a % b); }...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
74196376b26da2c95afebb199c640d9f
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
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 A782 { public static void main(String[] args) { InputStream inputStream = System....
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
5e4a64e1be1cb05e43023aa56a3a58b9
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
387550c6b73c7b102ef892f73f887f79
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.math.*; import java.util.*; public class Main { private final BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); private final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); private St...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
6ae771b8b8df1eaf69dbb8ffe8b1b1e1
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; public class Main { static long mod=(long)1e9+7; static long[]fac=new long[1002]; static int n, x=0,me,op; static int[]pe,a,aa, prime=new int[(int)1e7+1]; static int[][]perm; static long[][]memo; static Integer[]ps; static TreeSet<Long>p=new TreeSet<Long>(); p...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
0482f4a58b87eb8fd5ad1ba28abc2926
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; public class Main { static long startTime = System.currentTimeMillis(); // for global initializations and methods starts here // global initialisations and methods end here static void run() { boolean tc = true; AdityaFastIO r = new...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
2d7dc8e21f5f420caca92a4703936fc0
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; public class A { public static void main(String[] args) { FastReader in = new FastReader(); PrintWriter out = new PrintWriter(System.out); int T = in.nextInt(); for(int ttt = 1; ttt <= T; ttt++) { int n = in.nextInt(); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
915ddbc2682d884b5f6e750e0af9b634
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
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.util.InputMismatchException; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.io.Writer; impo...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
94694378076a4ce13897d301783b4b46
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
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.util.InputMismatchException; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.io.Writer; impo...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
9e5d74f734f74e9c67683758a1295339
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class Solution { public static void main(String... args){ Solution sol = new Solution(); Scanner in = new Scanner(System.in); int t = in.nextInt(); while(t-->0){ sol.solve(in); } } private String giveSt...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
6c908c4536404615faf82c044f0ad5d1
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Largest { public static void solve() throws Exception { FastReader fr=new FastReader(); PrintWriter out=new PrintWriter(System.out); int T=fr.nextInt(); while(T-->0) { // out.println("////////////...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
85f7f64487cb7e2a730ce5b1fc69c7d1
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
/* !!!!Hello World,Prakhar here!!!! codechef handle prakhar_3011 codeforces handle prakhar_30 trying to get good at CP PEACE OUT......... */ /* n r b 10 9 1 rrrrbrrrr 10 8 2 rrrbrrrbrr 11 9 2 rrrbrrrbrrr 6 5 1 */ import java.io.*; import java.util.*; public class redvsblue { ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
aa422f314cc5638739987083693a428d
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
/** * @Jai_Bajrang_Bali * @Har_Har_Mahadev */ import java.util.*; public class practice2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tt = sc.nextInt(); while (tt-- > 0) { int n=sc.nextInt(); int r=sc.nextInt();...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
7dc25d2a240d1c32103cf949f9b6611e
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Scanner; public class RedVsBlue { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0) { int n = sc.nextInt(); int r = sc.nextInt(); int b = sc.nextInt(); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
77e6c83c040dfafd4c3b3a1e052b7eca
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int T=sc.nextInt(); while(T-->0) { int n=sc.nextInt(); int r=sc.nextInt(); int b=sc.nextInt(); while(r>0 && b>0) ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
1a72e61ab2a0660d6457a580085bb517
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) throws IOException{ /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. *...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
7f09c0716bb6b6624dbcaae22c498dca
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Solution{ public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
a500ce6179a2fadedb48503275dd34b9
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
// package Round782DIV2; import java.io.*; import java.util.*; public class A { // GOGIGO!!! static long[] fac; static int mod = 998244353; public static void main(String[] args) throws IOException { // Scanner sc = new Scanner(new FileReader("input.in")); // PrintWriter pw = new ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
9f5acc5ad70cbf2e37c7cfa8987f197a
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.text.DecimalFormat; import java.util.*; public class Codeforces { static int mod= 1000000007 ; public static void main(String[] args) throws Exception { PrintWrit...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
cef6a7ac01347aabc99e019759fa8e7e
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { try{ Scanner sc =new Scanner(System.in); int t =sc.nextInt(); for(int o=0;o<t;o++) { int n = sc.nextInt(); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
c47b2dd66644abe83d7c5ba7c3c572ad
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException, InterruptedException { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); i...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
8d0b9523d0252124c51d6734b74b9c4c
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; public class red_versus_blue { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
dde1366f2b231a4e249a3eb5adb67914
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
// package CodeForces.contests.contest782div2; import java.util.*; /** * @author SyedAli * @createdAt 17-04-2022, Sunday, 20:03 */ public class RedVersusBlue { private static Scanner s = new Scanner(System.in); private static void solve() { int n = s.nextInt(), r = s.nextInt(), b = s.n...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
9b4229eda7c697a1a1b149bf8c1f8680
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class A_Red_Versus_Blue { static Scanner in = new Scanner(); static PrintWriter out = new PrintWriter(System.out); static String...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
c02f527f1fac8172ba7fc66691a7fa82
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.*; import java.util.Random; import java.util.StringTokenizer; import static java.lang.Long.compare; import static...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
9efd352a147db6c420ff2a5efa9ab351
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t>0){ int n=sc.nextInt(); int r=sc.nextInt(); int b=sc.nextInt(); int s=b+1; int rr=r/s; r%=s; ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
57710e65a689503a6ea30b37014b1c8f
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner in=new Scanner(System.in); int t=in.nextInt(); while(--t>=0) { int n=in.nextInt(), r=in.nextInt(), b=in.nextInt(); String s=""; int ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
0ebc7d6a4c7d46cc9f3028060cc44910
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Scanner; public class MyClass { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0) { int n,r,b; n= sc.nextInt(); r=sc.nextInt(); b=sc.nextInt(); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
02daa05916c9ca10239ebaca531f66ff
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.lang.*; import java.io.InputStreamReader; import static java.lang.Math.*; import static java.lang.System.out; import java.util.*; import java.io.File; import java.io.PrintStream; import java.io.PrintWriter; import java.math.BigInteger; pu...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
f1a80769ac8b094409972a924c14fa58
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Main { static int t; static int n; static int[] a; static String s; static FastReader fr = new FastReader(); static PrintWriter...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
0a2be397b207ef8e0f5c290e4c90ef7b
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { // try { // System.setIn(new FileInputStream("input.txt")); // System.setOut(new PrintStream(new FileOutputStream("output.txt"))); // } catch (Exception e) { // System.err.println("Error"); // }...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
a8dd1ed80e56c7161d9349cf59c48354
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Main { //--------------------------INPUT READER---------------------------------// static class fs { public BufferedReader br; StringTokenizer st = new StringTokenizer(""); public fs() { this(System.in); } public fs(I...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
9a69dfb3a0a1ce962d4a123726169926
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int TT = sc.nextInt(); while (TT-- > 0) { int n = sc.nextInt(), r = sc.nextInt(), b = sc.nextInt(); int k = n / (b + 1), cnt = 0; f...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
94b150542f323afde8f05f682643e89e
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
a9b1f890f6ca17a37dc5f9c2fab1556e
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Main implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); public static void main(String[] args) { new Thread(null, new Main(), "", 256 * (1L << 20)).start(); } public ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
430650176dd923af753e400eadca0222
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0){ int n=sc.nextInt(); int r = sc.nextInt(); int b= sc.nextInt(); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
3aa4018047b373a077591d576feda398
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; // "static void main" must be defined in a public class. public class Main { public static void main(String[] args) { new Solution().function(); } } class Solution { private Scanner sc = new Scanner(System.in); public void function() { int T = ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
6427832167fd444169aafc7d40dfee7b
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
//make sure to make new file! import java.io.*; import java.util.*; public class A782{ public static void main(String[] args)throws IOException{ BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); int t = Inte...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
37a8eaed28d09016e38e092b718ba92e
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.math.BigInteger; public final class B { static PrintWriter out = new PrintWriter(System.out); static StringBuilder ans=new StringBuilder(); static FastReader in=new FastReader(); // static int g[][]; static ArrayList<Int...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
8397e903885c4d5bc74f94051452b656
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; public class CF1{ public static void main(String[] args) { FastScanner sc=new FastScanner(); int T=sc.nextInt(); // int T=1; for (i...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
4303d7378a1915ddbabccb2802b29f95
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; public class A { public static void main(String[] args) throws IOException { FastReader in = new FastReader(System.in); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); int t = in.nextInt(); for (int tt = 0; tt < t...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
20c667d730cced0f9277191d3fb2ba30
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; public class Practice { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc....
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
f19f99343d4785c9d39c8ea738fb77bd
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
/* * Author: rickytsung(En Chi Tsung) * Date: 2022/7/30 * Problem: CF Round 782 */ import java.util.*; import java.time.*; import java.io.*; import java.math.*; public class Main { public static BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); public static BufferedWriter bw=ne...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
bda9075782af4983ca61550d0cebc4f3
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int m=sc.nextInt(); while(m-- > 0){ int n=sc.nextInt(),r=sc.nextInt(),b=sc.nextInt(); int mod=r%(b+1),div=r/(b+1); StringBuilde...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
c2fdca6b08365540281001ba15006e4e
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t--!=0){ int n=sc.nextInt(); int a=sc.nextInt(); int b=sc.nextInt(); for(int i=0;i<b;i++){ ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
9b1aad8040a1e4d39f99035c3cec0ad1
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader( ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
14c0d5fa86aec6e1359840acabba9297
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public final class Main { //int 2e9 - long 9e18 static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(0, 1), new Pair(1, 0), new Pair(0, -1)}; static...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
abe95e21ade51f63ecf2bdd516343ba4
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try { br = new BufferedReader( new FileReader("input.rtf")); PrintStrea...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
4091b24cfbb6d4cd720292deeb302132
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class RedVersusBlue { public static String duplicateR(int min) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < min; i++) builder.append("R"); return builder.toString(); } public static String print(ArrayList<Integer> rVb) { ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
b2aa951c532b83de3ab9e4603dbebfe8
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.System.out; public class Main { static class Reader{ BufferedReader br; StringTokenizer st; pub...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
38e07a0573b154954db61a97f9530fb4
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; import java.util.Arrays; import java.util.HashMap; public class vanita { public static void main(String[] args){ Scanner in =new Scanner(System.in); int cases = in.nextInt(); for(int i = 0; i < cases; i++){ int ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
f6eed0235669e4312e04e05f4cbc250d
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; import java.util.Arrays; import java.util.HashMap; public class vanita { public static void main(String[] args){ Scanner in =new Scanner(System.in); int cases = in.nextInt(); for(int i = 0; i < cases; i++){ int nu...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
e563083fa44f1f7e1cb6752f297d394a
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String args[]) { FastScanner input = new FastScanner(); int tc = input.nextInt(); work: ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
c5a6c3b372583294928598456698e38b
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Scanner; public class A1659 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for (int t=0; t<T; t++) { int N = in.nextInt(); int R = in.nextInt(); int B = in.nextInt(); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
cf2f060eca4b80147386098820b9ec63
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import java.io.*; public class Main { static PrintStream out = new PrintStream(System.out); static LinkedList<LinkedList<Integer>> adj; static boolean[] vis; static long ans; static int target; static HashMap<ArrayList<Integer>, Integer> seqs; //static ArrayL...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
260a6b8b3f0522bb47bc4d6d497a94ae
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; public class a_1659 { public static void main(String[] args) throws Except...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
5dca2632c1824660332c09623128705b
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.BufferedInputStream; import java.util.Scanner; public class Accepted { public static void main(String[] args){ Scanner sc = new Scanner(new BufferedInputStream(System.in)); int t = sc.nextInt(); System.out.println(); while (t-- > 0) { int n = sc.n...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
687761eaf46b3ca19cf019d117cb79a3
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
//package codeforces; import java.io.*; import java.util.*; import java.lang.*; public class Stringinput { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader(InputStream in) { br = new BufferedReader( ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
15a5eac0509dbf7a200c7a9a83c48f03
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Scanner; public class Main { public static String solution(int n, int r, int b) { int group = b+1; int mod = r%group; StringBuilder sb = new StringBuilder(); int each = r/group; for(int i = 0; i < mod; i++) { for(int j = 0; j < each+1; j...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
f713eb10296857236de8386deaf86d7f
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Scanner; //A. Red Versus Blue public class A { public static void main(String[] args) { new A().solve(); } public void solve() { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); char[] res = new char[105]; while (t-- > 0) { int length = scanner.ne...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 8
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
db5a611aebc7c527a6750087b0acb0cc
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
// Question -> https://codeforces.com/problemset/problem/1659/A import java.util.*; public class LiveQes1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { int n = sc.nextInt(); int ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
1577263f28f1a238b7d4174596c56499
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
// Question -> https://codeforces.com/problemset/problem/1659/A import java.util.*; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { int n = sc.nextInt(); int r = ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
6d969a17ba73ec1b928265ef3c6c03b1
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
// Question -> https://codeforces.com/problemset/problem/1659/A import java.util.*; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { int n = sc.nextInt(); int r = ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
4b940edf2924c68fa70d7fb3ec0bc4b4
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
// Question -> https://codeforces.com/problemset/problem/1659/A import java.util.*; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { int n = sc.nextInt(); int r = ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
57b48f0dad159f491c5f88b3b76c1b27
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
// Question -> https://codeforces.com/problemset/problem/1659/A import java.util.*; public class LiveQes1 { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int test_cases = scn.nextInt(); for (int i = 0; i < test_cases; i++) { int n = s...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
dfef1940d8be5f612ab0b60fe90fca87
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class scratch { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t>0){ t--; int n=sc.nextInt(); int r=sc.nextInt(); int b=sc.nextInt(); Str...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
6342796524f25a398804ef63687e09ca
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class Solution{ public static void main(String[] args){ Scanner y=new Scanner(System.in); int t=y.nextInt(); while(t!=0) { --t; int n=y.nextInt(); int r=y.nextInt(); int b=y.nextInt(); int m=r/(...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
a8d58b38da47c7e228639e3235392e46
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; import static java.lang.Integer.*; public class codeforces { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t =scan.nextInt(); for (int tc = 1; tc <= t; tc++) { int n=scan.nextInt(); int r=scan.nextInt...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
931565255ffdb5b09e17ac8977646b63
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0; i<t; i++) { int n=sc.nextInt(); int r=sc.nextInt(); int b=sc.nextInt(); String ans=""; int y=0; int k=0; int p=0; ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
232fda9603e278ea4fd48312fe320a7b
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; import java.util.regex.*; import java.util.stream.*; public class A { static FastScanner fs = new FastScanner(); public static void main(String[] args) throws IOException { int T = fs.nextInt(); int N, r, b; while (T-- > 0) { ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
c9cdc026359ae79d710c034d364d0145
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int test = sc.nextInt(); for(int t = 0; t<test; ++t){ long n = sc.nextLong(); long r = sc.nextLong(); long b = sc.nextLong(); lo...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
72b1c2569122c16f2ea7d32051c347a4
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.io.*; import java.util.*; public class BroCoders { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { int n = sc.nextInt(); int r = sc.nextInt(); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
c3a8a13b2ab4083dc4cc527945b73ec4
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.*; public class text1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int cs = sc.nextInt(); for(int dz = 0;dz < cs;dz ++) { int length = sc.nextInt(), r = sc.nextInt(), b = sc.nextInt() + 1; while(r != 0 && b ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
9362c0e96c3dcd00f41f47104071466b
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Scanner; public class Bishop { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int q = sc.nextInt(); for(int i=0; i<q; i++){ int n = sc.nextInt(); int r = sc.nextInt(); int b = sc.nextInt(); ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
92266b572cdda4c399984af4046c32ee
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int b = sc.nextInt(); int r = ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
6fa36b3eec426460c262367e85dd1709
train_110.jsonl
1650206100
Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $$$n$$$ matches.In the end, it turned out Team Red won $$$r$$$ times and Team Blue won $$$b$$$ times. Team Blue was less skilled than Team Red, so $$$b$$$ was strictly less than $$$r$$$.You missed th...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int b = sc.nextInt(); int r ...
Java
["3\n7 4 3\n6 5 1\n19 13 6", "6\n3 2 1\n10 6 4\n11 6 5\n10 9 1\n10 8 2\n11 9 2"]
1 second
["RBRBRBR\nRRRBRR\nRRBRRBRRBRRBRRBRRBR", "RBR\nRRBRBRBRBR\nRBRBRBRBRBR\nRRRRRBRRRR\nRRRBRRRBRR\nRRRBRRRBRRR"]
NoteThe first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $$$1$$$. We cannot minimize it any further.The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wi...
Java 17
standard input
[ "constructive algorithms", "greedy", "implementation", "math" ]
7cec27879b443ada552a6474c4e45c30
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$)  — the number of test cases. Each test case has a single line containing three integers $$$n$$$, $$$r$$$, and $$$b$$$ ($$$3 \leq n \leq 100$$$; $$$1 \leq b &lt; r \leq n$$$, $$$r+b=n$$$).
1,000
For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.
standard output
PASSED
c4a5eed8f62a1222e561c4f2691469dc
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.util.*; import java.io.*; public class ReverseSortSum { public static void main(String[] args) throws IOException { Reader in = new Reader(); PrintWriter out = new PrintWriter(System.out); int T = in.nextInt(); for (int t = 0; t < T; t++) { int N = in....
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
98fbac0aae31a8cff9b947741b2e9e8c
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; public class Main { //--------------------------INPUT READER---------------------------------// static class fs { public BufferedReader br; StringTokenizer st = new StringTokenizer(""); public fs() { this(System.in); } public fs(I...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
df3fc6a00ffacddb4a7d085715bba5e2
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; public class a { public static void main(String[] args){ FastScanner sc = new FastScanner(); int t = sc.nextInt(); while(t-- > 0){ int n = sc.nextInt(); int arr[] = new int[n]; for(int i=0; i<n; i++){ ...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
4afa1a4917340d8ca6d30c0626865c66
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; public class a { public static void main(String[] args){ FastScanner sc = new FastScanner(); int t = sc.nextInt(); while(t-- > 0){ int n = sc.nextInt(); int arr[] = new int[n]; for(int i=0; i<n; i++){ ...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
3156c129d60b000ab53e5f33f30847b0
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; public class problemD { public static void main(String[] args)throws IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(Syste...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
751051678aff4a8bcb16d6ec42b8bfbf
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; public final class Main { //int 2e9 - long 9e18 static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(0, 1), new Pair(1, 0), new Pair(0, -1)}; static...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
1f4d72f07333db8034ae728f650edde8
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) { FastReader input=new FastReader(); PrintWriter out=new PrintWriter(System.out); int T=input.nextInt(); while(T-->0) { int n=input.nextInt(); ...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
453ce3710d973a227e0fb4db35336796
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class D_Reverse_Sort_Sum { static Scanner in = new Scanner(); static PrintWriter out = new PrintWriter(System.out); static Strin...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
ca513da3d67a278642b0267b8df62139
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StreamTokenizer; import java.math.BigInteger; import static java.lang.System.out; import static java.lang.Math.*; import java.util.*; public class Main { public static ...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
eca25167bd3086a348a3650322dbc5f7
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class D_Reverse_Sort_Sum { static Scanner in = new Scanner(); static PrintWriter out = new PrintWriter(System.out); static Strin...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
4a5bf35849f10737b94fcd579c1ae278
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
/* || श्री राम समर्थ || || जय जय रघुवीर समर्थ || */ import java.io.*; import java.util.*; import static java.util.Arrays.sort; public class CodeforcesTemp { static Reader scan = new Reader(); static FastPrinter ou...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
d4cef16718a3aab9cc70f09981e6cfd1
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; public class p5 { BufferedReader br; StringTokenizer st; BufferedWriter bw; int x1,y1; int x2,y2; int l1,l2; int n; public static void main(String[] args)throws Exception { new p5().run(); } void run()throws IOException { br = new BufferedRead...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
d0eae49c17dd1eba57e46df015ac1ae2
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.util.*; import java.io.*; // res.append("Case #"+(p+1)+": "+hh+" \n"); ////*************************************************************************** /* public class E_Gardener_and_Tree implements Runnable{ public static void main(String[] args) throws Exception { new Thr...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
c36536602d872126c5dbbc82860fc775
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.math.BigInteger; import java.util.*; import java.util.concurrent.ThreadLocalRandom; public class c731{ pu...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
a39230b075ca3d8c9cd719db274b7e1e
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
//make sure to make new file! import java.io.*; import java.util.*; //upsolve public class D782b{ public static void main(String[] args)throws IOException{ BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); in...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
2f03e41f7d42d5413e93ed83f59fc00b
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; //import javafx.util.*; public class Main { static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static int INF = Integer.MAX_VALUE; static int NINF = Integer.MIN_VALUE; public static StringBuilder str = new Stri...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
95d156b43c59b80fb0eee846ec60d399
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
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.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.PriorityQueue; import java.util.St...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
0418425fab587cb8607137f4d350d65c
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import com.sun.security.jgss.GSSUtil; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; public class CF1{ public static void main(String[] args) { FastScanner sc=new FastScanner(); int T=sc.nextI...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
cef2e22edfe3a39a65136e955aad225c
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.util.*; public class Main { public static void main(String arggs[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0) { StringBuilder sb = new StringBuilder(); int n = sc.nextInt(); int[] arr = new int[n+1], sum = new int[n+1]; long total = 0; ...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
cd52803dc3dd50efe6fa8f43cf9663ac
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); long[]a=sc.nextlongArray(n); SegmentTree sg=new SegmentTree(a); long[...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
c9b819c48be2281cd1cbbdd508329951
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
/* I am dead inside Do you like NCT, sKz, BTS? 5 4 3 2 1 Moonwalk Imma knock it down like domino Is this what you want? Is this what you want? Let's ttalkbocky about that */ import static java.lang.Math.*; import java.util.*; import java.io.*; import java.math.*; public class NewTimeD { public stat...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output
PASSED
ead534cc45b733b51ac6942a284ce40b
train_110.jsonl
1650206100
Suppose you had an array $$$A$$$ of $$$n$$$ elements, each of which is $$$0$$$ or $$$1$$$.Let us define a function $$$f(k,A)$$$ which returns another array $$$B$$$, the result of sorting the first $$$k$$$ elements of $$$A$$$ in non-decreasing order. For example, $$$f(4,[0,1,1,0,0,1,0]) = [0,0,1,1,0,1,0]$$$. Note that t...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.math.BigInteger; public final class B { static PrintWriter out = new PrintWriter(System.out); static StringBuilder ans=new StringBuilder(); static FastReader in=new FastReader(); // static int g[][]; static ArrayList<Int...
Java
["5\n4\n2 4 2 4\n7\n0 3 4 2 3 2 7\n3\n0 0 0\n4\n0 0 0 4\n3\n1 2 3"]
2 seconds
["1 1 0 1 \n0 1 1 0 0 0 1 \n0 0 0 \n0 0 0 1 \n1 0 1"]
NoteHere's the explanation for the first test case. Given that $$$A=[1,1,0,1]$$$, we can construct each $$$B_i$$$: $$$B_1=[\color{blue}{1},1,0,1]$$$; $$$B_2=[\color{blue}{1},\color{blue}{1},0,1]$$$; $$$B_3=[\color{blue}{0},\color{blue}{1},\color{blue}{1},1]$$$; $$$B_4=[\color{blue}{0},\color{blue}{1},\color{blue}{...
Java 8
standard input
[ "constructive algorithms", "data structures", "greedy", "implementation", "math", "two pointers" ]
9dc1bee4e53ced89d827826f2d83dabf
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$)  — the number of test cases. Each test case has two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$). The second line contains $$$n$$$ integers $$$c_1, c_2, \ldots, c_n$$$ ($$$0 \leq c_i \leq n$$$). It ...
1,900
For each test case, output a single line containing $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$a_i$$$ is $$$0$$$ or $$$1$$$). If there are multiple answers, you may output any of them.
standard output